forked from mist-devel/mist-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fdd.h
38 lines (31 loc) · 1.22 KB
/
fdd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef FDD_H
#define FDD_H
// floppy disk interface defs
#define CMD_RDTRK 0x01
#define CMD_WRTRK 0x02
// floppy status
#define DSK_INSERTED 0x01 /*disk is inserted*/
#define DSK_WRITABLE 0x10 /*disk is writable*/
#define MAX_TRACKS (83*2)
typedef struct
{
unsigned char status; /*status of floppy*/
unsigned char tracks; /*number of tracks*/
unsigned long cache[MAX_TRACKS]; /*cluster cache*/
unsigned long cluster_offset; /*cluster offset to handle tricky loaders*/
unsigned char sector_offset; /*sector offset to handle tricky loaders*/
unsigned char track; /*current track*/
unsigned char track_prev; /*previous track*/
char name[22]; /*floppy name*/
} adfTYPE;
void SectorGapToFpga(void);
void SectorHeaderToFpga(unsigned char n, unsigned char dsksynch, unsigned char dsksyncl);
//unsigned short SectorToFpga(unsigned char sector, unsigned char track, unsigned char dsksynch, unsigned char dsksyncl);
void ReadTrack(adfTYPE *drive);
unsigned char FindSync(adfTYPE *drive);
unsigned char GetHeader(unsigned char *pTrack, unsigned char *pSector);
unsigned char GetData(void);
void WriteTrack(adfTYPE *drive);
void UpdateDriveStatus(void);
void HandleFDD(unsigned char c1, unsigned char c2);
#endif