]> git.sur5r.net Git - cc65/blob - libsrc/geos-cbm/conio/cclear.s
a346366f85f69159ef6c16a620c87fb4e8c243d4
[cc65] / libsrc / geos-cbm / conio / cclear.s
1 ;
2 ; Maciej 'YTM/Elysium' Witkowiak
3 ;
4 ; 06.03.2002
5
6 ; void cclearxy (unsigned char x, unsigned char y, unsigned char length);
7 ; void cclear (unsigned char length);
8
9             .include "jumptab.inc"
10             .include "geossym.inc"
11
12             .export             _cclearxy, _cclear
13             .import             popa, _gotoxy, fixcursor
14             .importzp           cursor_x, cursor_y, cursor_c
15
16 _cclearxy:
17         pha                     ; Save the length
18         jsr     popa            ; Get y
19         jsr     _gotoxy         ; Call this one, will pop params
20         pla                     ; Restore the length
21
22 _cclear:
23         cmp     #0              ; Is the length zero?
24         beq     L9              ; Jump if done
25         tax
26         lda     cursor_x        ; left start
27         sta     r3L
28         lda     cursor_x+1
29         sta     r3L+1
30         lda     cursor_y        ; level
31         sta     r2L
32         clc
33         adc     #8
34         sta     r2H
35         txa                     ; right end
36         clc
37         adc     cursor_c
38         sta     cursor_c
39         sta     r4L
40         ldx     #r4
41         ldy     #3
42         jsr     DShiftLeft
43         lda     curPattern      ; store current pattern
44         pha
45         lda     #0              ; set pattern to clear
46         jsr     SetPattern
47         jsr     Rectangle
48         pla
49         jsr     SetPattern      ; restore pattern
50         jsr     fixcursor
51 L9:     rts