add chline, cvline functions

This commit is contained in:
Konstantin
2025-06-13 12:50:39 +03:00
parent 9afe980124
commit c28bafa581
5 changed files with 85 additions and 7 deletions

View File

@@ -1,12 +1,13 @@
;
; Oleg A. Odintsov, Moscow, 2024
; Konstantin Fedorov, 12.06.2025
;
; void __fastcall__ cputcxy (unsigned char x, unsigned char y, char c);
; void __fastcall__ cputc (char c);
;
.import COUT
.export _cputcxy, _cputc
.export _cputcxy, _cputc, newline, putchar,putchardirect
.import gotoxy, VTABZ
.include "agat.inc"
@@ -15,20 +16,21 @@ _cputcxy:
jsr gotoxy
pla
_cputc:
cmp #$0D
cmp #$0D ; Test for \r = carriage return
bne notleft
ldy #$00
sty CH
rts
notleft:
cmp #$0A
cmp #$0A ; Test for \n = line feed
beq newline
putchar:
ldy CH
sta (BASL),Y
iny
lda TATTR
bmi wch
bmi wch ; Skip if t64
sta (BASL),Y
iny
wch:
@@ -47,3 +49,12 @@ newline:
: jmp VTABZ
noend:
rts
putchardirect:
ldy CH
sta (BASL),Y
lda TATTR
bmi :+
iny
sta (BASL),Y
: rts