|
|
1.1 root 1: /*
2: Hatari
3: */
4:
1.1.1.2 ! root 5:
1.1 root 6: /*
7: GEMDOS error codes, See 'The Atari Compendium' D.3
8: */
9: #define GEMDOS_EOK 0 // OK
10: #define GEMDOS_ERROR -1 // Generic error
11: #define GEMDOS_EDRVNR -2 // Drive not ready
12: #define GEMDOS_EUNCMD -3 // Unknown command
13: #define GEMDOS_E_CRC -4 // CRC error
14: #define GEMDOS_EBADRQ -5 // Bad request
15: #define GEMDOS_E_SEEK -6 // Seek error
16: #define GEMDOS_EMEDIA -7 // Unknown media
17: #define GEMDOS_ESECNF -8 // Sector not found
18: #define GEMDOS_EPAPER -9 // Out of paper
19: #define GEMDOS_EWRITF -10 // Write fault
20: #define GEMDOS_EREADF -11 // Read fault
21: #define GEMDOS_EWRPRO -12 // Device is write protected
22: #define GEMDOS_E_CHNG -14 // Media change detected
23: #define GEMDOS_EUNDEV -15 // Unknown device
24: #define GEMDOS_EINVFN -32 // Invalid function
25: #define GEMDOS_EFILNF -33 // File not found
26: #define GEMDOS_EPTHNF -34 // Path not found
27: #define GEMDOS_ENHNDL -35 // No more handles
28: #define GEMDOS_EACCDN -36 // Access denied
29: #define GEMDOS_EIHNDL -37 // Invalid handle
30: #define GEMDOS_ENSMEM -39 // Insufficient memory
31: #define GEMDOS_EIMBA -40 // Invalid memory block address
32: #define GEMDOS_EDRIVE -46 // Invalid drive specification
33: #define GEMDOS_ENSAME -48 // Cross device rename
34: #define GEMDOS_ENMFIL -49 // No more files
35: #define GEMDOS_ELOCKED -58 // Record is already locked
36: #define GEMDOS_ENSLOCK -59 // Invalid lock removal request
37: #define GEMDOS_ERANGE -64 // Range error
38: #define GEMDOS_EINTRN -65 // Internal error
39: #define GEMDOS_EPLFMT -66 // Invalid program load format
40: #define GEMDOS_EGSBF -67 // Memory block growth failure
41: #define GEMDOS_ELOOP -80 // Too many symbolic links
42: #define GEMDOS_EMOUNT -200 // Mount point crossed (indicator)
43:
44: /*
45: GemDOS file attributes
46: */
47: #define GEMDOS_FILE_ATTRIB_READONLY 0x01
48: #define GEMDOS_FILE_ATTRIB_HIDDEN 0x02
49: #define GEMDOS_FILE_ATTRIB_SYSTEM_FILE 0x04
50: #define GEMDOS_FILE_ATTRIB_VOLUME_LABEL 0x08
51: #define GEMDOS_FILE_ATTRIB_SUBDIRECTORY 0x10
52: #define GEMDOS_FILE_ATTRIB_WRITECLOSE 0x20
53:
54: /*
55: Disc Tranfer Address (DTA)
56: */
57: #define TOS_NAMELEN 14
58:
59: typedef struct {
60: unsigned char index[2];
61: unsigned char magic[4];
62: char dta_pat[TOS_NAMELEN];
63: char dta_sattrib;
64: char dta_attrib;
65: unsigned char dta_time[2];
66: unsigned char dta_date[2];
67: unsigned char dta_size[4];
68: char dta_name[TOS_NAMELEN];
69: } DTA;
70:
1.1.1.2 ! root 71: #define DTA_MAGIC_NUMBER 0x12983476
! 72: #define MAX_DTAS_FILES 256 /* Must be ^2 */
! 73: #define CALL_PEXEC_ROUTINE 3 /* Call our cartridge pexec routine */
1.1 root 74:
1.1.1.2 ! root 75: #define BASE_FILEHANDLE 64 /* Our emulation handles - MUST not be valid TOS ones, but MUST be <256 */
! 76: #define MAX_FILE_HANDLES 32 /* We can allow 32 files open at once */
1.1 root 77:
1.1.1.2 ! root 78: /*
! 79: DateTime structure used by TOS call $57 f_dattime
! 80: Changed to fix potential problem with alignment.
! 81: */
1.1 root 82: typedef struct {
1.1.1.2 ! root 83: unsigned short word1;
! 84: unsigned short word2;
1.1 root 85: } DATETIME;
86:
1.1.1.2 ! root 87:
! 88: #ifndef MAX_PATH
! 89: #define MAX_PATH 256
! 90: #endif
! 91:
! 92: typedef struct {
! 93: char hd_emulation_dir[MAX_PATH]; /* hd emulation directory */
! 94: char fs_currpath[MAX_PATH]; /* current path */
! 95: } EMULATEDDRIVE;
! 96:
! 97: extern EMULATEDDRIVE **emudrives;
! 98:
1.1 root 99: #define ISHARDDRIVE(Drive) (Drive!=-1)
100:
101: extern BOOL bInitGemDOS;
102: extern unsigned short int CurrentDrive;
103:
104: extern void GemDOS_Init(void);
105: extern void GemDOS_Reset(void);
106: extern void GemDOS_MemorySnapShot_Capture(BOOL bSave);
107: extern void GemDOS_CreateHardDriveFileName(int Drive,char *pszFileName,char *pszDestName);
108: extern BOOL GemDOS(void);
109: extern void GemDOS_OpCode(void);
110: extern void GemDOS_RunOldOpCode(void);
1.1.1.2 ! root 111: extern void GemDOS_Boot(void);
! 112:
! 113:
! 114:
! 115:
! 116:
! 117:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.