]> git.sur5r.net Git - cc65/blobdiff - libsrc/pce/clrscr.s
Fixed and improved some pce comments.
[cc65] / libsrc / pce / clrscr.s
index 59fda4f2e8c2d5bc75adc42c918854a4800efce7..907a78899b73fe46a91fe00a5034e52f0ea6567f 100644 (file)
@@ -1,30 +1,44 @@
+;
+; Clear (erase) the screen.
+;
+; Support the full 128- x 64-tile background.
+;
 
-                .include "pce.inc"
+        .export         _clrscr
 
-                .export _clrscr
-_clrscr:
-
-                st0     #VDC_MAWR
-                st1     #<$0000
-                st2     #>$0000
+        .import         plot
 
-                st0     #VDC_VWR
-                ldy     #$40
-rowloop:        ldx     #$80
-colloop:        lda #' '
-                staio VDC_DATA_LO
-                lda #$02
-                staio VDC_DATA_HI
+        .include        "pce.inc"
+        .include        "extzp.inc"
 
-                dex
-                bne     colloop
-                dey
-                bne     rowloop
-
-                rts
+_clrscr:
+        st0     #VDC_MAWR
+        st1     #<$0000
+        st2     #>$0000
+
+        st0     #VDC_VWR
+        ldy     #$40
+rowloop:
+        ldx     #$80
+colloop:
+        lda     #' '            ; low byte of char. index
+        sta     VDC_DATA_LO
+        lda     #$02            ; background color, high nybble of char. index
+        sta     VDC_DATA_HI
+
+        dex
+        bne     colloop
+        dey
+        bne     rowloop
+
+; Go to the home position.
+
+        stz     CURS_X
+        stz     CURS_Y
+        jmp     plot
 
 ;-------------------------------------------------------------------------------
 ; force the init constructor to be imported
 
                 .import initconio
-conio_init = initconio
+conio_init      = initconio