|
|
| version 1.3, 2004/08/04 15:04:51 | version 1.11, 2007/11/03 00:00:19 |
|---|---|
| Line 1 | Line 1 |
| #define IDEIO_MULTIPLE_MAX 0 | |
| #define IDEIO_BUFSIZE_MAX 4096 | |
| #define IDEIO_MEDIA_EJECTABLE (1 << 7) | |
| #define IDEIO_MEDIA_PREVENT (1 << 6) | |
| #define IDEIO_MEDIA_PERSIST (1 << 5) | |
| // (1 << 4) | |
| #define IDEIO_MEDIA_AUDIO (1 << 3) | |
| #define IDEIO_MEDIA_DATA (1 << 2) | |
| #define IDEIO_MEDIA_CHANGED (1 << 1) | |
| #define IDEIO_MEDIA_LOADED (1 << 0) | |
| #define IDEIO_MEDIA_COMBINE (IDEIO_MEDIA_DATA|IDEIO_MEDIA_AUDIO) | |
| typedef struct { | typedef struct { |
| UINT8 sxsidrv; | UINT8 sxsidrv; |
| UINT8 wp; | UINT8 wp; |
| UINT8 dr; | UINT8 dr; |
| UINT8 hd; | UINT8 hd; |
| Line 17 typedef struct { | Line 32 typedef struct { |
| UINT8 surfaces; | UINT8 surfaces; |
| UINT8 sectors; | UINT8 sectors; |
| UINT8 bufdir; | UINT8 bufdir; |
| UINT8 buftc; | |
| // for ATA multiple mode | |
| UINT8 mulcnt; | |
| UINT8 multhr; | |
| UINT8 mulmode; | |
| // for ATAPI | |
| UINT8 media; | |
| UINT8 sk; // sense key | |
| UINT16 asc; // additional sense code (LSB) & qualifer (MSB) | |
| UINT32 sector; // アクセスセクタ (LBA) | |
| UINT32 nsectors; // 総セクタ数 | |
| UINT16 secsize; // セクタサイズ | |
| UINT16 dmy; | |
| // buffer management | |
| UINT bufpos; | UINT bufpos; |
| UINT bufsize; | UINT bufsize; |
| BYTE buf[512]; | UINT8 buf[IDEIO_BUFSIZE_MAX]; |
| // audio | |
| UINT daflag; | |
| UINT32 dacurpos; | |
| UINT32 dalength; | |
| UINT dabufrem; | |
| UINT8 dabuf[2352]; | |
| } _IDEDRV, *IDEDRV; | } _IDEDRV, *IDEDRV; |
| typedef struct { | typedef struct { |
| Line 30 typedef struct { | Line 69 typedef struct { |
| typedef struct { | typedef struct { |
| UINT8 bank[2]; | UINT8 bank[2]; |
| UINT8 padding[2]; | UINT8 daplaying; |
| UINT8 padding; | |
| _IDEDEV dev[2]; | _IDEDEV dev[2]; |
| } IDEIO; | } IDEIO; |
| Line 44 enum { | Line 84 enum { |
| IDEDIR_NONE = 0, | IDEDIR_NONE = 0, |
| IDEDIR_OUT = 1, | IDEDIR_OUT = 1, |
| IDEDIR_IN = 2 | IDEDIR_IN = 2, |
| IDETC_TRANSFEREND = 0, | |
| IDETC_ATAPIREAD = 1 | |
| }; | }; |
| // error | // error |
| // bit7: Bad Block detected | // bit7: Bad Block detected |
| // bit6: Data ECC error | // bit6: Data ECC error |
| // bit4: ID Not Found | // bit4: ID Not Found |
| // bit2: Aborted command | // bit2: Aborted command |
| Line 64 enum { | Line 107 enum { |
| IDEERR_AMNF = 0x01 | IDEERR_AMNF = 0x01 |
| }; | }; |
| enum { | // interrupt reason (sector count) |
| IDEINTR_IO = 0x02, | // bit7-3: tag |
| IDEINTR_CD = 0x01 | // bit2: bus release |
| // bit1: input/output | |
| // bit0: command/data | |
| // | |
| enum { | |
| IDEINTR_REL = 0x04, | |
| IDEINTR_IO = 0x02, // 0: host->device, 1: device->host | |
| IDEINTR_CD = 0x01 // 0: data, 1: command | |
| }; | }; |
| // status | // status |
| // bit7: Busy | // bit7: Busy |
| // bit6: Drive Ready | // bit6: Drive Ready |
| // bit5: Drive Write Fault | // bit5: Drive Write Fault |
| // bit4: Drive Seek Complete | // bit4: Drive Seek Complete |
| Line 87 enum { | Line 137 enum { |
| IDESTAT_DRQ = 0x08, | IDESTAT_DRQ = 0x08, |
| IDESTAT_CORR = 0x04, | IDESTAT_CORR = 0x04, |
| IDESTAT_INDX = 0x02, | IDESTAT_INDX = 0x02, |
| IDESTAT_ERR = 0x01 | IDESTAT_ERR = 0x01, |
| // for ATAPI PACKET | |
| IDESTAT_DMRD = 0x20, // DMA Ready | |
| IDESTAT_SERV = 0x10, // Service | |
| IDESTAT_CHK = 0x01 | |
| }; | }; |
| // device/head | |
| // bit6: LBA (for read/write sector(s)/multiple) | |
| // bit4: master/slave device select | |
| enum { | enum { |
| IDEDEV_LBA = 0x40, | IDEDEV_LBA = 0x40, |
| IDEDEV_DEV = 0x10 | IDEDEV_DEV = 0x10 |
| }; | }; |
| // control | // control |
| // bit2: Software Reset | // bit2: Software Reset |
| // bit1: ~Interrupt Enable | // bit1: ~Interrupt Enable |
| enum { | enum { |
| Line 105 enum { | Line 164 enum { |
| }; | }; |
| #ifdef __cplusplus | #ifdef __cplusplus |
| extern "C" { | extern "C" { |
| #endif | #endif |
| Line 115 extern IDEIO ideio; | Line 173 extern IDEIO ideio; |
| void IOOUTCALL ideio_w16(UINT port, REG16 value); | void IOOUTCALL ideio_w16(UINT port, REG16 value); |
| REG16 IOINPCALL ideio_r16(UINT port); | REG16 IOINPCALL ideio_r16(UINT port); |
| void ideio_reset(void); | void ideio_reset(const NP2CFG *pConfig); |
| void ideio_bind(void); | void ideio_bind(void); |
| void ideio_notify(REG8 sxsidrv, UINT action); | |
| #ifdef __cplusplus | #ifdef __cplusplus |
| } | } |