--- hatari/src/includes/gemdos.h 2019/04/01 07:09:16 1.1.1.1 +++ hatari/src/includes/gemdos.h 2019/04/01 07:12:13 1.1.1.5 @@ -1,6 +1,11 @@ /* - Hatari + Hatari - gemdos.h + + This file is distributed under the GNU Public License, version 2 or at + your option any later version. Read the file gpl.txt for details. */ +#ifndef HATARI_GEMDOS_H +#define HATARI_GEMDOS_H /* GEMDOS error codes, See 'The Atari Compendium' D.3 @@ -55,11 +60,6 @@ */ #define TOS_NAMELEN 14 -//typedef struct { -// HANDLE FileHandle; -// WIN32_FIND_DATA FindFileData; -//} INTERNAL_DTA; - typedef struct { unsigned char index[2]; unsigned char magic[4]; @@ -71,36 +71,51 @@ typedef struct { unsigned char dta_size[4]; char dta_name[TOS_NAMELEN]; } DTA; -#define DTA_MAGIC_NUMBER 0x12983476 -#define MAX_DTAS_FILES 256 // Must be ^2 -//typedef struct { -// HANDLE FileHandle; -// BOOL bUsed; -//} FILE_HANDLE; +#define DTA_MAGIC_NUMBER 0x12983476 +#define MAX_DTAS_FILES 256 /* Must be ^2 */ +#define CALL_PEXEC_ROUTINE 3 /* Call our cartridge pexec routine */ -#define BASE_FILEHANDLE 64 // Our emulation handles - MUST not be valid TOS ones, but MUST be <256 -#define MAX_FILE_HANDLES 32 // We can allow 32 files open at once +#define BASE_FILEHANDLE 64 /* Our emulation handles - MUST not be valid TOS ones, but MUST be <256 */ +#define MAX_FILE_HANDLES 32 /* We can allow 32 files open at once */ -// DateTime +/* + DateTime structure used by TOS call $57 f_dattime + Changed to fix potential problem with alignment. +*/ typedef struct { - unsigned hour:5; - unsigned minute:6; - unsigned second:5; - unsigned year:7; - unsigned month:4; - unsigned day:5; + unsigned short word1; + unsigned short word2; } DATETIME; + +#ifndef MAX_PATH +#define MAX_PATH 256 +#endif + +typedef struct { + char hd_emulation_dir[MAX_PATH]; /* hd emulation directory */ + char fs_currpath[MAX_PATH]; /* current path */ + int hd_letter; /* drive letter */ +} EMULATEDDRIVE; + +extern EMULATEDDRIVE **emudrives; + #define ISHARDDRIVE(Drive) (Drive!=-1) +#define GEMDOS_EMU_ON (emudrives != NULL) extern BOOL bInitGemDOS; extern unsigned short int CurrentDrive; extern void GemDOS_Init(void); extern void GemDOS_Reset(void); +extern void GemDOS_InitDrives(void); +extern void GemDOS_UnInitDrives(void); extern void GemDOS_MemorySnapShot_Capture(BOOL bSave); -extern void GemDOS_CreateHardDriveFileName(int Drive,char *pszFileName,char *pszDestName); +extern void GemDOS_CreateHardDriveFileName(int Drive, const char *pszFileName, char *pszDestName); extern BOOL GemDOS(void); extern void GemDOS_OpCode(void); extern void GemDOS_RunOldOpCode(void); +extern void GemDOS_Boot(void); + +#endif /* HATARI_GEMDOS_H */