1 /*****************************************************************************/
5 /* Atari Lynx, Suzy chip register hardware structures */
8 /* This software is provided 'as-is', without any expressed or implied */
9 /* warranty. In no event will the authors be held liable for any damages */
10 /* arising from the use of this software. */
12 /* Permission is granted to anyone to use this software for any purpose, */
13 /* including commercial applications, and to alter it and redistribute it */
14 /* freely, subject to the following restrictions: */
16 /* 1. The origin of this software must not be misrepresented; you must not */
17 /* claim that you wrote the original software. If you use this software */
18 /* in a product, an acknowledgment in the product documentation would be */
19 /* appreciated but is not required. */
20 /* 2. Altered source versions must be plainly marked as such, and must not */
21 /* be misrepresented as being the original software. */
22 /* 3. This notice may not be removed or altered from any source */
25 /*****************************************************************************/
32 #define JOY_RIGHT 0x10
36 #define BUTTON_OPTION1 0x08
37 #define BUTTON_OPTION2 0x04
38 #define BUTTON_INNER 0x02
39 #define BUTTON_OUTER 0x01
42 #define BUTTON_PAUSE 0x01
46 #define FACTOR_A *(unsigned int *) 0xFC54
47 #define FACTOR_B *(unsigned int *) 0xFC52
48 #define PRODUCT0 *(unsigned int *) 0xFC60
49 #define PRODUCT1 *(unsigned int *) 0xFC62
50 #define PRODUCT *(long *) 0xFC60
52 #define DIVIDEND0 *(unsigned int *) 0xFC60
53 #define DIVIDEND1 *(unsigned int *) 0xFC62
54 #define DIVIDEND *(long *) 0xFC60
55 #define DIVISOR *(unsigned int *) 0xFC56
56 #define QUOTIENT0 *(unsigned int *) 0xFC52
57 #define QUOTIENT1 *(unsigned int *) 0xFC54
58 #define QUOTIENT *(long *) 0xFC52
59 #define REMAINDER0 *(unsigned int *) 0xFC6C
60 #define REMAINDER1 *(unsigned int *) 0xFC6E
61 #define REMAINDER *(long *) 0xFC6C
64 /* Sprite control block (SCB) defines */
73 #define TYPE_SHADOW 0x07
75 #define TYPE_NONCOLL 0x05
76 #define TYPE_NORMAL 0x04
77 #define TYPE_BOUNDARY 0x03
78 #define TYPE_BSHADOW 0x02
79 #define TYPE_BACKNONCOLL 0x01
80 #define TYPE_BACKGROUND 0x00
95 typedef struct SCB_REHVST_PAL { // SCB with all attributes
96 unsigned char sprctl0;
97 unsigned char sprctl1;
98 unsigned char sprcoll;
105 unsigned int stretch;
107 unsigned char penpal[8];
110 typedef struct SCB_REHVST { // SCB without pallette
111 unsigned char sprctl0;
112 unsigned char sprctl1;
113 unsigned char sprcoll;
120 unsigned int stretch;
124 typedef struct SCB_REHV { // SCB without stretch/tilt
125 unsigned char sprctl0;
126 unsigned char sprctl1;
127 unsigned char sprcoll;
136 typedef struct SCB_REHV_PAL { // SCB without str/tilt, w/ penpal
137 unsigned char sprctl0;
138 unsigned char sprctl1;
139 unsigned char sprcoll;
146 unsigned char penpal[8];
149 typedef struct SCB_REHVS { // SCB w/o tilt & penpal
150 unsigned char sprctl0;
151 unsigned char sprctl1;
152 unsigned char sprcoll;
159 unsigned int stretch;
162 typedef struct SCB_REHVS_PAL { // SCB w/o tilt w/penpal
163 unsigned char sprctl0;
164 unsigned char sprctl1;
165 unsigned char sprcoll;
172 unsigned int stretch;
173 unsigned char penpal[8];
176 typedef struct SCB_RENONE { // SCB w/o size/stretch/tilt/pal
177 unsigned char sprctl0;
178 unsigned char sprctl1;
179 unsigned char sprcoll;
186 typedef struct SCB_RENONE_PAL { // SCB w/o size/str/tilt w/penpal
187 unsigned char sprctl0;
188 unsigned char sprctl1;
189 unsigned char sprcoll;
194 unsigned char penpal[8];
198 /* Misc system defines */
202 #define SPRITE_GO 0x01
204 /* SPRSYS (write) $FC92 */
205 #define SIGNMATH 0x80
206 #define ACCUMULATE 0x40
207 #define NO_COLLIDE 0x20
208 #define VSTRETCH 0x10
209 #define LEFTHAND 0x08
210 #define CLR_UNSAFE 0x04
211 #define SPRITESTOP 0x02
213 /* SPRSYS (read) $FC92 */
214 #define MATHWORKING 0x80
215 #define MATHWARNING 0x40
216 #define MATHCARRY 0x20
217 #define VSTRETCHING 0x10
218 #define LEFTHANDED 0x08
219 #define UNSAFE_ACCESS 0x04
220 #define SPRITETOSTOP 0x02
221 #define SPRITEWORKING 0x01
224 #define HIGHSPEED 0x80
225 #define VECTORSPACE 0x08
226 #define ROMSPACE 0x04
227 #define MIKEYSPACE 0x02
228 #define SUZYSPACE 0x01
231 /* Suzy Hardware Registers */
233 unsigned int tmpadr; // 0xFC00 Temporary address
234 unsigned int tiltacc; // 0xFC02 Tilt accumulator
235 unsigned int hoff; // 0xFC04 Offset to H edge of screen
236 unsigned int voff; // 0xFC06 Offset to V edge of screen
237 unsigned char *sprbase; // 0xFC08 Base address of sprite
238 unsigned char *colbase; // 0xFC0A Base address of collision buffer
239 unsigned char *vidadr; // 0xFC0C Current vid buffer address
240 unsigned char *coladr; // 0xFC0E Current col buffer address
241 unsigned char *scbnext; // 0xFC10 Address of next SCB
242 unsigned char *sprdline; // 0xFC12 start of sprite data line address
243 unsigned char *hposstrt; // 0xFC14 start hpos
244 unsigned char *vposstrt; // 0xFC16 start vpos
245 unsigned char *sprhsize; // 0xFC18 sprite h size
246 unsigned char *sprvsize; // 0xFC1A sprite v size
247 unsigned int stretchl; // 0xFC1C H size adder
248 unsigned int tilt; // 0xFC1E H pos adder
249 unsigned int sprdoff; // 0xFC20 offset to next sprite data line
250 unsigned int sprvpos; // 0xFC22 current vpos
251 unsigned int colloff; // 0xFC24 offset to collision depository
252 unsigned int vsizeacc; // 0xFC26 vertical size accumulator
253 unsigned int hsizeoff; // 0xFC28 horizontal size offset
254 unsigned int vsizeoff; // 0xFC2A vertical size offset
255 unsigned char *scbaddr; // 0xFC2C address of current SCB
256 unsigned char *procaddr; // 0xFC2E address of current spr data proc
257 unsigned char unused0[32]; // 0xFC30 - 0xFC4F reserved/unused
258 unsigned char unused1[2]; // 0xFC50 - 0xFC51 do not use
259 unsigned char mathd; // 0xFC52
260 unsigned char mathc; // 0xFC53
261 unsigned char mathb; // 0xFC54
262 unsigned char matha; // 0xFC55
263 unsigned char mathp; // 0xFC56
264 unsigned char mathn; // 0xFC57
265 unsigned char unused2[8]; // 0xFC58 - 0xFC5F do not use
266 unsigned char mathh; // 0xFC60
267 unsigned char mathg; // 0xFC61
268 unsigned char mathf; // 0xFC62
269 unsigned char mathe; // 0xFC63
270 unsigned char unused3[8]; // 0xFC64 - 0xFC6B do not use
271 unsigned char mathm; // 0xFC6C
272 unsigned char mathl; // 0xFC6D
273 unsigned char mathk; // 0xFC6E
274 unsigned char mathj; // 0xFC6F
275 unsigned char unused4[16]; // 0xFC70 - 0xFC7F do not use
276 unsigned char sprctl0; // 0xFC80 sprite control bits 0
277 unsigned char sprctl1; // 0xFC81 sprite control bits 1
278 unsigned char sprcoll; // 0xFC82 sprite collision number
279 unsigned char sprinit; // 0xFC83 sprite initialization bits
280 unsigned char unused5[4]; // 0xFC84 - 0xFC87 unused
281 unsigned char suzyhrev; // 0xFC88 suzy hardware rev
282 unsigned char suzysrev; // 0xFC89 suzy software rev
283 unsigned char unused6[6]; // 0xFC8A - 0xFC8F unused
284 unsigned char suzybusen; // 0xFC90 suzy bus enable
285 unsigned char sprgo; // 0xFC91 sprite process start bit
286 unsigned char sprsys; // 0xFC92 sprite system control bits
287 unsigned char unused7[29]; // 0xFC93 - 0xFCAF unused
288 unsigned char joystick; // 0xFCB0 joystick and buttons
289 unsigned char switches; // 0xFCB1 other switches
290 unsigned char cart0; // 0xFCB2 cart0 r/w
291 unsigned char cart1; // 0xFCB3 cart1 r/w
292 unsigned char unused8[8]; // 0xFCB4 - 0xFCBF unused
293 unsigned char leds; // 0xFCC0 leds
294 unsigned char unused9; // 0xFCC1 unused
295 unsigned char parstat; // 0xFCC2 parallel port status
296 unsigned char pardata; // 0xFCC3 parallel port data
297 unsigned char howie; // 0xFCC4 howie (?)
298 // 0xFCC5 - 0xFCFF unused