--- np2/pccore.c 2003/11/21 06:51:10 1.19 +++ np2/pccore.c 2003/12/01 10:45:45 1.23 @@ -31,6 +31,7 @@ #include "timing.h" //#include "hostdrv.h" #include "debugsub.h" +#include "dosio.h" const char np2version[] = NP2VER_CORE; @@ -487,8 +488,15 @@ void screenvsync(NEVENTITEM item) { (void)item; } + // --------------------------------------------------------------------------- +#if defined(TRACE) +static int resetcnt = 0; +static int execcnt = 0; +int piccnt = 0; +#endif + void pccore_exec(BOOL draw) { drawframe = draw; @@ -507,9 +515,12 @@ void pccore_exec(BOOL draw) { // nevent_get1stevent(); while(screendispflag) { +#if defined(TRACE) + resetcnt++; +#endif pic_irq(); - if (cpuio.reset_req) { - cpuio.reset_req = 0; + if (i286core.s.resetreq) { + i286core.s.resetreq = 0; I286_CS = 0xf000; CS_BASE = 0xf0000; I286_IP = 0xfff0; @@ -519,7 +530,7 @@ void pccore_exec(BOOL draw) { i286_resetprefetch(); } -#ifndef TRACE +#if 1 // ndef TRACE if (I286_REMCLOCK > 0) { if (!(CPUTYPE & CPUTYPE_V30)) { i286(); @@ -530,35 +541,26 @@ void pccore_exec(BOOL draw) { } #else while(I286_REMCLOCK > 0) { -#if 0 TRACEOUT(("%.4x:%.4x", I286_CS, I286_IP)); -#elif 1 - if ((I286_CS == 0x1c29) && (I286_IP == 0x01E9)) { - if (I286_BX) { - TRACEOUT(("set %.4x", I286_BX)); - } - } - if ((I286_CS == 0x4159) && (I286_IP == 0x02d6)) { - if (I286_AX) { - TRACEOUT(("get %d", (short)I286_AX)); - } - } -#else - if (I286_CS == 0x4159) { - if ((I286_IP >= 0x02d1) && (I286_IP < 0x02e3)) { - TRACEOUT(("%s", debugsub_regs())); - } - } -#endif i286_step(); } #endif nevent_progress(); } - artic_callback(); // ver0.28 + artic_callback(); mpu98ii_callback(); diskdrv_callback(); calendar_inc(); sound_sync(); // happy! + +#if defined(TRACE) + execcnt++; + if (execcnt >= 60) { + TRACEOUT(("resetcnt = %d / pic %d", resetcnt, piccnt)); + execcnt = 0; + resetcnt = 0; + piccnt = 0; + } +#endif }