]> git.sur5r.net Git - cc65/blob - libsrc/pet/clrscr.s
Added kernal replacement routines
[cc65] / libsrc / pet / clrscr.s
1 ;
2 ; Ullrich von Bassewitz, 26.11.1998
3 ;
4 ; void clrscr (void);
5 ;
6
7         .export         _clrscr
8         .import         plot
9         .importzp       ptr1
10         .import         xsize
11
12         .include        "pet.inc"
13
14 _clrscr:
15
16 ; Set the screen base address
17
18         lda     #$00
19         sta     ptr1
20         lda     #$80
21         sta     ptr1+1
22
23 ; Determine, how many pages to fill
24
25         ldx     #4
26         lda     xsize
27         cmp     #40
28         beq     L1
29         ldx     #8
30
31 ; Clear the screen
32
33 L1:     lda     #$20            ; Screen code for blank
34         ldy     #$00
35 L2:     sta     (ptr1),y
36         iny
37         bne     L2
38         inc     ptr1+1
39         dex
40         bne     L2
41
42 ; Set the cursor to 0/0
43
44         lda     #0
45         sta     CURS_X
46         sta     CURS_Y
47         jmp     plot
48
49         rts
50