]> git.sur5r.net Git - cc65/blob - libsrc/osic1p/clrscr.s
Fix formatting, replace tabs with spaces.
[cc65] / libsrc / osic1p / clrscr.s
1 ;\r
2 ; void clrscr (void);\r
3 ;\r
4         .export         _clrscr\r
5         .import         plot\r
6         .importzp       CURS_X, CURS_Y\r
7         .include        "osic1p.inc"\r
8 \r
9 ; Adapted from the Challenger Character Graphics\r
10 ; Reference Manual, "2.3.3 MACHINE LANGUAGE SCREEN CLEAR"\r
11 ; This is self-modifying code!\r
12 BANKS = VIDEORAMSIZE / $100\r
13 \r
14 _clrscr:\r
15         lda       #$20 ;' '\r
16         ldy       #BANKS\r
17         ldx       #$00\r
18 staloc:\r
19         sta       SCRNBASE,X\r
20         inx\r
21         bne       staloc\r
22         inc       staloc+2\r
23         dey\r
24         bne       staloc\r
25         lda       #>(SCRNBASE); load high byte\r
26         sta       staloc+2    ; restore base address\r
27 \r
28         lda       #$00        ; cursor in upper left corner\r
29         sta       CURS_X\r
30         sta       CURS_Y\r
31         jmp       plot        ; Set the cursor position\r