]> git.sur5r.net Git - cc65/blob - libsrc/atari5200/clrscr.s
Changes due to code review.
[cc65] / libsrc / atari5200 / clrscr.s
1 ;
2 ; Christian Groessler, May-2014
3 ;
4 ; void clrscr (void);
5 ;
6
7         .export         _clrscr
8         .include        "atari5200.inc"
9         .importzp       ptr1
10
11 SCRSIZE =       480             ; 20x24: size of default conio atari5200 screen
12
13 _clrscr:lda     SAVMSC          ; screen memory
14         sta     ptr1
15         lda     SAVMSC+1
16         clc
17         adc     #>(SCRSIZE-1)
18         sta     ptr1+1
19         lda     #0              ; screen code of space char
20         ldy     #<(SCRSIZE-1)
21         ldx     #>(SCRSIZE-1)
22 _clr1:  sta     (ptr1),y
23         dey
24         bne     _clr1
25         sta     (ptr1),y
26         dex
27         bmi     done
28         dec     ptr1+1
29         dey
30         jmp     _clr1
31
32 done:   sta     COLCRS_5200
33         sta     ROWCRS_5200
34         rts