2014-11-08 00:14:46 +00:00
|
|
|
;
|
|
|
|
; void clrscr (void);
|
|
|
|
;
|
|
|
|
.export _clrscr
|
2014-11-29 19:50:48 +00:00
|
|
|
.import plot
|
|
|
|
.importzp CURS_X, CURS_Y
|
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:
|
2014-11-29 19:50:48 +00:00
|
|
|
lda #$20 ;' '
|
2015-02-08 16:35:40 +00:00
|
|
|
ldy #BANKS
|
|
|
|
ldx #$00
|
2014-11-16 20:57:59 +00:00
|
|
|
staloc:
|
2015-02-08 16:35:40 +00:00
|
|
|
sta SCRNBASE,X
|
|
|
|
inx
|
|
|
|
bne staloc
|
|
|
|
inc staloc+2
|
|
|
|
dey
|
|
|
|
bne staloc
|
|
|
|
lda #>(SCRNBASE); load high byte
|
|
|
|
sta staloc+2 ; restore base address
|
2014-11-29 19:50:48 +00:00
|
|
|
|
2015-02-08 16:35:40 +00:00
|
|
|
lda #$00 ; cursor in upper left corner
|
2014-11-29 19:50:48 +00:00
|
|
|
sta CURS_X
|
|
|
|
sta CURS_Y
|
2015-02-08 16:35:40 +00:00
|
|
|
jmp plot ; Set the cursor position
|