cc65/libsrc/telestrat/bgcolor.s

26 lines
680 B
ArmAsm
Raw Normal View History

2019-07-06 10:16:57 +02:00
; 2019-07-02, Jede (jede@oric.org)
;
.export _bgcolor
.import BGCOLOR
.import BGCOLOR_CHANGE
.include "telestrat.inc"
.proc _bgcolor
2019-07-07 22:02:48 +02:00
cmp BGCOLOR ; Do we set the same color? If we don't detect it, we loose one char on the screen for each bgcolor call with the same color
2019-07-06 10:16:57 +02:00
bne out ; Yes
2019-07-07 22:02:48 +02:00
ldy #$00
sty BGCOLOR_CHANGE
2019-07-06 10:16:57 +02:00
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