--- np2/io/cpuio.c 2003/12/08 06:24:03 1.5 +++ np2/io/cpuio.c 2004/03/25 10:41:13 1.11 @@ -2,25 +2,20 @@ #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, REG8 dat) { - CPU_ADRSMASK = 0x0fffff; -#if defined(CPUCORE_IA32) - cpumem_addrmask = 0xfffff; +#if defined(TRACE) + if (CPU_MSW & 1) { + TRACEOUT(("80286 ProtectMode Disable")); + } #endif + epsonio.cpumode = (CPU_MSW & 1)?'P':'R'; + CPU_A20EN(FALSE); CPU_RESETREQ = 1; - CPU_INTERRUPT(0x02); nevent_forceexit(); (void)port; (void)dat; @@ -28,10 +23,7 @@ static void IOOUTCALL cpuio_of0(UINT por static void IOOUTCALL cpuio_of2(UINT port, REG8 dat) { - CPU_ADRSMASK = 0x1fffff; -#if defined(CPUCORE_IA32) - cpumem_addrmask = 0xffffffff; -#endif + CPU_A20EN(TRUE); (void)port; (void)dat; } @@ -40,7 +32,7 @@ static REG8 IOINPCALL cpuio_if0(UINT por BYTE ret; - if (!(usesound & 0x80)) { + if (!(pccore.sound & 0x80)) { ret = 0x00; } else { // for AMD-98 @@ -54,15 +46,8 @@ 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); } @@ -73,17 +58,11 @@ static void IOOUTCALL cpuio_of6(UINT por switch(dat) { case 0x02: - CPU_ADRSMASK = 0x1fffff; -#if defined(CPUCORE_IA32) - cpumem_addrmask = 0xffffffff; -#endif + CPU_A20EN(TRUE); break; case 0x03: - CPU_ADRSMASK = 0x0fffff; -#if defined(CPUCORE_IA32) - cpumem_addrmask = 0xfffff; -#endif + CPU_A20EN(FALSE); break; } (void)port; @@ -94,7 +73,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) {