--- hatari/src/includes/hdc.h 2019/04/01 07:13:09 1.1.1.4 +++ hatari/src/includes/hdc.h 2019/04/09 08:48:43 1.1.1.7 @@ -14,8 +14,8 @@ /* HD Command packet macros */ #define HD_OPCODE(a) (a.command[0] & 0x1F) /* get opcode (bit 0-4) */ -#define HD_CONTROLLER(a) ((a.command[0] & 0xE0)>>5) /* get HD controller # (5-7) */ -#define HD_DRIVENUM(a) ((a.command[1] & 0xE0) >>5) /* get drive # (5-7) */ +#define HD_TARGET(a) ((a.command[0] & 0xE0)>>5) /* get HD target # (5-7) */ +#define HD_DEVICE(a) ((a.command[1] & 0xE0) >>5) /* get device # (5-7) */ #define HD_LBA_MSB(a) ((unsigned) a.command[1] & 0x1F) /* Logical Block adress, MSB */ #define HD_LBA_MID(a) ((unsigned) a.command[2]) /* Logical Block adress */ @@ -33,6 +33,7 @@ #define HD_WRITE_SECTOR 0x0A /* Write sector */ /* other codes */ +#define HD_TEST_UNIT_RDY 0x00 /* Test unit ready */ #define HD_FORMAT_DRIVE 0x04 /* Format the whole drive */ #define HD_SEEK 0x0B /* Seek */ #define HD_CORRECTION 0x0D /* Correction */ @@ -48,11 +49,13 @@ #define HD_STATUS_BUSY 0x08 /* Error codes for REQUEST SENSE: */ -#define HD_REQSENS_OK 0x00 /* OK return status */ -#define HD_REQSENS_OPCODE 0x20 /* Opcode not supported */ -#define HD_REQSENS_INVADDR 0x21 /* Invalid block address */ -#define HD_REQSENS_INVARG 0x24 /* Invalid argument */ -#define HD_REQSENS_NODRIVE 0x25 /* Invalid drive */ +#define HD_REQSENS_OK 0x00 /* OK return status */ +#define HD_REQSENS_NOSECTOR 0x01 /* No index or sector */ +#define HD_REQSENS_WRITEERR 0x03 /* Write fault */ +#define HD_REQSENS_OPCODE 0x20 /* Opcode not supported */ +#define HD_REQSENS_INVADDR 0x21 /* Invalid block address */ +#define HD_REQSENS_INVARG 0x24 /* Invalid argument */ +#define HD_REQSENS_NODRIVE 0x25 /* Invalid drive */ #define ACSI_EMU_ON bAcsiEmuOn /* Do we have HDC emulation? */ @@ -65,16 +68,13 @@ typedef struct { short int returnCode; /* return code from the HDC operation */ } HDCOMMAND; -extern FILE *hd_image_file; extern HDCOMMAND HDCCommand; extern short int HDCSectorCount; extern int nPartitions; -extern BOOL bAcsiEmuOn; +extern bool bAcsiEmuOn; -extern BOOL HDC_Init(char *filename); +extern bool HDC_Init(void); extern void HDC_UnInit(void); extern void HDC_WriteCommandPacket(void); -extern void HDC_DebugCommandPacket(FILE *hdlogFile); -extern void HDC_EmulateCommandPacket(void); #endif /* HATARI_HDC_H */