1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-08 13:04:52 +00:00
cc65/libsrc/cbm510/clrscr.s
cuz dada43f570 More cbm510 changes to make file I/O and kernal access work
git-svn-id: svn://svn.cc65.org/cc65/trunk@2846 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-12-27 16:11:14 +00:00

63 lines
977 B
ArmAsm

;
; Ullrich von Bassewitz, 14.09.2001
;
.export _clrscr
.import plot
.include "cbm510.inc"
.include "extzp.inc"
; ------------------------------------------------------------------------
; void __fastcall__ clrscr (void);
.proc _clrscr
lda #0
sta CURS_X
sta CURS_Y
jsr plot ; Set cursor to top left corner
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
.endproc
.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
.endproc