]> git.sur5r.net Git - cc65/blob - libsrc/atmos/clrscr.s
Remove trailings spaces from CBM-related asm files
[cc65] / libsrc / atmos / clrscr.s
1 ;
2 ; 2003-04-13, Ullrich von Bassewitz
3 ; 2013-07-16, Greg King
4 ;
5
6         .export         _clrscr
7         .importzp       ptr2
8
9         .include        "atmos.inc"
10
11 ; ------------------------------------------------------------------------
12 ; void clrscr (void);
13
14 .proc   _clrscr
15
16 ; Set the cursor to top left cursor position
17
18         ldy     #$00
19         sty     CURS_X
20         sty     CURS_Y
21
22 ; Set ptr2 to the screen position (left upper border)
23
24         lda     #<SCREEN
25         sta     ptr2
26         lda     #>SCREEN
27         sta     ptr2+1
28
29 ; Clear full pages. Y is still zero
30
31         ldx     #>(SCREEN_YSIZE * SCREEN_XSIZE)
32         lda     #' '
33 @L1:    sta     (ptr2),y
34         iny                     ; Bump low byte of address
35         bne     @L1
36         inc     ptr2+1          ; Bump high byte of address
37         dex
38         bne     @L1
39
40 ; Clear the remaining page
41
42 @L2:    sta     (ptr2),y
43         iny
44         cpy     #<(SCREEN_YSIZE * SCREEN_XSIZE)
45         bne     @L2
46         rts
47
48 .endproc