]> git.sur5r.net Git - cc65/blob - include/_vic2.h
Fixed _textcolor definition.
[cc65] / include / _vic2.h
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                                  _vic2.h                                  */
4 /*                                                                           */
5 /*                Internal include file, do not use directly                 */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 1998-2012, Ullrich von Bassewitz                                      */
10 /*                Roemerstrasse 52                                           */
11 /*                D-70794 Filderstadt                                        */
12 /* EMail:         uz@cc65.org                                                */
13 /*                                                                           */
14 /*                                                                           */
15 /* This software is provided 'as-is', without any expressed or implied       */
16 /* warranty.  In no event will the authors be held liable for any damages    */
17 /* arising from the use of this software.                                    */
18 /*                                                                           */
19 /* Permission is granted to anyone to use this software for any purpose,     */
20 /* including commercial applications, and to alter it and redistribute it    */
21 /* freely, subject to the following restrictions:                            */
22 /*                                                                           */
23 /* 1. The origin of this software must not be misrepresented; you must not   */
24 /*    claim that you wrote the original software. If you use this software   */
25 /*    in a product, an acknowledgment in the product documentation would be  */
26 /*    appreciated but is not required.                                       */
27 /* 2. Altered source versions must be plainly marked as such, and must not   */
28 /*    be misrepresented as being the original software.                      */
29 /* 3. This notice may not be removed or altered from any source              */
30 /*    distribution.                                                          */
31 /*                                                                           */
32 /*****************************************************************************/
33
34
35
36 #ifndef __VIC2_H
37 #define __VIC2_H
38
39
40
41 /* Define a structure with the vic register offsets. In cc65 mode, there
42 ** are aliases for the field accessible as arrays.
43 */
44 #if __CC65_STD__ == __CC65_STD_CC65__
45 struct __vic2 {
46     union {
47         struct {
48             unsigned char   spr0_x;         /* Sprite 0, X coordinate */
49             unsigned char   spr0_y;         /* Sprite 0, Y coordinate */
50             unsigned char   spr1_x;         /* Sprite 1, X coordinate */
51             unsigned char   spr1_y;         /* Sprite 1, Y coordinate */
52             unsigned char   spr2_x;         /* Sprite 2, X coordinate */
53             unsigned char   spr2_y;         /* Sprite 2, Y coordinate */
54             unsigned char   spr3_x;         /* Sprite 3, X coordinate */
55             unsigned char   spr3_y;         /* Sprite 3, Y coordinate */
56             unsigned char   spr4_x;         /* Sprite 4, X coordinate */
57             unsigned char   spr4_y;         /* Sprite 4, Y coordinate */
58             unsigned char   spr5_x;         /* Sprite 5, X coordinate */
59             unsigned char   spr5_y;         /* Sprite 5, Y coordinate */
60             unsigned char   spr6_x;         /* Sprite 6, X coordinate */
61             unsigned char   spr6_y;         /* Sprite 6, Y coordinate */
62             unsigned char   spr7_x;         /* Sprite 7, X coordinate */
63             unsigned char   spr7_y;         /* Sprite 7, Y coordinate */
64         };
65         struct {
66             unsigned char   x;              /* X coordinate */
67             unsigned char   y;              /* Y coordinate */
68         } spr_pos[8];
69     };
70     unsigned char           spr_hi_x;       /* High bits of X coordinate */
71     unsigned char           ctrl1;          /* Control register 1 */
72     unsigned char           rasterline;     /* Current raster line */
73     union {
74         struct {
75             unsigned char   strobe_x;       /* Light pen, X position */
76             unsigned char   strobe_y;       /* Light pen, Y position */
77         };
78         struct {
79             unsigned char   x;              /* Light pen, X position */
80             unsigned char   y;              /* Light pen, Y position */
81         } strobe;
82     };
83     unsigned char           spr_ena;        /* Enable sprites */
84     unsigned char           ctrl2;          /* Control register 2 */
85     unsigned char           spr_exp_y;      /* Expand sprites in Y dir */
86     unsigned char           addr;           /* Address of chargen and video ram */
87     unsigned char           irr;            /* Interrupt request register */
88     unsigned char           imr;            /* Interrupt mask register */
89     unsigned char           spr_bg_prio;    /* Priority to background */
90     unsigned char           spr_mcolor;     /* Sprite multicolor bits */
91     unsigned char           spr_exp_x;      /* Expand sprites in X dir */
92     unsigned char           spr_coll;       /* Sprite/sprite collision reg */
93     unsigned char           spr_bg_coll;    /* Sprite/background collision reg */
94     unsigned char           bordercolor;    /* Border color */
95     union {
96         struct {
97             unsigned char   bgcolor0;       /* Background color 0 */
98             unsigned char   bgcolor1;       /* Background color 1 */
99             unsigned char   bgcolor2;       /* Background color 2 */
100             unsigned char   bgcolor3;       /* Background color 3 */
101         };
102         unsigned char       bgcolor[4];     /* Background colors */
103     };
104     union {
105         struct {
106             unsigned char   spr_mcolor0;    /* Color 0 for multicolor sprites */
107             unsigned char   spr_mcolor1;    /* Color 1 for multicolor sprites */
108         };
109         /* spr_color is already used ... */
110         unsigned char       spr_mcolors[2]; /* Color for multicolor sprites */
111     };
112     union {
113         struct {
114             unsigned char   spr0_color;     /* Color sprite 0 */
115             unsigned char   spr1_color;     /* Color sprite 1 */
116             unsigned char   spr2_color;     /* Color sprite 2 */
117             unsigned char   spr3_color;     /* Color sprite 3 */
118             unsigned char   spr4_color;     /* Color sprite 4 */
119             unsigned char   spr5_color;     /* Color sprite 5 */
120             unsigned char   spr6_color;     /* Color sprite 6 */
121             unsigned char   spr7_color;     /* Color sprite 7 */
122         };
123         unsigned char       spr_color[8];   /* Colors for the sprites */
124     };
125
126     /* The following ones are only valid in the C128: */
127     unsigned char           x_kbd;          /* Additional keyboard lines */
128     unsigned char           clock;          /* Clock switch bit */
129 };
130 #else
131 struct __vic2 {
132     unsigned char           spr0_x;         /* Sprite 0, X coordinate */
133     unsigned char           spr0_y;         /* Sprite 0, Y coordinate */
134     unsigned char           spr1_x;         /* Sprite 1, X coordinate */
135     unsigned char           spr1_y;         /* Sprite 1, Y coordinate */
136     unsigned char           spr2_x;         /* Sprite 2, X coordinate */
137     unsigned char           spr2_y;         /* Sprite 2, Y coordinate */
138     unsigned char           spr3_x;         /* Sprite 3, X coordinate */
139     unsigned char           spr3_y;         /* Sprite 3, Y coordinate */
140     unsigned char           spr4_x;         /* Sprite 4, X coordinate */
141     unsigned char           spr4_y;         /* Sprite 4, Y coordinate */
142     unsigned char           spr5_x;         /* Sprite 5, X coordinate */
143     unsigned char           spr5_y;         /* Sprite 5, Y coordinate */
144     unsigned char           spr6_x;         /* Sprite 6, X coordinate */
145     unsigned char           spr6_y;         /* Sprite 6, Y coordinate */
146     unsigned char           spr7_x;         /* Sprite 7, X coordinate */
147     unsigned char           spr7_y;         /* Sprite 7, Y coordinate */
148     unsigned char           spr_hi_x;       /* High bits of X coordinate */
149     unsigned char           ctrl1;          /* Control register 1 */
150     unsigned char           rasterline;     /* Current raster line */
151     unsigned char           strobe_x;       /* Light pen, X position */
152     unsigned char           strobe_y;       /* Light pen, Y position */
153     unsigned char           spr_ena;        /* Enable sprites */
154     unsigned char           ctrl2;          /* Control register 2 */
155     unsigned char           spr_exp_y;      /* Expand sprites in Y dir */
156     unsigned char           addr;           /* Address of chargen and video ram */
157     unsigned char           irr;            /* Interrupt request register */
158     unsigned char           imr;            /* Interrupt mask register */
159     unsigned char           spr_bg_prio;    /* Priority to background */
160     unsigned char           spr_mcolor;     /* Sprite multicolor bits */
161     unsigned char           spr_exp_x;      /* Expand sprites in X dir */
162     unsigned char           spr_coll;       /* Sprite/sprite collision reg */
163     unsigned char           spr_bg_coll;    /* Sprite/background collision reg */
164     unsigned char           bordercolor;    /* Border color */
165     unsigned char           bgcolor0;       /* Background color 0 */
166     unsigned char           bgcolor1;       /* Background color 1 */
167     unsigned char           bgcolor2;       /* Background color 2 */
168     unsigned char           bgcolor3;       /* Background color 3 */
169     unsigned char           spr_mcolor0;    /* Color 0 for multicolor sprites */
170     unsigned char           spr_mcolor1;    /* Color 1 for multicolor sprites */
171     unsigned char           spr0_color;     /* Color sprite 0 */
172     unsigned char           spr1_color;     /* Color sprite 1 */
173     unsigned char           spr2_color;     /* Color sprite 2 */
174     unsigned char           spr3_color;     /* Color sprite 3 */
175     unsigned char           spr4_color;     /* Color sprite 4 */
176     unsigned char           spr5_color;     /* Color sprite 5 */
177     unsigned char           spr6_color;     /* Color sprite 6 */
178     unsigned char           spr7_color;     /* Color sprite 7 */
179
180     /* The following ones are only valid in the C128: */
181     unsigned char           x_kbd;          /* Additional keyboard lines */
182     unsigned char           clock;          /* Clock switch bit */
183 };
184 #endif
185
186
187
188 /* End of _vic2.h */
189 #endif
190
191
192