Fix typo and optimize

This commit is contained in:
jede
2019-07-07 22:02:48 +02:00
committed by greg-king5
parent 28eba8bff9
commit a0a6537bda
5 changed files with 21 additions and 22 deletions

View File

@@ -11,18 +11,20 @@
.proc _cputc
ldx CHARCOLOR_CHANGE
beq do_not_change_color_foreground
dec SCRX
dec SCRX
pha
lda CHARCOLOR
BRK_TELEMON $4E ; Change color on the screen (foreground)
lda #$00
sta CHARCOLOR_CHANGE
inc SCRX
pla
do_not_change_color_foreground:
ldx BGCOLOR_CHANGE
beq do_not_change_color
dec SCRX ; Dec SCRX in order to place attribute before the right position
pha
lda BGCOLOR
ORA #%00010000 ; Add 16 because background color is an attribute between 16 and 23. 17 is red background for example
@@ -36,6 +38,7 @@ do_not_change_color:
BRK_TELEMON XFWR ; Macro send char to screen (channel 0)
rts
.endproc
.bss
CHARCOLOR:
.res 1
CHARCOLOR_CHANGE: