2014-11-08 01:14:46 +01:00
|
|
|
;
|
|
|
|
; void clrscr (void);
|
|
|
|
;
|
|
|
|
.export _clrscr
|
2014-11-29 20:50:48 +01:00
|
|
|
.import plot
|
2015-02-12 22:12:51 +01:00
|
|
|
.include "extzp.inc"
|
2015-02-03 22:42:35 +01:00
|
|
|
.include "osic1p.inc"
|
2014-11-08 01:14:46 +01: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 21:57:59 +01:00
|
|
|
_clrscr:
|
2015-02-18 18:38:42 +01:00
|
|
|
lda #$20 ; ' '
|
2015-02-08 17:35:40 +01:00
|
|
|
ldy #BANKS
|
|
|
|
ldx #$00
|
2014-11-16 21:57:59 +01:00
|
|
|
staloc:
|
2015-02-08 17:35:40 +01:00
|
|
|
sta SCRNBASE,X
|
|
|
|
inx
|
|
|
|
bne staloc
|
|
|
|
inc staloc+2
|
|
|
|
dey
|
|
|
|
bne staloc
|
2015-02-18 18:38:42 +01:00
|
|
|
lda #>(SCRNBASE) ; Load high byte
|
|
|
|
sta staloc+2 ; Restore base address
|
2014-11-29 20:50:48 +01:00
|
|
|
|
2015-02-18 18:38:42 +01:00
|
|
|
lda #$00 ; Cursor in upper left corner
|
2014-11-29 20:50:48 +01:00
|
|
|
sta CURS_X
|
|
|
|
sta CURS_Y
|
2015-02-18 18:38:42 +01:00
|
|
|
jmp plot ; Set the cursor position
|