]> git.sur5r.net Git - cc65/blob - libsrc/geos-common/conio/cvline.s
Fixed several aspects of the GEOS CONIO implementation:
[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 popa, _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 popa                ; Get y
19         jsr _gotoxy             ; Call this one, will pop params
20         pla                     ; Restore the length
21
22 _cvline:    
23         cmp #0                  ; Is the length zero?
24         beq L9                  ; Jump if done
25         tax
26         lda cursor_x            ; x position
27         clc
28         adc #3                  ; in the middle of cell
29         sta r4L
30         lda cursor_x+1
31         adc #0
32         sta r4L+1
33         lda cursor_y            ; top start
34         sta r3L
35         txa                     ; bottom end
36         clc
37         adc cursor_r
38         sta cursor_r
39         asl a
40         asl a
41         asl a
42         clc                     ; one pixel less
43         sbc #0
44         sta r3H
45         lda #%11111111          ; pattern
46         jsr VerticalLine
47         jsr fixcursor
48 L9:     rts