]> git.sur5r.net Git - cc65/blob - libsrc/atmos/chline.s
Added SER_ prefix. Whitespace cleanup
[cc65] / libsrc / atmos / chline.s
1 ;
2 ; Ullrich von Bassewitz, 08.08.1998
3 ;
4 ; void chlinexy (unsigned char x, unsigned char y, unsigned char length);
5 ; void chline (unsigned char length);
6 ;
7
8         .export         _chlinexy, _chline
9         .import         setscrptr
10         .import         rvs
11         .import         popax
12         .importzp       ptr2
13
14         .include        "atmos.inc"
15
16
17 _chlinexy:
18         pha                     ; Save the length
19         jsr     popax           ; Get X and Y
20         sta     CURS_Y          ; Store Y
21         stx     CURS_X          ; Store X
22         pla                     ; Restore the length and run into _chline
23
24 _chline:
25         tax                     ; Is the length zero?
26         beq     @L9             ; Jump if done
27         jsr     setscrptr       ; Set ptr2 to screen, won't use X
28         txa                     ; Length into A
29         clc
30         adc     CURS_X
31         sta     CURS_X          ; Correct X position by length
32         lda     #'-'            ; Horizontal line screen code
33         ora     rvs
34 @L1:    sta     (ptr2),y        ; Write one char
35         iny                     ; Next char
36         bne     @L2
37         inc     ptr2+1          ; Bump high byte of screen pointer
38 @L2:    dex
39         bne     @L1
40 @L9:    rts
41