fcdev-cc65 0.0.0-stage → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/dio.h
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* dio.h */
|
|
4
|
+
/* */
|
|
5
|
+
/* Low-Level diskette I/O functions */
|
|
6
|
+
/* */
|
|
7
|
+
/* */
|
|
8
|
+
/* */
|
|
9
|
+
/* (C) 2005 Christian Groessler <chris@groessler.org> */
|
|
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 _DIO_H
|
|
34
|
+
#define _DIO_H
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/* Please note: All functions in this file will set __oserror *and* return its
|
|
39
|
+
** value. The only exception is dio_open, which will return NULL, but __oserror
|
|
40
|
+
** will be set. All function will also set __oserror in case of successful
|
|
41
|
+
** execution, effectively clearing it.
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
/*****************************************************************************/
|
|
47
|
+
/* Data */
|
|
48
|
+
/*****************************************************************************/
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
typedef struct __dhandle_t *dhandle_t;
|
|
53
|
+
|
|
54
|
+
typedef struct {
|
|
55
|
+
unsigned char head;
|
|
56
|
+
unsigned track;
|
|
57
|
+
unsigned sector;
|
|
58
|
+
} dio_phys_pos;
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
/*****************************************************************************/
|
|
63
|
+
/* Code */
|
|
64
|
+
/*****************************************************************************/
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
unsigned __fastcall__ dio_query_sectsize (dhandle_t handle);
|
|
69
|
+
/* returns sector size */
|
|
70
|
+
|
|
71
|
+
unsigned __fastcall__ dio_query_sectcount (dhandle_t handle);
|
|
72
|
+
/* returns sector count */
|
|
73
|
+
|
|
74
|
+
dhandle_t __fastcall__ dio_open (unsigned char device);
|
|
75
|
+
/* open device for subsequent dio access */
|
|
76
|
+
|
|
77
|
+
unsigned char __fastcall__ dio_close (dhandle_t handle);
|
|
78
|
+
/* close device, returns oserror (0 for success) */
|
|
79
|
+
|
|
80
|
+
unsigned char __fastcall__ dio_read (dhandle_t handle,
|
|
81
|
+
unsigned sect_num,
|
|
82
|
+
void *buffer);
|
|
83
|
+
/* read sector <sect_num> from device <handle> to memory at <buffer> */
|
|
84
|
+
/* the number of bytes transferred depends on the sector size */
|
|
85
|
+
/* returns oserror (0 for success) */
|
|
86
|
+
|
|
87
|
+
unsigned char __fastcall__ dio_write (dhandle_t handle,
|
|
88
|
+
unsigned sect_num,
|
|
89
|
+
const void *buffer);
|
|
90
|
+
/* write memory at <buffer> to sector <sect_num> on device <handle>, no verify */
|
|
91
|
+
/* the number of bytes transferred depends on the sector size */
|
|
92
|
+
/* returns oserror (0 for success) */
|
|
93
|
+
|
|
94
|
+
unsigned char __fastcall__ dio_write_verify (dhandle_t handle,
|
|
95
|
+
unsigned sect_num,
|
|
96
|
+
const void *buffer);
|
|
97
|
+
/* write memory at <buffer> to sector <sect_num> on device <handle>, verify after write */
|
|
98
|
+
/* the number of bytes transferred depends on the sector size */
|
|
99
|
+
/* returns oserror (0 for success) */
|
|
100
|
+
|
|
101
|
+
unsigned char __fastcall__ dio_phys_to_log (dhandle_t handle,
|
|
102
|
+
const dio_phys_pos *physpos, /* input */
|
|
103
|
+
unsigned *sectnum); /* output */
|
|
104
|
+
/* convert physical sector address (head/track/sector) to logical sector number */
|
|
105
|
+
/* returns oserror (0 for success) */
|
|
106
|
+
|
|
107
|
+
unsigned char __fastcall__ dio_log_to_phys (dhandle_t handle,
|
|
108
|
+
const unsigned *sectnum, /* input */
|
|
109
|
+
dio_phys_pos *physpos); /* output */
|
|
110
|
+
/* convert logical sector number to physical sector address (head/track/sector) */
|
|
111
|
+
/* returns oserror (0 for success) */
|
|
112
|
+
|
|
113
|
+
#endif /* #ifndef _DIO_H */
|
package/include/dirent.h
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* dirent.h */
|
|
4
|
+
/* */
|
|
5
|
+
/* Directory entries for cc65 */
|
|
6
|
+
/* */
|
|
7
|
+
/* */
|
|
8
|
+
/* */
|
|
9
|
+
/* (C) 2005 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 _DIRENT_H
|
|
34
|
+
#define _DIRENT_H
|
|
35
|
+
|
|
36
|
+
#include <target.h>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
/*****************************************************************************/
|
|
41
|
+
/* Data */
|
|
42
|
+
/*****************************************************************************/
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
typedef struct DIR DIR;
|
|
47
|
+
|
|
48
|
+
#if defined(__APPLE2__)
|
|
49
|
+
|
|
50
|
+
struct dirent {
|
|
51
|
+
char d_name[16];
|
|
52
|
+
unsigned d_ino;
|
|
53
|
+
unsigned d_blocks;
|
|
54
|
+
unsigned long d_size;
|
|
55
|
+
unsigned char d_type;
|
|
56
|
+
struct datetime d_ctime;
|
|
57
|
+
unsigned char d_access;
|
|
58
|
+
unsigned d_auxtype;
|
|
59
|
+
struct datetime d_mtime;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
#define _DE_ISREG(t) ((t) != 0x0F)
|
|
63
|
+
#define _DE_ISDIR(t) ((t) == 0x0F)
|
|
64
|
+
#define _DE_ISLBL(t) (0)
|
|
65
|
+
#define _DE_ISLNK(t) (0)
|
|
66
|
+
|
|
67
|
+
#elif defined(__ATARI__)
|
|
68
|
+
|
|
69
|
+
struct dirent {
|
|
70
|
+
char d_name[13]; /* 8.3 + trailing 0 */
|
|
71
|
+
unsigned char d_type;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
#define _DE_ISREG(t) ((t) != 0xC4)
|
|
75
|
+
#define _DE_ISDIR(t) ((t) == 0xC4)
|
|
76
|
+
#define _DE_ISLBL(t) (0)
|
|
77
|
+
#define _DE_ISLNK(t) (0)
|
|
78
|
+
|
|
79
|
+
#elif defined(__CBM__)
|
|
80
|
+
|
|
81
|
+
struct dirent {
|
|
82
|
+
char d_name[16+1];
|
|
83
|
+
unsigned int d_off;
|
|
84
|
+
unsigned int d_blocks;
|
|
85
|
+
unsigned char d_type; /* See _CBM_T_xxx defines */
|
|
86
|
+
|
|
87
|
+
/* bsd extensions */
|
|
88
|
+
unsigned char d_namlen;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/* File type specification macros. We need definitions of CBM file types. */
|
|
92
|
+
#include <cbm_filetype.h>
|
|
93
|
+
|
|
94
|
+
#define _DE_ISREG(t) (((t) & _CBM_T_REG) != 0)
|
|
95
|
+
#define _DE_ISDIR(t) ((t) == _CBM_T_DIR)
|
|
96
|
+
#define _DE_ISLBL(t) ((t) == _CBM_T_HEADER)
|
|
97
|
+
#define _DE_ISLNK(t) ((t) == _CBM_T_LNK)
|
|
98
|
+
|
|
99
|
+
#elif defined(__LYNX__)
|
|
100
|
+
|
|
101
|
+
struct dirent {
|
|
102
|
+
unsigned char d_blocks;
|
|
103
|
+
unsigned int d_offset;
|
|
104
|
+
char d_type;
|
|
105
|
+
void *d_address;
|
|
106
|
+
unsigned int d_size;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
extern struct dirent FileEntry;
|
|
110
|
+
#pragma zpsym ("FileEntry");
|
|
111
|
+
|
|
112
|
+
#define _DE_ISREG(t) (1)
|
|
113
|
+
#define _DE_ISDIR(t) (0)
|
|
114
|
+
#define _DE_ISLBL(t) (0)
|
|
115
|
+
#define _DE_ISLNK(t) (0)
|
|
116
|
+
|
|
117
|
+
#else
|
|
118
|
+
|
|
119
|
+
struct dirent {
|
|
120
|
+
char d_name[1];
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
#define _DE_ISREG(t) (1)
|
|
124
|
+
#define _DE_ISDIR(t) (0)
|
|
125
|
+
#define _DE_ISLBL(t) (0)
|
|
126
|
+
#define _DE_ISLNK(t) (0)
|
|
127
|
+
|
|
128
|
+
#endif
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
/*****************************************************************************/
|
|
133
|
+
/* Code */
|
|
134
|
+
/*****************************************************************************/
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
DIR* __fastcall__ opendir (const char* name);
|
|
139
|
+
|
|
140
|
+
struct dirent* __fastcall__ readdir (DIR* dir);
|
|
141
|
+
|
|
142
|
+
int __fastcall__ closedir (DIR* dir);
|
|
143
|
+
|
|
144
|
+
long __fastcall__ telldir (DIR* dir);
|
|
145
|
+
|
|
146
|
+
void __fastcall__ seekdir (DIR* dir, long offs);
|
|
147
|
+
|
|
148
|
+
void __fastcall__ rewinddir (DIR* dir);
|
|
149
|
+
|
|
150
|
+
/* End of dirent.h */
|
|
151
|
+
#endif
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* em-kernel.h */
|
|
4
|
+
/* */
|
|
5
|
+
/* Internally used EM functions */
|
|
6
|
+
/* */
|
|
7
|
+
/* */
|
|
8
|
+
/* */
|
|
9
|
+
/* (C) 2002-2003 Ullrich von Bassewitz */
|
|
10
|
+
/* Roemerstrasse 52 */
|
|
11
|
+
/* D-70794 Filderstadt */
|
|
12
|
+
/* EMail: uz@cc65.org */
|
|
13
|
+
/* */
|
|
14
|
+
/* */
|
|
15
|
+
/* This software is provided 'as-is', without any expressed or implied */
|
|
16
|
+
/* warranty. In no event will the authors be held liable for any damages */
|
|
17
|
+
/* arising from the use of this software. */
|
|
18
|
+
/* */
|
|
19
|
+
/* Permission is granted to anyone to use this software for any purpose, */
|
|
20
|
+
/* including commercial applications, and to alter it and redistribute it */
|
|
21
|
+
/* freely, subject to the following restrictions: */
|
|
22
|
+
/* */
|
|
23
|
+
/* 1. The origin of this software must not be misrepresented; you must not */
|
|
24
|
+
/* claim that you wrote the original software. If you use this software */
|
|
25
|
+
/* in a product, an acknowledgment in the product documentation would be */
|
|
26
|
+
/* appreciated but is not required. */
|
|
27
|
+
/* 2. Altered source versions must be plainly marked as such, and must not */
|
|
28
|
+
/* be misrepresented as being the original software. */
|
|
29
|
+
/* 3. This notice may not be removed or altered from any source */
|
|
30
|
+
/* distribution. */
|
|
31
|
+
/* */
|
|
32
|
+
/*****************************************************************************/
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
#ifndef _EM_KERNEL_H
|
|
37
|
+
#define _EM_KERNEL_H
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
/*****************************************************************************/
|
|
42
|
+
/* Data */
|
|
43
|
+
/*****************************************************************************/
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
/* A structure that describes the header of an extended memory driver loaded
|
|
48
|
+
** into memory.
|
|
49
|
+
*/
|
|
50
|
+
typedef struct {
|
|
51
|
+
|
|
52
|
+
/* Driver header */
|
|
53
|
+
char id[3]; /* Contains 0x65, 0x6d, 0x64 ("emd") */
|
|
54
|
+
unsigned char version; /* Interface version */
|
|
55
|
+
void* libreference; /* Library reference */
|
|
56
|
+
|
|
57
|
+
/* Jump vectors. Note that these are not C callable */
|
|
58
|
+
void* install; /* INSTALL routine */
|
|
59
|
+
void* deinstall; /* DEINSTALL routine */
|
|
60
|
+
void* pagecount; /* PAGECOUNT routine */
|
|
61
|
+
void* map; /* MAP routine */
|
|
62
|
+
void* use; /* USE routine */
|
|
63
|
+
void* mapclean; /* MAPCLEAN routine */
|
|
64
|
+
void* copyfrom; /* COPYFROM routine */
|
|
65
|
+
void* copyto; /* COPYTO routine */
|
|
66
|
+
|
|
67
|
+
} em_drv_header;
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
/* EM kernel variables */
|
|
72
|
+
extern em_drv_header* em_drv; /* Pointer to driver */
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
/* End of em-kernel.h */
|
|
77
|
+
#endif
|
package/include/em.h
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* em.h */
|
|
4
|
+
/* */
|
|
5
|
+
/* API for extended memory access */
|
|
6
|
+
/* */
|
|
7
|
+
/* */
|
|
8
|
+
/* */
|
|
9
|
+
/* (C) 2002-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 _EM_H
|
|
37
|
+
#define _EM_H
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
/*****************************************************************************/
|
|
42
|
+
/* Definitions */
|
|
43
|
+
/*****************************************************************************/
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
/* Size of an extended memory page */
|
|
48
|
+
#define EM_PAGE_SIZE 256
|
|
49
|
+
|
|
50
|
+
/* Error codes */
|
|
51
|
+
#define EM_ERR_OK 0 /* No error */
|
|
52
|
+
#define EM_ERR_NO_DRIVER 1 /* No driver available */
|
|
53
|
+
#define EM_ERR_CANNOT_LOAD 2 /* Error loading driver */
|
|
54
|
+
#define EM_ERR_INV_DRIVER 3 /* Invalid driver */
|
|
55
|
+
#define EM_ERR_NO_DEVICE 4 /* Device (hardware) not found */
|
|
56
|
+
#define EM_ERR_INSTALLED 5 /* A driver is already installed */
|
|
57
|
+
|
|
58
|
+
/* Parameters for the em_copy_... functions. NOTE: The first seven bytes
|
|
59
|
+
** have the same order and alignment as needed for the Commodore REU, so
|
|
60
|
+
** don't change the order without changing the assembler file that defines
|
|
61
|
+
** the struct offsets and the code in the REU driver.
|
|
62
|
+
*/
|
|
63
|
+
struct em_copy {
|
|
64
|
+
void* buf; /* Memory buffer to copy from or to */
|
|
65
|
+
unsigned char offs; /* Offset into page */
|
|
66
|
+
unsigned page; /* Starting page to copy from or to */
|
|
67
|
+
unsigned count; /* Number of bytes to copy */
|
|
68
|
+
unsigned char unused; /* Make the size 8 bytes */
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
/*****************************************************************************/
|
|
74
|
+
/* Functions */
|
|
75
|
+
/*****************************************************************************/
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
unsigned char __fastcall__ em_load_driver (const char* driver);
|
|
80
|
+
/* Load and install an extended memory driver. Return an error code. */
|
|
81
|
+
|
|
82
|
+
unsigned char em_unload (void);
|
|
83
|
+
/* Uninstall, then unload the currently loaded driver. */
|
|
84
|
+
|
|
85
|
+
unsigned char __fastcall__ em_install (const void* driver);
|
|
86
|
+
/* Install an already loaded driver. Return an error code. */
|
|
87
|
+
|
|
88
|
+
unsigned char em_uninstall (void);
|
|
89
|
+
/* Uninstall the currently loaded driver and return an error code.
|
|
90
|
+
** Note: This call does not free allocated memory.
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
unsigned em_pagecount (void);
|
|
94
|
+
/* Return the total number of 256 byte pages available in extended memory. */
|
|
95
|
+
|
|
96
|
+
void* __fastcall__ em_map (unsigned page);
|
|
97
|
+
/* Unmap the current page from memory and map a new one. The function returns
|
|
98
|
+
** a pointer to the location of the page in memory. Note: Without calling
|
|
99
|
+
** em_commit, the old contents of the memory window may be lost!
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
void* __fastcall__ em_use (unsigned page);
|
|
103
|
+
/* Tell the driver that the memory window is associated with a given page.
|
|
104
|
+
** This call is very similar to em_map. The difference is that the driver
|
|
105
|
+
** does not necessarily transfer the current contents of the extended
|
|
106
|
+
** memory into the returned window. If you're going to just write to the
|
|
107
|
+
** window and the current contents of the window are invalid or no longer
|
|
108
|
+
** use, this call may perform better than em_map.
|
|
109
|
+
*/
|
|
110
|
+
|
|
111
|
+
void em_commit (void);
|
|
112
|
+
/* Commit changes in the memory window to extended storage. If the contents
|
|
113
|
+
** of the memory window have been changed, these changes may be lost if
|
|
114
|
+
** em_map, em_copyfrom or em_copyto are called without calling em_commit
|
|
115
|
+
** first. Note: Not calling em_commit does not mean that the changes are
|
|
116
|
+
** discarded, it does just mean that some drivers will discard the changes.
|
|
117
|
+
*/
|
|
118
|
+
|
|
119
|
+
void __fastcall__ em_copyfrom (const struct em_copy* copy_data);
|
|
120
|
+
/* Copy from extended into linear memory. Note: This may invalidate the
|
|
121
|
+
** currently mapped page.
|
|
122
|
+
*/
|
|
123
|
+
|
|
124
|
+
void __fastcall__ em_copyto (const struct em_copy* copy_data);
|
|
125
|
+
/* Copy from linear into extended memory. Note: This may invalidate the
|
|
126
|
+
** currently mapped page.
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
/* End of em.h */
|
|
132
|
+
#endif
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
package/include/errno.h
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/*****************************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* errno.h */
|
|
4
|
+
/* */
|
|
5
|
+
/* Error codes */
|
|
6
|
+
/* */
|
|
7
|
+
/* */
|
|
8
|
+
/* */
|
|
9
|
+
/* (C) 1998-2010, 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 _ERRNO_H
|
|
37
|
+
#define _ERRNO_H
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
/*****************************************************************************/
|
|
42
|
+
/* Data */
|
|
43
|
+
/*****************************************************************************/
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
/* Operating system specific error code */
|
|
48
|
+
extern unsigned char __oserror;
|
|
49
|
+
|
|
50
|
+
#if __CC65_STD__ >= __CC65_STD_CC65__
|
|
51
|
+
/* define the name with just one underscore for backwards compatibility */
|
|
52
|
+
#define _oserror __oserror
|
|
53
|
+
#endif
|
|
54
|
+
|
|
55
|
+
extern int __errno;
|
|
56
|
+
/* System errors go here */
|
|
57
|
+
|
|
58
|
+
#define errno __errno
|
|
59
|
+
/* errno must be a macro */
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/* Possible error codes */
|
|
64
|
+
#define ENOENT 1 /* No such file or directory */
|
|
65
|
+
#define ENOMEM 2 /* Out of memory */
|
|
66
|
+
#define EACCES 3 /* Permission denied */
|
|
67
|
+
#define ENODEV 4 /* No such device */
|
|
68
|
+
#define EMFILE 5 /* Too many open files */
|
|
69
|
+
#define EBUSY 6 /* Device or resource busy */
|
|
70
|
+
#define EINVAL 7 /* Invalid argument */
|
|
71
|
+
#define ENOSPC 8 /* No space left on device */
|
|
72
|
+
#define EEXIST 9 /* File exists */
|
|
73
|
+
#define EAGAIN 10 /* Try again */
|
|
74
|
+
#define EIO 11 /* I/O error */
|
|
75
|
+
#define EINTR 12 /* Interrupted system call */
|
|
76
|
+
#define ENOSYS 13 /* Function not implemented */
|
|
77
|
+
#define ESPIPE 14 /* Illegal seek */
|
|
78
|
+
#define ERANGE 15 /* Range error */
|
|
79
|
+
#define EBADF 16 /* Bad file number */
|
|
80
|
+
#define ENOEXEC 17 /* Exec format error */
|
|
81
|
+
#define EUNKNOWN 18 /* Unknown OS specific error */
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
/*****************************************************************************/
|
|
86
|
+
/* Code */
|
|
87
|
+
/*****************************************************************************/
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
int __fastcall__ __osmaperrno (unsigned char oserror);
|
|
92
|
+
/* Map an operating system specific error code (for example from __oserror)
|
|
93
|
+
** into one of the E... codes above. It is user callable.
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
#if __CC65_STD__ >= __CC65_STD_CC65__
|
|
97
|
+
/* define the name with just one underscore for backwards compatibility */
|
|
98
|
+
#define _osmaperrno __osmaperrno
|
|
99
|
+
#endif
|
|
100
|
+
|
|
101
|
+
unsigned char __fastcall__ __seterrno (unsigned char code);
|
|
102
|
+
/* Set errno to a specific error code and return zero. Used by the library */
|
|
103
|
+
|
|
104
|
+
#if __CC65_STD__ >= __CC65_STD_CC65__
|
|
105
|
+
/* define the name with just one underscore for backwards compatibility */
|
|
106
|
+
#define _seterrno __seterrno
|
|
107
|
+
#endif
|
|
108
|
+
|
|
109
|
+
int __fastcall__ __directerrno (unsigned char code);
|
|
110
|
+
/* Set errno to a specific error code, clear __oserror and return -1. Used
|
|
111
|
+
** by the library.
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
#if __CC65_STD__ >= __CC65_STD_CC65__
|
|
115
|
+
/* define the name with just one underscore for backwards compatibility */
|
|
116
|
+
#define _directerrno __directerrno
|
|
117
|
+
#endif
|
|
118
|
+
|
|
119
|
+
int __fastcall__ __mappederrno (unsigned char code);
|
|
120
|
+
/* Set __oserror to the given platform specific error code. If it is a real
|
|
121
|
+
** error code (not zero) set errno to the corresponding system error code
|
|
122
|
+
** and return -1. Otherwise return zero.
|
|
123
|
+
** Used by the library.
|
|
124
|
+
*/
|
|
125
|
+
|
|
126
|
+
#if __CC65_STD__ >= __CC65_STD_CC65__
|
|
127
|
+
/* define the name with just one underscore for backwards compatibility */
|
|
128
|
+
#define _mappederrno __mappederrno
|
|
129
|
+
#endif
|
|
130
|
+
|
|
131
|
+
/* End of errno.h */
|
|
132
|
+
#endif
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|