|
|
1.1 root 1: /*
1.1.1.3 root 2: Hatari - floppy.h
3:
1.1.1.10 root 4: This file is distributed under the GNU General Public License, version 2
5: or at 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.11! root 22: #define FLOPPY_IMAGE_TYPE_NONE 0 /* no recognized image inserted */
! 23: #define FLOPPY_IMAGE_TYPE_ST 1
! 24: #define FLOPPY_IMAGE_TYPE_MSA 2
! 25: #define FLOPPY_IMAGE_TYPE_DIM 3
! 26: #define FLOPPY_IMAGE_TYPE_IPF 4 /* handled by capsimage library */
! 27: #define FLOPPY_IMAGE_TYPE_STX 5
! 28:
1.1.1.2 root 29: /* Structure for each drive connected as emulation */
1.1.1.3 root 30: typedef struct
31: {
1.1.1.11! root 32: int ImageType;
1.1.1.8 root 33: Uint8 *pBuffer;
34: char sFileName[FILENAME_MAX];
35: int nImageBytes;
36: bool bDiskInserted;
37: bool bContentsChanged;
38: bool bOKToSave;
1.1 root 39:
1.1.1.9 root 40: /* For the emulation of the WPRT bit when a disk is changed */
41: int TransitionState1;
42: int TransitionState1_VBL;
43: int TransitionState2;
44: int TransitionState2_VBL;
45: } EMULATION_DRIVE;
1.1 root 46:
1.1.1.7 root 47: extern EMULATION_DRIVE EmulationDrives[MAX_FLOPPYDRIVES];
1.1 root 48: extern int nBootDrive;
49:
1.1.1.9 root 50:
1.1 root 51: extern void Floppy_Init(void);
52: extern void Floppy_UnInit(void);
1.1.1.9 root 53: extern void Floppy_Reset(void);
1.1.1.7 root 54: extern void Floppy_MemorySnapShot_Capture(bool bSave);
1.1 root 55: extern void Floppy_GetBootDrive(void);
1.1.1.7 root 56: extern bool Floppy_IsWriteProtected(int Drive);
57: extern const char* Floppy_SetDiskFileNameNone(int Drive);
58: extern const char* Floppy_SetDiskFileName(int Drive, const char *pszFileName, const char *pszZipPath);
1.1.1.9 root 59: extern int Floppy_DriveTransitionUpdateState ( int Drive );
1.1.1.7 root 60: extern bool Floppy_InsertDiskIntoDrive(int Drive);
61: extern bool Floppy_EjectDiskFromDrive(int Drive);
62: extern void Floppy_FindDiskDetails(const Uint8 *pBuffer, int nImageBytes, Uint16 *pnSectorsPerTrack, Uint16 *pnSides);
1.1.1.11! root 63: extern bool Floppy_ReadSectors(int Drive, Uint8 **pBuffer, Uint16 Sector, Uint16 Track, Uint16 Side, short Count, int *pnSectorsPerTrack, int *pSectorSize);
1.1.1.9 root 64: 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 65:
66: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.