--- np2/i286a/i286a.c 2003/12/21 23:27:08 1.1 +++ np2/i286a/i286a.c 2004/01/07 12:51:29 1.8 @@ -2,7 +2,7 @@ #include "cpucore.h" - I286CORE i286core; + I286CORE i286acore; const UINT8 iflags[512] = { // Z_FLAG, S_FLAG, P_FLAG 0x44, 0x00, 0x00, 0x04, 0x00, 0x04, 0x04, 0x00, @@ -73,11 +73,40 @@ const UINT8 iflags[512] = { // Z_FLA // ---- -void i286a_reset(void) { +static void i286a_initreg(void) { - ZeroMemory(&CPU_STATSAVE, sizeof(CPU_STATSAVE)); - CPU_CS = 0x1fc0; - CS_BASE = 0x1fc00; + CPU_CS = 0xf000; + CS_BASE = 0xf0000; + CPU_IP = 0xfff0; CPU_ADRSMASK = 0xfffff; } +void i286a_reset(void) { + +#if 0 + if (offsetof(I286CORE, m) != 120) { + exit(1); + } +#endif + ZeroMemory(&i286acore.s, sizeof(i286acore.s)); + i286a_initreg(); +} + +void i286a_shut(void) { + + ZeroMemory(&i286acore.s, offsetof(I286STAT, cpu_type)); + i286a_initreg(); +} + + +#if 0 // ---- test +void ea_assert(UINT32 x) { + + TCHAR buf[32]; + + wsprintf(buf, _T("addr = %x [%.2x]"), x, i286_memoryread(x - 2)); + MessageBox(NULL, buf, _T("!"), MB_OK); + exit(1); +} +#endif +