--- xmil/io/fdc.h 2004/08/10 08:28:49 1.4 +++ xmil/io/fdc.h 2009/03/23 15:02:25 1.15 @@ -1,17 +1,23 @@ +/* #define SUPPORT_MOTORRISEUP */ + enum { FDCDIR_NONE = 0x00, - FDCDIR_IN = 0x01, - FDCDIR_OUT = 0x02 + FDCDIR_TAO = 0x01, + FDCDIR_IN = 0x02, + FDCDIR_OUT = 0x03 }; enum { - FDC_BUFFERS = 0x3000 + FDCMOTOR_STOP = 0, + FDCMOTOR_STARTING = 1, + FDCMOTOR_READY = 2, + FDCMOTOR_STOPING = 3 }; typedef struct { UINT8 cmd; - UINT8 type; + UINT8 ctype; UINT8 data; SINT8 step; UINT8 drv; @@ -39,21 +45,43 @@ typedef struct { UINT bufsize; UINT bufpos; + UINT8 busy; UINT8 hole; - UINT8 padding[3]; + UINT8 curtime; + UINT8 equip; UINT crcnum; - UINT32 busyclock; - UINT32 busystart; - UINT8 buffer[FDC_BUFFERS]; + SINT32 loopclock; + +#if defined(SUPPORT_MOTORRISEUP) + UINT8 motorevent[4]; + SINT32 motorclock[4]; +#endif + +#if !defined(CONST_DISKIMAGE) + UINT8 wt_mode; + UINT8 wt_sectors; + UINT8 wt_padding[2]; + UINT wt_ptr; + UINT wt_datpos; + UINT wt_datsize; + + UINT8 buffer[0x3000]; +#else + UINT8 crcbuf[6]; +#endif } FDCSTAT; typedef struct { - UINT dummy; + UINT8 diskstat[4]; +#if defined(CONST_DISKIMAGE) + UINT8 *buffer; +#endif } FDCEXT; typedef struct { FDCSTAT s; + FDCEXT e; } FDC; @@ -61,10 +89,15 @@ typedef struct { extern "C" { #endif -REG8 fdcisbusy(void); +void neitem_fdcbusy(UINT id); +#if defined(SUPPORT_MOTORRISEUP) +void fdc_callback(void); +#else +#define fdc_callback() +#endif -void IOOUTCALL fdc_o(UINT port, REG8 value); // x1_fdc_w -REG8 IOINPCALL fdc_i(UINT port); // x1_fdc_r +void IOOUTCALL fdc_o(UINT port, REG8 value); +REG8 IOINPCALL fdc_i(UINT port); void fdc_reset(void);