]> git.sur5r.net Git - cc65/blob - libsrc/vic20/color.s
Removed (pretty inconsistently used) tab chars from source code base.
[cc65] / libsrc / vic20 / color.s
1 ;
2 ; Ullrich von Bassewitz, 06.08.1998
3 ; Adapted for Vic20 by Steve Schmidtke 05.08.2002
4 ;
5 ; unsigned char __fastcall__ textcolor (unsigned char color);
6 ; unsigned char __fastcall__ bgcolor (unsigned char color);
7 ; unsigned char __fastcall__ bordercolor (unsigned char color);
8 ;
9
10
11         .export         _textcolor, _bgcolor, _bordercolor
12         .importzp       tmp1
13
14         .include        "vic20.inc"
15
16
17
18 .code
19
20 _textcolor:
21         ldx     CHARCOLOR       ; get old value
22         sta     CHARCOLOR       ; set new value
23         txa
24         rts
25
26
27 _bgcolor:
28         asl
29         asl
30         asl
31         asl
32         sta     tmp1
33         sei                     ; don't want anything messing around while we update
34         lda     VIC_COLOR       ; get old value
35         and     #$0F
36         tax
37         ora     tmp1
38         sta     VIC_COLOR       ; set new value
39         cli
40         txa
41         lsr
42         lsr
43         lsr
44         lsr
45         rts
46
47
48 _bordercolor:
49         and     #$07
50         sta     tmp1
51         sei                     ; don't want anything messing around while we update
52         lda     VIC_COLOR       ; get old value
53         and     #$F8
54         tax
55         ora     tmp1
56         sta     VIC_COLOR       ; set new value
57         cli
58         txa
59         rts
60