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,358 @@
1
+ /*****************************************************************************/
2
+ /* */
3
+ /* apple2.h */
4
+ /* */
5
+ /* Apple ][ system specific definitions */
6
+ /* */
7
+ /* */
8
+ /* */
9
+ /* (C) 2000 Kevin Ruland, <kevin@rodin.wustl.edu> */
10
+ /* (C) 2003 Ullrich von Bassewitz, <uz@cc65.org> */
11
+ /* */
12
+ /* */
13
+ /* This software is provided 'as-is', without any expressed or implied */
14
+ /* warranty. In no event will the authors be held liable for any damages */
15
+ /* arising from the use of this software. */
16
+ /* */
17
+ /* Permission is granted to anyone to use this software for any purpose, */
18
+ /* including commercial applications, and to alter it and redistribute it */
19
+ /* freely, subject to the following restrictions: */
20
+ /* */
21
+ /* 1. The origin of this software must not be misrepresented; you must not */
22
+ /* claim that you wrote the original software. If you use this software */
23
+ /* in a product, an acknowledgment in the product documentation would be */
24
+ /* appreciated but is not required. */
25
+ /* 2. Altered source versions must be plainly marked as such, and must not */
26
+ /* be misrepresented as being the original software. */
27
+ /* 3. This notice may not be removed or altered from any source */
28
+ /* distribution. */
29
+ /* */
30
+ /*****************************************************************************/
31
+
32
+
33
+
34
+ #ifndef _APPLE2_H
35
+ #define _APPLE2_H
36
+
37
+
38
+
39
+ /* Check for errors */
40
+ #if !defined(__APPLE2__)
41
+ # error This module may only be used when compiling for the Apple ][!
42
+ #endif
43
+
44
+ #include <time.h>
45
+ #include <apple2_filetype.h>
46
+
47
+
48
+
49
+ /*****************************************************************************/
50
+ /* Data */
51
+ /*****************************************************************************/
52
+
53
+
54
+
55
+ /* Color defines */
56
+ #define COLOR_BLACK 0x00
57
+ #define COLOR_WHITE 0x01
58
+
59
+ /* TGI color defines */
60
+ #define TGI_COLOR_BLACK 0x00
61
+ #define TGI_COLOR_GREEN 0x01
62
+ #define TGI_COLOR_PURPLE 0x02
63
+ #define TGI_COLOR_WHITE 0x03
64
+ #define TGI_COLOR_BLACK2 0x04
65
+ #define TGI_COLOR_ORANGE 0x05
66
+ #define TGI_COLOR_BLUE 0x06
67
+ #define TGI_COLOR_WHITE2 0x07
68
+
69
+ #define TGI_COLOR_MAGENTA TGI_COLOR_BLACK2
70
+ #define TGI_COLOR_DARKBLUE TGI_COLOR_WHITE2
71
+ #define TGI_COLOR_DARKGREEN 0x08
72
+ #define TGI_COLOR_GRAY 0x09
73
+ #define TGI_COLOR_CYAN 0x0A
74
+ #define TGI_COLOR_BROWN 0x0B
75
+ #define TGI_COLOR_GRAY2 0x0C
76
+ #define TGI_COLOR_PINK 0x0D
77
+ #define TGI_COLOR_YELLOW 0x0E
78
+ #define TGI_COLOR_AQUA 0x0F
79
+
80
+ /* Characters codes */
81
+ #define CH_ENTER 0x0D
82
+ #define CH_ESC 0x1B
83
+ #define CH_CURS_LEFT 0x08
84
+ #define CH_CURS_RIGHT 0x15
85
+
86
+ /* These characters are not available on the ][+, but
87
+ * are on the //e. */
88
+ #if defined(__APPLE2ENH__) || defined(APPLE2_INCLUDE_IIE_CHARS)
89
+ #define CH_DEL 0x7F
90
+ #define CH_CURS_UP 0x0B
91
+ #define CH_CURS_DOWN 0x0A
92
+
93
+ /* These are defined to be OpenApple + NumberKey */
94
+ #define CH_F1 0xB1
95
+ #define CH_F2 0xB2
96
+ #define CH_F3 0xB3
97
+ #define CH_F4 0xB4
98
+ #define CH_F5 0xB5
99
+ #define CH_F6 0xB6
100
+ #define CH_F7 0xB7
101
+ #define CH_F8 0xB8
102
+ #define CH_F9 0xB9
103
+ #define CH_F10 0xB0
104
+ #endif
105
+
106
+ #if defined(__APPLE2ENH__)
107
+
108
+ /* MouseText-based functions for boxes and lines drawing */
109
+ void mt_chline (unsigned char length);
110
+ void mt_cvline (unsigned char length);
111
+ void mt_chlinexy (unsigned char x, unsigned char y, unsigned char length);
112
+ void mt_cvlinexy (unsigned char x, unsigned char y, unsigned char length);
113
+
114
+ #define CH_HLINE 0x5F
115
+ #define CH_VLINE 0xDF
116
+ #define CH_ULCORNER 0x5F
117
+ #define CH_URCORNER 0x20
118
+ #define CH_LLCORNER 0xD4
119
+ #define CH_LRCORNER 0xDF
120
+ #define CH_TTEE 0x5F
121
+ #define CH_BTEE 0xD4
122
+ #define CH_LTEE 0xD4
123
+ #define CH_RTEE 0xDF
124
+ #define CH_CROSS 0xD4
125
+
126
+ #define _chline(length) mt_chline(length)
127
+ #define _chlinexy(x,y,length) mt_chlinexy(x,y,length)
128
+ #define _cvline(length) mt_cvline(length)
129
+ #define _cvlinexy(x,y,length) mt_cvlinexy(x,y,length)
130
+
131
+ #else
132
+
133
+ /* Functions that don't depend on MouseText to draw boxes and lines */
134
+ void dyn_chline (unsigned char h, unsigned char length);
135
+ void dyn_cvline (unsigned char v, unsigned char length);
136
+ void dyn_chlinexy (unsigned char h, unsigned char x, unsigned char y, unsigned char length);
137
+ void dyn_cvlinexy (unsigned char v, unsigned char x, unsigned char y, unsigned char length);
138
+
139
+ #if defined(DYN_BOX_DRAW)
140
+ /* When the user defines DYN_BOX_DRAW, we'll adapt to the machine
141
+ ** we run on.
142
+ */
143
+ extern char CH_HLINE;
144
+ extern char CH_VLINE;
145
+ extern char CH_ULCORNER;
146
+ extern char CH_URCORNER;
147
+ extern char CH_LLCORNER;
148
+ extern char CH_LRCORNER;
149
+ extern char CH_TTEE;
150
+ extern char CH_BTEE;
151
+ extern char CH_LTEE;
152
+ extern char CH_RTEE;
153
+ extern char CH_CROSS;
154
+
155
+ #else
156
+ /* Otherwise, fallback to safety and don't use MouseText at all. */
157
+ #define CH_HLINE '-'
158
+ #define CH_VLINE '!'
159
+ #define CH_ULCORNER '+'
160
+ #define CH_URCORNER '+'
161
+ #define CH_LLCORNER '+'
162
+ #define CH_LRCORNER '+'
163
+ #define CH_TTEE '+'
164
+ #define CH_BTEE '+'
165
+ #define CH_LTEE '+'
166
+ #define CH_RTEE '+'
167
+ #define CH_CROSS '+'
168
+ #endif /* DYN_BOX_DRAW */
169
+
170
+ #define _chline(length) dyn_chline(CH_HLINE, length)
171
+ #define _chlinexy(x, y, length) dyn_chlinexy(CH_HLINE, x ,y, length)
172
+ #define _cvline(length) dyn_cvline(CH_VLINE, length)
173
+ #define _cvlinexy(x, y, length) dyn_cvlinexy(CH_VLINE, x, y, length)
174
+
175
+ #endif /* __APPLE2ENH__ */
176
+
177
+ /* Masks for joy_read */
178
+ #define JOY_UP_MASK 0x10
179
+ #define JOY_DOWN_MASK 0x20
180
+ #define JOY_LEFT_MASK 0x04
181
+ #define JOY_RIGHT_MASK 0x08
182
+ #define JOY_BTN_1_MASK 0x40
183
+ #define JOY_BTN_2_MASK 0x80
184
+
185
+ /* Return codes for get_ostype */
186
+ #define APPLE_UNKNOWN 0x00
187
+ #define APPLE_II 0x10 /* Apple ][ */
188
+ #define APPLE_IIPLUS 0x11 /* Apple ][+ */
189
+ #define APPLE_IIIEM 0x20 /* Apple /// (emulation) */
190
+ #define APPLE_IIE 0x30 /* Apple //e */
191
+ #define APPLE_IIEENH 0x31 /* Apple //e (enhanced) */
192
+ #define APPLE_IIECARD 0x32 /* Apple //e Option Card */
193
+ #define APPLE_IIC 0x40 /* Apple //c */
194
+ #define APPLE_IIC35 0x41 /* Apple //c (3.5 ROM) */
195
+ #define APPLE_IICEXP 0x43 /* Apple //c (Mem. Exp.) */
196
+ #define APPLE_IICREV 0x44 /* Apple //c (Rev. Mem. Exp.) */
197
+ #define APPLE_IICPLUS 0x45 /* Apple //c Plus */
198
+ #define APPLE_IIGS 0x80 /* Apple IIgs */
199
+ #define APPLE_IIGS1 0x81 /* Apple IIgs (ROM 1) */
200
+ #define APPLE_IIGS3 0x83 /* Apple IIgs (ROM 3) */
201
+
202
+ /* Return codes for get_tv() */
203
+ #define TV_NTSC 0
204
+ #define TV_PAL 1
205
+ #define TV_OTHER 2
206
+
207
+ /* Video modes */
208
+ #define VIDEOMODE_40x24 0x15
209
+ #define VIDEOMODE_80x24 0x00
210
+ #define VIDEOMODE_40COL VIDEOMODE_40x24
211
+ #define VIDEOMODE_80COL VIDEOMODE_80x24
212
+
213
+ extern unsigned char _dos_type;
214
+ /* Valid _dos_type values:
215
+ **
216
+ ** AppleDOS 3.3 - 0x00
217
+ ** ProDOS 8 1.0.1 - 0x10
218
+ ** ProDOS 8 1.0.2 - 0x10
219
+ ** ProDOS 8 1.1.1 - 0x11
220
+ ** ProDOS 8 1.2 - 0x12
221
+ ** ProDOS 8 1.3 - 0x13
222
+ ** ProDOS 8 1.4 - 0x14
223
+ ** ProDOS 8 1.5 - 0x15
224
+ ** ProDOS 8 1.6 - 0x16
225
+ ** ProDOS 8 1.7 - 0x17
226
+ ** ProDOS 8 1.8 - 0x18
227
+ ** ProDOS 8 1.9 - 0x18 (!)
228
+ ** ProDOS 8 2.0.1 - 0x21
229
+ ** ProDOS 8 2.0.2 - 0x22
230
+ ** ProDOS 8 2.0.3 - 0x23
231
+ ** ProDOS 8 2.4.x - 0x24
232
+ */
233
+
234
+ /* struct stat.st_mode values */
235
+ #define S_IFDIR 0x01
236
+ #define S_IFREG 0x02
237
+ #define S_IFBLK 0xFF
238
+ #define S_IFCHR 0xFF
239
+ #define S_IFIFO 0xFF
240
+ #define S_IFLNK 0xFF
241
+ #define S_IFSOCK 0xFF
242
+
243
+ struct datetime {
244
+ struct {
245
+ unsigned day :5;
246
+ unsigned mon :4;
247
+ unsigned year :7;
248
+ } date;
249
+ struct {
250
+ unsigned char min;
251
+ unsigned char hour;
252
+ } time;
253
+ };
254
+
255
+
256
+
257
+ /*****************************************************************************/
258
+ /* Variables */
259
+ /*****************************************************************************/
260
+
261
+
262
+
263
+ /* The file stream implementation and the POSIX I/O functions will use the
264
+ ** following struct to set the date and time stamp on files. This specifically
265
+ ** applies to the open and fopen functions.
266
+ */
267
+ extern struct datetime _datetime;
268
+
269
+ /* The addresses of the static drivers */
270
+ #if !defined(__APPLE2ENH__)
271
+ extern void a2_auxmem_emd[];
272
+ extern void a2_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */
273
+ extern void a2_stdmou_mou[]; /* Referred to by mouse_static_stddrv[] */
274
+ extern void a2_ssc_ser[]; /* Referred to by ser_static_stddrv[] */
275
+ extern void a2_gs_ser[]; /* IIgs serial driver */
276
+ extern void a2_hi_tgi[]; /* Referred to by tgi_static_stddrv[] */
277
+ extern void a2_lo_tgi[];
278
+ #endif
279
+
280
+
281
+
282
+ /*****************************************************************************/
283
+ /* Code */
284
+ /*****************************************************************************/
285
+
286
+
287
+
288
+ void beep (void);
289
+ /* Beep beep. */
290
+
291
+ unsigned char get_tv (void);
292
+ /* Get the machine vblank frequency. Returns one of the TV_xxx codes. */
293
+
294
+ unsigned char get_ostype (void);
295
+ /* Get the machine type. Returns one of the APPLE_xxx codes. */
296
+
297
+ int __fastcall__ file_set_type(const char *pathname, unsigned char type);
298
+ /* Sets the ProDOS type for the file, returns 0 on success, sets errno on failure */
299
+
300
+ int __fastcall__ file_set_auxtype(const char *pathname, unsigned int auxtype);
301
+ /* Sets the ProDOS auxtype for the file, returns 0 on success, sets errno on failure */
302
+
303
+ void rebootafterexit (void);
304
+ /* Reboot machine after program termination has completed. */
305
+
306
+ #define ser_apple2_slot(num) ser_ioctl (0, (void*) (num))
307
+ /* Select a slot number from 1 to 7 prior to ser_open.
308
+ ** The default slot number is 2.
309
+ */
310
+
311
+ #define tgi_apple2_mix(onoff) tgi_ioctl (0, (void*) (onoff))
312
+ /* If onoff is 1, graphics/text mixed mode is enabled.
313
+ ** If onoff is 0, graphics/text mixed mode is disabled.
314
+ */
315
+
316
+ /* The following #defines will cause the matching functions calls in conio.h
317
+ ** to be overlaid by macros with the same names, saving the function call
318
+ ** overhead.
319
+ */
320
+ #define _textcolor(color) COLOR_WHITE
321
+ #define _bgcolor(color) COLOR_BLACK
322
+ #define _bordercolor(color) COLOR_BLACK
323
+ #define _cpeekcolor() COLOR_WHITE
324
+ #define _cpeekrevers() 0
325
+
326
+ struct tm* __fastcall__ gmtime_dt (const struct datetime* dt);
327
+ /* Converts a ProDOS date/time structure to a struct tm */
328
+
329
+ time_t __fastcall__ mktime_dt (const struct datetime* dt);
330
+ /* Converts a ProDOS date/time structure to a time_t UNIX timestamp */
331
+
332
+ typedef struct DIR DIR;
333
+
334
+ unsigned int __fastcall__ dir_entry_count(DIR *dir);
335
+ /* Returns the number of active files in a ProDOS directory */
336
+
337
+ #if !defined(__APPLE2ENH__)
338
+ unsigned char __fastcall__ allow_lowercase (unsigned char onoff);
339
+ /* If onoff is 0, lowercase characters printed to the screen via STDIO and
340
+ ** CONIO are forced to uppercase. If onoff is 1, lowercase characters are
341
+ ** printed to the screen untouched. By default lowercase characters are
342
+ ** forced to uppercase because a stock Apple ][+ doesn't support lowercase
343
+ ** display. The function returns the old lowercase setting.
344
+ */
345
+ #endif
346
+
347
+ signed char __fastcall__ videomode (unsigned mode);
348
+ /* Set the video mode, return the old mode, or -1 if 80-column hardware is not
349
+ ** installed. Call with one of the VIDEOMODE_xx constants.
350
+ */
351
+
352
+ void waitvsync (void);
353
+ /* Wait for start of next frame */
354
+
355
+
356
+
357
+ /* End of apple2.h */
358
+ #endif
@@ -0,0 +1,324 @@
1
+ /*****************************************************************************/
2
+ /* */
3
+ /* apple2_filetype.h */
4
+ /* */
5
+ /* Apple ][ file type definitions */
6
+ /* */
7
+ /* */
8
+ /* */
9
+ /* (C) 2017 Bill Chatfield, <bill_chatfield@yahoo.com> */
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 _APPLE2_FILETYPE_H
34
+ #define _APPLE2_FILETYPE_H
35
+
36
+
37
+
38
+ /* Check for errors */
39
+ #if !defined(__APPLE2__)
40
+ # error This module may only be used when compiling for the Apple ][!
41
+ #endif
42
+
43
+
44
+
45
+ /*****************************************************************************/
46
+ /* Data */
47
+ /*****************************************************************************/
48
+
49
+
50
+
51
+ /* ProDOS general file types */
52
+ #define PRODOS_T_UNK 0x00 /* Unknown */
53
+ #define PRODOS_T_BAD 0x01 /* Bad blocks */
54
+ #define PRODOS_T_PCD 0x02 /* Pascal code */
55
+ #define PRODOS_T_PTX 0x03 /* Pascal text */
56
+ #define PRODOS_T_TXT 0x04 /* ASCII text */
57
+ #define PRODOS_T_PDA 0x05 /* Pascal data */
58
+ #define PRODOS_T_BIN 0x06 /* Binary */
59
+ #define PRODOS_T_FNT 0x07 /* Apple III font */
60
+ #define PRODOS_T_FOT 0x08 /* Hi-res, dbl hi-res graphics */
61
+ #define PRODOS_T_BA3 0x09 /* Apple III BASIC program */
62
+ #define PRODOS_T_DA3 0x09 /* Apple III BASIC data */
63
+ #define PRODOS_T_WPF 0x0A /* Generic word processing */
64
+ #define PRODOS_T_SOS 0x0B /* SOS system */
65
+ #define PRODOS_T_DIR 0x0F /* ProDOS directory */
66
+
67
+ /* ProDOS productivity file types */
68
+ #define PRODOS_T_RPD 0x10 /* RPS data */
69
+ #define PRODOS_T_RPI 0x11 /* RPS index */
70
+ #define PRODOS_T_AFD 0x12 /* AppleFile discard */
71
+ #define PRODOS_T_AFM 0x13 /* AppleFile model */
72
+ #define PRODOS_T_AFR 0x14 /* AppleFile report */
73
+ #define PRODOS_T_SCL 0x15 /* Screen library */
74
+ #define PRODOS_T_PFS 0x16 /* PFS document */
75
+ #define PRODOS_T_ADB 0x19 /* AppleWorks database */
76
+ #define PRODOS_T_AWP 0x1A /* AppleWorks word processing */
77
+ #define PRODOS_T_ASP 0x1B /* AppleWorks spreadsheet */
78
+
79
+ /* ProDOS code file types */
80
+ #define PRODOS_T_TDM 0x20 /* Desktop Manager */
81
+ #define PRODOS_T_IPS 0x21 /* Instant Pascal source */
82
+ #define PRODOS_T_UPV 0x22 /* USCD Pascal volume */
83
+ #define PRODOS_T_3SD 0x29 /* SOS directory */
84
+ #define PRODOS_T_8SC 0x2A /* Source code */
85
+ #define PRODOS_T_8OB 0x2B /* Object code */
86
+ #define PRODOS_T_8IC 0x2C /* Interpreted code */
87
+ #define PRODOS_T_8LD 0x2D /* Language data */
88
+ #define PRODOS_T_P8C 0x2E /* ProDOS 8 code module */
89
+
90
+ /* ProDOS miscellaneous file types */
91
+ #define PRODOS_T_OCR 0x41 /* Optical char recognition */
92
+ #define PRODOS_T_FTD 0x42 /* File type definitions */
93
+
94
+ /* ProDOS Apple IIgs general file types */
95
+ #define PRODOS_T_GWP 0x50 /* Apple IIgs word processing */
96
+ #define PRODOS_T_GSS 0x51 /* Apple IIgs spreadsheet */
97
+ #define PRODOS_T_GDB 0x52 /* Apple IIgs database */
98
+ #define PRODOS_T_DRW 0x53 /* Object oriented graphics */
99
+ #define PRODOS_T_GDP 0x54 /* Apple IIgs desktop publish */
100
+ #define PRODOS_T_HMD 0x55 /* HyperMedia */
101
+ #define PRODOS_T_EDU 0x56 /* Educational program data */
102
+ #define PRODOS_T_STN 0x57 /* Stationary */
103
+ #define PRODOS_T_HLP 0x58 /* Help */
104
+ #define PRODOS_T_COM 0x59 /* Communications */
105
+ #define PRODOS_T_CFG 0x5A /* Configuration */
106
+ #define PRODOS_T_ANM 0x5B /* Animation */
107
+ #define PRODOS_T_MUM 0x5C /* Multimedia */
108
+ #define PRODOS_T_ENT 0x5D /* Entertainment */
109
+ #define PRODOS_T_DVU 0x5E /* Development utility */
110
+
111
+ /* ProDOS PC Transporter file types */
112
+ #define PRODOS_T_PRE 0x60 /* PC pre-boot */
113
+ #define PRODOS_T_BIO 0x6B /* PC BIOS */
114
+ #define PRODOS_T_NCF 0x66 /* ProDOS File Nav command file */
115
+ #define PRODOS_T_DVR 0x6D /* PC driver */
116
+ #define PRODOS_T_PRE2 0x6E /* PC pre-boot */
117
+ #define PRODOS_T_HDV 0x6F /* PC hard disk image */
118
+
119
+ /* ProDOS Kreative Software file types */
120
+ #define PRODOS_T_SN2 0x70 /* Sabine's Notebook 2.0 */
121
+ #define PRODOS_T_KMT 0x71
122
+ #define PRODOS_T_DSR 0x72
123
+ #define PRODOS_T_BAN 0x73
124
+ #define PRODOS_T_CG7 0x74
125
+ #define PRODOS_T_TNJ 0x75
126
+ #define PRODOS_T_SA7 0x76
127
+ #define PRODOS_T_KES 0x77
128
+ #define PRODOS_T_JAP 0x78
129
+ #define PRODOS_T_CSL 0x79
130
+ #define PRODOS_T_TME 0x7A
131
+ #define PRODOS_T_TLB 0x7B
132
+ #define PRODOS_T_MR7 0x7C
133
+ #define PRODOS_T_MLR 0x7D /* Mika City */
134
+ #define PRODOS_T_MMM 0x7E
135
+ #define PRODOS_T_JCP 0x7F
136
+
137
+ /* ProDOS GEOS file types */
138
+ #define PRODOS_T_GES 0x80 /* GEOS system file */
139
+ #define PRODOS_T_GEA 0x81 /* GEOS desk accessory */
140
+ #define PRODOS_T_GEO 0x82 /* GEOS application */
141
+ #define PRODOS_T_GED 0x83 /* GEOS document */
142
+ #define PRODOS_T_GEF 0x84 /* GEOS font */
143
+ #define PRODOS_T_GEP 0x85 /* GEOS printer driver */
144
+ #define PRODOS_T_GEI 0x86 /* GEOS input driver */
145
+ #define PRODOS_T_GEX 0x87 /* GEOS auxiliary driver */
146
+ #define PRODOS_T_GEV 0x89 /* GEOS swap file */
147
+ #define PRODOS_T_GEC 0x8B /* GEOS clock driver */
148
+ #define PRODOS_T_GEK 0x8C /* GEOS interface card driver */
149
+ #define PRODOS_T_GEW 0x8D /* GEOS formatting data */
150
+
151
+ /* ProDOS Apple IIgs BASIC file types */
152
+ #define PRODOS_T_WP 0xA0 /* WordPerfect */
153
+ #define PRODOS_T_GSB 0xAB /* Apple IIgs BASIC program */
154
+ #define PRODOS_T_TDF 0xAB /* Apple IIgs BASIC TDF */
155
+ #define PRODOS_T_BDF 0xAB /* Apple IIgs BASIC data */
156
+
157
+ /* ProDOS Apple IIgs system file types */
158
+ #define PRODOS_T_SRC 0xB0 /* Apple IIgs source code */
159
+ #define PRODOS_T_OBJ 0xB1 /* Apple IIgs object code */
160
+ #define PRODOS_T_LIB 0xB2 /* Apple IIgs library */
161
+ #define PRODOS_T_S16 0xB3 /* Apple IIgs application pgm */
162
+ #define PRODOS_T_RTL 0xB4 /* Apple IIgs runtime library */
163
+ #define PRODOS_T_EXE 0xB5 /* Apple IIgs shell script */
164
+ #define PRODOS_T_PIF 0xB6 /* Apple IIgs permanent init */
165
+ #define PRODOS_T_TIF 0xB7 /* Apple IIgs temporary init */
166
+ #define PRODOS_T_NDA 0xB8 /* Apple IIgs new desk accesry */
167
+ #define PRODOS_T_CDA 0xB9 /* Apple IIgs classic desk aces */
168
+ #define PRODOS_T_TOL 0xBA /* Apple IIgs tool */
169
+ #define PRODOS_T_DRV 0xBB /* Apple IIgs device driver */
170
+ #define PRODOS_T_LDF 0xBC /* Apple IIgs generic load file */
171
+ #define PRODOS_T_FST 0xBD /* Apple IIgs file sys translat */
172
+ #define PRODOS_T_DOC 0xBF /* Apple IIgs document */
173
+
174
+ /* ProDOS graphics file types */
175
+ #define PRODOS_T_PNT 0xC0 /* Apple IIgs packed sup hi-res */
176
+ #define PRODOS_T_PIC 0xC1 /* Apple IIgs super hi-res */
177
+ #define PRODOS_T_ANI 0xC2 /* PaintWorks animation */
178
+ #define PRODOS_T_PAL 0xC3 /* PaintWorks palette */
179
+ #define PRODOS_T_OOG 0xC5 /* Object-oriented graphics */
180
+ #define PRODOS_T_SCR 0xC6 /* Script */
181
+ #define PRODOS_T_CDV 0xC7 /* Apple IIgs control panel */
182
+ #define PRODOS_T_FON 0xC8 /* Apple IIgs font */
183
+ #define PRODOS_T_FND 0xC9 /* Apple IIgs Finder data */
184
+ #define PRODOS_T_ICN 0xCA /* Apple IIgs icon */
185
+
186
+ /* ProDOS audio file types */
187
+ #define PRODOS_T_MUS 0xD5 /* Music */
188
+ #define PRODOS_T_INS 0xD6 /* Instrument */
189
+ #define PRODOS_T_MID 0xD7 /* MIDI */
190
+ #define PRODOS_T_SND 0xD8 /* Apple IIgs audio */
191
+ #define PRODOS_T_DBM 0xDB /* DB master document */
192
+
193
+ /* ProDOS miscellaneous file types */
194
+ #define PRODOS_T_LBR 0xE0 /* Archive */
195
+ #define PRODOS_T_ATK 0xE2 /* AppleTalk data */
196
+ #define PRODOS_T_R16 0xEE /* EDASM 816 relocatable code */
197
+ #define PRODOS_T_PAR 0xEF /* Pascal area */
198
+
199
+ /* ProDOS system file types */
200
+ #define PRODOS_T_CMD 0xF0 /* ProDOS command file */
201
+ #define PRODOS_T_OVL 0xF1 /* User defined 1 */
202
+ #define PRODOS_T_UD2 0xF2 /* User defined 2 */
203
+ #define PRODOS_T_UD3 0xF3 /* User defined 3 */
204
+ #define PRODOS_T_UD4 0xF4 /* User defined 4 */
205
+ #define PRODOS_T_BAT 0xF5 /* User defined 5 */
206
+ #define PRODOS_T_UD6 0xF6 /* User defined 6 */
207
+ #define PRODOS_T_UD7 0xF7 /* User defined 7 */
208
+ #define PRODOS_T_PRG 0xF8 /* User defined 8 */
209
+ #define PRODOS_T_P16 0xF9 /* ProDOS-16 system file */
210
+ #define PRODOS_T_INT 0xFA /* Integer BASIC program */
211
+ #define PRODOS_T_IVR 0xFB /* Integer BASIC variables */
212
+ #define PRODOS_T_BAS 0xFC /* Applesoft BASIC program */
213
+ #define PRODOS_T_VAR 0xFD /* Applesoft BASIC variables */
214
+ #define PRODOS_T_REL 0xFE /* EDASM relocatable code */
215
+ #define PRODOS_T_SYS 0xFF /* ProDOS-8 system file */
216
+
217
+ /* The auxiliary type of a text file specifies its record length.
218
+ ** A record length of 0 indicates a sequential text file, which is
219
+ ** equivalent to text files of other operating systems like MacOS
220
+ ** or Windows, except that lines are delimited by carriage returns
221
+ ** only. An auxiliary type value greater than 0 for a text file,
222
+ ** which is the record length, indicates a random access text file
223
+ ** with fixed-length lines.
224
+ */
225
+ #define PRODOS_AUX_T_TXT_SEQ 0x0000 /* Sequential text */
226
+
227
+ /* 8IC auxiliary types */
228
+ #define PRODOS_AUX_T_8IC_APEX_PGM 0x8003 /* Apex program */
229
+
230
+ /* GWP auxiliary types */
231
+ #define PRODOS_AUX_T_GWP_TEACH 0x5445 /* Teach */
232
+ #define PRODOS_AUX_T_GWP_DELUXEWRITE 0x8001 /* DeluxeWrite */
233
+ #define PRODOS_AUX_T_GWP_APPLEWORKS_GS 0x8010 /* AppleWorks GS */
234
+
235
+ /* GSS auxiliary types */
236
+ #define PRODOS_AUX_T_GSS_APPLEWORKS_GS 0x8010 /* AppleWorks GS */
237
+
238
+ /* GDB auxiliary types */
239
+ #define PRODOS_AUX_T_GDB_APPLEWORKS_GS 0x8010 /* AppleWorks GS DB */
240
+ #define PRODOS_AUX_T_GDB_AWGS_TMPL 0x8011 /* AWGS template */
241
+ #define PRODOS_AUX_T_GDB_GSAS 0x8013
242
+
243
+ /* DRW auxiliary types */
244
+ #define PRODOS_AUX_T_DRW_OO_GRAPHICS 0x8013 /* AWGS O-O graphics */
245
+
246
+ /* GDP auxiliary types */
247
+ #define PRODOS_AUX_T_GDP_GRAPHICWRITER 0x8002 /* A2gs GraphicWriter */
248
+ #define PRODOS_AUX_T_GDP_APPLEWORKS_GS 0x8010 /* A2gs AWGS */
249
+
250
+ /* HMD auxiliary types */
251
+ #define PRODOS_AUX_T_HMD_HYPERCARD_GS 0x0001 /* HyperCard GS */
252
+ #define PRODOS_AUX_T_HMD_TUTOR_TECH 0x8001 /* Tutor-Tech */
253
+ #define PRODOS_AUX_T_HMD_HYPERSTUDIO 0x8002 /* HyperStudio */
254
+ #define PRODOS_AUX_T_HMD_NEXUS 0x8003 /* Nexus */
255
+
256
+ /* COM auxiliary types */
257
+ #define PRODOS_AUX_T_COM_APPLEWORKS_GS 0x8003 /* AppleWorks GS */
258
+
259
+ /* MLR auxiliary types */
260
+ #define PRODOS_AUX_T_MLR_SCRIPT 0x005C /* Mika City script */
261
+ #define PRODOS_AUX_T_MLR_COLOR_TABLE 0xC7AB /* Mika City color table */
262
+ #define PRODOS_AUX_T_MLR_CHARACTER_DEF 0xCDEF /* Mika City character def */
263
+
264
+ /* LDF auxiliary types */
265
+ #define PRODOS_AUX_T_LDF_NIFTY_LIST_MOD 0x4001 /* Nifty list module */
266
+ #define PRODOS_AUX_T_LDF_SUPER_INFO_MOD 0x4002 /* Super info module */
267
+ #define PRODOS_AUX_T_LDF_TWILIGHT_MOD 0x4004 /* Twilight module */
268
+ #define PRODOS_AUX_T_LDF_MARINETTI_LLM 0x4004 /* Marinetti link layer mod */
269
+
270
+ /* PNT auxiliary types */
271
+ #define PRODOS_AUX_T_PNT_PK_SUPER_HIRES 0x0001 /* Packed super hi-res */
272
+ #define PRODOS_AUX_T_PNT_APPLE_PREF 0x0002 /* Apple preferred format */
273
+ #define PRODOS_AUX_T_PNT_PK_QUICKDRAWII 0x0003 /* Packed QuickDraw II */
274
+
275
+ /* PIC auxiliary types */
276
+ #define PRODOS_AUX_T_PIC_QUICKDRAW 0x0001 /* QuickDraw image */
277
+ #define PRODOS_AUX_T_PIC_SHIRES_3200 0x0002 /* Super hi-res 3200 */
278
+
279
+ /* FON auxiliary types */
280
+ #define PRODOS_AUX_T_FON_QUICKDRAW_BIT 0x0000 /* QuickDraw bitmap font */
281
+ #define PRODOS_AUX_T_FON_POINTLESS_TT 0x0001 /* Pointless TrueType font */
282
+
283
+ /* SND auxiliary types */
284
+ #define PRODOS_AUX_T_SND_AIFF 0x0000 /* AIFF */
285
+ #define PRODOS_AUX_T_SND_AIFF_C 0x0001 /* AIFF-C */
286
+ #define PRODOS_AUX_T_SND_ASIF_INSTR 0x0002 /* ASIF instrument */
287
+ #define PRODOS_AUX_T_SND_SOUND_RSRC 0x0003 /* Sound resource */
288
+ #define PRODOS_AUX_T_SND_MIDI_SYNTH_WAV 0x0004 /* MIDI synth wave */
289
+ #define PRODOS_AUX_T_SND_HYPERSTUDIO 0x8001 /* HyperStudio sound */
290
+
291
+ /* LBR auxiliary types */
292
+ #define PRODOS_AUX_T_LBR_ALU 0x0000 /* ALU */
293
+ #define PRODOS_AUX_T_LBR_APPLE_SINGLE 0x0001 /* AppleSingle */
294
+ #define PRODOS_AUX_T_LBR_APPLEDBL_HDR 0x0002 /* AppleDouble header */
295
+ #define PRODOS_AUX_T_LBR_APPLEDBL_DATA 0x0003 /* AppleDouble data */
296
+ #define PRODOS_AUX_T_LBR_BINARY_II 0x8000 /* Binary II */
297
+ #define PRODOS_AUX_T_LBR_APPLELINK_ACU 0x8001 /* AppleLink ACU */
298
+ #define PRODOS_AUX_T_LBR_SHRINKIT 0x8002 /* ShrinkIt */
299
+
300
+ /* LBR auxiliary types */
301
+ #define PRODOS_AUX_T_ATK_EASYMNT_ALIAS 0x0000 /* EasyMount alias */
302
+
303
+ /* BAS auxiliary types */
304
+ #define PRODOS_AUX_T_BAS_PGM_LOAD_ADDR 0x0801 /* Applesoft pgm load addr */
305
+
306
+
307
+
308
+ /*****************************************************************************/
309
+ /* Variables */
310
+ /*****************************************************************************/
311
+
312
+
313
+
314
+ /* The file stream implementation and the POSIX I/O functions will use the
315
+ ** following variables to determine the file type and auxiliary type to use.
316
+ ** This applies specifically to the fopen and open functions.
317
+ */
318
+ extern unsigned char _filetype; /* Default: PRODOS_T_BIN */
319
+ extern unsigned int _auxtype; /* Default: 0 */
320
+
321
+
322
+
323
+ /* End of apple2_filetype.h */
324
+ #endif