]> git.sur5r.net Git - cc65/blob - include/atari.h
GTIA color defines; added c64 compatibility color defines
[cc65] / include / atari.h
1 /*
2  * atari.h
3  *
4  * Contributing authors:
5  *     Mark Keates
6  *     Freddy Offenga
7  *     Christian Groessler
8  */
9
10 #ifndef _ATARI_H
11 #define _ATARI_H
12
13 /* Characters codes */
14 #define CH_DEL          0xFE
15 #define CH_ESC          0x1B
16 #define CH_CURS_UP      28
17 #define CH_CURS_DOWN    29
18 #define CH_CURS_LEFT    30
19 #define CH_CURS_RIGHT   31
20
21 #define CH_TAB          0x7F   /* tabulator */
22 #define CH_EOL          0x0B   /* end-of-line marker */
23 #define CH_CLR          0x7D   /* clear screen */
24 #define CH_BEL          0xFD   /* bell */
25 #define CH_RUBOUT       0x7E   /* back space (rubout) */
26 #define CH_DELLINE      0x9C   /* delete line */
27 #define CH_INSLINE      0x9D   /* insert line */
28
29 /* These are defined to be Atari + NumberKey */
30 #define CH_F1           177
31 #define CH_F2           178
32 #define CH_F3           179
33 #define CH_F4           180
34 #define CH_F5           181
35 #define CH_F6           182
36 #define CH_F7           183
37 #define CH_F8           184
38 #define CH_F9           185
39 #define CH_F10          176
40
41 #define CH_ULCORNER     0x11
42 #define CH_URCORNER     0x05
43 #define CH_LLCORNER     0x1A
44 #define CH_LRCORNER     0x03
45 #define CH_TTEE         0x17
46 #define CH_BTEE         0x18
47 #define CH_LTEE         0x01
48 #define CH_RTEE         0x04
49 #define CH_CROSS        0x19
50 #define CH_HLINE        0x12
51 #define CH_VLINE        0x16
52
53 /* color defines */
54
55 /* make GTIA color value */
56 #define _gtia_mkcolor(hue,lum) (((hue) << 4) | ((lum) << 1))
57
58 /* luminance values go from 0 (black) to 7 (white) */
59
60 /* hue values */
61 #define HUE_GREY        0
62 #define HUE_GOLD        1
63 #define HUE_GOLDORANGE  2
64 #define HUE_REDORANGE   3
65 #define HUE_ORANGE      4
66 #define HUE_MAGENTA     5
67 #define HUE_PURPLE      6
68 #define HUE_BLUE        7
69 #define HUE_BLUE2       8
70 #define HUE_CYAN        9
71 #define HUE_BLUEGREEN   10
72 #define HUE_BLUEGREEN2  11
73 #define HUE_GREEN       12
74 #define HUE_YELLOWGREEN 13
75 #define HUE_YELLOW      14
76 #define HUE_YELLOWRED   15
77
78 /* Color defines, similar to c64 colors */
79 #define COLOR_BLACK             _gtia_mkcolor(HUE_GREY,0)
80 #define COLOR_WHITE             _gtia_mkcolor(HUE_GREY,7)
81 #define COLOR_RED               _gtia_mkcolor(HUE_REDORANGE,1)
82 #define COLOR_CYAN              _gtia_mkcolor(HUE_CYAN,3)
83 #define COLOR_VIOLET            _gtia_mkcolor(HUE_PURPLE,4)
84 #define COLOR_GREEN             _gtia_mkcolor(HUE_GREEN,2)
85 #define COLOR_BLUE              _gtia_mkcolor(HUE_BLUE,2)
86 #define COLOR_YELLOW            _gtia_mkcolor(HUE_YELLOW,7)
87 #define COLOR_ORANGE            _gtia_mkcolor(HUE_ORANGE,5)
88 #define COLOR_BROWN             _gtia_mkcolor(HUE_YELLOW,2)
89 #define COLOR_LIGHTRED          _gtia_mkcolor(HUE_REDORANGE,6)
90 #define COLOR_GRAY1             _gtia_mkcolor(HUE_GREY,2)
91 #define COLOR_GRAY2             _gtia_mkcolor(HUE_GREY,3)
92 #define COLOR_LIGHTGREEN        _gtia_mkcolor(HUE_GREEN,6)
93 #define COLOR_LIGHTBLUE         _gtia_mkcolor(HUE_BLUE,6)
94 #define COLOR_GRAY3             _gtia_mkcolor(HUE_GREY,5)
95
96 /* color register functions */
97 extern void __fastcall__ setcolor     (unsigned char color_reg, unsigned char hue, unsigned char luminace);
98 extern void __fastcall__ setcolor_low (unsigned char color_reg, unsigned char color_value);
99 extern unsigned char  __fastcall__ getcolor (unsigned char color_reg);
100
101 /* Define hardware */
102 #include <_gtia.h>
103 #define GTIA (*(struct __gtia_write*)0xD000)
104 #define GTIA (*(struct __gtia_read*)0xD000)
105
106 #include <_pbi.h>
107
108 #include <_pokey.h>
109 #define POKEY (*(struct __pokey_write*)0xD200)
110 #define POKEY (*(struct __pokey_read*)0xD200)
111
112 #include <_pia.h>
113 #define PIA (*(struct __pia*)0xD300)
114
115 #include <_antic.h>
116 #define ANTIC (*(struct __antic*)0xD400)
117
118 /* End of atari.h */
119 #endif