| version 1.2, 2003/10/21 11:22:05 | version 1.9, 2004/01/08 16:29:56 | 
| Line 1 | Line 1 | 
 | #include        "compiler.h" | #include        "compiler.h" | 
| #include        "i286.h" | #include        "cpucore.h" | 
 | #include        "pccore.h" | #include        "pccore.h" | 
 | #include        "iocore.h" | #include        "iocore.h" | 
 | #include        "sound.h" | #include        "sound.h" | 
| Line 8 | Line 8 | 
 |  |  | 
 | // ---- 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_ADRSMASK = 0x0fffff; | 
|  | 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_ADRSMASK = 0xffffffff; | 
 | (void)port; | (void)port; | 
 | (void)dat; | (void)dat; | 
 | } | } | 
 |  |  | 
| static BYTE IOINPCALL cpuio_if0(UINT port) { | static REG8 IOINPCALL cpuio_if0(UINT port) { | 
 |  |  | 
 | BYTE    ret; | BYTE    ret; | 
 |  |  | 
| Line 39  static BYTE IOINPCALL cpuio_if0(UINT por | Line 44  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_ADRSMASK = 0xffffffff; | 
 | break; | break; | 
 |  |  | 
 | case 0x03: | case 0x03: | 
| extmem.adrsmask = 0x0fffff; | CPU_ADRSMASK = 0x0fffff; | 
| 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 86  static BYTE IOINPCALL cpuio_if6(UINT por | Line 88  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 104  static const IOINP cpuioif0[8] = { | Line 106  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); |