2000-05-28 13:40:48 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 06.08.1998
|
|
|
|
;
|
|
|
|
; unsigned char __fastcall__ textcolor (unsigned char color);
|
|
|
|
; unsigned char __fastcall__ bgcolor (unsigned char color);
|
|
|
|
; unsigned char __fastcall__ bordercolor (unsigned char color);
|
|
|
|
;
|
|
|
|
|
|
|
|
.export _textcolor, _bgcolor, _bordercolor
|
|
|
|
|
|
|
|
.include "c128.inc"
|
|
|
|
|
|
|
|
|
2002-12-19 21:22:22 +00:00
|
|
|
.proc _textcolor
|
|
|
|
|
2002-12-19 20:29:27 +00:00
|
|
|
bit MODE ; Check 80/40 column mode
|
2002-12-19 21:22:22 +00:00
|
|
|
bmi @L1 ; Jump if 40 columns
|
|
|
|
ldx CHARCOLOR ; get old value
|
2000-05-28 13:40:48 +00:00
|
|
|
sta CHARCOLOR ; set new value
|
|
|
|
txa
|
2002-12-19 21:22:22 +00:00
|
|
|
ldx #$00
|
2000-05-28 13:40:48 +00:00
|
|
|
rts
|
|
|
|
|
2002-12-19 21:22:22 +00:00
|
|
|
@L1: tax ; Move new color to X
|
|
|
|
lda CHARCOLOR ; Get old color + attributes
|
|
|
|
and #$F0 ; Keep old attributes
|
|
|
|
ora $CE5C,x ; Translate VIC color -> VDC color
|
|
|
|
ldx CHARCOLOR ; Get the old color
|
|
|
|
sta CHARCOLOR ; Set the new color + old attributes
|
|
|
|
txa ; Old color -> A
|
|
|
|
and #$0F ; Mask out attributes
|
|
|
|
ldx #$00 ; Load high byte
|
|
|
|
rts
|
|
|
|
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
|
|
|
|
.proc _bgcolor
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
ldx VIC_BG_COLOR0 ; get old value
|
|
|
|
sta VIC_BG_COLOR0 ; set new value
|
|
|
|
txa
|
2002-12-19 21:22:22 +00:00
|
|
|
ldx #$00
|
2000-05-28 13:40:48 +00:00
|
|
|
rts
|
|
|
|
|
2002-12-19 21:22:22 +00:00
|
|
|
.endproc
|
|
|
|
|
|
|
|
|
|
|
|
.proc _bordercolor
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2001-09-13 21:45:44 +00:00
|
|
|
ldx VIC_BORDERCOLOR ; get old value
|
2000-05-28 13:40:48 +00:00
|
|
|
sta VIC_BORDERCOLOR ; set new value
|
|
|
|
txa
|
2002-12-19 21:22:22 +00:00
|
|
|
ldx #$00
|
2000-05-28 13:40:48 +00:00
|
|
|
rts
|
|
|
|
|
2002-12-19 21:22:22 +00:00
|
|
|
.endproc
|
|
|
|
|