|
|
1.1 root 1: /*
1.1.1.3 root 2: Hatari - floppy.h
3:
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.
1.1 root 6: */
7:
1.1.1.3 root 8: #ifndef HATARI_FLOPPY_H
9: #define HATARI_FLOPPY_H
10:
1.1.1.7 root 11: #include "configuration.h"
12:
1.1.1.9 ! root 13:
! 14:
! 15: #define MAX_FLOPPYDRIVES 2 /* A: and B: */
! 16: #define NUMBYTESPERSECTOR 512 /* All supported disk images are 512 bytes per sector */
! 17:
! 18: #define FLOPPY_DRIVE_TRANSITION_STATE_INSERT 1
! 19: #define FLOPPY_DRIVE_TRANSITION_STATE_EJECT 2
! 20: #define FLOPPY_DRIVE_TRANSITION_DELAY_VBL 18 /* min of 16 VBLs */
! 21:
1.1.1.2 root 22: /* Structure for each drive connected as emulation */
1.1.1.3 root 23: typedef struct
24: {
1.1.1.8 root 25: Uint8 *pBuffer;
26: char sFileName[FILENAME_MAX];
27: int nImageBytes;
28: bool bDiskInserted;
29: bool bContentsChanged;
30: bool bOKToSave;
1.1 root 31:
1.1.1.9 ! root 32: /* For the emulation of the WPRT bit when a disk is changed */
! 33: int TransitionState1;
! 34: int TransitionState1_VBL;
! 35: int TransitionState2;
! 36: int TransitionState2_VBL;
! 37: } EMULATION_DRIVE;
1.1 root 38:
1.1.1.7 root 39: extern EMULATION_DRIVE EmulationDrives[MAX_FLOPPYDRIVES];
1.1 root 40: extern int nBootDrive;
41:
1.1.1.9 ! root 42:
1.1 root 43: extern void Floppy_Init(void);
44: extern void Floppy_UnInit(void);
1.1.1.9 ! root 45: extern void Floppy_Reset(void);
1.1.1.7 root 46: extern void Floppy_MemorySnapShot_Capture(bool bSave);
1.1 root 47: extern void Floppy_GetBootDrive(void);
1.1.1.7 root 48: extern bool Floppy_IsWriteProtected(int Drive);
49: extern const char* Floppy_SetDiskFileNameNone(int Drive);
50: extern const char* Floppy_SetDiskFileName(int Drive, const char *pszFileName, const char *pszZipPath);
1.1.1.9 ! root 51: extern int Floppy_DriveTransitionUpdateState ( int Drive );
1.1.1.7 root 52: extern bool Floppy_InsertDiskIntoDrive(int Drive);
53: extern bool Floppy_EjectDiskFromDrive(int Drive);
54: extern void Floppy_FindDiskDetails(const Uint8 *pBuffer, int nImageBytes, Uint16 *pnSectorsPerTrack, Uint16 *pnSides);
1.1.1.9 ! root 55: extern bool Floppy_ReadSectors(int Drive, Uint8 *pBuffer, Uint16 Sector, Uint16 Track, Uint16 Side, short Count, int *pnSectorsPerTrack, int *pSectorSize);
! 56: extern bool Floppy_WriteSectors(int Drive, Uint8 *pBuffer, Uint16 Sector, Uint16 Track, Uint16 Side, short Count, int *pnSectorsPerTrack, int *pSectorSize);
1.1.1.3 root 57:
58: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.