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