1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-07 19:29:18 +00:00
cc65/libsrc/telestrat/textcolor.s
2019-07-21 14:11:51 -04:00

28 lines
690 B
ArmAsm

; 2019-07-02, Jede (jede@oric.org)
;
.export _textcolor
.import CHARCOLOR
.import CHARCOLOR_CHANGE
.include "telestrat.inc"
.proc _textcolor
cmp CHARCOLOR ; Do we set the same color? If we don't detect it, we loose one char on the screen for each textcolor call with the same color
bne out ; yes
ldy #$00
sty CHARCOLOR_CHANGE
; Return last color
rts
out:
ldx CHARCOLOR ; Get last color in order to return it
sta CHARCOLOR
lda #$01
sta CHARCOLOR_CHANGE
txa ; Return previous color
rts
.endproc