1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-05 06:28:57 +00:00
cc65/libsrc/osic1p/clrscr.s

32 lines
867 B
ArmAsm
Raw Normal View History

2014-11-08 00:14:46 +00:00
;
; void clrscr (void);
;
.export _clrscr
.import plot
.include "extzp.inc"
2015-02-03 21:42:35 +00:00
.include "osic1p.inc"
2014-11-08 00:14:46 +00:00
; Adapted from the Challenger Character Graphics
; Reference Manual, "2.3.3 MACHINE LANGUAGE SCREEN CLEAR"
; This is self-modifying code!
BANKS = VIDEORAMSIZE / $100
2014-11-16 20:57:59 +00:00
_clrscr:
lda #$20 ; ' '
ldy #BANKS
ldx #$00
2014-11-16 20:57:59 +00:00
staloc:
sta SCRNBASE,X
inx
bne staloc
inc staloc+2
dey
bne staloc
lda #>(SCRNBASE) ; Load high byte
sta staloc+2 ; Restore base address
lda #$00 ; Cursor in upper left corner
sta CURS_X
sta CURS_Y
jmp plot ; Set the cursor position