]> git.sur5r.net Git - cc65/blob - libsrc/atari/setcolor.s
Removed (pretty inconsistently used) tab chars from source code base.
[cc65] / libsrc / atari / setcolor.s
1 ;
2 ; Christian Groessler, June 2004
3 ;
4 ; this file provides a color functions similar to BASIC
5 ;
6 ; void __fastcall__ _setcolor     (unsigned char color_reg, unsigned char hue, unsigned char luminace);
7 ; void __fastcall__ _setcolor_low (unsigned char color_reg, unsigned char color_value);
8 ; unsigned char __fastcall__ _getcolor (unsigned char color_reg);
9 ;
10
11
12         .export         __setcolor, __setcolor_low, __getcolor
13         .import         popa
14         .include        "atari.inc"
15
16 .proc   __getcolor
17
18         tax
19         lda     COLOR0,x        ; get current value
20         ldx     #0
21         rts
22
23 .endproc
24
25 .proc   __setcolor
26
27 ;       asl     a               ; not -> BASIC compatible
28         sta     lum             ; remember luminance
29         jsr     popa            ; get hue
30         asl     a
31         asl     a
32         asl     a
33         asl     a
34         ora     lum
35 ;       jmp     __setcolor_low
36
37 .endproc
38
39 .proc   __setcolor_low
40
41         pha
42         jsr     popa
43         tax
44         pla
45         sta     COLOR0,x
46         rts
47
48 .endproc
49
50         .bss
51 lum:    .res    1