]> git.sur5r.net Git - cc65/blob - libsrc/atari/setcolor.s
Use decsp instead of subysp
[cc65] / libsrc / atari / setcolor.s
1 ;
2 ; Christian Groessler, June 2000
3 ;
4 ; this file provides a setcolor() function similar to BASIC SETCOLOR
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