2000-05-28 13:40:48 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 26.11.1998
|
|
|
|
;
|
|
|
|
; void clrscr (void);
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export _clrscr
|
|
|
|
.import plot
|
|
|
|
.importzp ptr1
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.include "pet.inc"
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
_clrscr:
|
|
|
|
|
|
|
|
; Set the screen base address
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
lda #$00
|
|
|
|
sta ptr1
|
|
|
|
lda #$80
|
|
|
|
sta ptr1+1
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
; Determine, how many pages to fill
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
ldx #4
|
|
|
|
lda SCR_LINELEN ; Check length of one line
|
|
|
|
cmp #40+1
|
|
|
|
bcc L1
|
|
|
|
ldx #8
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
; Clear the screen
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
L1: lda #$20 ; Screen code for blank
|
|
|
|
ldy #$00
|
|
|
|
L2: sta (ptr1),y
|
|
|
|
iny
|
|
|
|
bne L2
|
|
|
|
inc ptr1+1
|
|
|
|
dex
|
|
|
|
bne L2
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
; Set the cursor to 0/0
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
lda #0
|
|
|
|
sta CURS_X
|
|
|
|
sta CURS_Y
|
|
|
|
jmp plot
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
rts
|
2000-05-28 13:40:48 +00:00
|
|
|
|