]> git.sur5r.net Git - cc65/commitdiff
Set cursor in top left corner in clrscr()
authorStephan Mühlstrasser <stephan.muehlstrasser@web.de>
Sat, 29 Nov 2014 19:50:48 +0000 (20:50 +0100)
committerStephan Mühlstrasser <stephan.muehlstrasser@web.de>
Sat, 29 Nov 2014 19:50:48 +0000 (20:50 +0100)
as documented in conio.h

libsrc/c1p/clrscr.s

index 5550d1d756fac38e65639f154c436fa22e81b7c4..ce221f31e0f24a7acd004729fa3fea6c30845504 100644 (file)
@@ -2,6 +2,8 @@
 ; void clrscr (void);\r
 ;\r
         .export         _clrscr\r
+        .import         plot\r
+        .importzp       CURS_X, CURS_Y\r
         .include        "c1p.inc"\r
 \r
 ; Adapted from the Challenger Character Graphics\r
 BANKS = VIDEORAMSIZE / $100\r
 \r
 _clrscr:\r
-        lda #$20 ;' '\r
-               ldy #BANKS\r
-               ldx #$00\r
+        lda       #$20 ;' '\r
+               ldy       #BANKS\r
+               ldx       #$00\r
 staloc:\r
-               sta SCRNBASE,X\r
+               sta       SCRNBASE,X\r
                inx\r
-               bne staloc\r
-               inc staloc+2\r
+               bne       staloc\r
+               inc       staloc+2\r
                dey\r
-               bne staloc\r
-               lda #>(SCRNBASE) ; load high byte\r
-               sta staloc+2     ; restore base address\r
-               rts\r
+               bne       staloc\r
+               lda       #>(SCRNBASE); load high byte\r
+               sta       staloc+2    ; restore base address\r
+\r
+               lda       #$00        ; cursor in upper left corner\r
+        sta       CURS_X\r
+        sta       CURS_Y\r
+               jmp       plot        ; Set the cursor position\r