2001-09-14 09:52:30 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 14.09.2001
|
|
|
|
;
|
|
|
|
|
|
|
|
.export _clrscr
|
|
|
|
.import plot
|
|
|
|
|
2002-05-26 09:08:52 +00:00
|
|
|
.include "cbm510.inc"
|
2003-12-27 16:11:14 +00:00
|
|
|
.include "extzp.inc"
|
2001-09-14 09:52:30 +00:00
|
|
|
|
|
|
|
; ------------------------------------------------------------------------
|
|
|
|
; void __fastcall__ clrscr (void);
|
|
|
|
|
|
|
|
.proc _clrscr
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
sta CURS_X
|
|
|
|
sta CURS_Y
|
2001-09-21 12:55:27 +00:00
|
|
|
jsr plot ; Set cursor to top left corner
|
2001-09-14 09:52:30 +00:00
|
|
|
|
2001-09-21 12:55:27 +00:00
|
|
|
ldx #$00 ; Count
|
2001-09-14 14:37:08 +00:00
|
|
|
jsr clearpage
|
|
|
|
jsr clearpage
|
|
|
|
jsr clearpage
|
2001-09-21 12:55:27 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2001-09-14 14:37:08 +00:00
|
|
|
.proc clearpage
|
2002-05-26 09:08:52 +00:00
|
|
|
|
2001-09-21 12:55:27 +00:00
|
|
|
txa
|
|
|
|
pha ; Save count
|
2001-09-14 09:52:30 +00:00
|
|
|
|
2001-09-21 12:55:27 +00:00
|
|
|
lda #$20 ; Screencode for blank
|
|
|
|
ldy #$00
|
2001-09-14 14:37:08 +00:00
|
|
|
@L1: sta (SCREEN_PTR),y
|
|
|
|
iny
|
|
|
|
dex
|
|
|
|
bne @L1
|
|
|
|
inc SCREEN_PTR+1
|
2001-09-21 12:55:27 +00:00
|
|
|
|
|
|
|
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
|
2001-09-14 14:37:08 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
.endproc
|