2003-04-13 22:12:09 +00:00
|
|
|
;
|
2013-07-26 07:33:54 +00:00
|
|
|
; 2003-04-13, Ullrich von Bassewitz
|
|
|
|
; 2013-07-16, Greg King
|
2003-04-13 22:12:09 +00:00
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export _clrscr
|
2003-04-13 22:12:09 +00:00
|
|
|
.importzp ptr2
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.include "atmos.inc"
|
2003-04-13 22:12:09 +00:00
|
|
|
|
|
|
|
; ------------------------------------------------------------------------
|
2012-03-04 13:08:54 +00:00
|
|
|
; void clrscr (void);
|
2003-04-13 22:12:09 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.proc _clrscr
|
2003-04-13 22:12:09 +00:00
|
|
|
|
|
|
|
; Set the cursor to top left cursor position
|
|
|
|
|
|
|
|
ldy #$00
|
|
|
|
sty CURS_X
|
|
|
|
sty CURS_Y
|
|
|
|
|
|
|
|
; Set ptr2 to the screen position (left upper border)
|
|
|
|
|
|
|
|
lda #<SCREEN
|
|
|
|
sta ptr2
|
|
|
|
lda #>SCREEN
|
|
|
|
sta ptr2+1
|
|
|
|
|
|
|
|
; Clear full pages. Y is still zero
|
|
|
|
|
2013-07-26 07:33:54 +00:00
|
|
|
ldx #>(SCREEN_YSIZE * SCREEN_XSIZE)
|
2003-04-13 22:12:09 +00:00
|
|
|
lda #' '
|
|
|
|
@L1: sta (ptr2),y
|
|
|
|
iny ; Bump low byte of address
|
|
|
|
bne @L1
|
|
|
|
inc ptr2+1 ; Bump high byte of address
|
|
|
|
dex
|
|
|
|
bne @L1
|
|
|
|
|
|
|
|
; Clear the remaining page
|
|
|
|
|
|
|
|
@L2: sta (ptr2),y
|
|
|
|
iny
|
2013-07-26 07:33:54 +00:00
|
|
|
cpy #<(SCREEN_YSIZE * SCREEN_XSIZE)
|
2003-04-13 22:12:09 +00:00
|
|
|
bne @L2
|
|
|
|
rts
|
|
|
|
|
|
|
|
.endproc
|