Fix cputdirect

This commit is contained in:
jede 2021-03-08 21:16:44 +01:00
parent df64fd859c
commit facc1b4914

View file

@ -7,13 +7,12 @@
.export _cputc, _cputcxy, cputdirect, display_conio .export _cputc, _cputcxy, cputdirect, display_conio
.export CHARCOLOR, OLD_CHARCOLOR, BGCOLOR, OLD_BGCOLOR .export CHARCOLOR, OLD_CHARCOLOR, BGCOLOR, OLD_BGCOLOR
.import update_adscr .import update_adscr
.import popax .import popax
.include "telestrat.inc" .include "telestrat.inc"
cputdirect:
_cputcxy: _cputcxy:
pha ; Save C pha ; Save C
jsr popax ; Get X and Y jsr popax ; Get X and Y
@ -22,7 +21,7 @@ _cputcxy:
jsr update_adscr jsr update_adscr
pla pla
.proc _cputc _cputc:
cmp #$0D cmp #$0D
bne @not_CR bne @not_CR
ldy #$00 ldy #$00
@ -30,12 +29,13 @@ _cputcxy:
rts rts
@not_CR: @not_CR:
cmp #$0A cmp #$0A
bne @not_LF bne not_LF
inc SCRY inc SCRY
jmp update_adscr jmp update_adscr
@not_LF: cputdirect:
not_LF:
ldx CHARCOLOR ldx CHARCOLOR
cpx OLD_CHARCOLOR cpx OLD_CHARCOLOR
beq do_not_change_color_foreground beq do_not_change_color_foreground
@ -67,7 +67,7 @@ do_not_change_color_foreground:
do_not_change_color: do_not_change_color:
; it continues to display_conio ; it continues to display_conio
.endproc
.proc display_conio .proc display_conio
; This routine is used to displays char on screen ; This routine is used to displays char on screen