--- np2/io/iocore.c 2004/03/06 18:25:36 1.11 +++ np2/io/iocore.c 2004/03/23 04:45:04 1.15 @@ -5,6 +5,7 @@ #include "cbuscore.h" #include "sound.h" #include "fmboard.h" +#include "ideio.h" #include "cs4231io.h" #include "iocore16.tbl" @@ -32,6 +33,10 @@ _SYSPORT sysport; _UPD4990 uPD4990; +#if defined(SUPPORT_PC9821) + _PCIDEV pcidev; +#endif + // ---- @@ -434,6 +439,9 @@ static const IOCBFN resetfn[] = { #if !defined(CPUCORE_IA32) emsio_reset, #endif +#if defined(SUPPORT_PC9821) + pcidev_reset, +#endif }; static const IOCBFN bindfn[] = { @@ -453,6 +461,9 @@ static const IOCBFN bindfn[] = { #if !defined(CPUCORE_IA32) emsio_bind, #endif +#if defined(SUPPORT_PC9821) + pcidev_bind, +#endif }; @@ -479,6 +490,7 @@ void IOOUTCALL iocore_out8(UINT port, RE IOFUNC iof; +// VERBOSE(("iocore_out8(%x, %x)", port, dat)); CPU_REMCLOCK -= iocore.busclock; iof = iocore.base[(port >> 8) & 0xff]; iof->ioout[port & 0xff](port, dat); @@ -488,6 +500,7 @@ REG8 IOINPCALL iocore_inp8(UINT port) { IOFUNC iof; +// VERBOSE(("iocore_inp8(%x)", port)); CPU_REMCLOCK -= iocore.busclock; iof = iocore.base[(port >> 8) & 0xff]; return(iof->ioinp[port & 0xff](port)); @@ -498,6 +511,12 @@ void IOOUTCALL iocore_out16(UINT port, R IOFUNC iof; CPU_REMCLOCK -= iocore.busclock; +#if defined(SUPPORT_IDEIO) + if (port == 0x0640) { + ideio_w16(port, dat); + return; + } +#endif if ((port & 0xfff1) == 0x04a0) { egc_w16(port, dat); return; @@ -529,6 +548,11 @@ REG16 IOINPCALL iocore_inp16(UINT port) REG8 ret; CPU_REMCLOCK -= iocore.busclock; +#if defined(SUPPORT_IDEIO) + if (port == 0x0640) { + return(ideio_r16(port)); + } +#endif if ((port & 0xfffc) == 0x005c) { return(artic_r16(port)); } @@ -562,14 +586,27 @@ REG16 IOINPCALL iocore_inp16(UINT port) void IOOUTCALL iocore_out32(UINT port, UINT32 dat) { + CPU_REMCLOCK -= iocore.busclock; +#if defined(SUPPORT_PC9821) + if ((port & 0xfffb) == 0x0cf8) { + pcidev_w32(port, dat); + return; + } +#endif iocore_out16(port, (UINT16)dat); iocore_out16(port+2, (UINT16)(dat >> 16)); } UINT32 IOINPCALL iocore_inp32(UINT port) { - REG16 ret; + UINT32 ret; + CPU_REMCLOCK -= iocore.busclock; +#if defined(SUPPORT_PC9821) + if ((port & 0xfffb) == 0x0cf8) { + return(pcidev_r32(port)); + } +#endif ret = iocore_inp16(port); return(ret + (iocore_inp16(port+2) << 16)); }