]> git.sur5r.net Git - cc65/blob - libsrc/atari/clrscr.s
Fixed _textcolor definition.
[cc65] / libsrc / atari / clrscr.s
1 ;
2 ; Christian Groessler, Apr-2000
3 ;
4 ; void clrscr (void);
5 ;
6
7         .export         _clrscr
8         .include        "atari.inc"
9         .importzp       ptr1
10         .import         setcursor
11
12 SCRSIZE =       960             ; 40x24: size of default atari screen
13
14 _clrscr:lda     SAVMSC          ; screen memory
15         sta     ptr1
16         lda     SAVMSC+1
17         clc
18         adc     #>(SCRSIZE-1)
19         sta     ptr1+1
20         lda     #0              ; screen code of space char
21         sta     OLDCHR
22         ldy     #<(SCRSIZE-1)
23         ldx     #>(SCRSIZE-1)
24 _clr1:  sta     (ptr1),y
25         dey
26         bne     _clr1
27         sta     (ptr1),y
28         dex
29         bmi     done
30         dec     ptr1+1
31         dey
32         jmp     _clr1
33
34 done:   sta     COLCRS
35         sta     ROWCRS
36         jmp     setcursor