--- np2/pccore.c 2004/01/23 15:05:04 1.50 +++ np2/pccore.c 2004/01/25 05:41:28 1.52 @@ -284,8 +284,6 @@ void pccore_term(void) { fdd_eject(2); fdd_eject(3); - extmemmng_clear(); - iocore_destroy(); pc9861k_destruct(); @@ -326,33 +324,30 @@ void pccore_reset(void) { sound_init(); } - ZeroMemory(mem, 0x10fff0); // ver0.28 + ZeroMemory(mem, 0x110000); // ver0.28 ZeroMemory(mem + VRAM1_B, 0x18000); ZeroMemory(mem + VRAM1_E, 0x08000); ZeroMemory(mem + FONT_ADRS, 0x08000); - CPU_RESET(); - CPU_TYPE = 0; - if (np2cfg.dipsw[2] & 0x80) { - CPU_TYPE = CPUTYPE_V30; - } - //メモリスイッチ for (i=0; i<8; i++) { mem[0xa3fe2 + i*4] = np2cfg.memsw[i]; } - fddfile_reset2dmode(); - bios0x18_16(0x20, 0xe1); - pccore_set(); nevent_init(); - CPU_SETEXTMEM(pccore.extmem); + + CPU_RESET(); + CPU_SETEXTSIZE((UINT32)pccore.extmem); + + CPU_TYPE = 0; + if (np2cfg.dipsw[2] & 0x80) { + CPU_TYPE = CPUTYPE_V30; + } if (pccore.model & PCMODEL_EPSON) { // RAM ctrl CPU_RAM_D000 = 0xffff; } - sound_changeclock(); beep_changeclock(); sound_reset(); @@ -360,6 +355,8 @@ void pccore_reset(void) { wavemix_bind(); #endif + fddfile_reset2dmode(); + bios0x18_16(0x20, 0xe1); iocore_reset(); // サウンドでpicを呼ぶので… cbuscore_reset(); @@ -574,10 +571,10 @@ void screenvsync(NEVENTITEM item) { // --------------------------------------------------------------------------- -// #define IPTRACE (1 << 16) +// #define IPTRACE (1 << 12) -#if IPTRACE -static UINT trpos; +#if defined(TRACE) && IPTRACE +static UINT trpos = 0; static UINT32 treip[IPTRACE]; void iptrace_out(void) { @@ -667,11 +664,13 @@ void pccore_exec(BOOL draw) { treip[trpos & (IPTRACE - 1)] = (CPU_CS << 16) + CPU_IP; trpos++; #endif +#if 0 if (tr) { if ((CPU_CS == 0xf760) || (CPU_CS == 0xf990)) { TRACEOUT(("%.4x:%.4x", CPU_CS, CPU_IP)); } } +#endif #if 0 if ((tr & 2) && (mem[0x0471e] == '\\')) { TRACEOUT(("DTA BREAK %.4x:%.4x", CPU_CS, CPU_IP));