fcdev-cc65 0.0.0-stage → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +17 -0
- package/asminc/_file.inc +27 -0
- package/asminc/_heap.inc +35 -0
- package/asminc/accelerator.inc +80 -0
- package/asminc/agat.inc +39 -0
- package/asminc/apple2.inc +95 -0
- package/asminc/apple2.mac +54 -0
- package/asminc/ascii_charmap.inc +287 -0
- package/asminc/atari.inc +1169 -0
- package/asminc/atari.mac +65 -0
- package/asminc/atari2600.inc +7 -0
- package/asminc/atari2600_riot.inc +20 -0
- package/asminc/atari2600_tia.inc +69 -0
- package/asminc/atari5200.inc +133 -0
- package/asminc/atari7800.inc +14 -0
- package/asminc/atari7800_maria.inc +39 -0
- package/asminc/atari7800_riot.inc +20 -0
- package/asminc/atari7800_tia.inc +69 -0
- package/asminc/atari_antic.inc +95 -0
- package/asminc/atari_atascii_charmap.inc +301 -0
- package/asminc/atari_gtia.inc +119 -0
- package/asminc/atari_pokey.inc +43 -0
- package/asminc/atari_screen_charmap.inc +303 -0
- package/asminc/atmos.inc +117 -0
- package/asminc/c128.inc +224 -0
- package/asminc/c16.inc +9 -0
- package/asminc/c64.inc +219 -0
- package/asminc/c65.inc +239 -0
- package/asminc/cbm.mac +56 -0
- package/asminc/cbm510.inc +200 -0
- package/asminc/cbm610.inc +121 -0
- package/asminc/cbm_filetype.inc +34 -0
- package/asminc/cbm_kernal.inc +248 -0
- package/asminc/cbm_petscii_charmap.inc +291 -0
- package/asminc/cbm_screen_charmap.inc +305 -0
- package/asminc/cpu.mac +4 -0
- package/asminc/creativision.inc +66 -0
- package/asminc/ctype.inc +31 -0
- package/asminc/ctype_common.inc +91 -0
- package/asminc/ctypetable.inc +48 -0
- package/asminc/cx16.inc +574 -0
- package/asminc/em-error.inc +49 -0
- package/asminc/em-kernel.inc +106 -0
- package/asminc/errno.inc +37 -0
- package/asminc/fcntl.inc +21 -0
- package/asminc/gamate.inc +64 -0
- package/asminc/generic.mac +53 -0
- package/asminc/get_tv.inc +22 -0
- package/asminc/joy-error.inc +44 -0
- package/asminc/joy-kernel.inc +83 -0
- package/asminc/kim1.inc +31 -0
- package/asminc/longbranch.mac +88 -0
- package/asminc/lynx.inc +460 -0
- package/asminc/mega65.inc +239 -0
- package/asminc/modload.inc +78 -0
- package/asminc/module.mac +13 -0
- package/asminc/mouse-kernel.inc +184 -0
- package/asminc/nes.inc +93 -0
- package/asminc/o65.inc +150 -0
- package/asminc/opcodes.inc +514 -0
- package/asminc/pce.inc +93 -0
- package/asminc/pet.inc +100 -0
- package/asminc/plus4.inc +86 -0
- package/asminc/rp6502.inc +98 -0
- package/asminc/ser-error.inc +55 -0
- package/asminc/ser-kernel.inc +162 -0
- package/asminc/signal.inc +57 -0
- package/asminc/sim65.inc +75 -0
- package/asminc/smc.inc +267 -0
- package/asminc/stat.inc +64 -0
- package/asminc/statvfs.inc +46 -0
- package/asminc/stdio.inc +74 -0
- package/asminc/supervision.inc +75 -0
- package/asminc/sym1.inc +186 -0
- package/asminc/telestrat.inc +546 -0
- package/asminc/tgi-error.inc +52 -0
- package/asminc/tgi-kernel.inc +233 -0
- package/asminc/tgi-vectorfont.inc +70 -0
- package/asminc/time.inc +74 -0
- package/asminc/utsname.inc +46 -0
- package/asminc/vic20.inc +119 -0
- package/asminc/zeropage.inc +40 -0
- package/bin/ar65.exe +0 -0
- package/bin/ca65.exe +0 -0
- package/bin/cc65.exe +0 -0
- package/bin/da65.exe +0 -0
- package/bin/ld65.exe +0 -0
- package/cfg/module.cfg +21 -0
- package/cfg/nes.cfg +62 -0
- package/cfg/none.cfg +37 -0
- package/include/6502.h +140 -0
- package/include/_6522.h +68 -0
- package/include/_6525.h +62 -0
- package/include/_6526.h +71 -0
- package/include/_6545.h +53 -0
- package/include/_6551.h +55 -0
- package/include/_antic.h +254 -0
- package/include/_atari5200os.h +94 -0
- package/include/_atarios.h +661 -0
- package/include/_gtia.h +281 -0
- package/include/_heap.h +60 -0
- package/include/_maria.h +63 -0
- package/include/_mikey.h +264 -0
- package/include/_pbi.h +63 -0
- package/include/_pia.h +52 -0
- package/include/_pokey.h +220 -0
- package/include/_riot.h +26 -0
- package/include/_sid.h +68 -0
- package/include/_suzy.h +336 -0
- package/include/_ted.h +86 -0
- package/include/_tia.h +100 -0
- package/include/_vdc.h +53 -0
- package/include/_vic.h +67 -0
- package/include/_vic2.h +192 -0
- package/include/_vic3.h +188 -0
- package/include/accelerator.h +339 -0
- package/include/agat.h +76 -0
- package/include/apple2.h +358 -0
- package/include/apple2_filetype.h +324 -0
- package/include/apple2enh.h +67 -0
- package/include/arpa/inet.h +81 -0
- package/include/ascii_charmap.h +295 -0
- package/include/assert.h +59 -0
- package/include/atari.h +554 -0
- package/include/atari2600.h +32 -0
- package/include/atari5200.h +100 -0
- package/include/atari7800.h +67 -0
- package/include/atari_atascii_charmap.h +304 -0
- package/include/atari_screen_charmap.h +310 -0
- package/include/atmos.h +189 -0
- package/include/c128.h +175 -0
- package/include/c16.h +60 -0
- package/include/c64.h +175 -0
- package/include/c65.h +120 -0
- package/include/cbm.h +321 -0
- package/include/cbm264.h +165 -0
- package/include/cbm510.h +168 -0
- package/include/cbm610.h +153 -0
- package/include/cbm_filetype.h +108 -0
- package/include/cbm_petscii_charmap.h +297 -0
- package/include/cbm_screen_charmap.h +311 -0
- package/include/cc65.h +109 -0
- package/include/conio.h +248 -0
- package/include/creativision.h +78 -0
- package/include/ctype.h +88 -0
- package/include/cx16.h +420 -0
- package/include/dbg.h +124 -0
- package/include/device.h +72 -0
- package/include/dio.h +113 -0
- package/include/dirent.h +151 -0
- package/include/em/em-kernel.h +77 -0
- package/include/em.h +135 -0
- package/include/errno.h +135 -0
- package/include/fcntl.h +75 -0
- package/include/gamate.h +209 -0
- package/include/geos/gconst.h +69 -0
- package/include/geos/gdisk.h +79 -0
- package/include/geos/gdlgbox.h +110 -0
- package/include/geos/gfile.h +72 -0
- package/include/geos/ggraph.h +180 -0
- package/include/geos/gmemory.h +30 -0
- package/include/geos/gmenu.h +53 -0
- package/include/geos/gprocess.h +22 -0
- package/include/geos/gsprite.h +96 -0
- package/include/geos/gstruct.h +174 -0
- package/include/geos/gsym.h +340 -0
- package/include/geos/gsys.h +54 -0
- package/include/geos.h +109 -0
- package/include/inttypes.h +237 -0
- package/include/iso646.h +60 -0
- package/include/joystick/joy-kernel.h +84 -0
- package/include/joystick.h +109 -0
- package/include/kim1.h +73 -0
- package/include/limits.h +87 -0
- package/include/locale.h +83 -0
- package/include/lynx.h +144 -0
- package/include/lz4.h +43 -0
- package/include/lzsa.h +56 -0
- package/include/mega65.h +120 -0
- package/include/modload.h +103 -0
- package/include/mouse/mouse-kernel.h +67 -0
- package/include/mouse.h +220 -0
- package/include/nes.h +203 -0
- package/include/o65.h +178 -0
- package/include/osic1p.h +66 -0
- package/include/pce.h +110 -0
- package/include/peekpoke.h +58 -0
- package/include/pen.h +78 -0
- package/include/pet.h +113 -0
- package/include/plus4.h +63 -0
- package/include/rp6502.h +266 -0
- package/include/serial.h +180 -0
- package/include/setjmp.h +55 -0
- package/include/signal.h +74 -0
- package/include/sim65.h +136 -0
- package/include/stdarg.h +57 -0
- package/include/stdbool.h +53 -0
- package/include/stddef.h +66 -0
- package/include/stdint.h +144 -0
- package/include/stdio.h +166 -0
- package/include/stdlib.h +174 -0
- package/include/string.h +106 -0
- package/include/supervision.h +137 -0
- package/include/sym1.h +165 -0
- package/include/sys/stat.h +94 -0
- package/include/sys/statvfs.h +74 -0
- package/include/sys/types.h +102 -0
- package/include/sys/utsname.h +97 -0
- package/include/target.h +77 -0
- package/include/telestrat.h +129 -0
- package/include/tgi/tgi-error.h +64 -0
- package/include/tgi/tgi-kernel.h +75 -0
- package/include/tgi/tgi-vectorfont.h +90 -0
- package/include/tgi.h +286 -0
- package/include/time.h +143 -0
- package/include/unistd.h +103 -0
- package/include/vic20.h +141 -0
- package/include/zlib.h +175 -0
- package/include/zx02.h +44 -0
- package/lib/nes.lib +0 -0
- package/lib/none.lib +0 -0
- package/manifest.json +227 -0
- package/package.json +19 -4
- package/README.md +0 -3
package/include/cx16.h
ADDED
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* cx16.h */
|
|
4
|
+
/* */
|
|
5
|
+
/* CX16 system-specific definitions */
|
|
6
|
+
/* For prerelease 43 */
|
|
7
|
+
/* */
|
|
8
|
+
/* */
|
|
9
|
+
/* This software is provided "as-is", without any expressed or implied */
|
|
10
|
+
/* warranty. In no event will the authors be held liable for any damages */
|
|
11
|
+
/* arising from the use of this software. */
|
|
12
|
+
/* */
|
|
13
|
+
/* Permission is granted to anyone to use this software for any purpose, */
|
|
14
|
+
/* including commercial applications, and to alter it and redistribute it */
|
|
15
|
+
/* freely, subject to the following restrictions: */
|
|
16
|
+
/* */
|
|
17
|
+
/* 1. The origin of this software must not be misrepresented; you must not */
|
|
18
|
+
/* claim that you wrote the original software. If you use this software */
|
|
19
|
+
/* in a product, an acknowledgment in the product documentation would be */
|
|
20
|
+
/* appreciated, but is not required. */
|
|
21
|
+
/* 2. Altered source versions must be plainly marked as such, and must not */
|
|
22
|
+
/* be misrepresented as being the original software. */
|
|
23
|
+
/* 3. This notice may not be removed or altered from any source */
|
|
24
|
+
/* distribution. */
|
|
25
|
+
/* */
|
|
26
|
+
/*****************************************************************************/
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
#ifndef _CX16_H
|
|
31
|
+
#define _CX16_H
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
/* Check for errors */
|
|
36
|
+
#ifndef __CX16__
|
|
37
|
+
# error This module may be used only when compiling for the CX16!
|
|
38
|
+
#endif
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
/*****************************************************************************/
|
|
43
|
+
/* Data */
|
|
44
|
+
/*****************************************************************************/
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
/* Additional output character codes */
|
|
49
|
+
#define CH_COLOR_SWAP 0x01
|
|
50
|
+
#define CH_UNDERLINE 0x04
|
|
51
|
+
#define CH_WHITE 0x05
|
|
52
|
+
#define CH_BOLD 0x06
|
|
53
|
+
#define CH_BACKSPACE 0x08
|
|
54
|
+
#define CH_ITALIC 0x0B
|
|
55
|
+
#define CH_OUTLINE 0x0C
|
|
56
|
+
#define CH_FONT_ISO 0x0F
|
|
57
|
+
#define CH_RED 0x1C
|
|
58
|
+
#define CH_GREEN 0x1E
|
|
59
|
+
#define CH_BLUE 0x1F
|
|
60
|
+
#define CH_ORANGE 0x81
|
|
61
|
+
#define CH_FONT_PET 0x8F
|
|
62
|
+
#define CH_BLACK 0x90
|
|
63
|
+
#define CH_ATTR_CLEAR 0x92
|
|
64
|
+
#define CH_BROWN 0x95
|
|
65
|
+
#define CH_PINK 0x96
|
|
66
|
+
#define CH_LIGHTRED CH_PINK
|
|
67
|
+
#define CH_GRAY1 0x97
|
|
68
|
+
#define CH_GRAY2 0x98
|
|
69
|
+
#define CH_LIGHTGREEN 0x99
|
|
70
|
+
#define CH_LIGHTBLUE 0x9A
|
|
71
|
+
#define CH_GRAY3 0x9B
|
|
72
|
+
#define CH_PURPLE 0x9C
|
|
73
|
+
#define CH_YELLOW 0x9E
|
|
74
|
+
#define CH_CYAN 0x9F
|
|
75
|
+
#define CH_SHIFT_SPACE 0xA0
|
|
76
|
+
|
|
77
|
+
/* Additional key defines */
|
|
78
|
+
#define CH_SHIFT_TAB 0x18
|
|
79
|
+
#define CH_HELP 0x84
|
|
80
|
+
#define CH_F1 0x85
|
|
81
|
+
#define CH_F2 0x89
|
|
82
|
+
#define CH_F3 0x86
|
|
83
|
+
#define CH_F4 0x8A
|
|
84
|
+
#define CH_F5 0x87
|
|
85
|
+
#define CH_F6 0x8B
|
|
86
|
+
#define CH_F7 0x88
|
|
87
|
+
#define CH_F8 0x8C
|
|
88
|
+
#define CH_F9 0x10
|
|
89
|
+
#define CH_F10 0x15
|
|
90
|
+
#define CH_F11 0x16
|
|
91
|
+
#define CH_F12 0x17
|
|
92
|
+
|
|
93
|
+
/* Color defines */
|
|
94
|
+
#define COLOR_BLACK 0x00
|
|
95
|
+
#define COLOR_WHITE 0x01
|
|
96
|
+
#define COLOR_RED 0x02
|
|
97
|
+
#define COLOR_CYAN 0x03
|
|
98
|
+
#define COLOR_PURPLE 0x04
|
|
99
|
+
#define COLOR_GREEN 0x05
|
|
100
|
+
#define COLOR_BLUE 0x06
|
|
101
|
+
#define COLOR_YELLOW 0x07
|
|
102
|
+
#define COLOR_ORANGE 0x08
|
|
103
|
+
#define COLOR_BROWN 0x09
|
|
104
|
+
#define COLOR_PINK 0x0A
|
|
105
|
+
#define COLOR_LIGHTRED COLOR_PINK
|
|
106
|
+
#define COLOR_GRAY1 0x0B
|
|
107
|
+
#define COLOR_GRAY2 0x0C
|
|
108
|
+
#define COLOR_LIGHTGREEN 0x0D
|
|
109
|
+
#define COLOR_LIGHTBLUE 0x0E
|
|
110
|
+
#define COLOR_GRAY3 0x0F
|
|
111
|
+
|
|
112
|
+
/* TGI color defines */
|
|
113
|
+
#define TGI_COLOR_BLACK COLOR_BLACK
|
|
114
|
+
#define TGI_COLOR_WHITE COLOR_WHITE
|
|
115
|
+
#define TGI_COLOR_RED COLOR_RED
|
|
116
|
+
#define TGI_COLOR_CYAN COLOR_CYAN
|
|
117
|
+
#define TGI_COLOR_PURPLE COLOR_PURPLE
|
|
118
|
+
#define TGI_COLOR_GREEN COLOR_GREEN
|
|
119
|
+
#define TGI_COLOR_BLUE COLOR_BLUE
|
|
120
|
+
#define TGI_COLOR_YELLOW COLOR_YELLOW
|
|
121
|
+
#define TGI_COLOR_ORANGE COLOR_ORANGE
|
|
122
|
+
#define TGI_COLOR_BROWN COLOR_BROWN
|
|
123
|
+
#define TGI_COLOR_LIGHTRED COLOR_LIGHTRED
|
|
124
|
+
#define TGI_COLOR_GRAY1 COLOR_GRAY1
|
|
125
|
+
#define TGI_COLOR_GRAY2 COLOR_GRAY2
|
|
126
|
+
#define TGI_COLOR_LIGHTGREEN COLOR_LIGHTGREEN
|
|
127
|
+
#define TGI_COLOR_LIGHTBLUE COLOR_LIGHTBLUE
|
|
128
|
+
#define TGI_COLOR_GRAY3 COLOR_GRAY3
|
|
129
|
+
|
|
130
|
+
/* NES controller masks for joy_read() */
|
|
131
|
+
|
|
132
|
+
#define JOY_BTN_1_MASK 0x80
|
|
133
|
+
#define JOY_BTN_2_MASK 0x40
|
|
134
|
+
#define JOY_BTN_3_MASK 0x20
|
|
135
|
+
#define JOY_BTN_4_MASK 0x10
|
|
136
|
+
#define JOY_UP_MASK 0x08
|
|
137
|
+
#define JOY_DOWN_MASK 0x04
|
|
138
|
+
#define JOY_LEFT_MASK 0x02
|
|
139
|
+
#define JOY_RIGHT_MASK 0x01
|
|
140
|
+
|
|
141
|
+
#define JOY_BTN_A_MASK JOY_BTN_1_MASK
|
|
142
|
+
#define JOY_BTN_B_MASK JOY_BTN_2_MASK
|
|
143
|
+
#define JOY_SELECT_MASK JOY_BTN_3_MASK
|
|
144
|
+
#define JOY_START_MASK JOY_BTN_4_MASK
|
|
145
|
+
|
|
146
|
+
#define JOY_BTN_A(v) ((v) & JOY_BTN_A_MASK)
|
|
147
|
+
#define JOY_BTN_B(v) ((v) & JOY_BTN_B_MASK)
|
|
148
|
+
#define JOY_SELECT(v) ((v) & JOY_SELECT_MASK)
|
|
149
|
+
#define JOY_START(v) ((v) & JOY_START_MASK)
|
|
150
|
+
|
|
151
|
+
#define JOY_FIRE2_MASK JOY_BTN_2_MASK
|
|
152
|
+
#define JOY_FIRE2(v) ((v) & JOY_FIRE2_MASK)
|
|
153
|
+
|
|
154
|
+
/* Additional mouse button mask */
|
|
155
|
+
#define MOUSE_BTN_MIDDLE 0x02
|
|
156
|
+
|
|
157
|
+
/* get_tv() return codes
|
|
158
|
+
** set_tv() argument codes
|
|
159
|
+
*/
|
|
160
|
+
enum {
|
|
161
|
+
TV_NONE = 0x00,
|
|
162
|
+
TV_VGA,
|
|
163
|
+
TV_NTSC_COLOR,
|
|
164
|
+
TV_RGB,
|
|
165
|
+
TV_NONE2,
|
|
166
|
+
TV_VGA2,
|
|
167
|
+
TV_NTSC_MONO,
|
|
168
|
+
TV_RGB2
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
/* Video modes for videomode() */
|
|
172
|
+
#define VIDEOMODE_80x60 0x00
|
|
173
|
+
#define VIDEOMODE_80x30 0x01
|
|
174
|
+
#define VIDEOMODE_40x60 0x02
|
|
175
|
+
#define VIDEOMODE_40x30 0x03
|
|
176
|
+
#define VIDEOMODE_40x15 0x04
|
|
177
|
+
#define VIDEOMODE_20x30 0x05
|
|
178
|
+
#define VIDEOMODE_20x15 0x06
|
|
179
|
+
#define VIDEOMODE_22x23 0x07
|
|
180
|
+
#define VIDEOMODE_64x50 0x08
|
|
181
|
+
#define VIDEOMODE_64x25 0x09
|
|
182
|
+
#define VIDEOMODE_32x50 0x0A
|
|
183
|
+
#define VIDEOMODE_32x25 0x0B
|
|
184
|
+
#define VIDEOMODE_80COL VIDEOMODE_80x60
|
|
185
|
+
#define VIDEOMODE_40COL VIDEOMODE_40x30
|
|
186
|
+
#define VIDEOMODE_320x240 0x80
|
|
187
|
+
#define VIDEOMODE_SWAP (-1)
|
|
188
|
+
|
|
189
|
+
/* VERA's address increment/decrement numbers */
|
|
190
|
+
enum {
|
|
191
|
+
VERA_DEC_0 = ((0 << 1) | 1) << 3,
|
|
192
|
+
VERA_DEC_1 = ((1 << 1) | 1) << 3,
|
|
193
|
+
VERA_DEC_2 = ((2 << 1) | 1) << 3,
|
|
194
|
+
VERA_DEC_4 = ((3 << 1) | 1) << 3,
|
|
195
|
+
VERA_DEC_8 = ((4 << 1) | 1) << 3,
|
|
196
|
+
VERA_DEC_16 = ((5 << 1) | 1) << 3,
|
|
197
|
+
VERA_DEC_32 = ((6 << 1) | 1) << 3,
|
|
198
|
+
VERA_DEC_64 = ((7 << 1) | 1) << 3,
|
|
199
|
+
VERA_DEC_128 = ((8 << 1) | 1) << 3,
|
|
200
|
+
VERA_DEC_256 = ((9 << 1) | 1) << 3,
|
|
201
|
+
VERA_DEC_512 = ((10 << 1) | 1) << 3,
|
|
202
|
+
VERA_DEC_40 = ((11 << 1) | 1) << 3,
|
|
203
|
+
VERA_DEC_80 = ((12 << 1) | 1) << 3,
|
|
204
|
+
VERA_DEC_160 = ((13 << 1) | 1) << 3,
|
|
205
|
+
VERA_DEC_320 = ((14 << 1) | 1) << 3,
|
|
206
|
+
VERA_DEC_640 = ((15 << 1) | 1) << 3,
|
|
207
|
+
VERA_INC_0 = ((0 << 1) | 0) << 3,
|
|
208
|
+
VERA_INC_1 = ((1 << 1) | 0) << 3,
|
|
209
|
+
VERA_INC_2 = ((2 << 1) | 0) << 3,
|
|
210
|
+
VERA_INC_4 = ((3 << 1) | 0) << 3,
|
|
211
|
+
VERA_INC_8 = ((4 << 1) | 0) << 3,
|
|
212
|
+
VERA_INC_16 = ((5 << 1) | 0) << 3,
|
|
213
|
+
VERA_INC_32 = ((6 << 1) | 0) << 3,
|
|
214
|
+
VERA_INC_64 = ((7 << 1) | 0) << 3,
|
|
215
|
+
VERA_INC_128 = ((8 << 1) | 0) << 3,
|
|
216
|
+
VERA_INC_256 = ((9 << 1) | 0) << 3,
|
|
217
|
+
VERA_INC_512 = ((10 << 1) | 0) << 3,
|
|
218
|
+
VERA_INC_40 = ((11 << 1) | 0) << 3,
|
|
219
|
+
VERA_INC_80 = ((12 << 1) | 0) << 3,
|
|
220
|
+
VERA_INC_160 = ((13 << 1) | 0) << 3,
|
|
221
|
+
VERA_INC_320 = ((14 << 1) | 0) << 3,
|
|
222
|
+
VERA_INC_640 = ((15 << 1) | 0) << 3
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
/* VERA's interrupt flags */
|
|
226
|
+
#define VERA_IRQ_VSYNC 0b00000001
|
|
227
|
+
#define VERA_IRQ_RASTER 0b00000010
|
|
228
|
+
#define VERA_IRQ_SPR_COLL 0b00000100
|
|
229
|
+
#define VERA_IRQ_AUDIO_LOW 0b00001000
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
/* Define hardware. */
|
|
233
|
+
|
|
234
|
+
#define RAM_BANK (*(unsigned char *)0x00)
|
|
235
|
+
#define ROM_BANK (*(unsigned char *)0x01)
|
|
236
|
+
|
|
237
|
+
#include <_6522.h>
|
|
238
|
+
#define VIA1 (*(volatile struct __6522 *)0x9F00)
|
|
239
|
+
#define VIA2 (*(volatile struct __6522 *)0x9F10)
|
|
240
|
+
|
|
241
|
+
/* A structure with the Video Enhanced Retro Adapter's external registers */
|
|
242
|
+
struct __vera {
|
|
243
|
+
unsigned short address; /* Address for data ports */
|
|
244
|
+
unsigned char address_hi;
|
|
245
|
+
unsigned char data0; /* Data port 0 */
|
|
246
|
+
unsigned char data1; /* Data port 1 */
|
|
247
|
+
unsigned char control; /* Control register */
|
|
248
|
+
unsigned char irq_enable; /* Interrupt enable bits */
|
|
249
|
+
unsigned char irq_flags; /* Interrupt flags */
|
|
250
|
+
unsigned char irq_raster; /* Line where IRQ will occur */
|
|
251
|
+
union {
|
|
252
|
+
struct { /* Visible when DCSEL flag = 0 */
|
|
253
|
+
unsigned char video; /* Flags to enable video layers */
|
|
254
|
+
unsigned char hscale; /* Horizontal scale factor */
|
|
255
|
+
unsigned char vscale; /* Vertical scale factor */
|
|
256
|
+
unsigned char border; /* Border color (NTSC mode) */
|
|
257
|
+
};
|
|
258
|
+
struct { /* Visible when DCSEL flag = 1 */
|
|
259
|
+
unsigned char hstart; /* Horizontal start position */
|
|
260
|
+
unsigned char hstop; /* Horizontal stop position */
|
|
261
|
+
unsigned char vstart; /* Vertical start position */
|
|
262
|
+
unsigned char vstop; /* Vertical stop position */
|
|
263
|
+
};
|
|
264
|
+
struct { /* Visible when DCSEL flag = 2 */
|
|
265
|
+
unsigned char fxctrl;
|
|
266
|
+
unsigned char fxtilebase;
|
|
267
|
+
unsigned char fxmapbase;
|
|
268
|
+
unsigned char fxmult;
|
|
269
|
+
};
|
|
270
|
+
struct { /* Visible when DCSEL flag = 3 */
|
|
271
|
+
unsigned char fxxincrl;
|
|
272
|
+
unsigned char fxxincrh;
|
|
273
|
+
unsigned char fxyincrl;
|
|
274
|
+
unsigned char fxyincrh;
|
|
275
|
+
};
|
|
276
|
+
struct { /* Visible when DCSEL flag = 4 */
|
|
277
|
+
unsigned char fxxposl;
|
|
278
|
+
unsigned char fxxposh;
|
|
279
|
+
unsigned char fxyposl;
|
|
280
|
+
unsigned char fxyposh;
|
|
281
|
+
};
|
|
282
|
+
struct { /* Visible when DCSEL flag = 5 */
|
|
283
|
+
unsigned char fxxposs;
|
|
284
|
+
unsigned char fxyposs;
|
|
285
|
+
unsigned char fxpolyfilll;
|
|
286
|
+
unsigned char fxpolyfillh;
|
|
287
|
+
};
|
|
288
|
+
struct { /* Visible when DCSEL flag = 6 */
|
|
289
|
+
unsigned char fxcachel;
|
|
290
|
+
unsigned char fxcachem;
|
|
291
|
+
unsigned char fxcacheh;
|
|
292
|
+
unsigned char fxcacheu;
|
|
293
|
+
};
|
|
294
|
+
struct { /* Visible when DCSEL flag = 63 */
|
|
295
|
+
unsigned char dcver0;
|
|
296
|
+
unsigned char dcver1;
|
|
297
|
+
unsigned char dcver2;
|
|
298
|
+
unsigned char dcver3;
|
|
299
|
+
};
|
|
300
|
+
} display;
|
|
301
|
+
struct {
|
|
302
|
+
unsigned char config; /* Layer map geometry */
|
|
303
|
+
unsigned char mapbase; /* Map data address */
|
|
304
|
+
unsigned char tilebase; /* Tile address and geometry */
|
|
305
|
+
unsigned int hscroll; /* Smooth scroll horizontal offset */
|
|
306
|
+
unsigned int vscroll; /* Smooth scroll vertical offset */
|
|
307
|
+
} layer0;
|
|
308
|
+
struct {
|
|
309
|
+
unsigned char config;
|
|
310
|
+
unsigned char mapbase;
|
|
311
|
+
unsigned char tilebase;
|
|
312
|
+
unsigned int hscroll;
|
|
313
|
+
unsigned int vscroll;
|
|
314
|
+
} layer1;
|
|
315
|
+
struct {
|
|
316
|
+
unsigned char control; /* PCM format */
|
|
317
|
+
unsigned char rate; /* Sample rate */
|
|
318
|
+
unsigned char data; /* PCM output queue */
|
|
319
|
+
} audio; /* Pulse-Code Modulation registers */
|
|
320
|
+
struct {
|
|
321
|
+
unsigned char data;
|
|
322
|
+
unsigned char control;
|
|
323
|
+
} spi; /* SD card interface */
|
|
324
|
+
};
|
|
325
|
+
#define VERA (*(volatile struct __vera *)0x9F20)
|
|
326
|
+
|
|
327
|
+
/* Audio chip */
|
|
328
|
+
struct __ym2151 {
|
|
329
|
+
unsigned char reg; /* Register number for data */
|
|
330
|
+
union {
|
|
331
|
+
unsigned char data;
|
|
332
|
+
unsigned char status; /* Busy flag */
|
|
333
|
+
};
|
|
334
|
+
};
|
|
335
|
+
#define YM2151 (*(volatile struct __ym2151 *)0x9F40)
|
|
336
|
+
|
|
337
|
+
/* A structure with the x16emu's settings registers */
|
|
338
|
+
struct __emul {
|
|
339
|
+
unsigned char debug; /* Boolean: debugging enabled */
|
|
340
|
+
unsigned char vera_action; /* Boolean: displaying VERA activity */
|
|
341
|
+
unsigned char keyboard; /* Boolean: displaying typed keys */
|
|
342
|
+
unsigned char echo; /* How to send Kernal output to host */
|
|
343
|
+
unsigned char save_on_exit; /* Boolean: save machine state on exit */
|
|
344
|
+
unsigned char gif_method; /* How GIF movie is being recorded */
|
|
345
|
+
unsigned char const unused1[2];
|
|
346
|
+
unsigned long const cycle_count; /* Running total of CPU cycles (8 MHz.) */
|
|
347
|
+
unsigned char const unused2[1];
|
|
348
|
+
unsigned char const keymap; /* Keyboard layout number */
|
|
349
|
+
char const detect[2]; /* "16" if running on x16emu */
|
|
350
|
+
};
|
|
351
|
+
#define EMULATOR (*(volatile struct __emul *)0x9FB0)
|
|
352
|
+
|
|
353
|
+
/* An array window into the half Mebibyte or two Mebibytes of banked RAM */
|
|
354
|
+
#define BANK_RAM ((unsigned char *)0xA000)
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
/* The addresses of the static drivers */
|
|
359
|
+
|
|
360
|
+
extern void cx16_std_joy[]; /* Referenced by joy_static_stddrv[] */
|
|
361
|
+
extern void cx16_std_mou[]; /* Referenced by mouse_static_stddrv[] */
|
|
362
|
+
extern void cx320p1_tgi[]; /* Referenced by tgi_static_stddrv[] */
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
/*****************************************************************************/
|
|
367
|
+
/* Code */
|
|
368
|
+
/*****************************************************************************/
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
unsigned short get_numbanks (void);
|
|
373
|
+
/* Return the number of RAM banks that the machine has. */
|
|
374
|
+
|
|
375
|
+
signed char get_ostype (void);
|
|
376
|
+
/* Get the ROM build version.
|
|
377
|
+
** -1 -- custom build
|
|
378
|
+
** Negative -- prerelease build
|
|
379
|
+
** Positive -- release build
|
|
380
|
+
*/
|
|
381
|
+
|
|
382
|
+
unsigned char get_tv (void);
|
|
383
|
+
/* Return the video signal type that the machine is using.
|
|
384
|
+
** Return a TV_xx constant.
|
|
385
|
+
*/
|
|
386
|
+
|
|
387
|
+
void __fastcall__ set_tv (unsigned char type);
|
|
388
|
+
/* Set the video signal type that the machine will use.
|
|
389
|
+
** Call with a TV_xx constant.
|
|
390
|
+
*/
|
|
391
|
+
|
|
392
|
+
unsigned char __fastcall__ vera_layer_enable (unsigned char layers);
|
|
393
|
+
/* Display the layers that are "named" by the bit flags in layers.
|
|
394
|
+
** A value of 0b01 shows layer 0, a value of 0b10 shows layer 1,
|
|
395
|
+
** a value of 0b11 shows both layers. Return the previous value.
|
|
396
|
+
*/
|
|
397
|
+
|
|
398
|
+
unsigned char __fastcall__ vera_sprites_enable (unsigned char mode);
|
|
399
|
+
/* Enable the sprite engine when mode is non-zero (true);
|
|
400
|
+
** disable sprites when mode is zero. Return the previous mode.
|
|
401
|
+
*/
|
|
402
|
+
|
|
403
|
+
signed char __fastcall__ videomode (signed char mode);
|
|
404
|
+
/* Set the video mode, return the old mode.
|
|
405
|
+
** Return -1 if Mode isn't valid.
|
|
406
|
+
** Call with one of the VIDEOMODE_xx constants.
|
|
407
|
+
*/
|
|
408
|
+
|
|
409
|
+
unsigned char __fastcall__ vpeek (unsigned long addr);
|
|
410
|
+
/* Get a byte from a location in VERA's internal address space. */
|
|
411
|
+
|
|
412
|
+
void __fastcall__ vpoke (unsigned char data, unsigned long addr);
|
|
413
|
+
/* Put a byte into a location in VERA's internal address space.
|
|
414
|
+
** (addr is second instead of first for the sake of code efficiency.)
|
|
415
|
+
*/
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
/* End of cX16.h */
|
|
420
|
+
#endif
|
package/include/dbg.h
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* dbg.h */
|
|
4
|
+
/* */
|
|
5
|
+
/* Debugger module interface */
|
|
6
|
+
/* */
|
|
7
|
+
/* */
|
|
8
|
+
/* */
|
|
9
|
+
/* (C) 1998-2000, 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
|
+
/*
|
|
37
|
+
** This is the interface to the cc65 debugger. Since many of the functions
|
|
38
|
+
** used for the debugger are quite usable even in another context, they
|
|
39
|
+
** are declared here.
|
|
40
|
+
**
|
|
41
|
+
** To use the debugger, just call DbgInit in your application. Once it has
|
|
42
|
+
** been called, the debugger will catch any BRK opcode. Use the BREAK macro
|
|
43
|
+
** defined below to insert breakpoints into your code.
|
|
44
|
+
**
|
|
45
|
+
** There are currently a lot of things that cannot be debugged, graphical
|
|
46
|
+
** applications are an example. The debugger does not save your screen
|
|
47
|
+
** contents, so even your text screen gets destroyed. However, you can
|
|
48
|
+
** debug the C and runtime library, even if the debugger is using this
|
|
49
|
+
** stuff itself.
|
|
50
|
+
**
|
|
51
|
+
** Note: When using the debugger, there are some other identifiers with
|
|
52
|
+
** external linkage, that start with Dbg. Avoid those names if you use the
|
|
53
|
+
** module.
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
#ifndef _DBG_H
|
|
59
|
+
#define _DBG_H
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/*****************************************************************************/
|
|
64
|
+
/* Utility functions */
|
|
65
|
+
/*****************************************************************************/
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
unsigned __fastcall__ DbgDisAsm (unsigned Addr, char* Buf, unsigned char Len);
|
|
70
|
+
/* Disassemble one instruction at address addr into the given buffer.
|
|
71
|
+
** The resulting line has the format, "AAAA__BB_BB_BB___OPC_OPERAND",
|
|
72
|
+
** where AAAA is the hexadecimal representation of addr, BB are the
|
|
73
|
+
** bytes (in hex) that make the instruction, OPC is the mnemonic, and
|
|
74
|
+
** OPERAND is an operand for the instruction.
|
|
75
|
+
** The buffer is filled with spaces up to the given length and terminated as
|
|
76
|
+
** a usual C string. NOTE: Buf must be able to hold Len+1 characters.
|
|
77
|
+
** The function returns the length of the disassembled instruction, so,
|
|
78
|
+
** to disassemble the next instruction, add the return value to addr
|
|
79
|
+
** and call the function again.
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
unsigned __fastcall__ DbgDisAsmLen (unsigned Addr);
|
|
83
|
+
/* Disassemble one instruction, but do only return the length, do not
|
|
84
|
+
** create a visible representation. This function is useful when
|
|
85
|
+
** disassembling backwards, it is much faster than DbgDisAsm.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
int __fastcall__ DbgIsRAM (unsigned Addr);
|
|
89
|
+
/* Return true if we can read and write the given address */
|
|
90
|
+
|
|
91
|
+
char* __cdecl__ DbgMemDump (unsigned Addr, char* Buf, unsigned char Len);
|
|
92
|
+
/* Create a line of a memory dump in the given buffer. The buffer contains
|
|
93
|
+
** the starting address (4 digits hex), then Len bytes in this format:
|
|
94
|
+
** "AAAA__XX_YY_ZZ_...". The passed char buffer must hold Len*3+5 bytes
|
|
95
|
+
** plus a terminator byte.
|
|
96
|
+
** The function does not work correctly if the created string is longer
|
|
97
|
+
** than 255 bytes.
|
|
98
|
+
** The return value is Buf.
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
/*****************************************************************************/
|
|
104
|
+
/* High level user interface */
|
|
105
|
+
/*****************************************************************************/
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
void __fastcall__ DbgInit (unsigned unused);
|
|
110
|
+
/* Initialize the debugger. Use 0 as parameter. The debugger will popup on
|
|
111
|
+
** next brk encountered.
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
#define BREAK() __asm__ ("brk")
|
|
115
|
+
/* Use this to insert breakpoints into your code */
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
/* End of dbg.h */
|
|
120
|
+
#endif
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
package/include/device.h
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* device.h */
|
|
4
|
+
/* */
|
|
5
|
+
/* Device handling */
|
|
6
|
+
/* */
|
|
7
|
+
/* */
|
|
8
|
+
/* */
|
|
9
|
+
/* (C) 2012 Oliver Schmidt, <ol.sc@web.de> */
|
|
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 _DEVICE_H
|
|
34
|
+
#define _DEVICE_H
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
#ifndef _HAVE_size_t
|
|
39
|
+
typedef unsigned size_t;
|
|
40
|
+
#define _HAVE_size_t
|
|
41
|
+
#endif
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
/*****************************************************************************/
|
|
46
|
+
/* Data */
|
|
47
|
+
/*****************************************************************************/
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
#define INVALID_DEVICE 255
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
/*****************************************************************************/
|
|
56
|
+
/* Code */
|
|
57
|
+
/*****************************************************************************/
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
unsigned char getfirstdevice (void);
|
|
62
|
+
|
|
63
|
+
unsigned char __fastcall__ getnextdevice (unsigned char device);
|
|
64
|
+
|
|
65
|
+
unsigned char getcurrentdevice (void);
|
|
66
|
+
|
|
67
|
+
char* __fastcall__ getdevicedir (unsigned char device, char* buf, size_t size);
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
/* End of device.h */
|
|
72
|
+
#endif
|