|
|
1.1 root 1: /*
1.1.1.3 root 2: Hatari - hdc.h
3:
1.1.1.9 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:
1.1.1.4 root 7: This file contains definitions which are used for hardware-level
1.1.1.3 root 8: harddrive emulation.
1.1 root 9: */
10:
1.1.1.3 root 11: #ifndef HATARI_HDC_H
12: #define HATARI_HDC_H
13:
1.1 root 14:
15: /* Opcodes */
16: /* The following are multi-sector transfers with seek implied */
17: #define HD_VERIFY_TRACK 0x05 /* Verify track */
18: #define HD_FORMAT_TRACK 0x06 /* Format track */
19: #define HD_READ_SECTOR 0x08 /* Read sector */
1.1.1.8 root 20: #define HD_READ_SECTOR1 0x28 /* Read sector (class 1) */
1.1 root 21: #define HD_WRITE_SECTOR 0x0A /* Write sector */
1.1.1.8 root 22: #define HD_WRITE_SECTOR1 0x2A /* Write sector (class 1) */
1.1 root 23:
24: /* other codes */
1.1.1.7 root 25: #define HD_TEST_UNIT_RDY 0x00 /* Test unit ready */
1.1.1.4 root 26: #define HD_FORMAT_DRIVE 0x04 /* Format the whole drive */
1.1 root 27: #define HD_SEEK 0x0B /* Seek */
28: #define HD_CORRECTION 0x0D /* Correction */
29: #define HD_INQUIRY 0x12 /* Inquiry */
1.1.1.4 root 30: #define HD_MODESELECT 0x15 /* Mode select */
1.1 root 31: #define HD_MODESENSE 0x1A /* Mode sense */
32: #define HD_REQ_SENSE 0x03 /* Request sense */
33: #define HD_SHIP 0x1B /* Ship drive */
1.1.1.8 root 34: #define HD_READ_CAPACITY1 0x25 /* Read capacity (class 1) */
1.1 root 35:
1.1.1.4 root 36: /* Status codes */
37: #define HD_STATUS_OK 0x00
38: #define HD_STATUS_ERROR 0x02
39: #define HD_STATUS_BUSY 0x08
40:
41: /* Error codes for REQUEST SENSE: */
1.1.1.6 root 42: #define HD_REQSENS_OK 0x00 /* OK return status */
43: #define HD_REQSENS_NOSECTOR 0x01 /* No index or sector */
44: #define HD_REQSENS_WRITEERR 0x03 /* Write fault */
45: #define HD_REQSENS_OPCODE 0x20 /* Opcode not supported */
46: #define HD_REQSENS_INVADDR 0x21 /* Invalid block address */
47: #define HD_REQSENS_INVARG 0x24 /* Invalid argument */
1.1.1.10 root 48: #define HD_REQSENS_INVLUN 0x25 /* Invalid LUN */
1.1.1.4 root 49:
50: #define ACSI_EMU_ON bAcsiEmuOn /* Do we have HDC emulation? */
1.1 root 51:
1.1.1.11! root 52: extern int nAcsiPartitions;
1.1.1.5 root 53: extern bool bAcsiEmuOn;
1.1 root 54:
1.1.1.8 root 55: /**
56: * API.
57: */
1.1.1.7 root 58: extern bool HDC_Init(void);
1.1.1.3 root 59: extern void HDC_UnInit(void);
1.1.1.8 root 60: extern void HDC_ResetCommandStatus(void);
1.1.1.10 root 61: extern short int HDC_ReadCommandByte(int addr);
62: extern void HDC_WriteCommandByte(int addr, Uint8 byte);
1.1.1.11! root 63: extern int HDC_PartitionCount(FILE *fp, const Uint64 tracelevel);
1.1.1.10 root 64:
65: void Ncr5380_Reset(void);
1.1.1.3 root 66:
67: #endif /* HATARI_HDC_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.