]> git.sur5r.net Git - cc65/blob - libsrc/cbm510/color.s
Removed (pretty inconsistently used) tab chars from source code base.
[cc65] / libsrc / cbm510 / color.s
1 ;
2 ; Ullrich von Bassewitz, 13.09.2001
3 ;
4
5         .export         _textcolor, _bgcolor, _bordercolor
6         .import         sys_bank, restore_bank
7         .import         vic: zp, CHARCOLOR: zp
8
9         .include        "cbm510.inc"
10
11
12 ; ------------------------------------------------------------------------
13 ; unsigned char __fastcall__ textcolor (unsigned char color);
14 ; /* Set the color for text output. The old color setting is returned. */
15 ;
16
17 .proc   _textcolor
18
19         ldx     CHARCOLOR       ; get old value
20         sta     CHARCOLOR       ; set new value
21         txa
22         rts
23
24 .endproc
25
26 ; ------------------------------------------------------------------------
27 ; unsigned char __fastcall__ bgcolor (unsigned char color);
28 ; /* Set the color for the background. The old color setting is returned. */
29 ;
30
31 .proc   _bgcolor
32
33         jsr     sys_bank                ; Switch to the system bank
34         pha                             ; Save new color
35         ldy     #VIC_BG_COLOR0
36         lda     (vic),y                 ; Get current color...
37         tax                             ; ...into X
38         pla                             ; Get new color
39         sta     (vic),y                 ; Set new color
40         txa                             ; Get old color into X
41         jmp     restore_bank            ; Restore the old color
42
43 .endproc
44
45 ; ------------------------------------------------------------------------
46 ; unsigned char __fastcall__ bordercolor (unsigned char color);
47 ; /* Set the color for the border. The old color setting is returned. */
48
49 .proc   _bordercolor
50
51         jsr     sys_bank                ; Switch to the system bank
52         pha                             ; Save new color
53         ldy     #VIC_BORDERCOLOR
54         lda     (vic),y                 ; Get current color...
55         tax                             ; ...into X
56         pla                             ; Get new color
57         sta     (vic),y                 ; Set new color
58         txa                             ; Get old color into X
59         jmp     restore_bank            ; Restore the old color
60
61 .endproc
62
63
64