+;
+; Clear (erase) the screen.
+;
+; Support the full 128- x 64-tile background.
+;
- .include "pce.inc"
+ .export _clrscr
+
+ .import plot
+
+ .include "pce.inc"
+ .include "extzp.inc"
- .export _clrscr
_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
- st0 #VDC_MAWR
- st1 #<$0000
- st2 #>$0000
+ dex
+ bne colloop
+ dey
+ bne rowloop
- st0 #VDC_VWR
- ldy #$40
-rowloop: ldx #$80
-colloop: lda #' '
- staio VDC_DATA_LO
- lda #$02
- staio VDC_DATA_HI
+; Go to the home position.
- dex
- bne colloop
- dey
- bne rowloop
+ stz CURS_X
+ stz CURS_Y
+ jmp plot
- rts
+;-------------------------------------------------------------------------------
+; force the init constructor to be imported
+ .import initconio
+conio_init = initconio