2 ; Groepaz/Hitmen, 12.10.2015
4 ; unsigned char __fastcall__ textcolor (unsigned char color);
5 ; unsigned char __fastcall__ bgcolor (unsigned char color);
6 ; unsigned char __fastcall__ bordercolor (unsigned char color);
9 .export soft80_textcolor, soft80_bgcolor, soft80_bordercolor
10 .import soft80_internal_textcolor, soft80_internal_bgcolor
18 ldx soft80_internal_textcolor ; get old value
19 sta soft80_internal_textcolor ; set new value
27 ldx soft80_internal_bgcolor ; get old value
28 stx tmp2 ; save old value
29 sta soft80_internal_bgcolor ; set new value
33 .if SOFT80COLORVOODOO = 1
34 ; if the old bg color is equal to color ram of that cell, then also
35 ; update the color ram to the new value.
36 ; FIXME: perhaps we must also check if the non visible character is not
37 ; a space, and NOT update the color ram in that case.
42 lda soft80_colram+(page*250),x
44 cmp tmp2 ; old bg color
46 lda soft80_internal_bgcolor ; new bg color
47 sta soft80_colram+(page*250),x
58 lda #$34 ; disable I/O
61 ; if the old bg color is equal to text color in this cell, then also
62 ; update the text color to the new value.
63 ; FIXME: perhaps we need to check for space, see note above
68 lda soft80_vram+(page*250),x
70 cmp tmp2 ; old bg color
72 lda soft80_internal_bgcolor ; new bg color
74 ora tmp1 ; new bg color (high nibble)
75 sta soft80_vram+(page*250),x
85 lda tmp2 ; get old value
89 lda soft80_internal_bgcolor
94 sta tmp1 ; remember new bg color (high nibble)
95 ora soft80_internal_textcolor
96 sta CHARCOLOR ; text/bg combo for new chars
100 ldx VIC_BORDERCOLOR ; get old value
101 sta VIC_BORDERCOLOR ; set new value
105 ;-------------------------------------------------------------------------------
106 ; force the init constructor to be imported
109 conio_init = soft80_init