--- hatari/src/includes/floppy.h 2019/04/01 07:09:16 1.1 +++ hatari/src/includes/floppy.h 2019/04/01 07:14:51 1.1.1.7 @@ -1,35 +1,46 @@ /* - Hatari + Hatari - floppy.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. */ -// Structure for each drive connected as emulation -typedef struct { - unsigned char *pBuffer; - char szFileName[MAX_FILENAME_LENGTH]; +#ifndef HATARI_FLOPPY_H +#define HATARI_FLOPPY_H + +#include "configuration.h" + +/* Structure for each drive connected as emulation */ +typedef struct +{ + Uint8 *pBuffer; int nImageBytes; - BOOL bDiscInserted; - BOOL bMediaChanged; - BOOL bContentsChanged; - BOOL bOKToSave; + bool bDiskInserted; + bool bMediaChanged; + bool bContentsChanged; + bool bOKToSave; } EMULATION_DRIVE; -#define NUM_EMULATION_DRIVES 2 // A:, B: -#define DRIVE_BUFFER_BYTES (1536*1024) // 1.5Mb area for each drive -#define NUMBYTESPERSECTOR 512 // All discs are 512 bytes per sector +#define MAX_FLOPPYDRIVES 2 /* A:, B: */ +#define NUMBYTESPERSECTOR 512 /* All disks are 512 bytes per sector */ -extern EMULATION_DRIVE EmulationDrives[NUM_EMULATION_DRIVES]; +extern EMULATION_DRIVE EmulationDrives[MAX_FLOPPYDRIVES]; extern int nBootDrive; -extern char *pszDiscImageNameExts[]; extern void Floppy_Init(void); extern void Floppy_UnInit(void); -extern void Floppy_MemorySnapShot_Capture(BOOL bSave); +extern void Floppy_MemorySnapShot_Capture(bool bSave); extern void Floppy_GetBootDrive(void); -extern BOOL Floppy_InsertDiscIntoDrive(int Drive, char *pszFileName); -extern void Floppy_EjectDiscFromDrive(int Drive,BOOL bInformUser); -extern void Floppy_EjectBothDrives(void); -extern void Floppy_FindDiscDetails(unsigned char *pBuffer,int nImageBytes,unsigned short int *pnSectorsPerTrack,unsigned short int *pnSides); -extern BOOL Floppy_ReadSectors(int Drive,char *pBuffer,unsigned short int Sector,unsigned short int Track,unsigned short int Side, short int Count, int *pnSectorsPerTrack); -extern BOOL Floppy_WriteSectors(int Drive,char *pBuffer,unsigned short int Sector,unsigned short int Track,unsigned short int Side, short int Count, int *pnSectorsPerTrack); +extern bool Floppy_IsWriteProtected(int Drive); +extern const char* Floppy_SetDiskFileNameNone(int Drive); +extern const char* Floppy_SetDiskFileName(int Drive, const char *pszFileName, const char *pszZipPath); +extern bool Floppy_InsertDiskIntoDrive(int Drive); +extern bool Floppy_EjectDiskFromDrive(int Drive); +extern bool Floppy_EjectBothDrives(void); +extern void Floppy_FindDiskDetails(const Uint8 *pBuffer, int nImageBytes, Uint16 *pnSectorsPerTrack, Uint16 *pnSides); +extern bool Floppy_ReadSectors(int Drive, Uint8 *pBuffer, Uint16 Sector, Uint16 Track, Uint16 Side, short Count, int *pnSectorsPerTrack); +extern bool Floppy_WriteSectors(int Drive, Uint8 *pBuffer, Uint16 Sector, Uint16 Track, Uint16 Side, short Count, int *pnSectorsPerTrack); extern int Floppy_GetPhysicalSectorsPerTrack(int Drive); -extern BOOL Floppy_ReadPhysicalSector(int Drive,char *pBuffer,unsigned short int Sector,unsigned short int Track,unsigned short int Side,unsigned short int Count); +extern bool Floppy_ReadPhysicalSector(int Drive,char *pBuffer, Uint16 Sector, Uint16 Track, Uint16 Side, short Count); + +#endif