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/sim65.h
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* sim65.h */
|
|
4
|
+
/* */
|
|
5
|
+
/* Definitions for the sim6502 and sim65c02 targets */
|
|
6
|
+
/* */
|
|
7
|
+
/* */
|
|
8
|
+
/* */
|
|
9
|
+
/* (C) 2025 Sidney Cadot */
|
|
10
|
+
/* */
|
|
11
|
+
/* */
|
|
12
|
+
/* This software is provided 'as-is', without any expressed or implied */
|
|
13
|
+
/* warranty. In no event will the authors be held liable for any damages */
|
|
14
|
+
/* arising from the use of this software. */
|
|
15
|
+
/* */
|
|
16
|
+
/* Permission is granted to anyone to use this software for any purpose, */
|
|
17
|
+
/* including commercial applications, and to alter it and redistribute it */
|
|
18
|
+
/* freely, subject to the following restrictions: */
|
|
19
|
+
/* */
|
|
20
|
+
/* 1. The origin of this software must not be misrepresented; you must not */
|
|
21
|
+
/* claim that you wrote the original software. If you use this software */
|
|
22
|
+
/* in a product, an acknowledgment in the product documentation would be */
|
|
23
|
+
/* appreciated but is not required. */
|
|
24
|
+
/* 2. Altered source versions must be plainly marked as such, and must not */
|
|
25
|
+
/* be misrepresented as being the original software. */
|
|
26
|
+
/* 3. This notice may not be removed or altered from any source */
|
|
27
|
+
/* distribution. */
|
|
28
|
+
/* */
|
|
29
|
+
/*****************************************************************************/
|
|
30
|
+
|
|
31
|
+
#ifndef _SIM65_H
|
|
32
|
+
#define _SIM65_H
|
|
33
|
+
|
|
34
|
+
/* Check that we include this file while compiling to a compatible target. */
|
|
35
|
+
#if !defined(__SIM6502__) && !defined(__SIM65C02__)
|
|
36
|
+
# error This module may only be used when compiling for the sim6502 or sim65c02 targets!
|
|
37
|
+
#endif
|
|
38
|
+
|
|
39
|
+
#include <stdint.h>
|
|
40
|
+
|
|
41
|
+
/* The sim65 targets (sim6502, sim65c02) have a peripheral memory aperture located at
|
|
42
|
+
* address range 0xFFC0 .. 0xFFDF. Currently, the following peripherals are located
|
|
43
|
+
* inside that memory apeture:
|
|
44
|
+
*
|
|
45
|
+
* $FFC0 .. $FFC9 "counter" peripheral
|
|
46
|
+
* $FFCA .. $FFCB "sim65 control" peripheral
|
|
47
|
+
* $FFCC .. $FFDF (currently unused)
|
|
48
|
+
*
|
|
49
|
+
* The "peripherals" structure below corresponds to the register layout of the currently
|
|
50
|
+
* defined peripherals in this memory range. Combined with the fact that the sim6502 and
|
|
51
|
+
* sim65c02 linker configuration files define the "peripherals" symbol to be fixed at
|
|
52
|
+
* address $FFC0, this provides easy-to-use and efficient access to the peripheral registers.
|
|
53
|
+
*
|
|
54
|
+
* After including "sim65.h", it is possible for a C program to do things like:
|
|
55
|
+
*
|
|
56
|
+
* {
|
|
57
|
+
* peripherals.counter.latch = 0;
|
|
58
|
+
* peripherals.sim65.cpu_mode = SIM65_CPU_MODE_6502X;
|
|
59
|
+
* peripherals.sim65.trace_mode = SIM65_TRACE_MODE_ENABLE_FULL;
|
|
60
|
+
* }
|
|
61
|
+
*
|
|
62
|
+
* Note that "peripherals" variable is declared volatile. This instructs a C compiler to
|
|
63
|
+
* forego optimizations on memory accesses to the variable. However, CC65 currently ignores
|
|
64
|
+
* the volatile attribute. Fortunately, it is not smart with respect to optimizing
|
|
65
|
+
* memory accesses, so accessing the "peripherals" fields works fine in practice.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
extern volatile struct {
|
|
69
|
+
struct {
|
|
70
|
+
uint8_t latch;
|
|
71
|
+
uint8_t select;
|
|
72
|
+
union {
|
|
73
|
+
uint8_t value [8]; /* Access value as eight separate bytes. */
|
|
74
|
+
uint16_t value16 [4]; /* Access value as four 16-bit words. */
|
|
75
|
+
uint32_t value32 [2]; /* Access value as two 32-bit long words. */
|
|
76
|
+
};
|
|
77
|
+
} counter;
|
|
78
|
+
struct {
|
|
79
|
+
uint8_t cpu_mode;
|
|
80
|
+
uint8_t trace_mode;
|
|
81
|
+
} sim65;
|
|
82
|
+
} peripherals;
|
|
83
|
+
|
|
84
|
+
/* Values for the peripherals.counter.select field. */
|
|
85
|
+
#define COUNTER_SELECT_CLOCKCYCLE_COUNTER 0x00
|
|
86
|
+
#define COUNTER_SELECT_INSTRUCTION_COUNTER 0x01
|
|
87
|
+
#define COUNTER_SELECT_IRQ_COUNTER 0x02
|
|
88
|
+
#define COUNTER_SELECT_NMI_COUNTER 0x03
|
|
89
|
+
#define COUNTER_SELECT_WALLCLOCK_TIME 0x80
|
|
90
|
+
#define COUNTER_SELECT_WALLCLOCK_TIME_SPLIT 0x81
|
|
91
|
+
|
|
92
|
+
/* Values for the peripherals.sim65.cpu_mode field. */
|
|
93
|
+
#define SIM65_CPU_MODE_6502 0x00
|
|
94
|
+
#define SIM65_CPU_MODE_65C02 0x01
|
|
95
|
+
#define SIM65_CPU_MODE_6502X 0x02
|
|
96
|
+
|
|
97
|
+
/* Bitfield values for the peripherals.sim65.trace_mode field. */
|
|
98
|
+
#define SIM65_TRACE_MODE_FIELD_INSTR_COUNTER 0x40
|
|
99
|
+
#define SIM65_TRACE_MODE_FIELD_CLOCK_COUNTER 0x20
|
|
100
|
+
#define SIM65_TRACE_MODE_FIELD_PC 0x10
|
|
101
|
+
#define SIM65_TRACE_MODE_FIELD_INSTR_BYTES 0x08
|
|
102
|
+
#define SIM65_TRACE_MODE_FIELD_INSTR_ASSEMBLY 0x04
|
|
103
|
+
#define SIM65_TRACE_MODE_FIELD_CPU_REGISTERS 0x02
|
|
104
|
+
#define SIM65_TRACE_MODE_FIELD_CC65_SP 0x01
|
|
105
|
+
|
|
106
|
+
/* Values for the peripherals.sim65.trace_mode field that fully disable / enable tracing. */
|
|
107
|
+
#define SIM65_TRACE_MODE_DISABLE 0x00
|
|
108
|
+
#define SIM65_TRACE_MODE_ENABLE_FULL 0x7F
|
|
109
|
+
|
|
110
|
+
/* Convenience macros to enable / disable tracing at runtime. */
|
|
111
|
+
#define TRACE_ON() do peripherals.sim65.trace_mode = SIM65_TRACE_MODE_ENABLE_FULL; while(0)
|
|
112
|
+
#define TRACE_OFF() do peripherals.sim65.trace_mode = SIM65_TRACE_MODE_DISABLE; while(0)
|
|
113
|
+
|
|
114
|
+
/* Convenience macro to query the CPU mode at runtime. */
|
|
115
|
+
#define GET_CPU_MODE() peripherals.sim65.cpu_mode
|
|
116
|
+
|
|
117
|
+
/* Convenience macro to set the CPU mode at runtime.
|
|
118
|
+
*
|
|
119
|
+
* Use SIM65_CPU_MODE_6502, SIM65_CPU_MODE_65C02, or SIM65_CPU_MODE_6502 as argument.
|
|
120
|
+
*
|
|
121
|
+
* Important Note:
|
|
122
|
+
*
|
|
123
|
+
* When running in a program compiled for the "sim6502" target, it is safe to switch to
|
|
124
|
+
* 65C02 or 6502X mode, since the runtime library will only use plain 6502 opcodes, and
|
|
125
|
+
* those work the same in 65C02 and 6502X mode.
|
|
126
|
+
*
|
|
127
|
+
* However, when running in a program compiled for the "sim65c02" target, it is NOT safe
|
|
128
|
+
* to switch to 6502 or 6502X mode, since many routines in the runtime library use
|
|
129
|
+
* 65C02-specific opcodes, and these will not work as expected when the CPU is switched
|
|
130
|
+
* to 6502 or 6502X mode. When such an instruction is encountered, the program will
|
|
131
|
+
* exhibit undefined behavior.
|
|
132
|
+
*/
|
|
133
|
+
#define SET_CPU_MODE(mode) do peripherals.sim65.cpu_mode = mode; while(0)
|
|
134
|
+
|
|
135
|
+
/* End of sim65.h */
|
|
136
|
+
#endif
|
package/include/stdarg.h
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* stdarg.h */
|
|
4
|
+
/* */
|
|
5
|
+
/* Variable arguments */
|
|
6
|
+
/* */
|
|
7
|
+
/* */
|
|
8
|
+
/* */
|
|
9
|
+
/* (C) 1998-2004 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 _STDARG_H
|
|
37
|
+
#define _STDARG_H
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
typedef unsigned char* va_list;
|
|
42
|
+
|
|
43
|
+
#define va_start(ap, fix) ap = ((va_list)&(fix))
|
|
44
|
+
#define va_arg(ap,type) (*(type*)(ap -= ((sizeof (type) + 1) & ~1)))
|
|
45
|
+
#if __CC65_STD__ >= __CC65_STD_C99__
|
|
46
|
+
#define va_copy(dest, src) ((dest)=(src))
|
|
47
|
+
#endif
|
|
48
|
+
#define va_end(ap)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
/* End of stdarg.h */
|
|
53
|
+
#endif
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* stdbool.h */
|
|
4
|
+
/* */
|
|
5
|
+
/* C99 Boolean definitions */
|
|
6
|
+
/* */
|
|
7
|
+
/* */
|
|
8
|
+
/* */
|
|
9
|
+
/* (C) 2002 Greg King */
|
|
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 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's documentation, */
|
|
23
|
+
/* would be appreciated, but is not required. */
|
|
24
|
+
/* 2. Alterred source versions must be marked plainly as such, */
|
|
25
|
+
/* and must not be misrepresented as being the original software. */
|
|
26
|
+
/* 3. This notice may not be removed or alterred */
|
|
27
|
+
/* from any source distribution. */
|
|
28
|
+
/*****************************************************************************/
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
#ifndef _STDBOOL_H
|
|
33
|
+
#define _STDBOOL_H
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
#define bool _Bool
|
|
38
|
+
typedef unsigned char _Bool;
|
|
39
|
+
|
|
40
|
+
/* Standard test-results. */
|
|
41
|
+
#define false 0
|
|
42
|
+
#define true 1
|
|
43
|
+
|
|
44
|
+
/* All three names are macroes. */
|
|
45
|
+
#define __bool_true_false_are_defined 1
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
/* End of stdbool.h */
|
|
50
|
+
#endif
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
package/include/stddef.h
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* stddef.h */
|
|
4
|
+
/* */
|
|
5
|
+
/* Common definitions */
|
|
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 _STDDEF_H
|
|
37
|
+
#define _STDDEF_H
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
/* Standard data types */
|
|
42
|
+
#ifndef _HAVE_ptrdiff_t
|
|
43
|
+
#define _HAVE_ptrdiff_t
|
|
44
|
+
typedef int ptrdiff_t;
|
|
45
|
+
#endif
|
|
46
|
+
#ifndef _HAVE_wchar_t
|
|
47
|
+
#define _HAVE_wchar_t
|
|
48
|
+
typedef char wchar_t;
|
|
49
|
+
#endif
|
|
50
|
+
#ifndef _HAVE_size_t
|
|
51
|
+
#define _HAVE_size_t
|
|
52
|
+
typedef unsigned size_t;
|
|
53
|
+
#endif
|
|
54
|
+
|
|
55
|
+
/* NULL pointer */
|
|
56
|
+
#ifndef NULL
|
|
57
|
+
#define NULL ((void *) 0)
|
|
58
|
+
#endif
|
|
59
|
+
|
|
60
|
+
/* offsetof macro */
|
|
61
|
+
#define offsetof(type, member) (size_t) (&((type*) 0)->member)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
/* End of stddef.h */
|
|
66
|
+
#endif
|
package/include/stdint.h
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* stdint.h */
|
|
4
|
+
/* */
|
|
5
|
+
/* Standard integer types */
|
|
6
|
+
/* */
|
|
7
|
+
/* */
|
|
8
|
+
/* */
|
|
9
|
+
/* (C) 2002 Ullrich von Bassewitz */
|
|
10
|
+
/* Wacholderweg 14 */
|
|
11
|
+
/* D-70597 Stuttgart */
|
|
12
|
+
/* EMail: uz@musoftware.de */
|
|
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
|
+
/* Note: This file is not fully ISO 9899-1999 compliant because cc65 lacks
|
|
37
|
+
** a 64 bit data types. The declarations have been adjusted accordingly.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
#ifndef _STDINT_H
|
|
43
|
+
#define _STDINT_H
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
/* Exact-width integer types */
|
|
48
|
+
typedef signed char int8_t;
|
|
49
|
+
typedef int int16_t;
|
|
50
|
+
typedef long int32_t;
|
|
51
|
+
typedef unsigned char uint8_t;
|
|
52
|
+
typedef unsigned uint16_t;
|
|
53
|
+
typedef unsigned long uint32_t;
|
|
54
|
+
|
|
55
|
+
#define INT8_MIN -128
|
|
56
|
+
#define INT8_MAX 127
|
|
57
|
+
#define INT16_MIN (-32767 - 1)
|
|
58
|
+
#define INT16_MAX 32767
|
|
59
|
+
#define INT32_MIN (-2147483647L - 1L)
|
|
60
|
+
#define INT32_MAX 2147483647L
|
|
61
|
+
#define UINT8_MAX 255
|
|
62
|
+
#define UINT16_MAX 65535U
|
|
63
|
+
#define UINT32_MAX 4294967295UL
|
|
64
|
+
|
|
65
|
+
/* Minimum-width integer types */
|
|
66
|
+
typedef signed char int_least8_t;
|
|
67
|
+
typedef int int_least16_t;
|
|
68
|
+
typedef long int_least32_t;
|
|
69
|
+
typedef unsigned char uint_least8_t;
|
|
70
|
+
typedef unsigned uint_least16_t;
|
|
71
|
+
typedef unsigned long uint_least32_t;
|
|
72
|
+
|
|
73
|
+
#define INT_LEAST8_MIN INT8_MIN
|
|
74
|
+
#define INT_LEAST8_MAX INT8_MAX
|
|
75
|
+
#define INT_LEAST16_MIN INT16_MIN
|
|
76
|
+
#define INT_LEAST16_MAX INT16_MAX
|
|
77
|
+
#define INT_LEAST32_MIN INT32_MIN
|
|
78
|
+
#define INT_LEAST32_MAX INT32_MAX
|
|
79
|
+
#define UINT_LEAST8_MAX UINT8_MAX
|
|
80
|
+
#define UINT_LEAST16_MAX UINT16_MAX
|
|
81
|
+
#define UINT_LEAST32_MAX UINT32_MAX
|
|
82
|
+
|
|
83
|
+
/* Fastest minimum-width integer types */
|
|
84
|
+
typedef signed char int_fast8_t;
|
|
85
|
+
typedef int int_fast16_t;
|
|
86
|
+
typedef long int_fast32_t;
|
|
87
|
+
typedef unsigned char uint_fast8_t;
|
|
88
|
+
typedef unsigned uint_fast16_t;
|
|
89
|
+
typedef unsigned long uint_fast32_t;
|
|
90
|
+
|
|
91
|
+
#define INT_FAST8_MIN INT8_MIN
|
|
92
|
+
#define INT_FAST8_MAX INT8_MAX
|
|
93
|
+
#define INT_FAST16_MIN INT16_MIN
|
|
94
|
+
#define INT_FAST16_MAX INT16_MAX
|
|
95
|
+
#define INT_FAST32_MIN INT32_MIN
|
|
96
|
+
#define INT_FAST32_MAX INT32_MAX
|
|
97
|
+
#define UINT_FAST8_MAX UINT8_MAX
|
|
98
|
+
#define UINT_FAST16_MAX UINT16_MAX
|
|
99
|
+
#define UINT_FAST32_MAX UINT32_MAX
|
|
100
|
+
|
|
101
|
+
/* Integer types capable of holding object pointers */
|
|
102
|
+
typedef int intptr_t;
|
|
103
|
+
typedef unsigned uintptr_t;
|
|
104
|
+
|
|
105
|
+
#define INTPTR_MIN INT16_MIN
|
|
106
|
+
#define INTPTR_MAX INT16_MAX
|
|
107
|
+
#define UINTPTR_MAX UINT16_MAX
|
|
108
|
+
|
|
109
|
+
/* Greatest width integer types */
|
|
110
|
+
typedef long intmax_t;
|
|
111
|
+
typedef unsigned long uintmax_t;
|
|
112
|
+
|
|
113
|
+
#define INTMAX_MIN INT32_MIN
|
|
114
|
+
#define INTMAX_MAX INT32_MAX
|
|
115
|
+
#define UINTMAX_MAX UINT32_MAX
|
|
116
|
+
|
|
117
|
+
/* Limits of other integer types */
|
|
118
|
+
#define PTRDIFF_MIN INT16_MIN
|
|
119
|
+
#define PTRDIFF_MAX INT16_MAX
|
|
120
|
+
|
|
121
|
+
#define SIG_ATOMIC_MIN 0
|
|
122
|
+
#define SIG_ATOMIC_MAX UINT8_MAX
|
|
123
|
+
|
|
124
|
+
#define SIZE_MAX UINT16_MAX
|
|
125
|
+
|
|
126
|
+
/* Macros for minimum width integer constants */
|
|
127
|
+
#define INT8_C(c) c
|
|
128
|
+
#define INT16_C(c) c
|
|
129
|
+
#define INT32_C(c) c##L
|
|
130
|
+
#define UINT8_C(c) c##U
|
|
131
|
+
#define UINT16_C(c) c##U
|
|
132
|
+
#define UINT32_C(c) c##UL
|
|
133
|
+
|
|
134
|
+
/* Macros for greatest width integer constants */
|
|
135
|
+
#define INTMAX_C(c) c##L
|
|
136
|
+
#define UINTMAX_C(c) c##UL
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
/* End of stdint.h */
|
|
141
|
+
#endif
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
package/include/stdio.h
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* stdio.h */
|
|
4
|
+
/* */
|
|
5
|
+
/* Input/output */
|
|
6
|
+
/* */
|
|
7
|
+
/* */
|
|
8
|
+
/* */
|
|
9
|
+
/* (C) 1998-2011, 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 _STDIO_H
|
|
37
|
+
#define _STDIO_H
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
/* NULL pointer */
|
|
41
|
+
#ifndef NULL
|
|
42
|
+
#define NULL ((void *) 0)
|
|
43
|
+
#endif
|
|
44
|
+
|
|
45
|
+
/* size_t is needed */
|
|
46
|
+
#ifndef _HAVE_size_t
|
|
47
|
+
#define _HAVE_size_t
|
|
48
|
+
typedef unsigned size_t;
|
|
49
|
+
#endif
|
|
50
|
+
|
|
51
|
+
/* stdio.h should not define va_list, so we use an equivalent type in the
|
|
52
|
+
compiler namespace instead */
|
|
53
|
+
typedef unsigned char* __va_list;
|
|
54
|
+
|
|
55
|
+
/* Types */
|
|
56
|
+
typedef struct _FILE FILE;
|
|
57
|
+
typedef unsigned long fpos_t;
|
|
58
|
+
|
|
59
|
+
/* Standard file descriptors */
|
|
60
|
+
extern FILE* stdin;
|
|
61
|
+
extern FILE* stdout;
|
|
62
|
+
extern FILE* stderr;
|
|
63
|
+
|
|
64
|
+
/* Standard defines */
|
|
65
|
+
#define _IOFBF 0
|
|
66
|
+
#define _IOLBF 1
|
|
67
|
+
#define _IONBF 2
|
|
68
|
+
#define BUFSIZ 256
|
|
69
|
+
#define EOF -1
|
|
70
|
+
#define FOPEN_MAX 8
|
|
71
|
+
#define SEEK_CUR 0
|
|
72
|
+
#define SEEK_END 1
|
|
73
|
+
#define SEEK_SET 2
|
|
74
|
+
#define TMP_MAX 256
|
|
75
|
+
|
|
76
|
+
/* These defines that are platform dependent */
|
|
77
|
+
/* FILENAME_MAX is defined as the same value as PATH_MAX in limits.h, but we
|
|
78
|
+
are not allowed to include limits.h here */
|
|
79
|
+
#if defined(__APPLE2__)
|
|
80
|
+
# define FILENAME_MAX (64+1)
|
|
81
|
+
#elif defined(__ATARI__)
|
|
82
|
+
# define FILENAME_MAX (63+1)
|
|
83
|
+
#elif defined(__CBM__)
|
|
84
|
+
# define FILENAME_MAX (255) /* should be 256+1, see libsrc/common/_cmd.s why it's not */
|
|
85
|
+
#elif defined(__LUNIX__)
|
|
86
|
+
# define FILENAME_MAX (80+1)
|
|
87
|
+
#elif defined(__TELESTRAT__)
|
|
88
|
+
# define FILENAME_MAX (50+1)
|
|
89
|
+
#elif defined(__SIM6502__)
|
|
90
|
+
# define FILENAME_MAX (1024+1)
|
|
91
|
+
#elif defined(__SIM65C02__)
|
|
92
|
+
# define FILENAME_MAX (1024+1)
|
|
93
|
+
#else
|
|
94
|
+
# define FILENAME_MAX (16+1)
|
|
95
|
+
#endif
|
|
96
|
+
|
|
97
|
+
#define L_tmpnam FILENAME_MAX
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
/*****************************************************************************/
|
|
101
|
+
/* Code */
|
|
102
|
+
/*****************************************************************************/
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
/* Functions */
|
|
107
|
+
void __fastcall__ clearerr (FILE* f);
|
|
108
|
+
int __fastcall__ fclose (FILE* f);
|
|
109
|
+
int __fastcall__ feof (FILE* f);
|
|
110
|
+
int __fastcall__ ferror (FILE* f);
|
|
111
|
+
int __fastcall__ fflush (FILE* f);
|
|
112
|
+
int __fastcall__ fgetc (FILE* f);
|
|
113
|
+
char* __fastcall__ fgets (char* buf, size_t size, FILE* f);
|
|
114
|
+
FILE* __fastcall__ fopen (const char* name, const char* mode);
|
|
115
|
+
int fprintf (FILE* f, const char* format, ...);
|
|
116
|
+
int __fastcall__ fputc (int c, FILE* f);
|
|
117
|
+
int __fastcall__ fputs (const char* s, FILE* f);
|
|
118
|
+
size_t __fastcall__ fread (void* buf, size_t size, size_t count, FILE* f);
|
|
119
|
+
FILE* __fastcall__ freopen (const char* name, const char* mode, FILE* f);
|
|
120
|
+
size_t __fastcall__ fwrite (const void* buf, size_t size, size_t count, FILE* f);
|
|
121
|
+
int __fastcall__ fgetpos (FILE* f, fpos_t *pos);
|
|
122
|
+
int __fastcall__ fsetpos (FILE* f, const fpos_t* pos);
|
|
123
|
+
long __fastcall__ ftell (FILE* f);
|
|
124
|
+
int __fastcall__ fseek (FILE* f, long offset, int whence);
|
|
125
|
+
void __fastcall__ rewind (FILE *f);
|
|
126
|
+
int getchar (void);
|
|
127
|
+
char* __fastcall__ gets (char* s);
|
|
128
|
+
void __fastcall__ perror (const char* s);
|
|
129
|
+
int printf (const char* format, ...);
|
|
130
|
+
int __fastcall__ putchar (int c);
|
|
131
|
+
int __fastcall__ puts (const char* s);
|
|
132
|
+
int __fastcall__ remove (const char* name);
|
|
133
|
+
int __fastcall__ rename (const char* oldname, const char* newname);
|
|
134
|
+
int snprintf (char* buf, size_t size, const char* format, ...);
|
|
135
|
+
int sprintf (char* buf, const char* format, ...);
|
|
136
|
+
int __fastcall__ ungetc (int c, FILE* f);
|
|
137
|
+
int __fastcall__ vfprintf (FILE* f, const char* format, __va_list ap);
|
|
138
|
+
int __fastcall__ vprintf (const char* format, __va_list ap);
|
|
139
|
+
int __fastcall__ vsnprintf (char* buf, size_t size, const char* format, __va_list ap);
|
|
140
|
+
int __fastcall__ vsprintf (char* buf, const char* format, __va_list ap);
|
|
141
|
+
|
|
142
|
+
int scanf (const char* format, ...);
|
|
143
|
+
int fscanf (FILE* f, const char* format, ...);
|
|
144
|
+
int sscanf (const char* s, const char* format, ...);
|
|
145
|
+
int __fastcall__ vscanf (const char* format, __va_list ap);
|
|
146
|
+
int __fastcall__ vsscanf (const char* s, const char* format, __va_list ap);
|
|
147
|
+
int __fastcall__ vfscanf (FILE* f, const char* format, __va_list ap);
|
|
148
|
+
|
|
149
|
+
#if __CC65_STD__ == __CC65_STD_CC65__
|
|
150
|
+
FILE* __fastcall__ fdopen (int fd, const char* mode); /* Unix */
|
|
151
|
+
int __fastcall__ fileno (FILE* f); /* Unix */
|
|
152
|
+
#endif
|
|
153
|
+
void __fastcall__ __poserror (const char* msg); /* cc65 */
|
|
154
|
+
#if __CC65_STD__ == __CC65_STD_CC65__
|
|
155
|
+
/* define old name with one underscore for backwards compatibility */
|
|
156
|
+
#define _poserror __poserror
|
|
157
|
+
#endif
|
|
158
|
+
|
|
159
|
+
/* Masking macros for some functions */
|
|
160
|
+
#define getc(f) fgetc (f) /* ANSI */
|
|
161
|
+
#define putc(c, f) fputc (c, f) /* ANSI */
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
/* End of stdio.h */
|
|
166
|
+
#endif
|