fcdev-cc65 0.0.0-stage → 0.6.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,220 @@
1
+ /*****************************************************************************/
2
+ /* */
3
+ /* mouse.h */
4
+ /* */
5
+ /* Mouse API */
6
+ /* */
7
+ /* */
8
+ /* */
9
+ /* (C) 2003-2013, Ullrich von Bassewitz */
10
+ /* Roemerstrasse 52 */
11
+ /* D-70794 Filderstadt */
12
+ /* EMail: uz@cc65.org */
13
+ /* */
14
+ /* */
15
+ /* */
16
+ /* */
17
+ /* This software is provided 'as-is', without any expressed or implied */
18
+ /* warranty. In no event will the authors be held liable for any damages */
19
+ /* arising from the use of this software. */
20
+ /* */
21
+ /* Permission is granted to anyone to use this software for any purpose, */
22
+ /* including commercial applications, and to alter it and redistribute it */
23
+ /* freely, subject to the following restrictions: */
24
+ /* */
25
+ /* 1. The origin of this software must not be misrepresented; you must not */
26
+ /* claim that you wrote the original software. If you use this software */
27
+ /* in a product, an acknowledgment in the product documentation would be */
28
+ /* appreciated but is not required. */
29
+ /* 2. Altered source versions must be plainly marked as such, and must not */
30
+ /* be misrepresented as being the original software. */
31
+ /* 3. This notice may not be removed or altered from any source */
32
+ /* distribution. */
33
+ /* */
34
+ /*****************************************************************************/
35
+
36
+
37
+
38
+ #ifndef _MOUSE_H
39
+ #define _MOUSE_H
40
+
41
+
42
+
43
+ /*****************************************************************************/
44
+ /* Definitions */
45
+ /*****************************************************************************/
46
+
47
+
48
+
49
+ /* Error codes */
50
+ #define MOUSE_ERR_OK 0 /* No error */
51
+ #define MOUSE_ERR_NO_DRIVER 1 /* No driver available */
52
+ #define MOUSE_ERR_CANNOT_LOAD 2 /* Error loading driver */
53
+ #define MOUSE_ERR_INV_DRIVER 3 /* Invalid driver */
54
+ #define MOUSE_ERR_NO_DEVICE 4 /* Mouse hardware not found */
55
+ #define MOUSE_ERR_INV_IOCTL 5 /* Invalid ioctl code */
56
+
57
+ /* Mouse button masks */
58
+ #define MOUSE_BTN_LEFT 0x10
59
+ #define MOUSE_BTN_RIGHT 0x01
60
+
61
+ /* Structure containing the mouse coordinates */
62
+ struct mouse_pos {
63
+ int x;
64
+ int y;
65
+ };
66
+
67
+ /* Structure containing information about the mouse */
68
+ struct mouse_info {
69
+ struct mouse_pos pos; /* Mouse position */
70
+ unsigned char buttons; /* Mouse button mask */
71
+ };
72
+
73
+ /* Structure used for getbox/setbox */
74
+ struct mouse_box {
75
+ int minx;
76
+ int miny;
77
+ int maxx;
78
+ int maxy;
79
+ };
80
+
81
+ /* Structure containing mouse callback functions. These functions are declared
82
+ ** in C notation here, but they cannot be C functions (at least not easily),
83
+ ** since they may be called from within an interrupt.
84
+ */
85
+ struct mouse_callbacks {
86
+
87
+ void (*hide) (void);
88
+ /* Hide the mouse cursor. */
89
+
90
+ void (*show) (void);
91
+ /* Show the mouse cursor. */
92
+
93
+ void (*prep) (void);
94
+ /* Prepare to move the mouse cursor. This function is called,
95
+ ** even when the cursor is currently invisible.
96
+ */
97
+
98
+ void (*draw) (void);
99
+ /* Draw the mouse cursor. This function is called,
100
+ ** even when the cursor is currently invisible.
101
+ */
102
+
103
+ void __fastcall__ (*movex) (int x);
104
+ /* Move the mouse cursor to the new X coordinate. This function is called,
105
+ ** even when the cursor is currently invisible.
106
+ */
107
+
108
+ void __fastcall__ (*movey) (int y);
109
+ /* Move the mouse cursor to the new Y coordinate. This function is called,
110
+ ** even when the cursor is currently invisible.
111
+ */
112
+ };
113
+
114
+
115
+
116
+ /*****************************************************************************/
117
+ /* Declarations */
118
+ /*****************************************************************************/
119
+
120
+
121
+
122
+ /* The default mouse callbacks */
123
+ extern const struct mouse_callbacks mouse_def_callbacks;
124
+
125
+ #if defined(__CBM__)
126
+
127
+ /* The default mouse pointer shape used by the default mouse callbacks */
128
+ extern const unsigned char mouse_def_pointershape[63];
129
+
130
+ /* The default mouse pointer color used by the default mouse callbacks */
131
+ extern const unsigned char mouse_def_pointercolor;
132
+
133
+ #endif
134
+
135
+ /* The name of the standard mouse driver for a platform */
136
+ extern const char mouse_stddrv[];
137
+
138
+ /* The address of the static standard mouse driver for a platform */
139
+ extern const void mouse_static_stddrv[];
140
+
141
+
142
+
143
+ /*****************************************************************************/
144
+ /* Functions */
145
+ /*****************************************************************************/
146
+
147
+
148
+
149
+ unsigned char __fastcall__ mouse_load_driver (const struct mouse_callbacks* c,
150
+ const char* driver);
151
+ /* Load and install a mouse driver, return an error code. */
152
+
153
+ unsigned char mouse_unload (void);
154
+ /* Uninstall, then unload the currently loaded driver. */
155
+
156
+ unsigned char __fastcall__ mouse_install (const struct mouse_callbacks* c,
157
+ void* driver);
158
+ /* Install an already loaded driver. Return an error code. */
159
+
160
+ unsigned char mouse_uninstall (void);
161
+ /* Uninstall the currently loaded driver. Return an error code. */
162
+
163
+ const char* __fastcall__ mouse_geterrormsg (unsigned char code);
164
+ /* Get an error message describing the error in code. */
165
+
166
+ void mouse_hide (void);
167
+ /* Hide the mouse. The function manages a counter and may be called more than
168
+ ** once. For each call to mouse_hide there must be a call to mouse_show to make
169
+ ** the mouse visible again.
170
+ */
171
+
172
+ void mouse_show (void);
173
+ /* Show the mouse. See mouse_hide() for more information. */
174
+
175
+ void __fastcall__ mouse_setbox (const struct mouse_box* box);
176
+ /* Set the bounding box for the mouse pointer movement. The mouse X and Y
177
+ ** coordinates will never go outside the given box.
178
+ ** NOTE: The function does *not* check if the mouse is currently inside the
179
+ ** given margins. The proper way to use this function therefore is:
180
+ **
181
+ ** - Hide the mouse
182
+ ** - Set the bounding box
183
+ ** - Place the mouse at the desired position
184
+ ** - Show the mouse again.
185
+ **
186
+ ** NOTE2: When setting the box to something that is larger than the actual
187
+ ** screen, the positioning of the mouse cursor can fail. If such margins
188
+ ** are really what you want, you have to use your own cursor routines.
189
+ */
190
+
191
+ void __fastcall__ mouse_getbox (struct mouse_box* box);
192
+ /* Get the current bounding box for the mouse pointer movement. */
193
+
194
+ void __fastcall__ mouse_move (int x, int y);
195
+ /* Set the mouse cursor to the given position. If a mouse cursor is defined
196
+ ** and currently visible, the mouse cursor is also moved.
197
+ ** NOTE: This function does not check if the given position is valid and
198
+ ** inside the bounding box.
199
+ */
200
+
201
+ unsigned char mouse_buttons (void);
202
+ /* Return a bit mask encoding the states of the mouse buttons. Use the
203
+ ** MOUSE_BTN_XXX flags to decode a specific button.
204
+ */
205
+
206
+ void __fastcall__ mouse_pos (struct mouse_pos* pos);
207
+ /* Return the current mouse position. */
208
+
209
+ void __fastcall__ mouse_info (struct mouse_info* info);
210
+ /* Return the state of the mouse buttons and the position of the mouse. */
211
+
212
+ unsigned char __fastcall__ mouse_ioctl (unsigned char code, void* data);
213
+ /* Call the driver-specific ioctl function. Return an error code.
214
+ ** NON-PORTABLE!
215
+ */
216
+
217
+
218
+
219
+ /* End of mouse.h */
220
+ #endif
package/include/nes.h ADDED
@@ -0,0 +1,203 @@
1
+ /*****************************************************************************/
2
+ /* */
3
+ /* nes.h */
4
+ /* */
5
+ /* NES system specific definitions */
6
+ /* */
7
+ /* */
8
+ /* */
9
+ /* (C) 2002-2003 Groepaz/Hitmen */
10
+ /* */
11
+ /* */
12
+ /* This software is provided 'as-is', without any expressed or implied */
13
+ /* warranty. In no event will the authors be held liable for any damages */
14
+ /* arising from the use of this software. */
15
+ /* */
16
+ /* Permission is granted to anyone to use this software for any purpose, */
17
+ /* including commercial applications, and to alter it and redistribute it */
18
+ /* freely, subject to the following restrictions: */
19
+ /* */
20
+ /* 1. The origin of this software must not be misrepresented; you must not */
21
+ /* claim that you wrote the original software. If you use this software */
22
+ /* in a product, an acknowledgment in the product documentation would be */
23
+ /* appreciated but is not required. */
24
+ /* 2. Altered source versions must be plainly marked as such, and must not */
25
+ /* be misrepresented as being the original software. */
26
+ /* 3. This notice may not be removed or altered from any source */
27
+ /* distribution. */
28
+ /* */
29
+ /*****************************************************************************/
30
+
31
+
32
+
33
+ #ifndef _NES_H
34
+ #define _NES_H
35
+
36
+
37
+
38
+ /* Check for errors */
39
+ #if !defined(__NES__)
40
+ # error This module may only be used when compiling for the NES!
41
+ #endif
42
+
43
+
44
+
45
+ /* Key and character defines */
46
+ #define CH_ENTER '\n'
47
+ #define CH_CURS_UP 0x01
48
+ #define CH_CURS_DOWN 0x02
49
+ #define CH_CURS_LEFT 0x03
50
+ #define CH_CURS_RIGHT 0x04
51
+ #define CH_ESC 8
52
+ #define CH_DEL 20
53
+
54
+ #define CH_CROSS 0x10
55
+ #define CH_RTEE 0x17
56
+ #define CH_LTEE 0x0f
57
+ #define CH_TTEE 0x16
58
+ #define CH_BTEE 0x15
59
+ #define CH_HLINE 0x0b
60
+ #define CH_VLINE 0x0e
61
+ #define CH_ULCORNER 0x14
62
+ #define CH_URCORNER 0x12
63
+ #define CH_LLCORNER 0x11
64
+ #define CH_LRCORNER 0x08
65
+ #define CH_PI 0x05
66
+
67
+ /* Color defines */
68
+ #define COLOR_BLACK 0x00
69
+ #define COLOR_WHITE 0x01
70
+ #define COLOR_RED 0x02
71
+ #define COLOR_CYAN 0x03
72
+ #define COLOR_PURPLE 0x04
73
+ #define COLOR_GREEN 0x05
74
+ #define COLOR_BLUE 0x06
75
+ #define COLOR_YELLOW 0x07
76
+ #define COLOR_ORANGE 0x08
77
+ #define COLOR_BROWN 0x09
78
+ #define COLOR_LIGHTRED 0x0A
79
+ #define COLOR_GRAY1 0x0B
80
+ #define COLOR_GRAY2 0x0C
81
+ #define COLOR_LIGHTGREEN 0x0D
82
+ #define COLOR_LIGHTBLUE 0x0E
83
+ #define COLOR_GRAY3 0x0F
84
+
85
+ /* TGI color defines (default palette) */
86
+ #define TGI_COLOR_BLACK COLOR_BLACK
87
+ #define TGI_COLOR_RED COLOR_RED
88
+ #define TGI_COLOR_PINK COLOR_LIGHTRED
89
+ #define TGI_COLOR_LIGHTGREY COLOR_GRAY1
90
+ #define TGI_COLOR_GREY COLOR_GRAY2
91
+ #define TGI_COLOR_DARKGREY COLOR_GRAY3
92
+ #define TGI_COLOR_BROWN COLOR_BROWN
93
+ #define TGI_COLOR_PEACH COLOR_CYAN
94
+ #define TGI_COLOR_YELLOW COLOR_YELLOW
95
+ #define TGI_COLOR_LIGHTGREEN COLOR_LIGHTGREEN
96
+ #define TGI_COLOR_GREEN COLOR_GREEN
97
+ #define TGI_COLOR_DARKBROWN COLOR_ORANGE
98
+ #define TGI_COLOR_PURPLE COLOR_PURPLE
99
+ #define TGI_COLOR_BLUE COLOR_BLUE
100
+ #define TGI_COLOR_LIGHTBLUE COLOR_LIGHTBLUE
101
+ #define TGI_COLOR_WHITE COLOR_WHITE
102
+
103
+ /* Masks for joy_read */
104
+ #define JOY_UP_MASK 0x10
105
+ #define JOY_DOWN_MASK 0x20
106
+ #define JOY_LEFT_MASK 0x40
107
+ #define JOY_RIGHT_MASK 0x80
108
+ #define JOY_BTN_1_MASK 0x01
109
+ #define JOY_BTN_2_MASK 0x02
110
+ #define JOY_BTN_3_MASK 0x04
111
+ #define JOY_BTN_4_MASK 0x08
112
+
113
+ #define JOY_BTN_A_MASK JOY_BTN_1_MASK
114
+ #define JOY_BTN_B_MASK JOY_BTN_2_MASK
115
+ #define JOY_SELECT_MASK JOY_BTN_3_MASK
116
+ #define JOY_START_MASK JOY_BTN_4_MASK
117
+
118
+ #define JOY_BTN_A(v) ((v) & JOY_BTN_A_MASK)
119
+ #define JOY_BTN_B(v) ((v) & JOY_BTN_B_MASK)
120
+ #define JOY_SELECT(v) ((v) & JOY_SELECT_MASK)
121
+ #define JOY_START(v) ((v) & JOY_START_MASK)
122
+
123
+ /* Return codes of get_tv */
124
+ #define TV_NTSC 0
125
+ #define TV_PAL 1
126
+ #define TV_OTHER 2
127
+
128
+ /* No support for dynamically loadable drivers */
129
+ #define DYN_DRV 0
130
+
131
+ /* Define hardware */
132
+
133
+ /* Picture Processing Unit */
134
+ struct __ppu {
135
+ unsigned char control;
136
+ unsigned char mask; /* color; show sprites, background */
137
+ signed char volatile const status;
138
+ struct {
139
+ unsigned char address;
140
+ unsigned char data;
141
+ } sprite;
142
+ unsigned char scroll;
143
+ struct {
144
+ unsigned char address;
145
+ unsigned char data;
146
+ } vram;
147
+ };
148
+ #define PPU (*(struct __ppu*)0x2000)
149
+ #define SPRITE_DMA (APU.sprite.dma)
150
+
151
+ /* Audio Processing Unit */
152
+ struct __apu {
153
+ struct {
154
+ unsigned char control; /* duty, counter halt, volume/envelope */
155
+ unsigned char ramp;
156
+ unsigned char period_low; /* timing */
157
+ unsigned char len_period_high; /* length, timing */
158
+ } pulse[2];
159
+ struct {
160
+ unsigned char counter; /* counter halt, linear counter */
161
+ unsigned char unused;
162
+ unsigned char period_low; /* timing */
163
+ unsigned char len_period_high; /* length, timing */
164
+ } triangle;
165
+ struct {
166
+ unsigned char control; /* counter halt, volume/envelope */
167
+ unsigned char unused;
168
+ unsigned char period; /* loop, timing */
169
+ unsigned char len; /* length */
170
+ } noise;
171
+ struct {
172
+ unsigned char control; /* IRQ, loop, rate */
173
+ unsigned char output; /* output value */
174
+ unsigned char address;
175
+ unsigned char length;
176
+ } delta_mod; /* delta pulse-code modulation */
177
+ struct {
178
+ unsigned char dma;
179
+ } sprite;
180
+ signed char volatile status;
181
+ unsigned char unused;
182
+ unsigned char fcontrol;
183
+ };
184
+ #define APU (*(struct __apu*)0x4000)
185
+
186
+ #define JOYPAD ((unsigned char volatile[2])0x4016)
187
+
188
+ /* The addresses of the static drivers */
189
+ extern void nes_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */
190
+ extern void nes_64_56_2_tgi[]; /* Referred to by tgi_static_stddrv[] */
191
+
192
+
193
+
194
+ void waitvsync (void);
195
+ /* Wait for start of the next frame */
196
+
197
+ unsigned char get_tv (void);
198
+ /* Return the video mode the machine is using. */
199
+
200
+
201
+
202
+ /* End of nes.h */
203
+ #endif
package/include/o65.h ADDED
@@ -0,0 +1,178 @@
1
+ /*****************************************************************************/
2
+ /* */
3
+ /* o65.h */
4
+ /* */
5
+ /* Definitions for the o65 file format */
6
+ /* */
7
+ /* */
8
+ /* */
9
+ /* (C) 2002-2009, 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
+ /* This files exports structures and constants to handle the o65 relocatable
37
+ ** file format as defined by Andre Fachat. See the original document under
38
+ **
39
+ ** http://www.6502.org/users/andre/o65/fileformat.html
40
+ **
41
+ ** for more information.
42
+ */
43
+
44
+
45
+
46
+ #ifndef _O65_H
47
+ #define _O65_H
48
+
49
+
50
+
51
+ /* o65 size type. It is 2 bytes for the 6502 and 4 bytes for the 65816 */
52
+ typedef unsigned o65_size;
53
+
54
+
55
+ /* Structure that defines the o65 file header */
56
+ typedef struct o65_header o65_header;
57
+ struct o65_header {
58
+ char marker[2]; /* Non-C64 marker */
59
+ char magic[3]; /* o65 magic */
60
+ char version; /* Version number */
61
+ unsigned mode; /* Mode word */
62
+ o65_size tbase; /* Original text (code) segment address */
63
+ o65_size tlen; /* Size of text (code) segment */
64
+ o65_size dbase; /* Original data segment address */
65
+ o65_size dlen; /* Size of data segment */
66
+ o65_size bbase; /* Original bss segment address */
67
+ o65_size blen; /* Size of bss segment */
68
+ o65_size zbase; /* Original zp segment address */
69
+ o65_size zlen; /* Size of zp segment */
70
+ o65_size stack; /* Stacksize needed */
71
+ };
72
+
73
+
74
+
75
+ /* Marker, magic and version number */
76
+ #define O65_MARKER_0 0x01
77
+ #define O65_MARKER_1 0x00
78
+ #define O65_MAGIC_0 0x6F /* 'o' */
79
+ #define O65_MAGIC_1 0x36 /* '6' */
80
+ #define O65_MAGIC_2 0x35 /* '5' */
81
+ #define O65_VERSION 0x00
82
+
83
+ /* Defines for the mode word */
84
+ #define O65_CPU_65816 0x8000 /* Executable is for 65816 */
85
+ #define O65_CPU_6502 0x0000 /* Executable is for the 6502 */
86
+ #define O65_CPU_MASK 0x8000 /* Mask to extract CPU type */
87
+
88
+ #define O65_RELOC_PAGE 0x4000 /* Page wise relocation */
89
+ #define O65_RELOC_BYTE 0x0000 /* Byte wise relocation */
90
+ #define O65_RELOC_MASK 0x4000 /* Mask to extract relocation type */
91
+
92
+ #define O65_SIZE_32BIT 0x2000 /* All size words are 32bit */
93
+ #define O65_SIZE_16BIT 0x0000 /* All size words are 16bit */
94
+ #define O65_SIZE_MASK 0x2000 /* Mask to extract size */
95
+
96
+ #define O65_FTYPE_OBJ 0x1000 /* Object file */
97
+ #define O65_FTYPE_EXE 0x0000 /* Executable file */
98
+ #define O65_FTYPE_MASK 0x1000 /* Mask to extract type */
99
+
100
+ #define O65_ADDR_SIMPLE 0x0800 /* Simple addressing */
101
+ #define O65_ADDR_DEFAULT 0x0000 /* Default addressing */
102
+ #define O65_ADDR_MASK 0x0800 /* Mask to extract addressing */
103
+
104
+ #define O65_CHAIN 0x0400 /* Chained file, another one follows */
105
+ #define O65_CHAIN_MASK 0x0400 /* Mask to extract chain flag */
106
+
107
+ #define O65_BSSZERO 0x0200 /* BSS segment must be zeroed */
108
+ #define O65_BSSZERO_MASK 0x0200 /* Mask to extract bss zero flag */
109
+
110
+ /* The following is used if O65_CPU == 6502 */
111
+ #define O65_CPU2_6502 0x0000 /* Executable is for 6502 */
112
+ #define O65_CPU2_65C02 0x0010 /* Executable is for 65C02 */
113
+ #define O65_CPU2_65SC02 0x0020 /* Executable is for 65SC02 */
114
+ #define O65_CPU2_65CE02 0x0030 /* Executable is for 65CE02 */
115
+ #define O65_CPU2_6502X 0x0040 /* Executable is for NMOS 6502 */
116
+ #define O65_CPU2_65816_EMU 0x0050 /* Executable is for 65816 in emul mode */
117
+ #define O65_CPU2_MASK 0x00F0 /* Mask to extract CPU2 field */
118
+
119
+ #define O65_ALIGN_1 0x0000 /* Bytewise alignment */
120
+ #define O65_ALIGN_2 0x0001 /* Align words */
121
+ #define O65_ALIGN_4 0x0002 /* Align longwords */
122
+ #define O65_ALIGN_256 0x0003 /* Align pages (256 bytes) */
123
+ #define O65_ALIGN_MASK 0x0003 /* Mask to extract alignment */
124
+
125
+ /* The mode word as generated by the ld65 linker */
126
+ #define O65_MODE_CC65 (O65_CPU_6502 | \
127
+ O65_RELOC_BYTE | \
128
+ O65_SIZE_16BIT | \
129
+ O65_FTYPE_EXE | \
130
+ O65_ADDR_SIMPLE | \
131
+ O65_ALIGN_1)
132
+
133
+ /* The four o65 segment types. */
134
+ #define O65_SEGID_UNDEF 0x00
135
+ #define O65_SEGID_ABS 0x01
136
+ #define O65_SEGID_TEXT 0x02
137
+ #define O65_SEGID_DATA 0x03
138
+ #define O65_SEGID_BSS 0x04
139
+ #define O65_SEGID_ZP 0x05
140
+ #define O65_SEGID_MASK 0x07
141
+
142
+ /* Relocation type codes */
143
+ #define O65_RTYPE_WORD 0x80
144
+ #define O65_RTYPE_HIGH 0x40
145
+ #define O65_RTYPE_LOW 0x20
146
+ #define O65_RTYPE_SEGADDR 0xC0
147
+ #define O65_RTYPE_SEG 0xA0
148
+ #define O65_RTYPE_MASK 0xE0
149
+
150
+ /* Segment IDs */
151
+ #define O65_SEGID_UNDEF 0x00
152
+ #define O65_SEGID_ABS 0x01
153
+ #define O65_SEGID_TEXT 0x02
154
+ #define O65_SEGID_DATA 0x03
155
+ #define O65_SEGID_BSS 0x04
156
+ #define O65_SEGID_ZP 0x05
157
+ #define O65_SEGID_MASK 0x07
158
+
159
+ /* Option tags */
160
+ #define O65_OPT_FILENAME 0
161
+ #define O65_OPT_OS 1
162
+ #define O65_OPT_ASM 2
163
+ #define O65_OPT_AUTHOR 3
164
+ #define O65_OPT_TIMESTAMP 4
165
+
166
+ /* Operating system codes for O65_OPT_OS */
167
+ #define O65_OS_OSA65 1
168
+ #define O65_OS_LUNIX 2
169
+ #define O65_OS_CC65 3
170
+ #define O65_OS_OPENCBM 4
171
+
172
+
173
+
174
+ /* End of o65.h */
175
+ #endif
176
+
177
+
178
+
@@ -0,0 +1,66 @@
1
+ /*****************************************************************************/
2
+ /* */
3
+ /* osic1p.h */
4
+ /* */
5
+ /* Challenger 1P system specific definitions */
6
+ /* */
7
+ /* */
8
+ /* */
9
+ /* (C) 2015 Stephan Muehlstrasser */
10
+ /* */
11
+ /* */
12
+ /* This software is provided 'as-is', without any expressed or implied */
13
+ /* warranty. In no event will the authors be held liable for any damages */
14
+ /* arising from the use of this software. */
15
+ /* */
16
+ /* Permission is granted to anyone to use this software for any purpose, */
17
+ /* including commercial applications, and to alter it and redistribute it */
18
+ /* freely, subject to the following restrictions: */
19
+ /* */
20
+ /* 1. The origin of this software must not be misrepresented; you must not */
21
+ /* claim that you wrote the original software. If you use this software */
22
+ /* in a product, an acknowledgment in the product documentation would be */
23
+ /* appreciated but is not required. */
24
+ /* 2. Altered source versions must be plainly marked as such, and must not */
25
+ /* be misrepresented as being the original software. */
26
+ /* 3. This notice may not be removed or altered from any source */
27
+ /* distribution. */
28
+ /* */
29
+ /*****************************************************************************/
30
+
31
+ #ifndef _OSIC1P_H
32
+ #define _OSIC1P_H
33
+
34
+ /* Check for errors */
35
+ #if !defined(__OSIC1P__)
36
+ # error "This module may only be used when compiling for the Challenger 1P!"
37
+ #endif
38
+
39
+ /* Colors are not functional, display is black and white only. */
40
+ #define COLOR_BLACK 0x00
41
+ #define COLOR_WHITE 0x01
42
+
43
+ #define CH_ULCORNER 0xCC
44
+ #define CH_URCORNER 0xCD
45
+ #define CH_LLCORNER 0xCB
46
+ #define CH_LRCORNER 0xCE
47
+ #define CH_TTEE 0xD9
48
+ #define CH_BTEE 0xD7
49
+ #define CH_LTEE 0xD8
50
+ #define CH_RTEE 0xDA
51
+ #define CH_CROSS 0xDB
52
+ #define CH_HLINE 0x94
53
+ #define CH_VLINE 0x95
54
+
55
+ #define CH_ENTER 0x0D
56
+
57
+ /* The following #defines will cause the matching functions calls in conio.h
58
+ ** to be overlaid by macros with the same names, saving the function call
59
+ ** overhead.
60
+ */
61
+ #define _textcolor(color) COLOR_WHITE
62
+ #define _bgcolor(color) COLOR_BLACK
63
+ #define _bordercolor(color) COLOR_BLACK
64
+ #define _cpeekcolor(color) COLOR_WHITE
65
+
66
+ #endif