2 ; Ullrich von Bassewitz, 13.09.2001
5 .export _textcolor, _bgcolor, _bordercolor
6 .import sys_bank, restore_bank
9 .include "zeropage.inc"
13 ; ------------------------------------------------------------------------
14 ; unsigned char __fastcall__ textcolor (unsigned char color);
15 ; /* Set the color for text output. The old color setting is returned. */
20 ldx CHARCOLOR ; get old value
21 sta CHARCOLOR ; set new value
27 ; ------------------------------------------------------------------------
28 ; unsigned char __fastcall__ bgcolor (unsigned char color);
29 ; /* Set the color for the background. The old color setting is returned. */
34 jsr sys_bank ; Switch to the system bank
37 lda (vic),y ; Get current color...
40 sta (vic),y ; Set new color
41 txa ; Get old color into X
42 jmp restore_bank ; Restore the old color
46 ; ------------------------------------------------------------------------
47 ; unsigned char __fastcall__ bordercolor (unsigned char color);
48 ; /* Set the color for the border. The old color setting is returned. */
52 jsr sys_bank ; Switch to the system bank
55 lda (vic),y ; Get current color...
58 sta (vic),y ; Set new color
59 txa ; Get old color into X
60 jmp restore_bank ; Restore the old color