--- np2/io/cpuio.c 2003/10/21 11:22:05 1.2 +++ np2/io/cpuio.c 2003/12/26 22:24:06 1.7 @@ -1,31 +1,43 @@ #include "compiler.h" -#include "i286.h" +#include "cpucore.h" #include "pccore.h" #include "iocore.h" #include "sound.h" #include "fmboard.h" +// 後で調整 +#if defined(CPUCORE_IA32) +DWORD cpumem_addrmask = 0xfffff; +#endif + // ---- I/O -static void IOOUTCALL cpuio_of0(UINT port, BYTE dat) { +static void IOOUTCALL cpuio_of0(UINT port, REG8 dat) { - cpuio.reset_req = 1; - extmem.adrsmask = 0x0fffff; - i286_interrupt(0x02); + epsonio.cpumode = (CPU_MSW & 1)?'P':'R'; + CPU_ADRSMASK = 0x0fffff; +#if defined(CPUCORE_IA32) + cpumem_addrmask = 0xfffff; +#endif + CPU_RESETREQ = 1; +// CPU_INTERRUPT(0x02); nevent_forceexit(); (void)port; (void)dat; } -static void IOOUTCALL cpuio_of2(UINT port, BYTE dat) { +static void IOOUTCALL cpuio_of2(UINT port, REG8 dat) { - extmem.adrsmask = 0x1fffff; + CPU_ADRSMASK = 0xffffffff; +#if defined(CPUCORE_IA32) + cpumem_addrmask = 0xffffffff; +#endif (void)port; (void)dat; } -static BYTE IOINPCALL cpuio_if0(UINT port) { +static REG8 IOINPCALL cpuio_if0(UINT port) { BYTE ret; @@ -39,43 +51,47 @@ static BYTE IOINPCALL cpuio_if0(UINT por return(ret); } -static BYTE IOINPCALL cpuio_if2(UINT port) { +static REG8 IOINPCALL cpuio_if2(UINT port) { - BYTE ret; + REG8 ret; - ret = 0xfe; - if (extmem.adrsmask != 0x1fffff) { - ret++; - } + ret = 0xff; + ret -= (REG8)((CPU_ADRSMASK >> 20) & 1); (void)port; return(ret); } -#ifdef CPU386 // defineを変えてね -static void IOOUTCALL cpuio_of6(UINT port, BYTE dat) { +#if defined(CPUCORE_IA32) +static void IOOUTCALL cpuio_of6(UINT port, REG8 dat) { switch(dat) { case 0x02: - extmem.adrsmask = 0x1fffff; + CPU_ADRSMASK = 0xffffffff; +#if defined(CPUCORE_IA32) + cpumem_addrmask = 0xffffffff; +#endif break; case 0x03: - extmem.adrsmask = 0x0fffff; + CPU_ADRSMASK = 0x0fffff; +#if defined(CPUCORE_IA32) + cpumem_addrmask = 0xfffff; +#endif break; } (void)port; } -static BYTE IOINPCALL cpuio_if6(UINT port) { +static REG8 IOINPCALL cpuio_if6(UINT port) { - BYTE ret; + REG8 ret; ret = 0x00; - if (extmem.adrsmask != 0x1fffff) { + if (!(CPU_ADRSMASK & (1 << 20))) { ret |= 0x01; } - if (nmi.enable) { + if (nmiio.enable) { ret |= 0x02; } (void)port; @@ -86,7 +102,7 @@ static BYTE IOINPCALL cpuio_if6(UINT por // ---- I/F -#ifndef CPU386 // defineを変えてね +#if !defined(CPUCORE_IA32) static const IOOUT cpuioof0[8] = { cpuio_of0, cpuio_of2, NULL, NULL, NULL, NULL, NULL, NULL}; @@ -104,11 +120,6 @@ static const IOINP cpuioif0[8] = { NULL, NULL, NULL, NULL}; #endif -void cpuio_reset(void) { - - ZeroMemory(&cpuio, sizeof(cpuio)); -} - void cpuio_bind(void) { iocore_attachsysoutex(0x00f0, 0x0cf1, cpuioof0, 8);