--- np2/win9x/np2.cpp 2003/10/23 06:26:16 1.7 +++ np2/win9x/np2.cpp 2003/10/26 08:59:53 1.11 @@ -5,8 +5,10 @@ #endif #include "resource.h" #include "strres.h" +#include "parts.h" #include "np2.h" #include "np2arg.h" +#include "cputype.h" #include "dosio.h" #include "extromio.h" #include "commng.h" @@ -55,6 +57,7 @@ static char szClassName[] = "NP2-MainWi HWND hWndMain; HINSTANCE hInst; HINSTANCE hPrev; + int mmxflag; NP2OSCFG np2oscfg = { "Neko Project II", "NP2", @@ -66,7 +69,7 @@ static char szClassName[] = "NP2-MainWi {0, 0, 0x3e, 19200, "", "", "", ""}, // ver0.34 {0, 0, 0x3e, 19200, "", "", "", ""}, // ver0.34 0xffffff, 0xffbf6a, 0, 0, - 0, 1, 0, 9801, 0, 0, 0, 0}; // ver0.34 + 0, 1, 0, 9801, 0, 0, 0, 0, 0}; // ver0.38 char fddfolder[MAX_PATH]; char hddfolder[MAX_PATH]; @@ -217,6 +220,14 @@ static int flagsave(const char *ext) { return(ret); } +static void flagdelete(const char *ext) { + + char path[MAX_PATH]; + + getstatfilename(path, ext, sizeof(path)); + file_delete(path); +} + static int flagload(const char *ext, const char *title, BOOL force) { int ret; @@ -1072,7 +1083,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT } -static void processwait(WORD cnt) { +static void processwait(UINT cnt) { if (timing_getcount() >= cnt) { timing_setcount(0); @@ -1109,7 +1120,7 @@ int WINAPI WinMain(HINSTANCE hInstance, np2arg_analize(lpszCmdLine); initload(); - srand((unsigned)time(NULL)); + rand_setseed((unsigned)time(NULL)); CopyMemory(szClassName, np2oscfg.winid, 3); @@ -1123,6 +1134,8 @@ int WINAPI WinMain(HINSTANCE hInstance, hInst = hInstance; hPrev = hPreInst; + mmxflag = (havemmx())?0:MMXFLAG_NOTSUPPORT; + mmxflag += (np2oscfg.disablemmx)?MMXFLAG_DISABLE:0; TRACEINIT(); if (np2oscfg.KEYBOARD >= KEY_TYPEMAX) { // ver0.28 @@ -1374,7 +1387,6 @@ int WINAPI WinMain(HINSTANCE hInstance, pccore_exec(framecnt == 0); dclock_callback(); framecnt++; -#if 1 cnt = timing_getcount(); if (framecnt > cnt) { waitcnt = framecnt; @@ -1387,27 +1399,13 @@ int WINAPI WinMain(HINSTANCE hInstance, framemax++; } if (cnt >= 12) { - timing_init(); + timing_reset(); } else { timing_setcount(cnt - framecnt); } - framecnt = 0; - } -#else - if (timing_getcount() < framecnt) { - waitcnt = framecnt; - if (framemax > 1) { - framemax--; - } - } - else if (framecnt >= framemax) { - waitcnt = framecnt; - if (framemax < 12) { - framemax++; - } + processwait(0); } -#endif } else { processwait(waitcnt); @@ -1435,7 +1433,7 @@ int WINAPI WinMain(HINSTANCE hInstance, flagsave(np2resume); } else { -// DeleteFile(file_getcd(np2resume)); + flagdelete(np2resume); } #ifdef USE_ROMEO