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/rp6502.h
ADDED
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* rp6502.h */
|
|
4
|
+
/* */
|
|
5
|
+
/* Picocomputer 6502 */
|
|
6
|
+
/* */
|
|
7
|
+
/* */
|
|
8
|
+
/* This software is provided 'as-is', without any expressed or implied */
|
|
9
|
+
/* warranty. In no event will the authors be held liable for any damages */
|
|
10
|
+
/* arising from the use of this software. */
|
|
11
|
+
/* */
|
|
12
|
+
/* Permission is granted to anyone to use this software for any purpose, */
|
|
13
|
+
/* including commercial applications, and to alter it and redistribute it */
|
|
14
|
+
/* freely, subject to the following restrictions: */
|
|
15
|
+
/* */
|
|
16
|
+
/* 1. The origin of this software must not be misrepresented; you must not */
|
|
17
|
+
/* claim that you wrote the original software. If you use this software */
|
|
18
|
+
/* in a product, an acknowledgment in the product documentation would be */
|
|
19
|
+
/* appreciated but is not required. */
|
|
20
|
+
/* 2. Altered source versions must be plainly marked as such, and must not */
|
|
21
|
+
/* be misrepresented as being the original software. */
|
|
22
|
+
/* 3. This notice may not be removed or altered from any source */
|
|
23
|
+
/* distribution. */
|
|
24
|
+
/* */
|
|
25
|
+
/*****************************************************************************/
|
|
26
|
+
|
|
27
|
+
#ifndef _RP6502_H
|
|
28
|
+
#define _RP6502_H
|
|
29
|
+
|
|
30
|
+
/* RP6502 VIA $FFD0-$FFDF */
|
|
31
|
+
|
|
32
|
+
#include <_6522.h>
|
|
33
|
+
#define VIA (*(volatile struct __6522 *)0xFFD0)
|
|
34
|
+
|
|
35
|
+
/* RP6502 RIA $FFE0-$FFF9 */
|
|
36
|
+
|
|
37
|
+
struct __RP6502
|
|
38
|
+
{
|
|
39
|
+
const unsigned char ready;
|
|
40
|
+
unsigned char tx;
|
|
41
|
+
const unsigned char rx;
|
|
42
|
+
const unsigned char vsync;
|
|
43
|
+
unsigned char rw0;
|
|
44
|
+
unsigned char step0;
|
|
45
|
+
unsigned int addr0;
|
|
46
|
+
unsigned char rw1;
|
|
47
|
+
unsigned char step1;
|
|
48
|
+
unsigned int addr1;
|
|
49
|
+
unsigned char xstack;
|
|
50
|
+
unsigned int errno;
|
|
51
|
+
unsigned char op;
|
|
52
|
+
unsigned char irq;
|
|
53
|
+
const unsigned char spin;
|
|
54
|
+
const unsigned char busy;
|
|
55
|
+
const unsigned char lda;
|
|
56
|
+
unsigned char a;
|
|
57
|
+
const unsigned char ldx;
|
|
58
|
+
unsigned char x;
|
|
59
|
+
const unsigned char rts;
|
|
60
|
+
unsigned int sreg;
|
|
61
|
+
};
|
|
62
|
+
#define RIA (*(volatile struct __RP6502 *)0xFFE0)
|
|
63
|
+
|
|
64
|
+
#define RIA_READY_TX_BIT 0x80
|
|
65
|
+
#define RIA_READY_RX_BIT 0x40
|
|
66
|
+
#define RIA_BUSY_BIT 0x80
|
|
67
|
+
|
|
68
|
+
/* XSTACK helpers */
|
|
69
|
+
|
|
70
|
+
void __fastcall__ ria_push_long (unsigned long val);
|
|
71
|
+
void __fastcall__ ria_push_int (unsigned int val);
|
|
72
|
+
#define ria_push_char(v) RIA.xstack = v
|
|
73
|
+
|
|
74
|
+
long ria_pop_long (void);
|
|
75
|
+
int ria_pop_int (void);
|
|
76
|
+
#define ria_pop_char() RIA.xstack
|
|
77
|
+
|
|
78
|
+
/* Set the RIA fastcall register */
|
|
79
|
+
|
|
80
|
+
void __fastcall__ ria_set_axsreg (unsigned long axsreg);
|
|
81
|
+
void __fastcall__ ria_set_ax (unsigned int ax);
|
|
82
|
+
#define ria_set_a(v) RIA.a = v
|
|
83
|
+
|
|
84
|
+
/* Run an OS operation */
|
|
85
|
+
|
|
86
|
+
int __fastcall__ ria_call_int (unsigned char op);
|
|
87
|
+
long __fastcall__ ria_call_long (unsigned char op);
|
|
88
|
+
|
|
89
|
+
/* These run _mappederrno() on error */
|
|
90
|
+
|
|
91
|
+
int __fastcall__ ria_call_int_errno (unsigned char op);
|
|
92
|
+
long __fastcall__ ria_call_long_errno (unsigned char op);
|
|
93
|
+
|
|
94
|
+
/* OS operation numbers */
|
|
95
|
+
|
|
96
|
+
#define RIA_OP_EXIT 0xFF
|
|
97
|
+
#define RIA_OP_ZXSTACK 0x00
|
|
98
|
+
#define RIA_OP_XREG 0x01
|
|
99
|
+
#define RIA_OP_PHI2 0x02
|
|
100
|
+
#define RIA_OP_CODEPAGE 0x03
|
|
101
|
+
#define RIA_OP_LRAND 0x04
|
|
102
|
+
#define RIA_OP_STDIN_OPT 0x05
|
|
103
|
+
#define RIA_OP_CLOCK 0x0F
|
|
104
|
+
#define RIA_OP_CLOCK_GETRES 0x10
|
|
105
|
+
#define RIA_OP_CLOCK_GETTIME 0x11
|
|
106
|
+
#define RIA_OP_CLOCK_SETTIME 0x12
|
|
107
|
+
#define RIA_OP_CLOCK_GETTIMEZONE 0x13
|
|
108
|
+
#define RIA_OP_OPEN 0x14
|
|
109
|
+
#define RIA_OP_CLOSE 0x15
|
|
110
|
+
#define RIA_OP_READ_XSTACK 0x16
|
|
111
|
+
#define RIA_OP_READ_XRAM 0x17
|
|
112
|
+
#define RIA_OP_WRITE_XSTACK 0x18
|
|
113
|
+
#define RIA_OP_WRITE_XRAM 0x19
|
|
114
|
+
#define RIA_OP_LSEEK 0x1A
|
|
115
|
+
#define RIA_OP_UNLINK 0x1B
|
|
116
|
+
#define RIA_OP_RENAME 0x1C
|
|
117
|
+
|
|
118
|
+
/* C API for the operating system. */
|
|
119
|
+
|
|
120
|
+
int __cdecl__ xregn (char device, char channel, unsigned char address, unsigned count,
|
|
121
|
+
...);
|
|
122
|
+
int __cdecl__ xreg (char device, char channel, unsigned char address, ...);
|
|
123
|
+
int phi2 (void);
|
|
124
|
+
int codepage (void);
|
|
125
|
+
long lrand (void);
|
|
126
|
+
int __fastcall__ stdin_opt (unsigned long ctrl_bits, unsigned char str_length);
|
|
127
|
+
int __fastcall__ read_xstack (void* buf, unsigned count, int fildes);
|
|
128
|
+
int __fastcall__ read_xram (unsigned buf, unsigned count, int fildes);
|
|
129
|
+
int __fastcall__ write_xstack (const void* buf, unsigned count, int fildes);
|
|
130
|
+
int __fastcall__ write_xram (unsigned buf, unsigned count, int fildes);
|
|
131
|
+
|
|
132
|
+
/* XREG location helpers */
|
|
133
|
+
|
|
134
|
+
#define xreg_ria_keyboard(...) xreg(0, 0, 0, __VA_ARGS__)
|
|
135
|
+
#define xreg_ria_mouse(...) xreg(0, 0, 1, __VA_ARGS__)
|
|
136
|
+
#define xreg_vga_canvas(...) xreg(1, 0, 0, __VA_ARGS__)
|
|
137
|
+
#define xreg_vga_mode(...) xreg(1, 0, 1, __VA_ARGS__)
|
|
138
|
+
|
|
139
|
+
/* XRAM structure helpers */
|
|
140
|
+
|
|
141
|
+
#define xram0_struct_set(addr, type, member, val) \
|
|
142
|
+
RIA.addr0 = (unsigned)(&((type *)0)->member) + (unsigned)addr; \
|
|
143
|
+
switch (sizeof(((type *)0)->member)) \
|
|
144
|
+
{ \
|
|
145
|
+
case 1: \
|
|
146
|
+
RIA.rw0 = val; \
|
|
147
|
+
break; \
|
|
148
|
+
case 2: \
|
|
149
|
+
RIA.step0 = 1; \
|
|
150
|
+
RIA.rw0 = val & 0xff; \
|
|
151
|
+
RIA.rw0 = (val >> 8) & 0xff; \
|
|
152
|
+
break; \
|
|
153
|
+
case 4: \
|
|
154
|
+
RIA.step0 = 1; \
|
|
155
|
+
RIA.rw0 = (unsigned long)val & 0xff; \
|
|
156
|
+
RIA.rw0 = ((unsigned long)val >> 8) & 0xff; \
|
|
157
|
+
RIA.rw0 = ((unsigned long)val >> 16) & 0xff; \
|
|
158
|
+
RIA.rw0 = ((unsigned long)val >> 24) & 0xff; \
|
|
159
|
+
break; \
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
#define xram1_struct_set(addr, type, member, val) \
|
|
163
|
+
RIA.addr1 = (unsigned)(&((type *)0)->member) + (unsigned)addr; \
|
|
164
|
+
switch (sizeof(((type *)0)->member)) \
|
|
165
|
+
{ \
|
|
166
|
+
case 1: \
|
|
167
|
+
RIA.rw1 = val; \
|
|
168
|
+
break; \
|
|
169
|
+
case 2: \
|
|
170
|
+
RIA.step1 = 1; \
|
|
171
|
+
RIA.rw1 = val & 0xff; \
|
|
172
|
+
RIA.rw1 = (val >> 8) & 0xff; \
|
|
173
|
+
break; \
|
|
174
|
+
case 4: \
|
|
175
|
+
RIA.step1 = 1; \
|
|
176
|
+
RIA.rw1 = (unsigned long)val & 0xff; \
|
|
177
|
+
RIA.rw1 = ((unsigned long)val >> 8) & 0xff; \
|
|
178
|
+
RIA.rw1 = ((unsigned long)val >> 16) & 0xff; \
|
|
179
|
+
RIA.rw1 = ((unsigned long)val >> 24) & 0xff; \
|
|
180
|
+
break; \
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
typedef struct
|
|
184
|
+
{
|
|
185
|
+
unsigned char x_wrap; // bool
|
|
186
|
+
unsigned char y_wrap; // bool
|
|
187
|
+
int x_pos_px;
|
|
188
|
+
int y_pos_px;
|
|
189
|
+
int width_chars;
|
|
190
|
+
int height_chars;
|
|
191
|
+
unsigned xram_data_ptr;
|
|
192
|
+
unsigned xram_palette_ptr;
|
|
193
|
+
unsigned xram_font_ptr;
|
|
194
|
+
} vga_mode1_config_t;
|
|
195
|
+
|
|
196
|
+
typedef struct
|
|
197
|
+
{
|
|
198
|
+
unsigned char x_wrap; // bool
|
|
199
|
+
unsigned char y_wrap; // bool
|
|
200
|
+
int x_pos_px;
|
|
201
|
+
int y_pos_px;
|
|
202
|
+
int width_tiles;
|
|
203
|
+
int height_tiles;
|
|
204
|
+
unsigned xram_data_ptr;
|
|
205
|
+
unsigned xram_palette_ptr;
|
|
206
|
+
unsigned xram_tile_ptr;
|
|
207
|
+
} vga_mode2_config_t;
|
|
208
|
+
|
|
209
|
+
typedef struct
|
|
210
|
+
{
|
|
211
|
+
unsigned char x_wrap; // bool
|
|
212
|
+
unsigned char y_wrap; // bool
|
|
213
|
+
int x_pos_px;
|
|
214
|
+
int y_pos_px;
|
|
215
|
+
int width_px;
|
|
216
|
+
int height_px;
|
|
217
|
+
unsigned xram_data_ptr;
|
|
218
|
+
unsigned xram_palette_ptr;
|
|
219
|
+
} vga_mode3_config_t;
|
|
220
|
+
|
|
221
|
+
typedef struct
|
|
222
|
+
{
|
|
223
|
+
int x_pos_px;
|
|
224
|
+
int y_pos_px;
|
|
225
|
+
unsigned xram_sprite_ptr;
|
|
226
|
+
unsigned char log_size;
|
|
227
|
+
unsigned char has_opacity_metadata; // bool
|
|
228
|
+
} vga_mode4_sprite_t;
|
|
229
|
+
|
|
230
|
+
typedef struct
|
|
231
|
+
{
|
|
232
|
+
int transform[6];
|
|
233
|
+
int x_pos_px;
|
|
234
|
+
int y_pos_px;
|
|
235
|
+
unsigned xram_sprite_ptr;
|
|
236
|
+
unsigned char log_size;
|
|
237
|
+
unsigned char has_opacity_metadata; // bool
|
|
238
|
+
} vga_mode4_asprite_t;
|
|
239
|
+
|
|
240
|
+
/* Values in __oserror are the union of these FatFs errors and errno.h */
|
|
241
|
+
|
|
242
|
+
typedef enum
|
|
243
|
+
{
|
|
244
|
+
FR_OK = 32, /* Succeeded */
|
|
245
|
+
FR_DISK_ERR, /* A hard error occurred in the low level disk I/O layer */
|
|
246
|
+
FR_INT_ERR, /* Assertion failed */
|
|
247
|
+
FR_NOT_READY, /* The physical drive cannot work */
|
|
248
|
+
FR_NO_FILE, /* Could not find the file */
|
|
249
|
+
FR_NO_PATH, /* Could not find the path */
|
|
250
|
+
FR_INVALID_NAME, /* The path name format is invalid */
|
|
251
|
+
FR_DENIED, /* Access denied due to prohibited access or directory full */
|
|
252
|
+
FR_EXIST, /* Access denied due to prohibited access */
|
|
253
|
+
FR_INVALID_OBJECT, /* The file/directory object is invalid */
|
|
254
|
+
FR_WRITE_PROTECTED, /* The physical drive is write protected */
|
|
255
|
+
FR_INVALID_DRIVE, /* The logical drive number is invalid */
|
|
256
|
+
FR_NOT_ENABLED, /* The volume has no work area */
|
|
257
|
+
FR_NO_FILESYSTEM, /* There is no valid FAT volume */
|
|
258
|
+
FR_MKFS_ABORTED, /* The f_mkfs() aborted due to any problem */
|
|
259
|
+
FR_TIMEOUT, /* Could not get a grant to access the volume within defined period */
|
|
260
|
+
FR_LOCKED, /* The operation is rejected according to the file sharing policy */
|
|
261
|
+
FR_NOT_ENOUGH_CORE, /* LFN working buffer could not be allocated */
|
|
262
|
+
FR_TOO_MANY_OPEN_FILES, /* Number of open files > FF_FS_LOCK */
|
|
263
|
+
FR_INVALID_PARAMETER /* Given parameter is invalid */
|
|
264
|
+
} FRESULT;
|
|
265
|
+
|
|
266
|
+
#endif /* _RP6502_H */
|
package/include/serial.h
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* serial.h */
|
|
4
|
+
/* */
|
|
5
|
+
/* Serial communication API */
|
|
6
|
+
/* */
|
|
7
|
+
/* */
|
|
8
|
+
/* */
|
|
9
|
+
/* (C) 2003-2012, 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 _SERIAL_H
|
|
37
|
+
#define _SERIAL_H
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
/*****************************************************************************/
|
|
42
|
+
/* Data */
|
|
43
|
+
/*****************************************************************************/
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
/* Baudrate settings */
|
|
48
|
+
#define SER_BAUD_45_5 0x00
|
|
49
|
+
#define SER_BAUD_50 0x01
|
|
50
|
+
#define SER_BAUD_75 0x02
|
|
51
|
+
#define SER_BAUD_110 0x03
|
|
52
|
+
#define SER_BAUD_134_5 0x04
|
|
53
|
+
#define SER_BAUD_150 0x05
|
|
54
|
+
#define SER_BAUD_300 0x06
|
|
55
|
+
#define SER_BAUD_600 0x07
|
|
56
|
+
#define SER_BAUD_1200 0x08
|
|
57
|
+
#define SER_BAUD_1800 0x09
|
|
58
|
+
#define SER_BAUD_2400 0x0A
|
|
59
|
+
#define SER_BAUD_3600 0x0B
|
|
60
|
+
#define SER_BAUD_4800 0x0C
|
|
61
|
+
#define SER_BAUD_7200 0x0D
|
|
62
|
+
#define SER_BAUD_9600 0x0E
|
|
63
|
+
#define SER_BAUD_19200 0x0F
|
|
64
|
+
#define SER_BAUD_38400 0x10
|
|
65
|
+
#define SER_BAUD_57600 0x11
|
|
66
|
+
#define SER_BAUD_115200 0x12
|
|
67
|
+
#define SER_BAUD_230400 0x13
|
|
68
|
+
#define SER_BAUD_31250 0x14
|
|
69
|
+
#define SER_BAUD_62500 0x15
|
|
70
|
+
#define SER_BAUD_56_875 0x16
|
|
71
|
+
|
|
72
|
+
/* Data bit settings */
|
|
73
|
+
#define SER_BITS_5 0x00
|
|
74
|
+
#define SER_BITS_6 0x01
|
|
75
|
+
#define SER_BITS_7 0x02
|
|
76
|
+
#define SER_BITS_8 0x03
|
|
77
|
+
|
|
78
|
+
/* Stop bit settings */
|
|
79
|
+
#define SER_STOP_1 0x00 /* One stop bit */
|
|
80
|
+
#define SER_STOP_2 0x01 /* Two stop bits */
|
|
81
|
+
|
|
82
|
+
/* Parity settings */
|
|
83
|
+
#define SER_PAR_NONE 0x00
|
|
84
|
+
#define SER_PAR_ODD 0x01
|
|
85
|
+
#define SER_PAR_EVEN 0x02
|
|
86
|
+
#define SER_PAR_MARK 0x03
|
|
87
|
+
#define SER_PAR_SPACE 0x04
|
|
88
|
+
|
|
89
|
+
/* Handshake settings. The latter two may be combined. */
|
|
90
|
+
#define SER_HS_NONE 0x00 /* No handshake */
|
|
91
|
+
#define SER_HS_HW 0x01 /* Hardware (RTS/CTS) handshake */
|
|
92
|
+
#define SER_HS_SW 0x02 /* Software handshake */
|
|
93
|
+
|
|
94
|
+
/* Bit masks to mask out things from the status returned by ser_status.
|
|
95
|
+
** These are 6551 specific and must be mapped by drivers for other chips.
|
|
96
|
+
*/
|
|
97
|
+
#define SER_STATUS_PE 0x01 /* Parity error */
|
|
98
|
+
#define SER_STATUS_FE 0x02 /* Framing error */
|
|
99
|
+
#define SER_STATUS_OE 0x04 /* Overrun error */
|
|
100
|
+
#define SER_STATUS_DCD 0x20 /* NOT data carrier detect */
|
|
101
|
+
#define SER_STATUS_DSR 0x40 /* NOT data set ready */
|
|
102
|
+
|
|
103
|
+
/* Error codes returned by all functions */
|
|
104
|
+
#define SER_ERR_OK 0x00 /* Not an error - relax */
|
|
105
|
+
#define SER_ERR_NO_DRIVER 0x01 /* No driver available */
|
|
106
|
+
#define SER_ERR_CANNOT_LOAD 0x02 /* Error loading driver */
|
|
107
|
+
#define SER_ERR_INV_DRIVER 0x03 /* Invalid driver */
|
|
108
|
+
#define SER_ERR_NO_DEVICE 0x04 /* Device (hardware) not found */
|
|
109
|
+
#define SER_ERR_BAUD_UNAVAIL 0x05 /* Baud rate not available */
|
|
110
|
+
#define SER_ERR_NO_DATA 0x06 /* Nothing to read */
|
|
111
|
+
#define SER_ERR_OVERFLOW 0x07 /* No room in send buffer */
|
|
112
|
+
#define SER_ERR_INIT_FAILED 0x08 /* Initialization failed */
|
|
113
|
+
#define SER_ERR_INV_IOCTL 0x09 /* IOCTL not supported */
|
|
114
|
+
#define SER_ERR_INSTALLED 0x0A /* A driver is already installed */
|
|
115
|
+
#define SER_ERR_NOT_OPEN 0x0B /* Driver is not open */
|
|
116
|
+
|
|
117
|
+
/* Struct containing parameters for the serial port */
|
|
118
|
+
struct ser_params {
|
|
119
|
+
unsigned char baudrate; /* Baudrate */
|
|
120
|
+
unsigned char databits; /* Number of data bits */
|
|
121
|
+
unsigned char stopbits; /* Number of stop bits */
|
|
122
|
+
unsigned char parity; /* Parity setting */
|
|
123
|
+
unsigned char handshake; /* Type of handshake to use */
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
/* The name of the standard serial driver for a platform */
|
|
127
|
+
extern const char ser_stddrv[];
|
|
128
|
+
|
|
129
|
+
/* The address of the static standard serial driver for a platform */
|
|
130
|
+
extern const void ser_static_stddrv[];
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
/*****************************************************************************/
|
|
135
|
+
/* Code */
|
|
136
|
+
/*****************************************************************************/
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
unsigned char __fastcall__ ser_load_driver (const char* driver);
|
|
141
|
+
/* Load and install a serial driver. Return an error code. */
|
|
142
|
+
|
|
143
|
+
unsigned char ser_unload (void);
|
|
144
|
+
/* Uninstall, then unload the currently loaded driver. */
|
|
145
|
+
|
|
146
|
+
unsigned char __fastcall__ ser_install (const void* driver);
|
|
147
|
+
/* Install an already loaded driver. Return an error code. */
|
|
148
|
+
|
|
149
|
+
unsigned char ser_uninstall (void);
|
|
150
|
+
/* Uninstall the currently loaded driver and return an error code.
|
|
151
|
+
** Note: This call does not free allocated memory.
|
|
152
|
+
*/
|
|
153
|
+
|
|
154
|
+
unsigned char __fastcall__ ser_open (const struct ser_params* params);
|
|
155
|
+
/* "Open" the port by setting the port parameters and enable interrupts. */
|
|
156
|
+
|
|
157
|
+
unsigned char ser_close (void);
|
|
158
|
+
/* "Close" the port. Clear buffers and disable interrupts. */
|
|
159
|
+
|
|
160
|
+
unsigned char __fastcall__ ser_get (char* b);
|
|
161
|
+
/* Get a character from the serial port. If no characters are available, the
|
|
162
|
+
** function will return SER_ERR_NO_DATA, so this is not a fatal error.
|
|
163
|
+
*/
|
|
164
|
+
|
|
165
|
+
unsigned char __fastcall__ ser_put (char b);
|
|
166
|
+
/* Send a character via the serial port. There is a transmit buffer, but
|
|
167
|
+
** transmitting is not done via interrupt. The function returns
|
|
168
|
+
** SER_ERR_OVERFLOW if there is no space left in the transmit buffer.
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
unsigned char __fastcall__ ser_status (unsigned char* status);
|
|
172
|
+
/* Return the serial port status. */
|
|
173
|
+
|
|
174
|
+
unsigned char __fastcall__ ser_ioctl (unsigned char code, void* data);
|
|
175
|
+
/* Driver specific entry. */
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
/* End of serial.h */
|
|
180
|
+
#endif
|
package/include/setjmp.h
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* setjmp.h */
|
|
4
|
+
/* */
|
|
5
|
+
/* Nonlocal jumps */
|
|
6
|
+
/* */
|
|
7
|
+
/* */
|
|
8
|
+
/* */
|
|
9
|
+
/* (C) 1998-2009, Ullrich von Bassewitz */
|
|
10
|
+
/* Roemerstrasse 52 */
|
|
11
|
+
/* D-70794 Filderstadt */
|
|
12
|
+
/* EMail: uz@cc65.org */
|
|
13
|
+
/* */
|
|
14
|
+
/* */
|
|
15
|
+
/* This software is provided 'as-is', without any expressed or implied */
|
|
16
|
+
/* warranty. In no event will the authors be held liable for any damages */
|
|
17
|
+
/* arising from the use of this software. */
|
|
18
|
+
/* */
|
|
19
|
+
/* Permission is granted to anyone to use this software for any purpose, */
|
|
20
|
+
/* including commercial applications, and to alter it and redistribute it */
|
|
21
|
+
/* freely, subject to the following restrictions: */
|
|
22
|
+
/* */
|
|
23
|
+
/* 1. The origin of this software must not be misrepresented; you must not */
|
|
24
|
+
/* claim that you wrote the original software. If you use this software */
|
|
25
|
+
/* in a product, an acknowledgment in the product documentation would be */
|
|
26
|
+
/* appreciated but is not required. */
|
|
27
|
+
/* 2. Altered source versions must be plainly marked as such, and must not */
|
|
28
|
+
/* be misrepresented as being the original software. */
|
|
29
|
+
/* 3. This notice may not be removed or altered from any source */
|
|
30
|
+
/* distribution. */
|
|
31
|
+
/* */
|
|
32
|
+
/*****************************************************************************/
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
#ifndef _SETJMP_H
|
|
37
|
+
#define _SETJMP_H
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
typedef char jmp_buf [5];
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
int __fastcall__ __setjmp (jmp_buf buf);
|
|
46
|
+
#define setjmp __setjmp /* ISO insists on a macro */
|
|
47
|
+
void __fastcall__ longjmp (jmp_buf buf, int retval) __attribute__((noreturn));
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
/* End of setjmp.h */
|
|
52
|
+
#endif
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
package/include/signal.h
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* signal.h */
|
|
4
|
+
/* */
|
|
5
|
+
/* Signal handling definitions */
|
|
6
|
+
/* */
|
|
7
|
+
/* */
|
|
8
|
+
/* */
|
|
9
|
+
/* (C) 2002-2005, 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 _SIGNAL_H
|
|
37
|
+
#define _SIGNAL_H
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
/* sig_atomic_t */
|
|
42
|
+
typedef unsigned char sig_atomic_t;
|
|
43
|
+
|
|
44
|
+
/* Type of a signal handler */
|
|
45
|
+
typedef void __fastcall__ (*__sigfunc) (int);
|
|
46
|
+
|
|
47
|
+
/* Functions that implement SIG_IGN and SIG_DFL */
|
|
48
|
+
void __fastcall__ __sig_ign (int);
|
|
49
|
+
void __fastcall__ __sig_dfl (int);
|
|
50
|
+
|
|
51
|
+
/* Standard signal handling functions */
|
|
52
|
+
#define SIG_DFL __sig_dfl
|
|
53
|
+
#define SIG_IGN __sig_ign
|
|
54
|
+
#define SIG_ERR ((__sigfunc) 0x0000)
|
|
55
|
+
|
|
56
|
+
/* Signal numbers */
|
|
57
|
+
#define SIGABRT 0
|
|
58
|
+
#define SIGFPE 1
|
|
59
|
+
#define SIGILL 2
|
|
60
|
+
#define SIGINT 3
|
|
61
|
+
#define SIGSEGV 4
|
|
62
|
+
#define SIGTERM 5
|
|
63
|
+
|
|
64
|
+
/* Function declarations */
|
|
65
|
+
__sigfunc __fastcall__ signal (int sig, __sigfunc func);
|
|
66
|
+
int __fastcall__ raise (int sig);
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
/* End of signal.h */
|
|
71
|
+
#endif
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|