--- np2/win9x/np2.cpp 2003/10/18 10:00:29 1.4 +++ np2/win9x/np2.cpp 2003/10/23 06:26:16 1.7 @@ -1,6 +1,8 @@ #include "compiler.h" #include +#ifndef __GNUC__ #include +#endif #include "resource.h" #include "strres.h" #include "np2.h" @@ -16,18 +18,19 @@ #include "winkbd.h" #include "ini.h" #include "menu.h" -#include "dialog.h" #include "winloc.h" #include "sstp.h" #include "sstpmsg.h" #include "dclock.h" +#ifdef USE_ROMEO +#include "juliet.h" +#endif +#include "dialog.h" #include "memory.h" #include "pccore.h" #include "iocore.h" #include "pc9861k.h" #include "mpu98ii.h" -#include "timing.h" -#include "debugsub.h" #include "bios.h" #include "scrndraw.h" #include "sound.h" @@ -35,14 +38,11 @@ #include "s98.h" #include "diskdrv.h" #include "fddfile.h" - -#ifdef USE_ROMEO -#include "juliet.h" -#endif - +#include "timing.h" +#include "statsave.h" +#include "debugsub.h" #include "keydisp.h" #include "viewer.h" -#include "statsave.h" #ifdef BETA_RELEASE @@ -275,7 +275,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT switch (msg) { case WM_CREATE: sstp_construct(hWnd); +#ifndef __GNUC__ WINNLSEnableIME(hWnd, FALSE); +#endif // DragAcceptFiles(hWnd, TRUE); break; @@ -808,6 +810,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 { @@ -1095,7 +1098,7 @@ int WINAPI WinMain(HINSTANCE hInstance, MSG msg; HMENU hMenu; HWND hwndorg; - int i; + UINT i; #ifdef OPENING_WAIT UINT32 tick; #endif @@ -1103,13 +1106,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) { @@ -1367,11 +1368,33 @@ int WINAPI WinMain(HINSTANCE hInstance, } else { // auto skip if (!waitcnt) { + UINT cnt; joy_flash(); mouse_callback(); pccore_exec(framecnt == 0); dclock_callback(); framecnt++; +#if 1 + cnt = timing_getcount(); + if (framecnt > cnt) { + waitcnt = framecnt; + if (framemax > 1) { + framemax--; + } + } + else if (framecnt >= framemax) { + if (framemax < 12) { + framemax++; + } + if (cnt >= 12) { + timing_init(); + } + else { + timing_setcount(cnt - framecnt); + } + framecnt = 0; + } +#else if (timing_getcount() < framecnt) { waitcnt = framecnt; if (framemax > 1) { @@ -1384,6 +1407,7 @@ int WINAPI WinMain(HINSTANCE hInstance, framemax++; } } +#endif } else { processwait(waitcnt);