2 ; Groepaz/Hitmen, 12.10.2015
4 ; unsigned char __fastcall__ textcolor (unsigned char color);
5 ; unsigned char __fastcall__ bgcolor (unsigned char color);
8 .export soft80_textcolor, soft80_bgcolor
9 .import soft80_internal_textcolor, soft80_internal_bgcolor
17 ldx soft80_internal_textcolor ; get old value
18 sta soft80_internal_textcolor ; set new value
26 ldx soft80_internal_bgcolor ; get old value
27 stx tmp2 ; save old value
28 sta soft80_internal_bgcolor ; set new value
32 .if SOFT80COLORVOODOO = 1
33 ; if the old bg color is equal to color ram of that cell, then also
34 ; update the color ram to the new value.
35 ; FIXME: perhaps we must also check if the non visible character is not
36 ; a space, and NOT update the color ram in that case.
41 lda soft80_colram+(page*250),x
43 cmp tmp2 ; old bg color
45 lda soft80_internal_bgcolor ; new bg color
46 sta soft80_colram+(page*250),x
57 lda #$34 ; disable I/O
60 ; if the old bg color is equal to text color in this cell, then also
61 ; update the text color to the new value.
62 ; FIXME: perhaps we need to check for space, see note above
67 lda soft80_vram+(page*250),x
69 cmp tmp2 ; old bg color
71 lda soft80_internal_bgcolor ; new bg color
73 ora tmp1 ; new bg color (high nibble)
74 sta soft80_vram+(page*250),x
84 lda tmp2 ; get old value
88 lda soft80_internal_bgcolor
93 sta tmp1 ; remember new bg color (high nibble)
94 ora soft80_internal_textcolor
95 sta CHARCOLOR ; text/bg combo for new chars
98 ;-------------------------------------------------------------------------------
99 ; force the init constructor to be imported
102 conio_init = soft80_init