|
|
| version 1.1, 2003/10/16 17:57:50 | version 1.12, 2005/02/07 14:46:11 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #include "i286.h" | #include "cpucore.h" |
| #include "memory.h" | |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| #include "sound.h" | |
| #include "fmboard.h" | |
| // ---- I/O | // ---- I/O |
| static void IOOUTCALL cpuio_of0(UINT port, BYTE dat) { | static void IOOUTCALL cpuio_of0(UINT port, REG8 dat) { |
| cpuio.reset_req = 1; | #if defined(TRACE) |
| extmem.adrsmask = 0x0fffff; | if (CPU_MSW & 1) { |
| i286_interrupt(0x02); | TRACEOUT(("80286 ProtectMode Disable")); |
| } | |
| #endif | |
| epsonio.cpumode = (CPU_MSW & 1)?'P':'R'; | |
| CPU_A20EN(FALSE); | |
| CPU_RESETREQ = 1; | |
| nevent_forceexit(); | nevent_forceexit(); |
| (void)port; | (void)port; |
| (void)dat; | (void)dat; |
| } | } |
| static void IOOUTCALL cpuio_of2(UINT port, BYTE dat) { | static void IOOUTCALL cpuio_of2(UINT port, REG8 dat) { |
| extmem.adrsmask = 0x1fffff; | CPU_A20EN(TRUE); |
| (void)port; | (void)port; |
| (void)dat; | (void)dat; |
| } | } |
| static BYTE IOINPCALL cpuio_if0(UINT port) { | static REG8 IOINPCALL cpuio_if0(UINT port) { |
| BYTE ret; | UINT8 ret; |
| if (!(usesound & 0x80)) { | if (!(pccore.sound & 0x80)) { |
| ret = 0x00; | ret = 0x00; |
| } | } |
| else { // for AMD-98 | else { // for AMD-98 |
| Line 40 static BYTE IOINPCALL cpuio_if0(UINT por | Line 42 static BYTE IOINPCALL cpuio_if0(UINT por |
| return(ret); | return(ret); |
| } | } |
| static BYTE IOINPCALL cpuio_if2(UINT port) { | static REG8 IOINPCALL cpuio_if2(UINT port) { |
| BYTE ret; | REG8 ret; |
| ret = 0xfe; | ret = 0xff; |
| if (extmem.adrsmask != 0x1fffff) { | ret -= (REG8)((CPU_ADRSMASK >> 20) & 1); |
| ret++; | |
| } | |
| (void)port; | (void)port; |
| return(ret); | return(ret); |
| } | } |
| #ifdef CPU386 // defineを変えてね | #if defined(CPUCORE_IA32) |
| static void IOOUTCALL cpuio_of6(UINT port, BYTE dat) { | static void IOOUTCALL cpuio_of6(UINT port, REG8 dat) { |
| switch(dat) { | switch(dat) { |
| case 0x02: | case 0x02: |
| extmem.adrsmask = 0x1fffff; | CPU_A20EN(TRUE); |
| break; | break; |
| case 0x03: | case 0x03: |
| extmem.adrsmask = 0x0fffff; | CPU_A20EN(FALSE); |
| break; | break; |
| } | } |
| (void)port; | (void)port; |
| } | } |
| static BYTE IOINPCALL cpuio_if6(UINT port) { | static REG8 IOINPCALL cpuio_if6(UINT port) { |
| BYTE ret; | REG8 ret; |
| ret = 0x00; | ret = 0x00; |
| if (extmem.adrsmask != 0x1fffff) { | if (!(CPU_ADRSMASK & (1 << 20))) { |
| ret |= 0x01; | ret |= 0x01; |
| } | } |
| if (nmi.enable) { | if (nmiio.enable) { |
| ret |= 0x02; | ret |= 0x02; |
| } | } |
| (void)port; | (void)port; |
| Line 87 static BYTE IOINPCALL cpuio_if6(UINT por | Line 87 static BYTE IOINPCALL cpuio_if6(UINT por |
| // ---- I/F | // ---- I/F |
| #ifndef CPU386 // defineを変えてね | #if !defined(CPUCORE_IA32) |
| static const IOOUT cpuioof0[8] = { | static const IOOUT cpuioof0[8] = { |
| cpuio_of0, cpuio_of2, NULL, NULL, | cpuio_of0, cpuio_of2, NULL, NULL, |
| NULL, NULL, NULL, NULL}; | NULL, NULL, NULL, NULL}; |
| Line 105 static const IOINP cpuioif0[8] = { | Line 105 static const IOINP cpuioif0[8] = { |
| NULL, NULL, NULL, NULL}; | NULL, NULL, NULL, NULL}; |
| #endif | #endif |
| void cpuio_reset(void) { | |
| ZeroMemory(&cpuio, sizeof(cpuio)); | |
| } | |
| void cpuio_bind(void) { | void cpuio_bind(void) { |
| iocore_attachsysoutex(0x00f0, 0x0cf1, cpuioof0, 8); | iocore_attachsysoutex(0x00f0, 0x0cf1, cpuioof0, 8); |