--- xmil/io/iocore.c 2004/08/08 15:14:08 1.6 +++ xmil/io/iocore.c 2004/08/12 17:57:36 1.9 @@ -171,7 +171,7 @@ static const IOOUT defout[0x20] = { palette_o, palette_o, palette_o, ply_o, - pcg_o, pcg_o, + dummy_out, pcg_o, pcg_o, pcg_o, crtc_o, subcpu_o, @@ -180,18 +180,31 @@ static const IOOUT defout[0x20] = { memio_ram, port1fxx_o}; +typedef void (*INITFN)(void); + +static const INITFN initfn[] = { + cgrom_reset, cmt_reset, crtc_reset, + ctc_reset, dmac_reset, fdc_reset, + memio_reset, pcg_reset, ppi_reset, + sio_reset, sndboard_reset, subcpu_reset, + vramio_reset}; + // ---- void iocore_reset(void) { + UINT i; + ZeroMemory(&iocore, sizeof(iocore)); CopyMemory(iocore.e.inpfn, definp, sizeof(definp)); CopyMemory(iocore.e.outfn, defout, sizeof(defout)); +#if defined(SUPPORT_BANKMEM) if (pccore.ROM_TYPE >= 2) { - iocore.e.inpfn[0x0b] = memio_ems_i; - iocore.e.outfn[0x0b] = memio_ems_o; + iocore.e.inpfn[0x0b] = memio_bank_i; + iocore.e.outfn[0x0b] = memio_bank_o; } +#endif if (pccore.ROM_TYPE >= 3) { iocore.e.inpfn[0x10] = palette_i; iocore.e.inpfn[0x11] = palette_i; @@ -202,6 +215,9 @@ void iocore_reset(void) { iocore.e.inpfn[0x07] = opm_i; iocore.e.outfn[0x07] = opm_o; } + for (i=0; i