--- np2/win9x/np2.cpp 2003/10/16 17:58:56 1.1.1.1 +++ np2/win9x/np2.cpp 2003/10/23 12:58:44 1.8 @@ -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 @@ -51,9 +51,6 @@ #define STATSAVEMAX 10 -static char np2help[] = "np2.hlp"; -static char np2resume[] = "sav"; - static char szClassName[] = "NP2-MainWindow"; HWND hWndMain; HINSTANCE hInst; @@ -86,6 +83,9 @@ static int np2opening = 1; static int np2quitmsg = 0; HMENU hStat = NULL; +static const char np2help[] = "np2.hlp"; +static const char np2resume[] = "sav"; + typedef struct { const char *str; @@ -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; @@ -323,13 +325,11 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT case IDM_SCRNMUL10: case IDM_SCRNMUL12: case IDM_SCRNMUL16: -#if 0 - if ((SCREENMODE & SCMD_WINDOWED) && + if ((!scrnmng_isfullscreen()) && !(GetWindowLong(hWndMain, GWL_STYLE) & WS_MINIMIZE)) { xmenu_setscrnmul(wParam - IDM_SCRNMUL); - ddraws_setmul(wParam - IDM_SCRNMUL); + scrnmng_setmultiple(wParam - IDM_SCRNMUL); } -#endif break; default: @@ -810,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 { @@ -1079,9 +1080,9 @@ static void processwait(WORD cnt) { scrnmng_dispclock(); keydisp_draw(np2oscfg.DRAW_SKIP); viewer_allreload(FALSE); - if (np2oscfg.DISPCLK & 2) { + if (np2oscfg.DISPCLK & 3) { if (sysmng_workclockrenewal()) { - sysmng_updatecaption(2); + sysmng_updatecaption(3); } } } @@ -1097,7 +1098,7 @@ int WINAPI WinMain(HINSTANCE hInstance, MSG msg; HMENU hMenu; HWND hwndorg; - int i; + UINT i; #ifdef OPENING_WAIT UINT32 tick; #endif @@ -1105,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) { @@ -1369,22 +1368,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); + } + framecnt = 0; } } else {