1 #ifndef AFILE_H_ 2 #define AFILE_H_ 3 4 /* File types returned by AFILE_DetectFileType() and AFILE_OpenFile(). */ 5 #define AFILE_ERROR 0 6 #define AFILE_ATR 1 7 #define AFILE_XFD 2 8 #define AFILE_ATR_GZ 3 9 #define AFILE_XFD_GZ 4 10 #define AFILE_DCM 5 11 #define AFILE_XEX 6 12 #define AFILE_BAS 7 13 #define AFILE_LST 8 14 #define AFILE_CART 9 15 #define AFILE_ROM 10 16 #define AFILE_CAS 11 17 #define AFILE_BOOT_TAPE 12 18 #define AFILE_STATE 13 19 #define AFILE_STATE_GZ 14 20 #define AFILE_PRO 15 21 #define AFILE_ATX 16 22 23 /* ATR format header */ 24 struct AFILE_ATR_Header { 25 unsigned char magic1; 26 unsigned char magic2; 27 unsigned char seccountlo; 28 unsigned char seccounthi; 29 unsigned char secsizelo; 30 unsigned char secsizehi; 31 unsigned char hiseccountlo; 32 unsigned char hiseccounthi; 33 unsigned char gash[7]; 34 unsigned char writeprotect; 35 }; 36 37 /* First two bytes of an ATR file. */ 38 #define AFILE_ATR_MAGIC1 0x96 39 #define AFILE_ATR_MAGIC2 0x02 40 41 /* Auto-detects file type and returns one of AFILE_* values. */ 42 int AFILE_DetectFileType(const char *filename); 43 44 /* Auto-detects file type and mounts the file in the emulator. 45 reboot: Atari800_Coldstart() for disks, cartridges and tapes 46 diskno: drive number for disks (1-8) 47 readonly: mount disks as read-only */ 48 int AFILE_OpenFile(const char *filename, int reboot, int diskno, int readonly); 49 50 #endif /* AFILE_H_ */ 51