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
package/include/c65.h ADDED
@@ -0,0 +1,120 @@
1
+ /*****************************************************************************/
2
+ /* */
3
+ /* c65.h */
4
+ /* */
5
+ /* C65 system specific definitions */
6
+ /* */
7
+ /* */
8
+ /* */
9
+ /* (C) 1998-2013, Ullrich von Bassewitz */
10
+ /* Roemerstrasse 52 */
11
+ /* D-70794 Filderstadt */
12
+ /* EMail: uz@cc65.org */
13
+ /* */
14
+ /* */
15
+ /* This software is provided 'as-is', without any expressed or implied */
16
+ /* warranty. In no event will the authors be held liable for any damages */
17
+ /* arising from the use of this software. */
18
+ /* */
19
+ /* Permission is granted to anyone to use this software for any purpose, */
20
+ /* including commercial applications, and to alter it and redistribute it */
21
+ /* freely, subject to the following restrictions: */
22
+ /* */
23
+ /* 1. The origin of this software must not be misrepresented; you must not */
24
+ /* claim that you wrote the original software. If you use this software */
25
+ /* in a product, an acknowledgment in the product documentation would be */
26
+ /* appreciated but is not required. */
27
+ /* 2. Altered source versions must be plainly marked as such, and must not */
28
+ /* be misrepresented as being the original software. */
29
+ /* 3. This notice may not be removed or altered from any source */
30
+ /* distribution. */
31
+ /* */
32
+ /*****************************************************************************/
33
+
34
+
35
+
36
+ #ifndef _C65_H
37
+ #define _C65_H
38
+
39
+
40
+
41
+ /* Check for errors */
42
+ #if !defined(__C65__)
43
+ # error This module may only be used when compiling for the MEGA65!
44
+ #endif
45
+
46
+
47
+
48
+ /* Additional key defines */
49
+ #define CH_F1 133
50
+ #define CH_F2 137
51
+ #define CH_F3 134
52
+ #define CH_F4 138
53
+ #define CH_F5 135
54
+ #define CH_F6 139
55
+ #define CH_F7 136
56
+ #define CH_F8 140
57
+
58
+ /* Color defines */
59
+ #define COLOR_BLACK 0x00
60
+ #define COLOR_WHITE 0x01
61
+ #define COLOR_RED 0x02
62
+ #define COLOR_CYAN 0x03
63
+ #define COLOR_PURPLE 0x04
64
+ #define COLOR_GREEN 0x05
65
+ #define COLOR_BLUE 0x06
66
+ #define COLOR_YELLOW 0x07
67
+ #define COLOR_ORANGE 0x08
68
+ #define COLOR_BROWN 0x09
69
+ #define COLOR_LIGHTRED 0x0A
70
+ #define COLOR_GRAY1 0x0B
71
+ #define COLOR_GRAY2 0x0C
72
+ #define COLOR_LIGHTGREEN 0x0D
73
+ #define COLOR_LIGHTBLUE 0x0E
74
+ #define COLOR_GRAY3 0x0F
75
+
76
+ /* TGI color defines */
77
+ #define TGI_COLOR_BLACK COLOR_BLACK
78
+ #define TGI_COLOR_WHITE COLOR_WHITE
79
+ #define TGI_COLOR_RED COLOR_RED
80
+ #define TGI_COLOR_CYAN COLOR_CYAN
81
+ #define TGI_COLOR_PURPLE COLOR_PURPLE
82
+ #define TGI_COLOR_GREEN COLOR_GREEN
83
+ #define TGI_COLOR_BLUE COLOR_BLUE
84
+ #define TGI_COLOR_YELLOW COLOR_YELLOW
85
+ #define TGI_COLOR_ORANGE COLOR_ORANGE
86
+ #define TGI_COLOR_BROWN COLOR_BROWN
87
+ #define TGI_COLOR_LIGHTRED COLOR_LIGHTRED
88
+ #define TGI_COLOR_GRAY1 COLOR_GRAY1
89
+ #define TGI_COLOR_GRAY2 COLOR_GRAY2
90
+ #define TGI_COLOR_LIGHTGREEN COLOR_LIGHTGREEN
91
+ #define TGI_COLOR_LIGHTBLUE COLOR_LIGHTBLUE
92
+ #define TGI_COLOR_GRAY3 COLOR_GRAY3
93
+
94
+ /* Masks for joy_read */
95
+ #define JOY_UP_MASK 0x01
96
+ #define JOY_DOWN_MASK 0x02
97
+ #define JOY_LEFT_MASK 0x04
98
+ #define JOY_RIGHT_MASK 0x08
99
+ #define JOY_BTN_1_MASK 0x10
100
+
101
+
102
+ /* Define hardware */
103
+ #include <_vic3.h>
104
+ #define VIC (*(struct __vic2*)0xD000)
105
+
106
+ #include <_sid.h>
107
+ #define SID1 (*(struct __sid*)0xD400)
108
+ #define SID2 (*(struct __sid*)0xD420)
109
+
110
+ #include <_6526.h>
111
+ #define CIA1 (*(struct __6526*)0xDC00)
112
+ #define CIA2 (*(struct __6526*)0xDD00)
113
+
114
+
115
+ /* Define special memory areas */
116
+ #define COLOR_RAM ((unsigned char*)0xD800)
117
+
118
+
119
+ /* End of c65.h */
120
+ #endif
package/include/cbm.h ADDED
@@ -0,0 +1,321 @@
1
+ /*****************************************************************************/
2
+ /* */
3
+ /* cbm.h */
4
+ /* */
5
+ /* CBM system-specific definitions */
6
+ /* */
7
+ /* */
8
+ /* */
9
+ /* (C) 1998-2015, Ullrich von Bassewitz */
10
+ /* Roemerstrasse 52 */
11
+ /* D-70794 Filderstadt */
12
+ /* EMail: uz@cc65.org */
13
+ /* */
14
+ /* */
15
+ /* This software is provided 'as-is', without any expressed or implied */
16
+ /* warranty. In no event will the authors be held liable for any damages */
17
+ /* arising from the use of this software. */
18
+ /* */
19
+ /* Permission is granted to anyone to use this software for any purpose, */
20
+ /* including commercial applications, and to alter it and redistribute it */
21
+ /* freely, subject to the following restrictions: */
22
+ /* */
23
+ /* 1. The origin of this software must not be misrepresented; you must not */
24
+ /* claim that you wrote the original software. If you use this software */
25
+ /* in a product, an acknowledgment in the product documentation would be */
26
+ /* appreciated but is not required. */
27
+ /* 2. Altered source versions must be plainly marked as such, and must not */
28
+ /* be misrepresented as being the original software. */
29
+ /* 3. This notice may not be removed or altered from any source */
30
+ /* distribution. */
31
+ /* */
32
+ /*****************************************************************************/
33
+
34
+
35
+
36
+ #ifndef _CBM_H
37
+ #define _CBM_H
38
+
39
+
40
+
41
+ /* Check for errors */
42
+ #if !defined(__CBM__)
43
+ # error This module may be used only when compiling for CBM machines!
44
+ #endif
45
+
46
+
47
+
48
+ /* We need NULL. */
49
+ #include <stddef.h>
50
+
51
+ /* Load the system-specific files here, if needed. */
52
+ #if defined(__C64__) && !defined(_C64_H)
53
+ # include <c64.h>
54
+ #elif defined(__VIC20__) && !defined(_VIC20_H)
55
+ # include <vic20.h>
56
+ #elif defined(__C128__) && !defined(_C128_H)
57
+ # include <c128.h>
58
+ #elif defined(__PLUS4__) && !defined(_PLUS4_H)
59
+ # include <plus4.h>
60
+ #elif defined(__C16__) && !defined(_C16_H)
61
+ # include <c16.h>
62
+ #elif defined(__CBM510__) && !defined(_CBM510_H)
63
+ # include <cbm510.h>
64
+ #elif defined(__CBM610__) && !defined(_CBM610_H)
65
+ # include <cbm610.h>
66
+ #elif defined(__PET__) && !defined(_PET_H)
67
+ # include <pet.h>
68
+ #elif defined(__CX16__) && !defined(_CX16_H)
69
+ # include <cx16.h>
70
+ #elif defined(__C65__) && !defined(_C65_H)
71
+ # include <c65.h>
72
+ #elif defined(__MEGA65__) && !defined(_MEGA65_H)
73
+ # include <mega65.h>
74
+ #endif
75
+
76
+ /* Include definitions for CBM file types */
77
+ #include <cbm_filetype.h>
78
+
79
+
80
+
81
+ #define JOY_FIRE_MASK JOY_BTN_1_MASK
82
+ #define JOY_FIRE(v) ((v) & JOY_FIRE_MASK)
83
+
84
+
85
+
86
+ /*****************************************************************************/
87
+ /* Variables */
88
+ /*****************************************************************************/
89
+
90
+
91
+
92
+ /* The file stream implementation and the POSIX I/O functions will
93
+ ** use the following variable to determine the file type to use.
94
+ */
95
+ extern char _filetype; /* Defaults to 's' */
96
+
97
+
98
+
99
+ /*****************************************************************************/
100
+ /* Character-codes (CBM charset) */
101
+ /*****************************************************************************/
102
+
103
+
104
+
105
+ #define CH_HLINE 192
106
+ #define CH_VLINE 221
107
+ #define CH_ULCORNER 176
108
+ #define CH_URCORNER 174
109
+ #define CH_LLCORNER 173
110
+ #define CH_LRCORNER 189
111
+ #define CH_TTEE 178
112
+ #define CH_BTEE 177
113
+ #define CH_LTEE 171
114
+ #define CH_RTEE 179
115
+ #define CH_CROSS 219
116
+ #define CH_CURS_UP 145
117
+ #define CH_CURS_DOWN 17
118
+ #define CH_CURS_LEFT 157
119
+ #define CH_CURS_RIGHT 29
120
+ #define CH_PI 222
121
+ #define CH_HOME 19
122
+ #define CH_DEL 20
123
+ #define CH_INS 148
124
+ #define CH_ENTER 13
125
+ #define CH_STOP 3
126
+ #define CH_LIRA 92
127
+ #define CH_ESC 27
128
+ #define CH_FONT_LOWER 14
129
+ #define CH_FONT_UPPER 142
130
+
131
+
132
+
133
+ /*****************************************************************************/
134
+ /* Definitions for directory reading functions */
135
+ /*****************************************************************************/
136
+
137
+
138
+
139
+ /* CBM FILE ACCESS */
140
+ #define CBM_A_RO 1 /* Read only */
141
+ #define CBM_A_WO 2 /* Write only */
142
+ #define CBM_A_RW 3 /* Read, Write */
143
+
144
+ struct cbm_dirent {
145
+ char name[17]; /* File name in PetSCII, limited to 16 chars */
146
+ unsigned int size; /* Size, in 254-/256-byte blocks */
147
+ unsigned char type;
148
+ unsigned char access;
149
+ };
150
+
151
+
152
+
153
+ /*****************************************************************************/
154
+ /* Machine info */
155
+ /*****************************************************************************/
156
+
157
+
158
+
159
+ #define TV_NTSC 0
160
+ #define TV_PAL 1
161
+ #define TV_OTHER 2
162
+
163
+ unsigned char get_tv (void);
164
+ /* Return the video mode the machine is using. */
165
+
166
+ #define KBREPEAT_CURSOR 0x00
167
+ #define KBREPEAT_NONE 0x40
168
+ #define KBREPEAT_ALL 0x80
169
+
170
+ unsigned char __fastcall__ kbrepeat (unsigned char mode);
171
+ /* Changes which keys have automatic repeat. */
172
+
173
+ #if !defined(__CBM610__)
174
+ void waitvsync (void);
175
+ /* Wait for the start of the next video field. */
176
+ #endif
177
+
178
+ /*****************************************************************************/
179
+ /* CBM kernal functions */
180
+ /*****************************************************************************/
181
+
182
+
183
+
184
+ /* Constants to use with cbm_open() for openning a file for reading or
185
+ ** writing without the need to append ",r" or ",w" to the filename.
186
+ **
187
+ ** e.g., cbm_open(2, 8, CBM_READ, "0:data,s");
188
+ */
189
+ #define CBM_READ 0 /* default is ",p" */
190
+ #define CBM_WRITE 1 /* ditto */
191
+ #define CBM_SEQ 2 /* default is ",r" -- or ",s" when writing */
192
+
193
+ /* Kernal-level functions */
194
+ unsigned char cbm_k_acptr (void);
195
+ unsigned char cbm_k_basin (void);
196
+ void __fastcall__ cbm_k_bsout (unsigned char C);
197
+ unsigned char __fastcall__ cbm_k_chkin (unsigned char FN);
198
+ unsigned char cbm_k_chrin (void);
199
+ void __fastcall__ cbm_k_chrout (unsigned char C);
200
+ void __fastcall__ cbm_k_ciout (unsigned char C);
201
+ unsigned char __fastcall__ cbm_k_ckout (unsigned char FN);
202
+ void cbm_k_clall (void);
203
+ void __fastcall__ cbm_k_close (unsigned char FN);
204
+ void cbm_k_clrch (void);
205
+ unsigned char cbm_k_getin (void);
206
+ unsigned cbm_k_iobase (void);
207
+ void __fastcall__ cbm_k_listen (unsigned char dev);
208
+ unsigned int __fastcall__ cbm_k_load(unsigned char flag, unsigned addr);
209
+ unsigned char cbm_k_open (void);
210
+ unsigned char cbm_k_readst (void);
211
+ unsigned char __fastcall__ cbm_k_save(unsigned int start, unsigned int end);
212
+ void cbm_k_scnkey (void);
213
+ void __fastcall__ cbm_k_second (unsigned char addr);
214
+ void __fastcall__ cbm_k_setlfs (unsigned char LFN, unsigned char DEV,
215
+ unsigned char SA);
216
+ void __fastcall__ cbm_k_setnam (const char* Name);
217
+ void __fastcall__ cbm_k_settim (unsigned long timer);
218
+ void __fastcall__ cbm_k_talk (unsigned char dev);
219
+ void __fastcall__ cbm_k_tksa (unsigned char addr);
220
+ void cbm_k_udtim (void);
221
+ void cbm_k_unlsn (void);
222
+ void cbm_k_untlk (void);
223
+
224
+
225
+
226
+ /*****************************************************************************/
227
+ /* BASIC-like file I/O functions */
228
+ /*****************************************************************************/
229
+
230
+
231
+
232
+ /* The cbm_* I/O functions below set __oserror (see errno.h),
233
+ ** in case of an error.
234
+ **
235
+ ** error-code BASIC error
236
+ ** ---------- -----------
237
+ ** 1 = too many files
238
+ ** 2 = file open
239
+ ** 3 = file not open
240
+ ** 4 = file not found
241
+ ** 5 = device not present
242
+ ** 6 = not input-file
243
+ ** 7 = not output-file
244
+ ** 8 = missing file-name
245
+ ** 9 = illegal device-number
246
+ **
247
+ ** 10 = STOP-key pushed
248
+ ** 11 = general I/O-error
249
+ */
250
+
251
+
252
+
253
+ unsigned int __fastcall__ cbm_load (const char* name, unsigned char device, void* data);
254
+ /* Loads file "name", from given device, to given address -- or, to the load
255
+ ** address of the file if "data" is the null pointer (like load"name",8,1
256
+ ** in BASIC).
257
+ ** Returns number of bytes that were loaded if loading was successful;
258
+ ** otherwise 0, "__oserror" contains an error-code, then (see table above).
259
+ */
260
+
261
+ unsigned char __fastcall__ cbm_save (const char* name, unsigned char device,
262
+ const void* addr, unsigned int size);
263
+ /* Saves "size" bytes, starting at "addr", to a file.
264
+ ** Returns 0 if saving was successful, otherwise an error-code (see table
265
+ ** above).
266
+ */
267
+
268
+ unsigned char __fastcall__ cbm_open (unsigned char lfn, unsigned char device,
269
+ unsigned char sec_addr, const char* name);
270
+ /* Opens a file. Works just like the BASIC command.
271
+ ** Returns 0 if openning was successful, otherwise an error-code (see table
272
+ ** above).
273
+ */
274
+
275
+ void __fastcall__ cbm_close (unsigned char lfn);
276
+ /* Closes a file */
277
+
278
+ int __fastcall__ cbm_read (unsigned char lfn, void* buffer, unsigned int size);
279
+ /* Reads up to "size" bytes from a file into "buffer".
280
+ ** Returns the number of actually-read bytes, 0 if there are no bytes left.
281
+ ** -1 in case of an error; then, __oserror contains an error-code (see table
282
+ ** above). (Remember: 0 means end-of-file; -1 means error.)
283
+ */
284
+
285
+ int __fastcall__ cbm_write (unsigned char lfn, const void* buffer,
286
+ unsigned int size);
287
+ /* Writes up to "size" bytes from "buffer" to a file.
288
+ ** Returns the number of actually-written bytes, or -1 in case of an error;
289
+ ** __oserror contains an error-code, then (see above table).
290
+ */
291
+
292
+ unsigned char cbm_opendir (unsigned char lfn, unsigned char device, ...);
293
+ /* Opens directory listing. Returns 0 if opening directory was successful;
294
+ ** otherwise, an error-code corresponding to cbm_open(). As an optional
295
+ ** argument, the name of the directory may be passed to the function. If
296
+ ** no explicit name is specified, "$" is used.
297
+ */
298
+
299
+ unsigned char __fastcall__ cbm_readdir (unsigned char lfn,
300
+ struct cbm_dirent* l_dirent);
301
+ /* Reads one directory line into cbm_dirent structure.
302
+ ** Returns 0 if reading directory-line was successful.
303
+ ** Returns non-zero if reading directory failed, or no more file-names to read.
304
+ ** Returns 2 on last line. Then, l_dirent->size = the number of "blocks free",
305
+ ** "blocks used", or "mb free". Return codes:
306
+ ** 0 = read file-name
307
+ ** 1 = couldn't read directory
308
+ ** 2 = read "blocks free", "blocks used", or "mb free"
309
+ ** 3 = couldn't find start of file-name
310
+ ** 4 = couldn't find end of file-name
311
+ ** 5 = couldn't read file-type
312
+ ** 6 = premature end of file
313
+ */
314
+
315
+ void __fastcall__ cbm_closedir (unsigned char lfn);
316
+ /* Closes directory by cbm_close(lfn) */
317
+
318
+
319
+
320
+ /* End of cbm.h */
321
+ #endif
@@ -0,0 +1,165 @@
1
+ /*****************************************************************************/
2
+ /* */
3
+ /* cbm264.h */
4
+ /* */
5
+ /* System specific definitions for the C16, C116 and Plus/4 */
6
+ /* */
7
+ /* */
8
+ /* */
9
+ /* (C) 1998-2003 Ullrich von Bassewitz */
10
+ /* Roemerstrasse 52 */
11
+ /* D-70794 Filderstadt */
12
+ /* EMail: uz@cc65.org */
13
+ /* */
14
+ /* */
15
+ /* This software is provided 'as-is', without any expressed or implied */
16
+ /* warranty. In no event will the authors be held liable for any damages */
17
+ /* arising from the use of this software. */
18
+ /* */
19
+ /* Permission is granted to anyone to use this software for any purpose, */
20
+ /* including commercial applications, and to alter it and redistribute it */
21
+ /* freely, subject to the following restrictions: */
22
+ /* */
23
+ /* 1. The origin of this software must not be misrepresented; you must not */
24
+ /* claim that you wrote the original software. If you use this software */
25
+ /* in a product, an acknowledgment in the product documentation would be */
26
+ /* appreciated but is not required. */
27
+ /* 2. Altered source versions must be plainly marked as such, and must not */
28
+ /* be misrepresented as being the original software. */
29
+ /* 3. This notice may not be removed or altered from any source */
30
+ /* distribution. */
31
+ /* */
32
+ /*****************************************************************************/
33
+
34
+
35
+
36
+ #ifndef _CBM264_H
37
+ #define _CBM264_H
38
+
39
+
40
+
41
+ /* Check for errors */
42
+ #if !defined(__C16__)
43
+ # error This module may only be used when compiling for the Plus/4 or C16!
44
+ #endif
45
+
46
+
47
+
48
+ /*****************************************************************************/
49
+ /* Data */
50
+ /*****************************************************************************/
51
+
52
+
53
+
54
+ /* Additional key defines */
55
+ #define CH_F1 133
56
+ #define CH_F2 137
57
+ #define CH_F3 134
58
+ #define CH_F4 138
59
+ #define CH_F5 135
60
+ #define CH_F6 139
61
+ #define CH_F7 136
62
+ #define CH_F8 140
63
+
64
+
65
+
66
+ /* Color attributes */
67
+ #define CATTR_LUMA0 0x00
68
+ #define CATTR_LUMA1 0x10
69
+ #define CATTR_LUMA2 0x20
70
+ #define CATTR_LUMA3 0x30
71
+ #define CATTR_LUMA4 0x40
72
+ #define CATTR_LUMA5 0x50
73
+ #define CATTR_LUMA6 0x60
74
+ #define CATTR_LUMA7 0x70
75
+ #define CATTR_BLINK 0x80
76
+
77
+ /* Base colors */
78
+ #define BCOLOR_BLACK 0x00
79
+ #define BCOLOR_WHITE 0x01
80
+ #define BCOLOR_RED 0x02
81
+ #define BCOLOR_CYAN 0x03
82
+ #define BCOLOR_PURPLE 0x04
83
+ #define BCOLOR_GREEN 0x05
84
+ #define BCOLOR_BLUE 0x06
85
+ #define BCOLOR_YELLOW 0x07
86
+ #define BCOLOR_ORANGE 0x08
87
+ #define BCOLOR_BROWN 0x09
88
+ #define BCOLOR_LEMON 0x0A /* What's that color? */
89
+ #define BCOLOR_LIGHTVIOLET 0x0B
90
+ #define BCOLOR_BLUEGREEN 0x0C
91
+ #define BCOLOR_LIGHTBLUE 0x0D
92
+ #define BCOLOR_DARKBLUE 0x0E
93
+ #define BCOLOR_LIGHTGREEN 0x0F
94
+
95
+ /* Now try to mix up a C64/C128 compatible palette */
96
+ #define COLOR_BLACK (BCOLOR_BLACK)
97
+ #define COLOR_WHITE (BCOLOR_WHITE | CATTR_LUMA7)
98
+ #define COLOR_RED (BCOLOR_RED | CATTR_LUMA4)
99
+ #define COLOR_CYAN (BCOLOR_CYAN | CATTR_LUMA7)
100
+ #define COLOR_PURPLE (BCOLOR_LIGHTVIOLET | CATTR_LUMA7)
101
+ #define COLOR_GREEN (BCOLOR_GREEN | CATTR_LUMA7)
102
+ #define COLOR_BLUE (BCOLOR_BLUE | CATTR_LUMA7)
103
+ #define COLOR_YELLOW (BCOLOR_YELLOW | CATTR_LUMA7)
104
+ #define COLOR_ORANGE (BCOLOR_ORANGE | CATTR_LUMA7)
105
+ #define COLOR_BROWN (BCOLOR_BROWN | CATTR_LUMA7)
106
+ #define COLOR_LIGHTRED (BCOLOR_RED | CATTR_LUMA7)
107
+ #define COLOR_GRAY1 (BCOLOR_WHITE | CATTR_LUMA1)
108
+ #define COLOR_GRAY2 (BCOLOR_WHITE | CATTR_LUMA3)
109
+ #define COLOR_LIGHTGREEN (BCOLOR_LIGHTGREEN | CATTR_LUMA7)
110
+ #define COLOR_LIGHTBLUE (BCOLOR_LIGHTBLUE | CATTR_LUMA7)
111
+ #define COLOR_GRAY3 (BCOLOR_WHITE | CATTR_LUMA5)
112
+
113
+ /* TGI color defines */
114
+ #define TGI_COLOR_BLACK (BCOLOR_BLACK)
115
+ #define TGI_COLOR_WHITE (BCOLOR_WHITE | CATTR_LUMA7)
116
+ #define TGI_COLOR_RED (BCOLOR_RED | CATTR_LUMA4)
117
+ #define TGI_COLOR_CYAN (BCOLOR_CYAN | CATTR_LUMA7)
118
+ #define TGI_COLOR_PURPLE (BCOLOR_LIGHTVIOLET | CATTR_LUMA7)
119
+ #define TGI_COLOR_GREEN (BCOLOR_GREEN | CATTR_LUMA7)
120
+ #define TGI_COLOR_BLUE (BCOLOR_BLUE | CATTR_LUMA7)
121
+ #define TGI_COLOR_YELLOW (BCOLOR_YELLOW | CATTR_LUMA7)
122
+ #define TGI_COLOR_ORANGE (BCOLOR_ORANGE | CATTR_LUMA7)
123
+ #define TGI_COLOR_BROWN (BCOLOR_BROWN | CATTR_LUMA7)
124
+ #define TGI_COLOR_LIGHTRED (BCOLOR_RED | CATTR_LUMA7)
125
+ #define TGI_COLOR_GRAY1 (BCOLOR_WHITE | CATTR_LUMA1)
126
+ #define TGI_COLOR_GRAY2 (BCOLOR_WHITE | CATTR_LUMA3)
127
+ #define TGI_COLOR_LIGHTGREEN (BCOLOR_LIGHTGREEN | CATTR_LUMA7)
128
+ #define TGI_COLOR_LIGHTBLUE (BCOLOR_LIGHTBLUE | CATTR_LUMA7)
129
+ #define TGI_COLOR_GRAY3 (BCOLOR_WHITE | CATTR_LUMA5)
130
+
131
+ /* Masks for joy_read */
132
+ #define JOY_UP_MASK 0x01
133
+ #define JOY_DOWN_MASK 0x02
134
+ #define JOY_LEFT_MASK 0x04
135
+ #define JOY_RIGHT_MASK 0x08
136
+ #define JOY_BTN_1_MASK 0x80
137
+
138
+
139
+
140
+ /* Define hardware */
141
+ #include <_ted.h>
142
+ #define TED (*(struct __ted*)0xFF00)
143
+
144
+ /* Define special memory areas */
145
+ #define COLOR_RAM ((unsigned char*)0x0800)
146
+
147
+
148
+
149
+ /*****************************************************************************/
150
+ /* Code */
151
+ /*****************************************************************************/
152
+
153
+ void fast (void);
154
+ /* Switch the CPU into double-clock mode. */
155
+
156
+ void slow (void);
157
+ /* Switch the CPU into single-clock mode. */
158
+
159
+ unsigned char isfast (void);
160
+ /* Returns 1 if the CPU is in double-clock mode. */
161
+
162
+
163
+
164
+ /* End of cbm264.h */
165
+ #endif