--- xmil/io/iocore.h 2004/08/01 05:31:30 1.1 +++ xmil/io/iocore.h 2008/06/02 20:07:31 1.9 @@ -6,46 +6,57 @@ #define IOINPCALL #endif -typedef void (IOOUTCALL *IOOUT)(UINT port, REG8 val); +typedef void (IOOUTCALL *IOOUT)(UINT port, REG8 dat); typedef REG8 (IOINPCALL *IOINP)(UINT port); -typedef void (*IOCBFN)(void); +typedef struct { + UINT8 mode; + UINT8 ppib; +#if defined(SUPPORT_BANKMEM) + UINT8 bankmem; +#else + UINT8 __bankmem; /* protect */ +#endif + UINT8 padding; +} IOSTAT; + +typedef struct { + IOINP inpfn[0x40]; + IOOUT outfn[0x40]; +} IOFNTBL; -enum { - IOCORE_OUTHTBL = 0x01, - IOCORE_INPHTBL = 0x02 -}; - -typedef union { - IOOUT fn; - IOOUT *tbl; -} OUTHTBL; - -typedef union { - IOINP fn; - IOINP *tbl; -} INPHTBL; +typedef struct { + SINT32 framestartclock; + SINT32 dispclock; + SINT32 vsyncstart; +#if !defined(MAINFRAMES_OLD) + SINT32 vsyncend; +#else + SINT32 vpulseclock; +#endif +} IOEXT; typedef struct { - UINT mode; - IOOUT outv[3]; - IOINP inpv[3]; - UINT8 iofg[0x20]; - OUTHTBL outh[0x20]; - INPHTBL inph[0x20]; + IOFNTBL f; + IOSTAT s; + IOEXT e; } IOCORE; #include "cgrom.h" #include "cmt.h" +#include "crtc.h" #include "ctc.h" #include "dipsw.h" #include "dmac.h" +#include "fdc.h" +#include "memio.h" #include "pcg.h" #include "ppi.h" #include "sio.h" #include "sndboard.h" #include "subcpu.h" +#include "vramio.h" #ifdef __cplusplus @@ -55,8 +66,10 @@ extern "C" { extern IOCORE iocore; extern CGROM cgrom; extern CMT cmt; +extern CRTC crtc; extern CTC ctc; extern DMAC dma; +extern FDC fdc; extern PCG pcg; extern PPI ppi; extern SIO sio; @@ -65,13 +78,9 @@ extern SUBCPU subcpu; void iocore_reset(void); -void iocore_regouthigh(UINT port, IOOUT fn); -void iocore_regoutlow(UINT port, IOOUT fn); -void iocore_reginphigh(UINT port, IOINP fn); -void iocore_reginplow(UINT port, IOINP fn); -// void IOOUTCALL iocore_out(UINT port, REG8 dat); -// REG8 IOINPCALL iocore_inp(UINT port); +void IOOUTCALL iocore_out(UINT port, REG8 dat); +REG8 IOINPCALL iocore_inp(UINT port); #ifdef __cplusplus }