--- np2/pccore.c 2003/11/28 08:01:32 1.21 +++ np2/pccore.c 2003/12/04 13:54:28 1.26 @@ -1,4 +1,5 @@ #include "compiler.h" +#include "dosio.h" #include "soundmng.h" #include "sysmng.h" #include "timemng.h" @@ -31,7 +32,6 @@ #include "timing.h" //#include "hostdrv.h" #include "debugsub.h" -#include "dosio.h" const char np2version[] = NP2VER_CORE; @@ -51,7 +51,7 @@ 1, 0x82, 0, {0x17, 0x04, 0x1f}, {0x0c, 0x0c, 0x02, 0x10, 0x3f, 0x3f}, 1, 80, 0, - {"", ""}, ""}; + {"", ""}, "", ""}; PCCORE pc = { PCBASECLOCK25, 4, @@ -80,6 +80,26 @@ static const BYTE msw_default[8] = // --------------------------------------------------------------------------- +void getbiospath(char *path, const char *fname, int maxlen) { + +const char *p; + + p = np2cfg.biospath; + + p = np2cfg.biospath; + if (p[0]) { + file_cpyname(path, p, maxlen); + file_setseparator(path, maxlen); + file_catname(path, fname, maxlen); + } + else { + file_cpyname(path, file_getcd(fname), maxlen); + } +} + + +// ---- + static void setvsyncclock(void) { UINT vfp; @@ -184,6 +204,8 @@ static void sound_term(void) { void pccore_init(void) { + i286_initialize(); + pal_initlcdtable(); pal_makelcdpal(); pal_makeskiptable(); @@ -488,8 +510,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; @@ -508,9 +537,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; @@ -520,7 +552,7 @@ void pccore_exec(BOOL draw) { i286_resetprefetch(); } -#if 1 // ndef TRACE +#if 1 // ndef TRACE if (I286_REMCLOCK > 0) { if (!(CPUTYPE & CPUTYPE_V30)) { i286(); @@ -531,6 +563,7 @@ void pccore_exec(BOOL draw) { } #else while(I286_REMCLOCK > 0) { + TRACEOUT(("%.4x:%.4x", I286_CS, I286_IP)); i286_step(); } #endif @@ -541,5 +574,15 @@ void pccore_exec(BOOL draw) { 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 }