--- np2/win9x/np2.cpp 2003/10/21 11:22:05 1.5 +++ np2/win9x/np2.cpp 2003/10/25 16:01:21 1.10 @@ -217,6 +217,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; @@ -810,6 +818,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT if (LOWORD(wParam) != WA_INACTIVE) { np2break &= ~NP2BREAK_MAIN; scrnmng_update(); + keystat_allrelease(); mouse_running(MOUSE_CONT_M); } else { @@ -1071,7 +1080,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT } -static void processwait(WORD cnt) { +static void processwait(UINT cnt) { if (timing_getcount() >= cnt) { timing_setcount(0); @@ -1105,13 +1114,11 @@ int WINAPI WinMain(HINSTANCE hInstance, GetModuleFileName(NULL, modulefile, sizeof(modulefile)); dosio_init(); file_setcd(modulefile); - np2arg_analize(lpszCmdLine); // タイミング修正 // ver0.29 + np2arg_analize(lpszCmdLine); initload(); srand((unsigned)time(NULL)); - np2arg_analize(lpszCmdLine); - CopyMemory(szClassName, np2oscfg.winid, 3); if ((hwndorg = FindWindow(szClassName, NULL)) != NULL) { @@ -1369,22 +1376,30 @@ int WINAPI WinMain(HINSTANCE hInstance, } else { // auto skip if (!waitcnt) { + UINT cnt; joy_flash(); mouse_callback(); pccore_exec(framecnt == 0); dclock_callback(); framecnt++; - if (timing_getcount() < framecnt) { + cnt = timing_getcount(); + if (framecnt > cnt) { waitcnt = framecnt; if (framemax > 1) { framemax--; } } else if (framecnt >= framemax) { - waitcnt = framecnt; if (framemax < 12) { framemax++; } + if (cnt >= 12) { + timing_reset(); + } + else { + timing_setcount(cnt - framecnt); + } + processwait(0); } } else { @@ -1413,7 +1428,7 @@ int WINAPI WinMain(HINSTANCE hInstance, flagsave(np2resume); } else { -// DeleteFile(file_getcd(np2resume)); + flagdelete(np2resume); } #ifdef USE_ROMEO