Add textcolor and bgcolor.s
This commit is contained in:
28
libsrc/telestrat/textcolor.s
Normal file
28
libsrc/telestrat/textcolor.s
Normal file
@@ -0,0 +1,28 @@
|
||||
; 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
|
||||
lda #$00
|
||||
sta CHARCOLOR_CHANGE
|
||||
|
||||
lda CHARCOLOR ; 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user