]> git.sur5r.net Git - cc65/blob - libsrc/geos-cbm/conio/clrscr.s
b1bdc17ad9b98c3a50a798b352da9edd272ea20d
[cc65] / libsrc / geos-cbm / conio / clrscr.s
1
2 ;
3 ; Maciej 'YTM/Elysium' Witkowiak
4 ;
5 ; 27.10.2001, 23.12.2002
6
7 ; void clrscr (void);
8
9             .export _clrscr
10
11             .include "../inc/jumptab.inc"
12             .include "../inc/geossym.inc"
13             .include "../inc/const.inc"
14
15             .import fixcursor
16             .importzp cursor_c, cursor_r
17
18 _clrscr:
19             lda #ST_WR_FORE | ST_WR_BACK
20             sta dispBufferOn
21             lda curPattern              ; save current pattern
22             pha
23             lda #0                      ; set pattern to clear
24             jsr SetPattern
25             ldx #0
26             stx r3L
27             stx r3H
28             stx r2L
29             stx cursor_c
30             inx
31             stx cursor_r
32             jsr fixcursor               ; home cursor
33             lda #199
34             sta r2H
35             lda graphMode
36             bpl L40
37             lda #>639                   ; 80 columns
38             ldx #<639
39             bne L99
40 L40:        lda #>319                   ; 40 columns
41             ldx #<319
42 L99:        sta r4H
43             stx r4L
44             jsr Rectangle
45             pla
46             jmp SetPattern              ; restore pattern