2001-09-13 21:37:59 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 13.09.2001
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export _textcolor, _bgcolor, _bordercolor
|
|
|
|
.import sys_bank, restore_bank
|
|
|
|
.import vic: zp, CHARCOLOR: zp
|
2001-09-13 21:37:59 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.include "cbm510.inc"
|
2001-09-13 21:37:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
; ------------------------------------------------------------------------
|
|
|
|
; unsigned char __fastcall__ textcolor (unsigned char color);
|
|
|
|
; /* Set the color for text output. The old color setting is returned. */
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.proc _textcolor
|
2001-09-13 21:37:59 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
ldx CHARCOLOR ; get old value
|
|
|
|
sta CHARCOLOR ; set new value
|
|
|
|
txa
|
|
|
|
rts
|
2001-09-13 21:37:59 +00:00
|
|
|
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
; ------------------------------------------------------------------------
|
|
|
|
; unsigned char __fastcall__ bgcolor (unsigned char color);
|
|
|
|
; /* Set the color for the background. The old color setting is returned. */
|
|
|
|
;
|
|
|
|
|
|
|
|
.proc _bgcolor
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
jsr sys_bank ; Switch to the system bank
|
|
|
|
pha ; Save new color
|
|
|
|
ldy #VIC_BG_COLOR0
|
|
|
|
lda (vic),y ; Get current color...
|
|
|
|
tax ; ...into X
|
|
|
|
pla ; Get new color
|
|
|
|
sta (vic),y ; Set new color
|
|
|
|
txa ; Get old color into X
|
|
|
|
jmp restore_bank ; Restore the old color
|
2001-09-13 21:37:59 +00:00
|
|
|
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
; ------------------------------------------------------------------------
|
|
|
|
; unsigned char __fastcall__ bordercolor (unsigned char color);
|
|
|
|
; /* Set the color for the border. The old color setting is returned. */
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.proc _bordercolor
|
|
|
|
|
|
|
|
jsr sys_bank ; Switch to the system bank
|
|
|
|
pha ; Save new color
|
|
|
|
ldy #VIC_BORDERCOLOR
|
|
|
|
lda (vic),y ; Get current color...
|
|
|
|
tax ; ...into X
|
|
|
|
pla ; Get new color
|
|
|
|
sta (vic),y ; Set new color
|
|
|
|
txa ; Get old color into X
|
|
|
|
jmp restore_bank ; Restore the old color
|
2001-09-13 21:37:59 +00:00
|
|
|
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
|
|
|
|
|