fcdev-cc65 0.0.0-stage → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/LICENSE +17 -0
  2. package/asminc/_file.inc +27 -0
  3. package/asminc/_heap.inc +35 -0
  4. package/asminc/accelerator.inc +80 -0
  5. package/asminc/agat.inc +39 -0
  6. package/asminc/apple2.inc +95 -0
  7. package/asminc/apple2.mac +54 -0
  8. package/asminc/ascii_charmap.inc +287 -0
  9. package/asminc/atari.inc +1169 -0
  10. package/asminc/atari.mac +65 -0
  11. package/asminc/atari2600.inc +7 -0
  12. package/asminc/atari2600_riot.inc +20 -0
  13. package/asminc/atari2600_tia.inc +69 -0
  14. package/asminc/atari5200.inc +133 -0
  15. package/asminc/atari7800.inc +14 -0
  16. package/asminc/atari7800_maria.inc +39 -0
  17. package/asminc/atari7800_riot.inc +20 -0
  18. package/asminc/atari7800_tia.inc +69 -0
  19. package/asminc/atari_antic.inc +95 -0
  20. package/asminc/atari_atascii_charmap.inc +301 -0
  21. package/asminc/atari_gtia.inc +119 -0
  22. package/asminc/atari_pokey.inc +43 -0
  23. package/asminc/atari_screen_charmap.inc +303 -0
  24. package/asminc/atmos.inc +117 -0
  25. package/asminc/c128.inc +224 -0
  26. package/asminc/c16.inc +9 -0
  27. package/asminc/c64.inc +219 -0
  28. package/asminc/c65.inc +239 -0
  29. package/asminc/cbm.mac +56 -0
  30. package/asminc/cbm510.inc +200 -0
  31. package/asminc/cbm610.inc +121 -0
  32. package/asminc/cbm_filetype.inc +34 -0
  33. package/asminc/cbm_kernal.inc +248 -0
  34. package/asminc/cbm_petscii_charmap.inc +291 -0
  35. package/asminc/cbm_screen_charmap.inc +305 -0
  36. package/asminc/cpu.mac +4 -0
  37. package/asminc/creativision.inc +66 -0
  38. package/asminc/ctype.inc +31 -0
  39. package/asminc/ctype_common.inc +91 -0
  40. package/asminc/ctypetable.inc +48 -0
  41. package/asminc/cx16.inc +574 -0
  42. package/asminc/em-error.inc +49 -0
  43. package/asminc/em-kernel.inc +106 -0
  44. package/asminc/errno.inc +37 -0
  45. package/asminc/fcntl.inc +21 -0
  46. package/asminc/gamate.inc +64 -0
  47. package/asminc/generic.mac +53 -0
  48. package/asminc/get_tv.inc +22 -0
  49. package/asminc/joy-error.inc +44 -0
  50. package/asminc/joy-kernel.inc +83 -0
  51. package/asminc/kim1.inc +31 -0
  52. package/asminc/longbranch.mac +88 -0
  53. package/asminc/lynx.inc +460 -0
  54. package/asminc/mega65.inc +239 -0
  55. package/asminc/modload.inc +78 -0
  56. package/asminc/module.mac +13 -0
  57. package/asminc/mouse-kernel.inc +184 -0
  58. package/asminc/nes.inc +93 -0
  59. package/asminc/o65.inc +150 -0
  60. package/asminc/opcodes.inc +514 -0
  61. package/asminc/pce.inc +93 -0
  62. package/asminc/pet.inc +100 -0
  63. package/asminc/plus4.inc +86 -0
  64. package/asminc/rp6502.inc +98 -0
  65. package/asminc/ser-error.inc +55 -0
  66. package/asminc/ser-kernel.inc +162 -0
  67. package/asminc/signal.inc +57 -0
  68. package/asminc/sim65.inc +75 -0
  69. package/asminc/smc.inc +267 -0
  70. package/asminc/stat.inc +64 -0
  71. package/asminc/statvfs.inc +46 -0
  72. package/asminc/stdio.inc +74 -0
  73. package/asminc/supervision.inc +75 -0
  74. package/asminc/sym1.inc +186 -0
  75. package/asminc/telestrat.inc +546 -0
  76. package/asminc/tgi-error.inc +52 -0
  77. package/asminc/tgi-kernel.inc +233 -0
  78. package/asminc/tgi-vectorfont.inc +70 -0
  79. package/asminc/time.inc +74 -0
  80. package/asminc/utsname.inc +46 -0
  81. package/asminc/vic20.inc +119 -0
  82. package/asminc/zeropage.inc +40 -0
  83. package/bin/ar65.exe +0 -0
  84. package/bin/ca65.exe +0 -0
  85. package/bin/cc65.exe +0 -0
  86. package/bin/da65.exe +0 -0
  87. package/bin/ld65.exe +0 -0
  88. package/cfg/module.cfg +21 -0
  89. package/cfg/nes.cfg +62 -0
  90. package/cfg/none.cfg +37 -0
  91. package/include/6502.h +140 -0
  92. package/include/_6522.h +68 -0
  93. package/include/_6525.h +62 -0
  94. package/include/_6526.h +71 -0
  95. package/include/_6545.h +53 -0
  96. package/include/_6551.h +55 -0
  97. package/include/_antic.h +254 -0
  98. package/include/_atari5200os.h +94 -0
  99. package/include/_atarios.h +661 -0
  100. package/include/_gtia.h +281 -0
  101. package/include/_heap.h +60 -0
  102. package/include/_maria.h +63 -0
  103. package/include/_mikey.h +264 -0
  104. package/include/_pbi.h +63 -0
  105. package/include/_pia.h +52 -0
  106. package/include/_pokey.h +220 -0
  107. package/include/_riot.h +26 -0
  108. package/include/_sid.h +68 -0
  109. package/include/_suzy.h +336 -0
  110. package/include/_ted.h +86 -0
  111. package/include/_tia.h +100 -0
  112. package/include/_vdc.h +53 -0
  113. package/include/_vic.h +67 -0
  114. package/include/_vic2.h +192 -0
  115. package/include/_vic3.h +188 -0
  116. package/include/accelerator.h +339 -0
  117. package/include/agat.h +76 -0
  118. package/include/apple2.h +358 -0
  119. package/include/apple2_filetype.h +324 -0
  120. package/include/apple2enh.h +67 -0
  121. package/include/arpa/inet.h +81 -0
  122. package/include/ascii_charmap.h +295 -0
  123. package/include/assert.h +59 -0
  124. package/include/atari.h +554 -0
  125. package/include/atari2600.h +32 -0
  126. package/include/atari5200.h +100 -0
  127. package/include/atari7800.h +67 -0
  128. package/include/atari_atascii_charmap.h +304 -0
  129. package/include/atari_screen_charmap.h +310 -0
  130. package/include/atmos.h +189 -0
  131. package/include/c128.h +175 -0
  132. package/include/c16.h +60 -0
  133. package/include/c64.h +175 -0
  134. package/include/c65.h +120 -0
  135. package/include/cbm.h +321 -0
  136. package/include/cbm264.h +165 -0
  137. package/include/cbm510.h +168 -0
  138. package/include/cbm610.h +153 -0
  139. package/include/cbm_filetype.h +108 -0
  140. package/include/cbm_petscii_charmap.h +297 -0
  141. package/include/cbm_screen_charmap.h +311 -0
  142. package/include/cc65.h +109 -0
  143. package/include/conio.h +248 -0
  144. package/include/creativision.h +78 -0
  145. package/include/ctype.h +88 -0
  146. package/include/cx16.h +420 -0
  147. package/include/dbg.h +124 -0
  148. package/include/device.h +72 -0
  149. package/include/dio.h +113 -0
  150. package/include/dirent.h +151 -0
  151. package/include/em/em-kernel.h +77 -0
  152. package/include/em.h +135 -0
  153. package/include/errno.h +135 -0
  154. package/include/fcntl.h +75 -0
  155. package/include/gamate.h +209 -0
  156. package/include/geos/gconst.h +69 -0
  157. package/include/geos/gdisk.h +79 -0
  158. package/include/geos/gdlgbox.h +110 -0
  159. package/include/geos/gfile.h +72 -0
  160. package/include/geos/ggraph.h +180 -0
  161. package/include/geos/gmemory.h +30 -0
  162. package/include/geos/gmenu.h +53 -0
  163. package/include/geos/gprocess.h +22 -0
  164. package/include/geos/gsprite.h +96 -0
  165. package/include/geos/gstruct.h +174 -0
  166. package/include/geos/gsym.h +340 -0
  167. package/include/geos/gsys.h +54 -0
  168. package/include/geos.h +109 -0
  169. package/include/inttypes.h +237 -0
  170. package/include/iso646.h +60 -0
  171. package/include/joystick/joy-kernel.h +84 -0
  172. package/include/joystick.h +109 -0
  173. package/include/kim1.h +73 -0
  174. package/include/limits.h +87 -0
  175. package/include/locale.h +83 -0
  176. package/include/lynx.h +144 -0
  177. package/include/lz4.h +43 -0
  178. package/include/lzsa.h +56 -0
  179. package/include/mega65.h +120 -0
  180. package/include/modload.h +103 -0
  181. package/include/mouse/mouse-kernel.h +67 -0
  182. package/include/mouse.h +220 -0
  183. package/include/nes.h +203 -0
  184. package/include/o65.h +178 -0
  185. package/include/osic1p.h +66 -0
  186. package/include/pce.h +110 -0
  187. package/include/peekpoke.h +58 -0
  188. package/include/pen.h +78 -0
  189. package/include/pet.h +113 -0
  190. package/include/plus4.h +63 -0
  191. package/include/rp6502.h +266 -0
  192. package/include/serial.h +180 -0
  193. package/include/setjmp.h +55 -0
  194. package/include/signal.h +74 -0
  195. package/include/sim65.h +136 -0
  196. package/include/stdarg.h +57 -0
  197. package/include/stdbool.h +53 -0
  198. package/include/stddef.h +66 -0
  199. package/include/stdint.h +144 -0
  200. package/include/stdio.h +166 -0
  201. package/include/stdlib.h +174 -0
  202. package/include/string.h +106 -0
  203. package/include/supervision.h +137 -0
  204. package/include/sym1.h +165 -0
  205. package/include/sys/stat.h +94 -0
  206. package/include/sys/statvfs.h +74 -0
  207. package/include/sys/types.h +102 -0
  208. package/include/sys/utsname.h +97 -0
  209. package/include/target.h +77 -0
  210. package/include/telestrat.h +129 -0
  211. package/include/tgi/tgi-error.h +64 -0
  212. package/include/tgi/tgi-kernel.h +75 -0
  213. package/include/tgi/tgi-vectorfont.h +90 -0
  214. package/include/tgi.h +286 -0
  215. package/include/time.h +143 -0
  216. package/include/unistd.h +103 -0
  217. package/include/vic20.h +141 -0
  218. package/include/zlib.h +175 -0
  219. package/include/zx02.h +44 -0
  220. package/lib/nes.lib +0 -0
  221. package/lib/none.lib +0 -0
  222. package/manifest.json +227 -0
  223. package/package.json +19 -4
  224. package/README.md +0 -3
