]> git.sur5r.net Git - cc65/blob - libsrc/geos-common/conio/cvline.s
Introduced internal gotoxy that pops both parameters.
[cc65] / libsrc / geos-common / conio / cvline.s
1 ;
2 ; Maciej 'YTM/Elysium' Witkowiak
3 ;
4 ; 06.03.2002
5
6 ; void cvlinexy (unsigned char x, unsigned char y, unsigned char length);
7 ; void cvline (unsigned char length);
8
9             .export _cvlinexy, _cvline
10             .import gotoxy, fixcursor
11             .importzp cursor_x, cursor_y, cursor_r
12
13             .include "jumptab.inc"
14             .include "geossym.inc"
15
16 _cvlinexy:
17         pha                     ; Save the length
18         jsr gotoxy              ; Call this one, will pop params
19         pla                     ; Restore the length
20
21 _cvline:    
22         cmp #0                  ; Is the length zero?
23         beq L9                  ; Jump if done
24         tax
25         lda cursor_x            ; x position
26         clc
27         adc #3                  ; in the middle of cell
28         sta r4L
29         lda cursor_x+1
30         adc #0
31         sta r4L+1
32         lda cursor_y            ; top start
33         sta r3L
34         txa                     ; bottom end
35         clc
36         adc cursor_r
37         sta cursor_r
38         asl a
39         asl a
40         asl a
41         clc                     ; one pixel less
42         sbc #0
43         sta r3H
44         lda #%11111111          ; pattern
45         jsr VerticalLine
46         jsr fixcursor
47 L9:     rts