From 1497330cc06512aff6a6708ba2d9e053b38ca7e1 Mon Sep 17 00:00:00 2001 From: jede Date: Sat, 25 Feb 2017 22:10:13 +0100 Subject: [PATCH] adding clrscr.s --- asminc/telestrat.inc | 3 +++ libsrc/telestrat/clrscr.s | 31 +++++++++++++++++++++++++++++++ libsrc/telestrat/gotoxy.s | 2 ++ 3 files changed, 36 insertions(+) create mode 100644 libsrc/telestrat/clrscr.s diff --git a/asminc/telestrat.inc b/asminc/telestrat.inc index ab209e520..8a51e1c32 100644 --- a/asminc/telestrat.inc +++ b/asminc/telestrat.inc @@ -133,6 +133,9 @@ XPING = $9D ; Page $200 SCRX := $220 SCRY := $224 +ADSCRL := $218 +ADSCRH := $21C + ; --------------------------------------------------------------------------- ; Page $500 diff --git a/libsrc/telestrat/clrscr.s b/libsrc/telestrat/clrscr.s new file mode 100644 index 000000000..8c45aeeec --- /dev/null +++ b/libsrc/telestrat/clrscr.s @@ -0,0 +1,31 @@ + .export _clrscr + + .importzp sp + + .include "telestrat.inc" + +.proc _clrscr + lda #SCREEN + sta RES + sty RES+1 + + ldy #<(SCREEN+SCREEN_XSIZE*SCREEN_YSIZE) + ldx #>(SCREEN+SCREEN_XSIZE*SCREEN_YSIZE) + lda #' ' + BRK_TELEMON XFILLM + + + ; reset prompt position + lda #<(SCREEN+40) + sta ADSCRL + lda #>(SCREEN+40) + sta ADSCRH + + ; reset display position + lda #$01 + sta SCRY + lda #$02 + sta SCRX + rts +.endproc diff --git a/libsrc/telestrat/gotoxy.s b/libsrc/telestrat/gotoxy.s index 18e010ae2..fb659d968 100644 --- a/libsrc/telestrat/gotoxy.s +++ b/libsrc/telestrat/gotoxy.s @@ -8,6 +8,8 @@ .proc _gotoxy + ; This function move only cursor for display, it does not move the prompt position + ; in telemon, there is position for prompt, and another for the cursor sta SCRY jsr popa sta SCRX -- 2.39.5