--- np2/win9x/np2.cpp 2006/12/23 23:34:32 1.66 +++ np2/win9x/np2.cpp 2006/12/24 13:21:37 1.68 @@ -8,7 +8,6 @@ #include "parts.h" #include "np2.h" #include "np2arg.h" -#include "cputype.h" #include "dosio.h" #include "extromio.h" #include "commng.h" @@ -23,7 +22,6 @@ #include "winloc.h" #include "sstp.h" #include "sstpmsg.h" -#include "dclock.h" #include "toolwin.h" #include "juliet.h" #include "np2class.h" @@ -45,6 +43,12 @@ #include "debugsub.h" #include "subwind.h" #include "viewer.h" +#if !defined(_WIN64) +#include "cputype.h" +#endif +#if defined(SUPPORT_DCLOCK) +#include "dclock.h" +#endif #ifdef BETA_RELEASE @@ -55,16 +59,14 @@ static TCHAR szClassName[] = _T("NP2-Ma HWND hWndMain; HINSTANCE hInst; HINSTANCE hPrev; +#if !defined(_WIN64) int mmxflag; +#endif UINT8 np2break = 0; // ver0.30 BOOL winui_en; NP2OSCFG np2oscfg = { -#if !defined(SUPPORT_PC9821) - OEMTEXT("Neko Project II"), -#else - OEMTEXT("Neko Project 21"), -#endif + OEMTEXT(PROJECTNAME) OEMTEXT(PROJECTSUBNAME), OEMTEXT("NP2"), CW_USEDEFAULT, CW_USEDEFAULT, 1, 1, 0, 1, 0, 0, 0, 0, KEY_UNKNOWN, 0, @@ -377,7 +379,7 @@ static void np2cmd(HWND hWnd, UINT16 cmd UINT update; BOOL b; - hInst = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE); + hInst = GetWindowInst(hWnd); update = 0; switch(cmd) { case IDM_RESET: @@ -1129,7 +1131,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT BITMAP bmp; HDC hmdc; HBRUSH hbrush; - hinst = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE); + hinst = GetWindowInst(hWnd); GetClientRect(hWnd, &rect); width = rect.right - rect.left; height = rect.bottom - rect.top; @@ -1266,6 +1268,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT HTCAPTION, 0L)); } } +#if defined(SUPPORT_DCLOCK) else { POINT p; if ((GetCursorPos(&p)) && (p.y >= 466)) { @@ -1274,6 +1277,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT dclock_reset(); } } +#endif return(DefWindowProc(hWnd, msg, wParam, lParam)); } break; @@ -1295,6 +1299,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT if (!scrnmng_isfullscreen()) { np2popup(hWnd, lParam); } +#if defined(SUPPORT_DCLOCK) else { POINT p; if ((GetCursorPos(&p)) && (p.y >= 466) && @@ -1304,6 +1309,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT dclock_reset(); } } +#endif return(DefWindowProc(hWnd, msg, wParam, lParam)); } break; @@ -1417,7 +1423,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT static void framereset(UINT cnt) { framecnt = 0; +#if defined(SUPPORT_DCLOCK) scrnmng_dispclock(); +#endif kdispwin_draw((UINT8)cnt); skbdwin_process(); mdbgwin_process(); @@ -1482,8 +1490,10 @@ int WINAPI WinMain(HINSTANCE hInstance, hInst = loadextinst(hInstance); hPrev = hPreInst; +#if !defined(_WIN64) mmxflag = (havemmx())?0:MMXFLAG_NOTSUPPORT; mmxflag += (np2oscfg.disablemmx)?MMXFLAG_DISABLE:0; +#endif TRACEINIT(); xrollkey = (np2oscfg.xrollkey == 0); @@ -1703,7 +1713,9 @@ int WINAPI WinMain(HINSTANCE hInstance, joymng_sync(); mousemng_sync(); pccore_exec(framecnt == 0); +#if defined(SUPPORT_DCLOCK) dclock_callback(); +#endif if (np2oscfg.DRAW_SKIP) { // nowait frame skip framecnt++; if (framecnt >= np2oscfg.DRAW_SKIP) { @@ -1722,7 +1734,9 @@ int WINAPI WinMain(HINSTANCE hInstance, joymng_sync(); mousemng_sync(); pccore_exec(framecnt == 0); +#if defined(SUPPORT_DCLOCK) dclock_callback(); +#endif framecnt++; } else { @@ -1735,7 +1749,9 @@ int WINAPI WinMain(HINSTANCE hInstance, joymng_sync(); mousemng_sync(); pccore_exec(framecnt == 0); +#if defined(SUPPORT_DCLOCK) dclock_callback(); +#endif framecnt++; cnt = timing_getcount(); if (framecnt > cnt) {