1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-17 09:29:10 +00:00
cc65/libsrc/telestrat/textcolor.s

28 lines
718 B
ArmAsm
Raw Normal View History

2019-07-06 08:16:57 +00:00
; 2019-07-02, Jede (jede@oric.org)
;
.export _textcolor
.import CHARCOLOR
.import CHARCOLOR_CHANGE
.include "telestrat.inc"
.proc _textcolor
2019-07-07 20:02:48 +00:00
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
2019-07-06 08:16:57 +00:00
bne out ; yes
2019-07-07 20:02:48 +00:00
ldy #$00
sty CHARCOLOR_CHANGE
lda CHARCOLOR ; Return last color
2019-07-06 08:16:57 +00:00
rts
out:
2019-07-07 20:02:48 +00:00
ldx CHARCOLOR ; Get last color in order to return it
2019-07-06 08:16:57 +00:00
sta CHARCOLOR
lda #$01
sta CHARCOLOR_CHANGE
2019-07-07 20:02:48 +00:00
txa ; Return previous color
2019-07-06 08:16:57 +00:00
rts
.endproc