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