Add textcolor and bgcolor.s

This commit is contained in:
jede
2019-07-06 10:16:57 +02:00
committed by greg-king5
parent 14ac1a7ff6
commit 7f9e73a1ce
8 changed files with 129 additions and 14 deletions

View File

@@ -0,0 +1,28 @@
; 2019-07-02, Jede (jede@oric.org)
;
.export _bgcolor
.import BGCOLOR
.import BGCOLOR_CHANGE
.include "telestrat.inc"
.proc _bgcolor
cmp BGCOLOR ; 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 BGCOLOR_CHANGE
lda BGCOLOR ; Return last color
rts
out:
ldx BGCOLOR ; Get last color in order to return it
sta BGCOLOR
lda #$01 ; Notify the change color
sta BGCOLOR_CHANGE
txa ; Return previous color
rts
.endproc