]> git.sur5r.net Git - cc65/blob - libsrc/atari5200/textcolor.s
atari5200: conio now uses just four colors altogether
[cc65] / libsrc / atari5200 / textcolor.s
1 ;
2 ; Christian Groessler, 02-Apr-2019
3 ;
4 ; unsigned char __fastcall__ textcolor (unsigned char color);
5 ;
6 ; "color" value is a palette index (0..3) or COLOR_xxx value (0..3)
7
8         .export         _textcolor
9         .import         conio_color
10
11
12 _textcolor:
13         ; move bits #0 and #1 to bits #6 and #7
14         and     #3
15         clc
16         ror     a
17         ror     a
18         ror     a               ; new conio_color value
19         ldx     conio_color     ; get old value
20         sta     conio_color     ; store new value
21         txa
22         ; move bits #6 and #7 to bits #0 and #1
23         clc
24         rol     a
25         rol     a
26         rol     a
27         ldx     #0
28         rts