@@ -0,0 +1,281 @@
1
+ /*****************************************************************************/
2
+ /* */
3
+ /* _gtia.h */
4
+ /* */
5
+ /* Internal include file, do not use directly */
6
+ /* */
7
+ /* "GTIA, Graphic Television Interface Adaptor, is a custom chip used in the */
8
+ /* Atari 8-bit family of computers and in the Atari 5200 console. In these */
9
+ /* systems, GTIA chip works together with ANTIC to produce video display. */
10
+ /* ANTIC generates the playfield graphics (text and bitmap) while GTIA */
11
+ /* provides the color for the playfield and adds overlay objects known as */
12
+ /* player/missile graphics (sprites)" - Wikipedia article on "GTIA" */
13
+ /* */
14
+ /* */
15
+ /* (C) 2000 Freddy Offenga <taf_offenga@yahoo.com> */
16
+ /* 2019-01-16: Bill Kendrick <nbs@sonic.net>: More defines for registers */
17
+ /* */
18
+ /* */
19
+ /* This software is provided 'as-is', without any expressed or implied */
20
+ /* warranty. In no event will the authors be held liable for any damages */
21
+ /* arising from the use of this software. */
22
+ /* */
23
+ /* Permission is granted to anyone to use this software for any purpose, */
24
+ /* including commercial applications, and to alter it and redistribute it */
25
+ /* freely, subject to the following restrictions: */
26
+ /* */
27
+ /* 1. The origin of this software must not be misrepresented; you must not */
28
+ /* claim that you wrote the original software. If you use this software */
29
+ /* in a product, an acknowledgment in the product documentation would be */
30
+ /* appreciated but is not required. */
31
+ /* 2. Altered source versions must be plainly marked as such, and must not */
32
+ /* be misrepresented as being the original software. */
33
+ /* 3. This notice may not be removed or altered from any source */
34
+ /* distribution. */
35
+ /* */
36
+ /*****************************************************************************/
37
+
38
+
39
+ #ifndef __GTIA_H
40
+ #define __GTIA_H
41
+
42
+ /*****************************************************************************/
43
+ /* Define a structure with the GTIA register offsets for write (W) */
44
+ /*****************************************************************************/
45
+
46
+ struct __gtia_write {
47
+ unsigned char hposp0; /* 0x00: horizontal position of player 0 */
48
+ unsigned char hposp1; /* 0x01: horizontal position of player 1 */
49
+ unsigned char hposp2; /* 0x02: horizontal position of player 2 */
50
+ unsigned char hposp3; /* 0x03: horizontal position of player 3 */
51
+ unsigned char hposm0; /* 0x04: horizontal position of missile 0 */
52
+ unsigned char hposm1; /* 0x05: horizontal position of missile 1 */
53
+ unsigned char hposm2; /* 0x06: horizontal position of missile 2 */
54
+ unsigned char hposm3; /* 0x07: horizontal position of missile 3 */
55
+
56
+ unsigned char sizep0; /* 0x08: size of player 0 */
57
+ unsigned char sizep1; /* 0x09: size of player 1 */
58
+ unsigned char sizep2; /* 0x0A: size of player 2 */
59
+ unsigned char sizep3; /* 0x0B: size of player 3 */
60
+ unsigned char sizem; /* 0x0C: size of missiles */
61
+
62
+ unsigned char grafp0; /* 0x0D: graphics shape player 0 (used when ANTIC is not instructed to use DMA; see DMACTL) */
63
+ unsigned char grafp1; /* 0x0E: graphics shape player 1 */
64
+ unsigned char grafp2; /* 0x0F: graphics shape player 2 */
65
+ unsigned char grafp3; /* 0x10: graphics shape player 3 */
66
+ unsigned char grafm; /* 0x11: graphics shape missiles */
67
+
68
+ unsigned char colpm0; /* 0x12: color player and missile 0 */
69
+ unsigned char colpm1; /* 0x13: color player and missile 1 */
70
+ unsigned char colpm2; /* 0x14: color player and missile 2 */
71
+ unsigned char colpm3; /* 0x15: color player and missile 3 */
72
+ unsigned char colpf0; /* 0x16: color playfield 0 */
73
+ unsigned char colpf1; /* 0x17: color playfield 1 */
74
+ unsigned char colpf2; /* 0x18: color playfield 2 */
75
+ unsigned char colpf3; /* 0x19: color playfield 3 */
76
+ unsigned char colbk; /* 0x1A: color background */
77
+
78
+ unsigned char prior; /* 0x1B: priority selection */
79
+
80
+ unsigned char vdelay;
81
+ /* 0x1C: vertical delay -- one-line resolution movement of
82
+ ** vertical position of an object when two line resolution display is enabled
83
+ */
84
+
85
+ unsigned char gractl; /* 0x1D: stick/paddle latch, p/m control */
86
+
87
+ unsigned char hitclr; /* 0x1E: clear p/m collision */
88
+ unsigned char consol; /* 0x1F: builtin speaker */
89
+ };
90
+
91
+
92
+ /*****************************************************************************/
93
+ /* (W) Values for SIZEP0-SIZEP3 and SIZEM registers: */
94
+ /*****************************************************************************/
95
+
96
+ #define PMG_SIZE_NORMAL 0x0 /* one color clock per pixel */
97
+ #define PMG_SIZE_DOUBLE 0x1 /* two color clocks per pixel */
98
+ #define PMG_SIZE_QUAD 0x3 /* four color clocks per pixel */
99
+
100
+
101
+ /* COLPM0-COLPM3, COLPF0-COLPF3, COLBK color registers */
102
+
103
+ /*****************************************************************************/
104
+ /* Color definitions */
105
+ /*****************************************************************************/
106
+
107
+ /* Make a GTIA color value */
108
+ #define _gtia_mkcolor(hue,lum) (((hue) << 4) | ((lum) << 1))
109
+
110
+ /* Luminance values go from 0 (black) to 7 (white) */
111
+
112
+ /* Hue values */
113
+ /* (These can vary depending on TV standard (NTSC vs PAL),
114
+ ** tint potentiometer settings, TV tint settings, emulator palette, etc.)
115
+ */
116
+ #define HUE_GREY 0
117
+ #define HUE_GOLD 1
118
+ #define HUE_GOLDORANGE 2
119
+ #define HUE_REDORANGE 3
120
+ #define HUE_ORANGE 4
121
+ #define HUE_MAGENTA 5
122
+ #define HUE_PURPLE 6
123
+ #define HUE_BLUE 7
124
+ #define HUE_BLUE2 8
125
+ #define HUE_CYAN 9
126
+ #define HUE_BLUEGREEN 10
127
+ #define HUE_BLUEGREEN2 11
128
+ #define HUE_GREEN 12
129
+ #define HUE_YELLOWGREEN 13
130
+ #define HUE_YELLOW 14
131
+ #define HUE_YELLOWRED 15
132
+
133
+ /* Color defines, similar to c64 colors (untested) */
134
+ /* Hardware palette values (for GTIA colxxx registers) */
135
+ #define GTIA_COLOR_BLACK _gtia_mkcolor(HUE_GREY,0)
136
+ #define GTIA_COLOR_WHITE _gtia_mkcolor(HUE_GREY,7)
137
+ #define GTIA_COLOR_RED _gtia_mkcolor(HUE_REDORANGE,1)
138
+ #define GTIA_COLOR_CYAN _gtia_mkcolor(HUE_CYAN,3)
139
+ #define GTIA_COLOR_VIOLET _gtia_mkcolor(HUE_PURPLE,4)
140
+ #define GTIA_COLOR_GREEN _gtia_mkcolor(HUE_GREEN,2)
141
+ #define GTIA_COLOR_BLUE _gtia_mkcolor(HUE_BLUE,2)
142
+ #define GTIA_COLOR_YELLOW _gtia_mkcolor(HUE_YELLOW,7)
143
+ #define GTIA_COLOR_ORANGE _gtia_mkcolor(HUE_ORANGE,5)
144
+ #define GTIA_COLOR_BROWN _gtia_mkcolor(HUE_YELLOW,2)
145
+ #define GTIA_COLOR_LIGHTRED _gtia_mkcolor(HUE_REDORANGE,6)
146
+ #define GTIA_COLOR_GRAY1 _gtia_mkcolor(HUE_GREY,2)
147
+ #define GTIA_COLOR_GRAY2 _gtia_mkcolor(HUE_GREY,3)
148
+ #define GTIA_COLOR_LIGHTGREEN _gtia_mkcolor(HUE_GREEN,6)
149
+ #define GTIA_COLOR_LIGHTBLUE _gtia_mkcolor(HUE_BLUE,6)
150
+ #define GTIA_COLOR_GRAY3 _gtia_mkcolor(HUE_GREY,5)
151
+
152
+
153
+ /*****************************************************************************/
154
+ /* (W) PRIOR register values */
155
+ /*****************************************************************************/
156
+
157
+ #define PRIOR_P03_PF03 0x01 /* Players 0-3, then Playfields 0-3, then background */
158
+ #define PRIOR_P01_PF03_P23 0x02 /* Players 0-1, then Playfields 0-3, then Players 2-3, then background */
159
+ #define PRIOR_PF03_P03 0x04 /* Playfields 0-3, then Players 0-3, then background */
160
+ #define PRIOR_PF01_P03_PF23 0x08 /* Playfields 0-1, then Players 0-3, then Playfields 2-3, then background */
161
+
162
+ #define PRIOR_5TH_PLAYER 0x10 /* Four missiles combine to be a 5th player (uses COLPF3) */
163
+
164
+ /* Causes overlap of players 0 & 1 and of players 2 & 3 to result in a third color,
165
+ ** the logical OR of the two players' colors, and other overlaps (e.g., players 0 and 2)
166
+ ** to result in black (0x00).
167
+ */
168
+ #define PRIOR_OVERLAP_3RD_COLOR 0x20
169
+
170
+
171
+ /*****************************************************************************/
172
+ /* (W) GTIA special graphics mode options for GPRIOR */
173
+ /*****************************************************************************/
174
+
175
+ /* Pixels are 2 color clocks wide, and one scanline tall
176
+ ** (so 80x192 in normal playfield width).
177
+ ** May be used with both bitmap and character modelines.
178
+ */
179
+
180
+ /* 16 shade shades of the background (COLBK) hue;
181
+ ** Note: brightnesses other than 0 (darkest) in COLBK cause additional effects
182
+ */
183
+ #define PRIOR_GFX_MODE_9 0x40
184
+
185
+ /* 9 color palette mode;
186
+ ** COLPM0 (acts as background) thru COLPM3, followed by COLPF0 thru COLPF3, and COLBK
187
+ */
188
+ #define PRIOR_GFX_MODE_10 0x80
189
+
190
+ /* 16 hues of the background (COLBK) brightness;
191
+ ** Note: hues other than 0 (greys) in COLBK caus additional effects
192
+ */
193
+ #define PRIOR_GFX_MODE_11 0xC0
194
+
195
+
196
+ /*****************************************************************************/
197
+ /* (W) VDELAY register values */
198
+ /*****************************************************************************/
199
+
200
+ #define VDELAY_MISSILE0 0x01
201
+ #define VDELAY_MISSILE1 0x02
202
+ #define VDELAY_MISSILE2 0x04
203
+ #define VDELAY_MISSILE3 0x08
204
+ #define VDELAY_PLAYER0 0x10
205
+ #define VDELAY_PLAYER1 0x20
206
+ #define VDELAY_PLAYER2 0x40
207
+ #define VDELAY_PLAYER3 0x80
208
+
209
+
210
+ /*****************************************************************************/
211
+ /* (W) GRACTL register values */
212
+ /*****************************************************************************/
213
+
214
+ #define GRACTL_MISSLES 0x01 /* enable missiles */
215
+ #define GRACTL_PLAYERS 0x02 /* enable players */
216
+
217
+ /* "Latch" triggers; once pressed, will give a continuous
218
+ ** pressed input until this bit is cleared
219
+ */
220
+ #define GRACTL_LATCH_TRIGGER_INPUTS 0x04
221
+
222
+
223
+ /*****************************************************************************/
224
+ /* Define a structure with the GTIA register offsets for read (R) */
225
+ /*****************************************************************************/
226
+
227
+ struct __gtia_read {
228
+ unsigned char m0pf; /* 0x00: missile 0 to playfield collision */
229
+ unsigned char m1pf; /* 0x01: missile 1 to playfield collision */
230
+ unsigned char m2pf; /* 0x02: missile 2 to playfield collision */
231
+ unsigned char m3pf; /* 0x03: missile 3 to playfield collision */
232
+ unsigned char p0pf; /* 0x04: player 0 to playfield collision */
233
+ unsigned char p1pf; /* 0x05: player 1 to playfield collision */
234
+ unsigned char p2pf; /* 0x06: player 2 to playfield collision */
235
+ unsigned char p3pf; /* 0x07: player 3 to playfield collision */
236
+ unsigned char m0pl; /* 0x08: missile 0 to player collision */
237
+ unsigned char m1pl; /* 0x09: missile 1 to player collision */
238
+ unsigned char m2pl; /* 0x0A: missile 2 to player collision */
239
+ unsigned char m3pl; /* 0x0B: missile 3 to player collision */
240
+ unsigned char p0pl; /* 0x0C: player 0 to player collision */
241
+ unsigned char p1pl; /* 0x0D: player 1 to player collision */
242
+ unsigned char p2pl; /* 0x0E: player 2 to player collision */
243
+ unsigned char p3pl; /* 0x0F: player 3 to player collision */
244
+
245
+ unsigned char trig0; /* 0x10: joystick trigger 0 (0=pressed, 1=released) */
246
+ unsigned char trig1; /* 0x11: joystick trigger 1 */
247
+ unsigned char trig2; /* 0x12: joystick trigger 2 */
248
+ unsigned char trig3; /* 0x13: joystick trigger 3 */
249
+
250
+ unsigned char pal; /* 0x14: pal/ntsc flag */
251
+
252
+ unsigned char unused[10];
253
+
254
+ unsigned char consol; /* 0x1F: console buttons */
255
+ };
256
+
257
+
258
+ /*****************************************************************************/
259
+ /* (R) PAL register possible values */
260
+ /*****************************************************************************/
261
+
262
+ /* Note: This only tells you whether the GTIA is PAL or NTSC; some NTSC
263
+ ** systems are modded with PAL ANTIC chips; testing VCOUNT limits can be
264
+ ** done to check for that. Seems like it's not possible to test for SECAM
265
+ */
266
+
267
+ #define TV_STD_PAL 0x1
268
+ #define TV_STD_NTSC 0xE
269
+
270
+
271
+ /*****************************************************************************/
272
+ /* Macros for reading console keys (Start/Select/Option) via CONSOL register */
273
+ /*****************************************************************************/
274
+
275
+ #define CONSOL_START(x) !((unsigned char)((x) & 1)) /* true if Start pressed */
276
+ #define CONSOL_SELECT(x) !((unsigned char)((x) & 2)) /* true if Select pressed */
277
+ #define CONSOL_OPTION(x) !((unsigned char)((x) & 4)) /* true if Option pressed */
278
+
279
+
280
+ /* End of _gtia.h */
281
+ #endif /* #ifndef __GTIA_H */
@@ -0,0 +1,60 @@
1
+ /*
2
+ ** _heap.h
3
+ **
4
+ ** Ullrich von Bassewitz, 1998-06-03, 2004-12-19
5
+ **
6
+ */
7
+
8
+
9
+
10
+ #ifndef __HEAP_H
11
+ #define __HEAP_H
12
+
13
+
14
+
15
+ /* Structure that preceeds a user block in most cases.
16
+ ** The aligned_malloc function may generate blocks where the start pointer
17
+ ** and size are splitted to handle a memory hole that is needed for
18
+ ** alignment.
19
+ */
20
+ struct usedblock {
21
+ unsigned size;
22
+ struct usedblock* start;
23
+ };
24
+
25
+ /* Space needed for administering used blocks */
26
+ #define HEAP_ADMIN_SPACE sizeof (struct usedblock)
27
+
28
+ /* The data type used to implement the free list.
29
+ ** Beware: Field order is significant!
30
+ */
31
+ struct freeblock {
32
+ unsigned size;
33
+ struct freeblock* next;
34
+ struct freeblock* prev;
35
+ };
36
+
37
+
38
+
39
+ /* Variables that describe the heap */
40
+ extern unsigned* __heaporg; /* Bottom of heap */
41
+ extern unsigned* __heapptr; /* Current top */
42
+ extern unsigned* __heapend; /* Upper limit */
43
+ extern struct freeblock* __heapfirst; /* First free block in list */
44
+ extern struct freeblock* __heaplast; /* Last free block in list */
45
+
46
+ #if __CC65_STD__ == __CC65_STD_CC65__
47
+ /* define old name with one underscore for backwards compatibility */
48
+ #define _heaporg __heaporg
49
+ #define _heapptr __heapptr
50
+ #define _heapend __heapend
51
+ #define _heapfirst __heapfirst
52
+ #define _heaplast __heaplast
53
+ #endif
54
+
55
+ /* End of _heap.h */
56
+
57
+ #endif
58
+
59
+
60
+
@@ -0,0 +1,63 @@
1
+ /*****************************************************************************/
2
+ /* */
3
+ /* _maria.h */
4
+ /* */
5
+ /* Atari 7800, Maria chip register hardware structures */
6
+ /* */
7
+ /* */
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. */
11
+ /* */
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: */
15
+ /* */
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 */
23
+ /* distribution. */
24
+ /* */
25
+ /*****************************************************************************/
26
+
27
+ /*
28
+ * MARIA registers
29
+ */
30
+ struct __maria {
31
+ unsigned char bkgrnd;
32
+ unsigned char p0c1;
33
+ unsigned char p0c2;
34
+ unsigned char p0c3;
35
+ unsigned char wsync;
36
+ unsigned char p1c1;
37
+ unsigned char p1c2;
38
+ unsigned char p1c3;
39
+ unsigned char mstat;
40
+ unsigned char p2c1;
41
+ unsigned char p2c2;
42
+ unsigned char p2c3;
43
+ unsigned char dpph;
44
+ unsigned char p3c1;
45
+ unsigned char p3c2;
46
+ unsigned char p3c3;
47
+ unsigned char dppl;
48
+ unsigned char p4c1;
49
+ unsigned char p4c2;
50
+ unsigned char p4c3;
51
+ unsigned char chbase;
52
+ unsigned char p5c1;
53
+ unsigned char p5c2;
54
+ unsigned char p5c3;
55
+ unsigned char offset;
56
+ unsigned char p6c1;
57
+ unsigned char p6c2;
58
+ unsigned char p6c3;
59
+ unsigned char ctrl;
60
+ unsigned char p7c1;
61
+ unsigned char p7c2;
62
+ unsigned char p7c3;
63
+ };
@@ -0,0 +1,264 @@
1
+ /*****************************************************************************/
2
+ /* */
3
+ /* _mikey.h */
4
+ /* */
5
+ /* Atari Lynx, Mikey chip register hardware structures */
6
+ /* */
7
+ /* */
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. */
11
+ /* */
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: */
15
+ /* */
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 */
23
+ /* distribution. */
24
+ /* */
25
+ /*****************************************************************************/
26
+
27
+ #ifndef __MIKEY_H
28
+ #define __MIKEY_H
29
+
30
+ /* Timer structure */
31
+ typedef struct _mikey_timer {
32
+ unsigned char reload;
33
+ unsigned char control;
34
+ unsigned char count;
35
+ unsigned char control2;
36
+ } _mikey_timer;
37
+
38
+ typedef struct _mikey_all_timers {
39
+ struct _mikey_timer timer[8];
40
+ } _mikey_all_timers;
41
+
42
+ /* Audio channel structure */
43
+ typedef struct _mikey_audio {
44
+ unsigned char volume;
45
+ unsigned char feedback;
46
+ unsigned char dac;
47
+ unsigned char shiftlo;
48
+ unsigned char reload;
49
+ unsigned char control;
50
+ unsigned char count;
51
+ unsigned char other;
52
+ } _mikey_audio;
53
+
54
+ /* Define a structure with the mikey register offsets */
55
+ struct __mikey {
56
+ struct _mikey_timer timer0; /* 0xFD00 */
57
+ struct _mikey_timer timer1; /* 0xFD04 */
58
+ struct _mikey_timer timer2; /* 0xFD08 */
59
+ struct _mikey_timer timer3; /* 0xFD0C */
60
+ struct _mikey_timer timer4; /* 0xFD10 */
61
+ struct _mikey_timer timer5; /* 0xFD14 */
62
+ struct _mikey_timer timer6; /* 0xFD18 */
63
+ struct _mikey_timer timer7; /* 0xFD1C */
64
+ struct _mikey_audio channel_a; /* 0xFD20 */
65
+ struct _mikey_audio channel_b; /* 0xFD28 */
66
+ struct _mikey_audio channel_c; /* 0xFD30 */
67
+ struct _mikey_audio channel_d; /* 0xFD38 */
68
+ unsigned char attena; /* 0xFD40 ?? not yet allocated? */
69
+ unsigned char attenb; /* 0xFD41 | */
70
+ unsigned char attenc; /* 0xFD42 | */
71
+ unsigned char attend; /* 0xFD43 | */
72
+ unsigned char panning; /* 0xFD44 | */
73
+ unsigned char unused0[11]; /* 0xFD45 - 0xFD4F not used */
74
+ unsigned char mstereo; /* 0xFD50 stereo control bits */
75
+ unsigned char unused1[47]; /* 0xFD51 - 0xFD7F not used */
76
+ unsigned char intrst; /* 0xFD80 interrupt poll 0 */
77
+ unsigned char intset; /* 0xFD81 interrupt poll 1 */
78
+ unsigned char unused2[2]; /* 0xFD82 - 0xFD83 not used */
79
+ unsigned char magrdy0; /* 0xFD84 mag tape channel0 ready bit */
80
+ unsigned char magrdy1; /* 0xFD85 mag tape channel1 ready bit */
81
+ unsigned char audin; /* 0xFD86 audio in */
82
+ unsigned char sysctl1; /* 0xFD87 control bits */
83
+ unsigned char mikeyrev; /* 0xFD88 mikey hardware rev */
84
+ unsigned char mikeysrev; /* 0xFD89 mikey software rev */
85
+ unsigned char iodir; /* 0xFD8A parallel i/o data dir */
86
+ unsigned char iodat; /* 0xFD8B parallel data */
87
+ unsigned char serctl; /* 0xFD8C serial control register */
88
+ unsigned char serdat; /* 0xFD8D serial data */
89
+ unsigned char unused3[2]; /* 0xFD8E - 0xFD8F not used */
90
+ unsigned char sdoneack; /* 0xFD90 suzy done acknowledge */
91
+ unsigned char cpusleep; /* 0xFD91 cpu bus request disable */
92
+ unsigned char dispctl; /* 0xFD92 video bus request enable, viddma */
93
+ unsigned char pkbkup; /* 0xFD93 magic 'P' count */
94
+ unsigned char *scrbase; /* 0xFD94 start address of video display */
95
+ unsigned char unused4[6]; /* 0xFD96 - 0xFD9B not used */
96
+ unsigned char mtest0; /* 0xFD9C */
97
+ unsigned char mtest1; /* 0xFD9D */
98
+ unsigned char mtest2; /* 0xFD9E */
99
+ unsigned char unused5; /* 0xFD9F not used */
100
+ unsigned char palette[32]; /* 0xFDA0 - 0xFDBF palette 32 bytes */
101
+ unsigned char unused6[64]; /* 0xFDC0 - 0xFDFF not used */
102
+ unsigned char bootrom[504]; /* 0xFE00 - 0xFFD8 boot rom */
103
+ unsigned char reserved; /* 0xFFD8 reserved for future hardware */
104
+ unsigned char mapctl; /* 0xFFF9 map control register */
105
+ struct {
106
+ unsigned char *nmi; /* 0xFFFA NMI vector */
107
+ unsigned char *reset; /* 0xFFFB reset vector */
108
+ unsigned char *irq; /* 0xFFFC IRQ vector */
109
+ } vectors;
110
+ };
111
+
112
+ /* TIM_CONTROLA control bit definitions */
113
+ enum {
114
+ ENABLE_INT = 0x80,
115
+ RESET_DONE = 0x40,
116
+ ENABLE_RELOAD = 0x10,
117
+ ENABLE_COUNT = 0x08
118
+ };
119
+
120
+ /* AUD_CONTROL control bit definitions */
121
+ enum {
122
+ FEEDBACK_7 = 0x80,
123
+ ENABLE_INTEGRATE = 0x20
124
+ };
125
+
126
+ /* Audio and timer clock settings for source period */
127
+ enum {
128
+ AUD_LINKING = 0x07,
129
+ AUD_64 = 0x06,
130
+ AUD_32 = 0x05,
131
+ AUD_16 = 0x04,
132
+ AUD_8 = 0x03,
133
+ AUD_4 = 0x02,
134
+ AUD_2 = 0x01,
135
+ AUD_1 = 0x00
136
+ };
137
+
138
+ /* TIM_CONTROLB control bit definitions */
139
+ enum {
140
+ TIMER_DONE = 0x08,
141
+ LAST_CLOCK = 0x04,
142
+ BORROW_IN = 0x02,
143
+ BORROW_OUT = 0x01
144
+ };
145
+
146
+ /* MPAN and MSTEREO registers bit definitions */
147
+ enum {
148
+ LEFT3_SELECT = 0x80,
149
+ LEFT2_SELECT = 0x40,
150
+ LEFT1_SELECT = 0x20,
151
+ LEFT0_SELECT = 0x10,
152
+ RIGHT3_SELECT = 0x08,
153
+ RIGHT2_SELECT = 0x04,
154
+ RIGHT1_SELECT = 0x02,
155
+ RIGHT0_SELECT = 0x01,
156
+ LEFT_ATTENMASK = 0xF0,
157
+ RIGHT_ATTENMASK = 0x0F
158
+ };
159
+
160
+ /* Interrupt Reset and Set bit definitions */
161
+ enum {
162
+ TIMER7_INT = 0x80,
163
+ TIMER6_INT = 0x40,
164
+ TIMER5_INT = 0x20,
165
+ TIMER4_INT = 0x10,
166
+ TIMER3_INT = 0x08,
167
+ TIMER2_INT = 0x04,
168
+ TIMER1_INT = 0x02,
169
+ TIMER0_INT = 0x01,
170
+ SERIAL_INT = TIMER4_INT,
171
+ VERTICAL_INT = TIMER2_INT,
172
+ HORIZONTAL_INT = TIMER0_INT
173
+ };
174
+
175
+ /* SYSCTL1 bit definitions */
176
+ enum {
177
+ POWERON = 0x02,
178
+ CART_ADDR_STROBE = 0x01
179
+ };
180
+
181
+ /* IODIR and IODAT bit definitions */
182
+ enum {
183
+ AUDIN_BIT = 0x10, /* different from AUDIN address */
184
+ READ_ENABLE = 0x10, /* same bit for AUDIN_BIT */
185
+ RESTLESS = 0x08,
186
+ NOEXP = 0x04, /* if set, redeye is not connected */
187
+ CART_ADDR_DATA = 0x02,
188
+ CART_POWER_OFF = 0x02, /* same bit for CART_ADDR_DATA */
189
+ EXTERNAL_POWER = 0x01
190
+ };
191
+
192
+ /* SERCTL bit definitions for write operations */
193
+ enum {
194
+ TXINTEN = 0x80,
195
+ RXINTEN = 0x40,
196
+ PAREN = 0x10,
197
+ RESETERR = 0x08,
198
+ TXOPEN = 0x04,
199
+ TXBRK = 0x02,
200
+ PAREVEN = 0x01
201
+ };
202
+
203
+ /* SERCTL bit definitions for read operations */
204
+ enum {
205
+ TXRDY = 0x80,
206
+ RXRDY = 0x40,
207
+ TXEMPTY = 0x20,
208
+ PARERR = 0x10,
209
+ OVERRUN = 0x08,
210
+ FRAMERR = 0x04,
211
+ RXBRK = 0x02,
212
+ PARBIT = 0x01
213
+ };
214
+
215
+ /* DISPCTL bit definitions */
216
+ enum {
217
+ DISP_COLOR = 0x08, /* must be set to 1 */
218
+ DISP_FOURBIT = 0x04, /* must be set to 1 */
219
+ DISP_FLIP = 0x02,
220
+ DMA_ENABLE = 0x01 /* must be set to 1 */
221
+ };
222
+
223
+ /* MTEST0 bit definitions */
224
+ enum {
225
+ AT_CNT16 = 0x80,
226
+ AT_TEST = 0x40,
227
+ XCLKEN = 0x20,
228
+ UART_TURBO = 0x10,
229
+ ROM_SEL = 0x08,
230
+ ROM_TEST = 0x04,
231
+ M_TEST = 0x02,
232
+ CPU_TEST = 0x01
233
+ };
234
+
235
+ /* MTEST1 bit definitions */
236
+ enum {
237
+ P_CNT16 = 0x40,
238
+ REF_CNT16 = 0x20,
239
+ VID_TRIG = 0x10,
240
+ REF_TRIG = 0x08,
241
+ VID_DMA_DIS = 0x04,
242
+ REF_FAST = 0x02,
243
+ REF_DIS = 0x01
244
+ };
245
+
246
+ /* MTEST2 bit definitions */
247
+ enum {
248
+ V_STROBE = 0x10,
249
+ V_ZERO = 0x08,
250
+ H_120 = 0x04,
251
+ H_ZERO = 0x02,
252
+ V_BLANKEF = 0x01
253
+ };
254
+
255
+ /* MAPCTL bit definitions */
256
+ enum {
257
+ TURBO_DISABLE = 0x80,
258
+ VECTOR_SPACE = 0x08,
259
+ ROM_SPACE = 0x04,
260
+ MIKEY_SPACE = 0x02,
261
+ SUZY_SPACE = 0x01
262
+ };
263
+
264
+ #endif