]> git.sur5r.net Git - cc65/blob - libsrc/geos-common/conio/chline.s
Only for jumps, the lib uses named asm labels in branches
[cc65] / libsrc / geos-common / conio / chline.s
1 ;
2 ; Maciej 'YTM/Elysium' Witkowiak
3 ;
4 ; 06.03.2002
5
6 ; void chlinexy (unsigned char x, unsigned char y, unsigned char length);
7 ; void chline (unsigned char length);
8
9             .export _chlinexy, _chline
10             .import gotoxy, fixcursor
11             .importzp cursor_x, cursor_y, cursor_c
12
13             .include "jumptab.inc"
14             .include "geossym.inc"
15
16 _chlinexy:
17         pha                     ; Save the length
18         jsr gotoxy              ; Call this one, will pop params
19         pla                     ; Restore the length
20
21 _chline:
22         cmp #0                  ; Is the length zero?
23         beq L9                  ; Jump if done
24         tax
25         lda cursor_x            ; left start
26         sta r3L
27         lda cursor_x+1
28         sta r3L+1
29         lda cursor_y            ; level
30         clc
31         adc #4                  ; in the middle of a cell
32         sta r11L
33         txa                     ; right end
34         clc
35         adc cursor_c
36         sta cursor_c
37         sta r4L
38         lda #0
39         sta r4L+1
40         ldx #r4
41         ldy #3
42         jsr DShiftLeft
43         clc                     ; one pixel less
44         lda r4L
45         sbc #0
46         sta r4L
47         lda r4L+1
48         sbc #0
49         sta r4L+1
50         lda #%11111111          ; pattern
51         jsr HorizontalLine
52         jsr fixcursor
53 L9:     rts