add chline, cvline functions
This commit is contained in:
@@ -32,7 +32,12 @@
|
|||||||
#define CH_CURS_UP 0x19
|
#define CH_CURS_UP 0x19
|
||||||
#define CH_CURS_DOWN 0x1A
|
#define CH_CURS_DOWN 0x1A
|
||||||
#define CH_ESC 0x1B
|
#define CH_ESC 0x1B
|
||||||
|
#define CH_HLINE 0x1B
|
||||||
|
#define CH_VLINE 0x5C
|
||||||
|
#define CH_ULCORNER 0x10
|
||||||
|
#define CH_URCORNER 0x12
|
||||||
|
#define CH_LLCORNER 0x1D
|
||||||
|
#define CH_LRCORNER 0x1F
|
||||||
|
|
||||||
/* Masks for joy_read */
|
/* Masks for joy_read */
|
||||||
#define JOY_UP_MASK 0x10
|
#define JOY_UP_MASK 0x10
|
||||||
@@ -68,4 +73,4 @@ void rebootafterexit (void);
|
|||||||
/* End of agat.h */
|
/* End of agat.h */
|
||||||
|
|
||||||
|
|
||||||
#endif //_AGAT_H
|
#endif
|
||||||
|
|||||||
33
libsrc/agat/chline.s
Normal file
33
libsrc/agat/chline.s
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
;
|
||||||
|
; Ullrich von Bassewitz, 08.08.1998
|
||||||
|
; Colin Leroy-Mira, 26.05.2025
|
||||||
|
; Konstantin Fedorov, 12.06.2025
|
||||||
|
;
|
||||||
|
; void chlinexy (unsigned char x, unsigned char y, unsigned char length);
|
||||||
|
; void chline (unsigned char length);
|
||||||
|
;
|
||||||
|
|
||||||
|
.export _chlinexy, _chline, chlinedirect
|
||||||
|
.import gotoxy, putchar
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
|
|
||||||
|
_chlinexy:
|
||||||
|
pha ; Save the length
|
||||||
|
jsr gotoxy ; Call this one, will pop params
|
||||||
|
pla ; Restore the length and run into _chline
|
||||||
|
|
||||||
|
_chline:
|
||||||
|
ldx #$1B ; horizontal line character
|
||||||
|
|
||||||
|
chlinedirect:
|
||||||
|
stx tmp1
|
||||||
|
cmp #$00 ; Is the length zero?
|
||||||
|
beq done ; Jump if done
|
||||||
|
sta tmp2
|
||||||
|
: lda tmp1 ; Screen code
|
||||||
|
jsr putchar ; Direct output
|
||||||
|
dec tmp2
|
||||||
|
bne :-
|
||||||
|
done: rts
|
||||||
|
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
;
|
;
|
||||||
; Oleg A. Odintsov, Moscow, 2024
|
; Oleg A. Odintsov, Moscow, 2024
|
||||||
|
; Konstantin Fedorov, 12.06.2025
|
||||||
;
|
;
|
||||||
; void __fastcall__ cputcxy (unsigned char x, unsigned char y, char c);
|
; void __fastcall__ cputcxy (unsigned char x, unsigned char y, char c);
|
||||||
; void __fastcall__ cputc (char c);
|
; void __fastcall__ cputc (char c);
|
||||||
;
|
;
|
||||||
|
|
||||||
.import COUT
|
.import COUT
|
||||||
.export _cputcxy, _cputc
|
.export _cputcxy, _cputc, newline, putchar,putchardirect
|
||||||
.import gotoxy, VTABZ
|
.import gotoxy, VTABZ
|
||||||
.include "agat.inc"
|
.include "agat.inc"
|
||||||
|
|
||||||
@@ -15,20 +16,21 @@ _cputcxy:
|
|||||||
jsr gotoxy
|
jsr gotoxy
|
||||||
pla
|
pla
|
||||||
_cputc:
|
_cputc:
|
||||||
cmp #$0D
|
cmp #$0D ; Test for \r = carriage return
|
||||||
bne notleft
|
bne notleft
|
||||||
ldy #$00
|
ldy #$00
|
||||||
sty CH
|
sty CH
|
||||||
rts
|
rts
|
||||||
notleft:
|
notleft:
|
||||||
cmp #$0A
|
cmp #$0A ; Test for \n = line feed
|
||||||
beq newline
|
beq newline
|
||||||
|
|
||||||
putchar:
|
putchar:
|
||||||
ldy CH
|
ldy CH
|
||||||
sta (BASL),Y
|
sta (BASL),Y
|
||||||
iny
|
iny
|
||||||
lda TATTR
|
lda TATTR
|
||||||
bmi wch
|
bmi wch ; Skip if t64
|
||||||
sta (BASL),Y
|
sta (BASL),Y
|
||||||
iny
|
iny
|
||||||
wch:
|
wch:
|
||||||
@@ -47,3 +49,12 @@ newline:
|
|||||||
: jmp VTABZ
|
: jmp VTABZ
|
||||||
noend:
|
noend:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
putchardirect:
|
||||||
|
ldy CH
|
||||||
|
sta (BASL),Y
|
||||||
|
lda TATTR
|
||||||
|
bmi :+
|
||||||
|
iny
|
||||||
|
sta (BASL),Y
|
||||||
|
: rts
|
||||||
|
|||||||
29
libsrc/agat/cvline.s
Normal file
29
libsrc/agat/cvline.s
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
;
|
||||||
|
; Ullrich von Bassewitz, 08.08.1998
|
||||||
|
; Colin Leroy-Mira, 26.05.2025
|
||||||
|
; Konstantin Fedorov, 12.06.2025
|
||||||
|
;
|
||||||
|
; void cvlinexy (unsigned char x, unsigned char y, unsigned char length);
|
||||||
|
; void cvline (unsigned char length);
|
||||||
|
;
|
||||||
|
|
||||||
|
.export _cvlinexy, _cvline
|
||||||
|
.import gotoxy, putchardirect, newline
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
|
|
||||||
|
_cvlinexy:
|
||||||
|
pha ; Save the length
|
||||||
|
jsr gotoxy ; Call this one, will pop params
|
||||||
|
pla ; Restore the length and run into _cvline
|
||||||
|
|
||||||
|
_cvline:
|
||||||
|
cmp #$00 ; Is the length zero?
|
||||||
|
beq done ; Jump if done
|
||||||
|
sta tmp2
|
||||||
|
: lda #$5C ; vertical line character
|
||||||
|
jsr putchardirect ; Write, no cursor advance
|
||||||
|
jsr newline ; Advance cursor to next line
|
||||||
|
dec tmp2
|
||||||
|
bne :-
|
||||||
|
done: rts
|
||||||
@@ -11,5 +11,5 @@
|
|||||||
|
|
||||||
HOME:
|
HOME:
|
||||||
lda #$8C
|
lda #$8C
|
||||||
jsr COUT
|
jmp COUT
|
||||||
rts
|
rts
|
||||||
|
|||||||
Reference in New Issue
Block a user