2001-09-14 09:52:30 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 14.09.2001
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export _clrscr
|
|
|
|
.import plot
|
2001-09-14 09:52:30 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.include "cbm510.inc"
|
2003-12-27 16:11:14 +00:00
|
|
|
.include "extzp.inc"
|
2001-09-14 09:52:30 +00:00
|
|
|
|
|
|
|
; ------------------------------------------------------------------------
|
2012-03-04 13:08:54 +00:00
|
|
|
; void clrscr (void);
|
2001-09-14 09:52:30 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.proc _clrscr
|
2001-09-14 09:52:30 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
lda #0
|
|
|
|
sta CURS_X
|
|
|
|
sta CURS_Y
|
|
|
|
jsr plot ; Set cursor to top left corner
|
2001-09-14 09:52:30 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
ldx #$00 ; Count
|
|
|
|
jsr clearpage
|
|
|
|
jsr clearpage
|
|
|
|
jsr clearpage
|
|
|
|
ldx #<(40*25) ; Count
|
|
|
|
jsr clearpage ; Clear remainder of last page
|
|
|
|
jmp plot ; Set screen pointer again
|
2001-09-14 09:52:30 +00:00
|
|
|
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.proc clearpage
|
|
|
|
|
|
|
|
txa
|
|
|
|
pha ; Save count
|
|
|
|
|
|
|
|
lda #$20 ; Screencode for blank
|
|
|
|
ldy #$00
|
|
|
|
@L1: sta (SCREEN_PTR),y
|
|
|
|
iny
|
|
|
|
dex
|
|
|
|
bne @L1
|
|
|
|
inc SCREEN_PTR+1
|
|
|
|
|
|
|
|
pla
|
|
|
|
tax ; Reload count
|
|
|
|
lda IndReg
|
|
|
|
pha
|
|
|
|
lda #$0F
|
|
|
|
sta IndReg ; Switch to the system bank
|
|
|
|
lda CHARCOLOR ; Load color
|
|
|
|
ldy #$00
|
|
|
|
@L2: sta (CRAM_PTR),y
|
|
|
|
iny
|
|
|
|
dex
|
|
|
|
bne @L2
|
|
|
|
inc CRAM_PTR+1
|
|
|
|
pla
|
|
|
|
sta IndReg ; Restore the old indirect bank
|
|
|
|
rts
|
2001-09-14 14:37:08 +00:00
|
|
|
|
|
|
|
.endproc
|