--- np2/io/cpuio.c 2003/12/08 00:55:32 1.4 +++ np2/io/cpuio.c 2004/01/08 16:29:56 1.9 @@ -5,22 +5,19 @@ #include "sound.h" #include "fmboard.h" -// 後で調整 -#if defined(CPU386) -DWORD cpumem_addrmask = 0xfffff; -#endif - // ---- I/O static void IOOUTCALL cpuio_of0(UINT port, REG8 dat) { - CPU_ADRSMASK = 0x0fffff; -#if defined(CPU386) - cpumem_addrmask = 0xfffff; +#if defined(TRACE) + if (CPU_MSW & 1) { + TRACEOUT(("80286 ProtectMode Disable")); + } #endif + epsonio.cpumode = (CPU_MSW & 1)?'P':'R'; + CPU_ADRSMASK = 0x0fffff; CPU_RESETREQ = 1; - CPU_INTERRUPT(0x02); nevent_forceexit(); (void)port; (void)dat; @@ -28,10 +25,7 @@ static void IOOUTCALL cpuio_of0(UINT por static void IOOUTCALL cpuio_of2(UINT port, REG8 dat) { - CPU_ADRSMASK = 0x1fffff; -#if defined(CPU386) - cpumem_addrmask = 0xffffffff; -#endif + CPU_ADRSMASK = 0xffffffff; (void)port; (void)dat; } @@ -54,37 +48,23 @@ static REG8 IOINPCALL cpuio_if2(UINT por REG8 ret; -#if 1 ret = 0xff; ret -= (REG8)((CPU_ADRSMASK >> 20) & 1); -#else - ret = 0xfe; - if (CPU_ADRSMASK != 0x1fffff) { - ret++; - } -#endif (void)port; return(ret); } -#ifdef CPU386 // defineを変えてね +#if defined(CPUCORE_IA32) static void IOOUTCALL cpuio_of6(UINT port, REG8 dat) { switch(dat) { case 0x02: - CPU_ADRSMASK = 0x1fffff; -#if defined(CPU_386) - cpumem_addrmask = 0xffffffff; -#endif + CPU_ADRSMASK = 0xffffffff; break; case 0x03: CPU_ADRSMASK = 0x0fffff; -#if defined(CPU_386) - cpumem_addrmask = 0xfffff; -#endif - break; } (void)port; } @@ -94,7 +74,7 @@ static REG8 IOINPCALL cpuio_if6(UINT por REG8 ret; ret = 0x00; - if (CPU_ADRSMASK != 0x1fffff) { + if (!(CPU_ADRSMASK & (1 << 20))) { ret |= 0x01; } if (nmiio.enable) { @@ -108,7 +88,7 @@ static REG8 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};