1;*
2;* clrscr
3;*
4;* NB: All screen functions assume Graphics Mode 1 in a default configuration.
5;* Therefore, this is hard coded to use $1000-$12FF as screen VRAM.
6
7        .export         _clrscr
8        .include        "creativision.inc"
9
10_clrscr:
11
12        sei             ; Disable interrupts. Default INT handler reads VDP_STATUS
13                        ; and would lose any setup done here.
14
15        lda     #$00    ; VRAM offset low
16        sta     VDP_CONTROL_W
17
18        lda     #$50    ; VRAM offset high ($10 OR $40)
19        sta     VDP_CONTROL_W
20
21        lda     #$40    ; Space char from ROM setup
22
23        ldx     #0
24        ldy     #3
25
26L1:     sta     VDP_DATA_W
27        inx
28        bne     L1
29        dey
30        bne     L1
31
32        cli             ; Let interrupts go again
33
34        lda     #0
35        sta     CURSOR_X
36        sta     CURSOR_Y
37        sta     SCREEN_PTR
38        lda     #$10
39        sta     SCREEN_PTR+1
40
41        rts
42