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