]> git.sur5r.net Git - cc65/blob - libsrc/cbm510/clrscr.s
Fixed capslock on startup
[cc65] / libsrc / cbm510 / clrscr.s
1 ;
2 ; Ullrich von Bassewitz, 14.09.2001
3 ;
4
5         .export         _clrscr
6         .import         plot
7
8         .include        "cbm510.inc"
9
10 ; ------------------------------------------------------------------------
11 ; void __fastcall__ clrscr (void);
12
13 .proc   _clrscr
14
15         lda     #0
16         sta     CURS_X
17         sta     CURS_Y
18         jsr     plot            ; Set cursor to top left corner
19
20         ldx     #$00            ; Count
21         jsr     clearpage
22         jsr     clearpage
23         jsr     clearpage
24         ldx     #<(40*25)       ; Count
25         jsr     clearpage       ; Clear remainder of last page
26         jmp     plot            ; Set screen pointer again
27
28 .endproc
29
30
31 .proc   clearpage
32
33         txa
34         pha                     ; Save count
35
36         lda     #$20            ; Screencode for blank
37         ldy     #$00
38 @L1:    sta     (SCREEN_PTR),y
39         iny
40         dex
41         bne     @L1
42         inc     SCREEN_PTR+1
43
44         pla
45         tax                     ; Reload count
46         lda     IndReg
47         pha
48         lda     #$0F
49         sta     IndReg          ; Switch to the system bank
50         lda     CHARCOLOR       ; Load color
51         ldy     #$00
52 @L2:    sta     (CRAM_PTR),y
53         iny
54         dex
55         bne     @L2
56         inc     CRAM_PTR+1
57         pla
58         sta     IndReg          ; Restore the old indirect bank
59         rts
60
61 .endproc