| version 1.22, 2003/11/02 17:03:24 | version 1.26, 2003/11/06 01:58:36 | 
| Line 60  static char  szClassName[] = "NP2-MainWi | Line 60  static char  szClassName[] = "NP2-MainWi | 
 | HINSTANCE       hInst; | HINSTANCE       hInst; | 
 | HINSTANCE       hPrev; | HINSTANCE       hPrev; | 
 | int                     mmxflag; | int                     mmxflag; | 
 |  | BYTE            np2break = 0;                                                                   // ver0.30 | 
 |  | BOOL            winui_en; | 
 |  |  | 
 | NP2OSCFG        np2oscfg = { | NP2OSCFG        np2oscfg = { | 
 | "Neko Project II", "NP2", | "Neko Project II", "NP2", | 
| Line 71  static char  szClassName[] = "NP2-MainWi | Line 73  static char  szClassName[] = "NP2-MainWi | 
 | {0, 0, 0x3e, 19200, "", "", "", ""},            // ver0.34 | {0, 0, 0x3e, 19200, "", "", "", ""},            // ver0.34 | 
 | {0, 0, 0x3e, 19200, "", "", "", ""},            // ver0.34 | {0, 0, 0x3e, 19200, "", "", "", ""},            // ver0.34 | 
 | 0xffffff, 0xffbf6a, 0, 0, | 0xffffff, 0xffbf6a, 0, 0, | 
| 0, 1, 0, 9801, 0, 0, 0, 0, 0, 0, 0};            // ver0.38 | 0, 1, 0, 9801, 0, 0, 0, 0, 0, 0, 0, 0};         // ver0.38 | 
 |  |  | 
| char    fddfolder[MAX_PATH]; | char            fddfolder[MAX_PATH]; | 
| char    hddfolder[MAX_PATH]; | char            hddfolder[MAX_PATH]; | 
| char    bmpfilefolder[MAX_PATH]; | char            bmpfilefolder[MAX_PATH]; | 
| char    modulefile[MAX_PATH]; | char            modulefile[MAX_PATH]; | 
|  |  | 
| static  UINT    framecnt = 0; | static  UINT            framecnt = 0; | 
| static  UINT    waitcnt = 0; | static  UINT            waitcnt = 0; | 
| static  UINT    framemax = 1; | static  UINT            framemax = 1; | 
| BYTE    np2break = 0;                                                                   // ver0.30 | static  BYTE            np2stopemulate = 0; | 
| static  BYTE    np2stopemulate = 0; | static  int                     np2opening = 1; | 
| static  int             np2opening = 1; | static  int                     np2quitmsg = 0; | 
| static  int             np2quitmsg = 0; | static  HMENU           hStat = NULL; | 
| HMENU   hStat = NULL; | static  BYTE            scrnmode; | 
| static  BYTE    scrnmode; | static  WINLOCEX        smwlex; | 
| WINLOC          wl; |  | 
| WINLOCEX        wlex; |  | 
 |  |  | 
 | static const char np2help[] = "np2.chm"; | static const char np2help[] = "np2.chm"; | 
 | static const char np2flagext[] = "S%02d"; | static const char np2flagext[] = "S%02d"; | 
 | static const char np2resumeext[] = "sav"; | static const char np2resumeext[] = "sav"; | 
 |  |  | 
 |  |  | 
 |  |  | 
 | static void winuienter(void) { | static void winuienter(void) { | 
 |  |  | 
 |  | winui_en = TRUE; | 
 | soundmng_disable(SNDPROC_MAIN); | soundmng_disable(SNDPROC_MAIN); | 
 | scrnmng_topwinui(); | scrnmng_topwinui(); | 
 | } | } | 
| Line 105  static void winuileave(void) { | Line 107  static void winuileave(void) { | 
 |  |  | 
 | scrnmng_clearwinui(); | scrnmng_clearwinui(); | 
 | soundmng_enable(SNDPROC_MAIN); | soundmng_enable(SNDPROC_MAIN); | 
 |  | winui_en = FALSE; | 
 | } | } | 
 |  |  | 
 | WINLOCEX np2_winlocexallwin(HWND base) { | WINLOCEX np2_winlocexallwin(HWND base) { | 
| Line 130  static void changescreen(BYTE newmode) { | Line 133  static void changescreen(BYTE newmode) { | 
 |  |  | 
 | BYTE            change; | BYTE            change; | 
 | BYTE            renewal; | BYTE            renewal; | 
 |  | WINLOCEX        wlex; | 
 |  |  | 
 | change = scrnmode ^ newmode; | change = scrnmode ^ newmode; | 
 | renewal = (change & SCRNMODE_FULLSCREEN); | renewal = (change & SCRNMODE_FULLSCREEN); | 
 |  | wlex = NULL; | 
 | if (newmode & SCRNMODE_FULLSCREEN) { | if (newmode & SCRNMODE_FULLSCREEN) { | 
 | renewal |= (change & SCRNMODE_HIGHCOLOR); | renewal |= (change & SCRNMODE_HIGHCOLOR); | 
 | } | } | 
| Line 145  static void changescreen(BYTE newmode) { | Line 150  static void changescreen(BYTE newmode) { | 
 | keydisp_destroy(); | keydisp_destroy(); | 
 | } | } | 
 | else if (renewal & SCRNMODE_ROTATEMASK) { | else if (renewal & SCRNMODE_ROTATEMASK) { | 
 | winlocex_destroy(wlex); |  | 
 | wlex = np2_winlocexallwin(hWndMain); | wlex = np2_winlocexallwin(hWndMain); | 
 |  | winlocex_setholdwnd(wlex, hWndMain); | 
 | } | } | 
 | soundmng_stop(); | soundmng_stop(); | 
| mouse_running(MOUSE_STOP); | mousemng_disable(MOUSEPROC_WINUI); | 
 | scrnmng_destroy(); | scrnmng_destroy(); | 
 | if (scrnmng_create(newmode) == SUCCESS) { | if (scrnmng_create(newmode) == SUCCESS) { | 
 | scrnmode = newmode; | scrnmode = newmode; | 
| Line 174  static void changescreen(BYTE newmode) { | Line 179  static void changescreen(BYTE newmode) { | 
 | else if (renewal & SCRNMODE_ROTATEMASK) { | else if (renewal & SCRNMODE_ROTATEMASK) { | 
 | winlocex_move(wlex); | winlocex_move(wlex); | 
 | winlocex_destroy(wlex); | winlocex_destroy(wlex); | 
 | wlex = NULL; |  | 
 | } | } | 
| mouse_running(MOUSE_CONT); | mousemng_enable(MOUSEPROC_WINUI); | 
 | soundmng_play(); | soundmng_play(); | 
 | } | } | 
 | else { | else { | 
| Line 297  static int flagload(const char *ext, con | Line 301  static int flagload(const char *ext, con | 
 |  |  | 
 | // ---- proc | // ---- proc | 
 |  |  | 
 |  | static void np2popup(HWND hWnd, LPARAM lp) { | 
 |  |  | 
 |  | HMENU   mainmenu; | 
 |  | HMENU   hMenu; | 
 |  | POINT   pt; | 
 |  |  | 
 |  | mainmenu = (HMENU)GetWindowLong(hWnd, NP2GWL_HMENU); | 
 |  | if (mainmenu == NULL) { | 
 |  | return; | 
 |  | } | 
 |  | hMenu = CreatePopupMenu(); | 
 |  | menu_addmenubar(hMenu, mainmenu); | 
 |  | pt.x = LOWORD(lp); | 
 |  | pt.y = HIWORD(lp); | 
 |  | ClientToScreen(hWnd, &pt); | 
 |  | TrackPopupMenu(hMenu, TPM_LEFTALIGN, pt.x, pt.y, 0, hWnd, NULL); | 
 |  | DestroyMenu(hMenu); | 
 |  | } | 
 |  |  | 
 | LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { | LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { | 
 |  |  | 
 | PAINTSTRUCT     ps; | PAINTSTRUCT     ps; | 
| Line 305  LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 328  LRESULT CALLBACK WndProc(HWND hWnd, UINT | 
 | BOOL            b; | BOOL            b; | 
 | UINT            update; | UINT            update; | 
 | HWND            subwin; | HWND            subwin; | 
 |  | WINLOCEX        wlex; | 
 |  |  | 
 | switch (msg) { | switch (msg) { | 
 | case WM_CREATE: | case WM_CREATE: | 
 |  | np2class_wmcreate(hWnd); | 
 |  | np2class_windowtype(hWnd, np2oscfg.wintype); | 
 | sstp_construct(hWnd); | sstp_construct(hWnd); | 
 | #ifndef __GNUC__ | #ifndef __GNUC__ | 
 | WINNLSEnableIME(hWnd, FALSE); | WINNLSEnableIME(hWnd, FALSE); | 
| Line 342  LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 368  LRESULT CALLBACK WndProc(HWND hWnd, UINT | 
 | if ((!scrnmng_isfullscreen()) && | if ((!scrnmng_isfullscreen()) && | 
 | (!(GetWindowLong(hWnd, GWL_STYLE) & | (!(GetWindowLong(hWnd, GWL_STYLE) & | 
 | (WS_MAXIMIZE | WS_MINIMIZE)))) { | (WS_MAXIMIZE | WS_MINIMIZE)))) { | 
 | winlocex_destroy(wlex); |  | 
 | wlex = np2_winlocexallwin(hWnd); | wlex = np2_winlocexallwin(hWnd); | 
 | wincentering(hWnd); | wincentering(hWnd); | 
 | winlocex_move(wlex); | winlocex_move(wlex); | 
 | winlocex_destroy(wlex); | winlocex_destroy(wlex); | 
 | wlex = NULL; |  | 
 | } | } | 
 | break; | break; | 
 |  |  | 
| Line 388  LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 412  LRESULT CALLBACK WndProc(HWND hWnd, UINT | 
 | break; | break; | 
 |  |  | 
 | case SC_MINIMIZE: | case SC_MINIMIZE: | 
 | winlocex_destroy(wlex); |  | 
 | wlex = np2_winlocexallwin(hWnd); | wlex = np2_winlocexallwin(hWnd); | 
 | winlocex_close(wlex); | winlocex_close(wlex); | 
 | winlocex_destroy(wlex); | winlocex_destroy(wlex); | 
 | wlex = NULL; |  | 
 | return(DefWindowProc(hWnd, msg, wParam, lParam)); | return(DefWindowProc(hWnd, msg, wParam, lParam)); | 
 |  |  | 
 | case SC_RESTORE: | case SC_RESTORE: | 
| Line 772  LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 794  LRESULT CALLBACK WndProc(HWND hWnd, UINT | 
 | break; | break; | 
 |  |  | 
 | case IDM_MOUSE: | case IDM_MOUSE: | 
| mouse_running(MOUSE_XOR); | mousemng_toggle(MOUSEPROC_SYSTEM); | 
 | xmenu_setmouse(np2oscfg.MOUSE_SW ^ 1); | xmenu_setmouse(np2oscfg.MOUSE_SW ^ 1); | 
 | update |= SYS_UPDATECFG; | update |= SYS_UPDATECFG; | 
 | break; | break; | 
| Line 899  LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 921  LRESULT CALLBACK WndProc(HWND hWnd, UINT | 
 | np2break &= ~NP2BREAK_MAIN; | np2break &= ~NP2BREAK_MAIN; | 
 | scrnmng_update(); | scrnmng_update(); | 
 | keystat_allrelease(); | keystat_allrelease(); | 
| mouse_running(MOUSE_CONT_M); | mousemng_enable(MOUSEPROC_BG); | 
 | } | } | 
 | else { | else { | 
 | np2break |= NP2BREAK_MAIN; | np2break |= NP2BREAK_MAIN; | 
| mouse_running(MOUSE_STOP_M); | mousemng_disable(MOUSEPROC_BG); | 
 | } | } | 
 | np2active_renewal(); | np2active_renewal(); | 
 | break; | break; | 
| Line 973  LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 995  LRESULT CALLBACK WndProc(HWND hWnd, UINT | 
 |  |  | 
 | case WM_ENTERSIZEMOVE: | case WM_ENTERSIZEMOVE: | 
 | soundmng_disable(SNDPROC_MAIN); | soundmng_disable(SNDPROC_MAIN); | 
| mouse_running(MOUSE_STOP); | mousemng_disable(MOUSEPROC_WINUI); | 
| winlocex_destroy(wlex); | winlocex_destroy(smwlex); | 
| wlex = np2_winlocexallwin(hWnd); | smwlex = np2_winlocexallwin(hWnd); | 
|  | scrnmng_entersizing(); | 
 | break; | break; | 
 |  |  | 
 | case WM_MOVING: | case WM_MOVING: | 
 | if (np2oscfg.WINSNAP) { | if (np2oscfg.WINSNAP) { | 
| winlocex_moving(wlex, (RECT *)lParam); | winlocex_moving(smwlex, (RECT *)lParam); | 
 | } | } | 
 | break; | break; | 
 |  |  | 
 |  | case WM_SIZING: | 
 |  | scrnmng_sizing((UINT)wParam, (RECT *)lParam); | 
 |  | break; | 
 |  |  | 
 | case WM_EXITSIZEMOVE: | case WM_EXITSIZEMOVE: | 
| winlocex_move(wlex); | scrnmng_exitsizing(); | 
| winlocex_destroy(wlex); | winlocex_move(smwlex); | 
| wlex = NULL; | winlocex_destroy(smwlex); | 
| mouse_running(MOUSE_CONT); | smwlex = NULL; | 
|  | mousemng_enable(MOUSEPROC_WINUI); | 
 | soundmng_enable(SNDPROC_MAIN); | soundmng_enable(SNDPROC_MAIN); | 
 | break; | break; | 
 |  |  | 
 | case WM_KEYDOWN: | case WM_KEYDOWN: | 
 | if (wParam == VK_F11) { | if (wParam == VK_F11) { | 
| scrnmng_enablemenubar(); | np2class_enablemenu(hWndMain, TRUE); | 
 | return(DefWindowProc(hWnd, WM_SYSKEYDOWN, VK_F10, lParam)); | return(DefWindowProc(hWnd, WM_SYSKEYDOWN, VK_F10, lParam)); | 
 | } | } | 
 | if ((wParam == VK_F12) && (!np2oscfg.F12COPY)) { | if ((wParam == VK_F12) && (!np2oscfg.F12COPY)) { | 
| mouse_running(MOUSE_XOR); | mousemng_toggle(MOUSEPROC_SYSTEM); | 
 | xmenu_setmouse(np2oscfg.MOUSE_SW ^ 1); | xmenu_setmouse(np2oscfg.MOUSE_SW ^ 1); | 
 | sysmng_update(SYS_UPDATECFG); | sysmng_update(SYS_UPDATECFG); | 
 | } | } | 
| Line 1044  LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 1072  LRESULT CALLBACK WndProc(HWND hWnd, UINT | 
 | break; | break; | 
 |  |  | 
 | case WM_LBUTTONDOWN: | case WM_LBUTTONDOWN: | 
| if (!mouse_btn(MOUSE_LEFTDOWN)) { | if (!mousemng_buttonevent(MOUSEMNG_LEFTDOWN)) { | 
| if (scrnmng_isfullscreen()) { | if (!scrnmng_isfullscreen()) { | 
|  | if (np2oscfg.wintype == 2) { | 
|  | return(SendMessage(hWnd, WM_NCLBUTTONDOWN, | 
|  | HTCAPTION, 0L)); | 
|  | } | 
|  | } | 
|  | else { | 
 | POINT p; | POINT p; | 
 | if ((GetCursorPos(&p)) && (p.y >= 466)) { | if ((GetCursorPos(&p)) && (p.y >= 466)) { | 
 | np2oscfg.clk_x++; | np2oscfg.clk_x++; | 
| Line 1058  LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 1092  LRESULT CALLBACK WndProc(HWND hWnd, UINT | 
 | break; | break; | 
 |  |  | 
 | case WM_LBUTTONUP: | case WM_LBUTTONUP: | 
| if (!mouse_btn(MOUSE_LEFTUP)) { | if (!mousemng_buttonevent(MOUSEMNG_LEFTUP)) { | 
 | return(DefWindowProc(hWnd, msg, wParam, lParam)); | return(DefWindowProc(hWnd, msg, wParam, lParam)); | 
 | } | } | 
 | break; | break; | 
 |  |  | 
 | case WM_MBUTTONDOWN:                                                                    // ver0.26 | case WM_MBUTTONDOWN:                                                                    // ver0.26 | 
| mouse_running(MOUSE_XOR); | mousemng_toggle(MOUSEPROC_SYSTEM); | 
 | xmenu_setmouse(np2oscfg.MOUSE_SW ^ 1); | xmenu_setmouse(np2oscfg.MOUSE_SW ^ 1); | 
 | sysmng_update(SYS_UPDATECFG); | sysmng_update(SYS_UPDATECFG); | 
 | break; | break; | 
 |  |  | 
 | case WM_RBUTTONDOWN: | case WM_RBUTTONDOWN: | 
| if (!mouse_btn(MOUSE_RIGHTDOWN)) { | if (!mousemng_buttonevent(MOUSEMNG_RIGHTDOWN)) { | 
| if (scrnmng_isfullscreen()) { | if (!scrnmng_isfullscreen()) { | 
| POINT   p; | np2popup(hWnd, lParam); | 
|  | } | 
|  | else { | 
|  | POINT p; | 
 | if ((GetCursorPos(&p)) && (p.y >= 466) && | if ((GetCursorPos(&p)) && (p.y >= 466) && | 
 | (np2oscfg.clk_x)) { | (np2oscfg.clk_x)) { | 
 | np2oscfg.clk_fnt++; | np2oscfg.clk_fnt++; | 
| Line 1085  LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 1122  LRESULT CALLBACK WndProc(HWND hWnd, UINT | 
 | break; | break; | 
 |  |  | 
 | case WM_RBUTTONUP: | case WM_RBUTTONUP: | 
| if (!mouse_btn(MOUSE_RIGHTUP)) { | if (!mousemng_buttonevent(MOUSEMNG_RIGHTUP)) { | 
 | return(DefWindowProc(hWnd, msg, wParam, lParam)); | return(DefWindowProc(hWnd, msg, wParam, lParam)); | 
 | } | } | 
 | break; | break; | 
 |  |  | 
 |  | case WM_LBUTTONDBLCLK: | 
 |  | if (!scrnmng_isfullscreen()) { | 
 |  | np2oscfg.wintype++; | 
 |  | if (np2oscfg.wintype >= 3) { | 
 |  | np2oscfg.wintype = 0; | 
 |  | } | 
 |  | wlex = np2_winlocexallwin(hWnd); | 
 |  | winlocex_setholdwnd(wlex, hWnd); | 
 |  | np2class_windowtype(hWnd, np2oscfg.wintype); | 
 |  | winlocex_move(wlex); | 
 |  | winlocex_destroy(wlex); | 
 |  | sysmng_update(SYS_UPDATEOSCFG); | 
 |  | } | 
 |  | break; | 
 |  |  | 
 | case WM_CLOSE: | case WM_CLOSE: | 
 | b = FALSE; | b = FALSE; | 
 | if (!np2oscfg.comfirm) { | if (!np2oscfg.comfirm) { | 
| Line 1112  LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 1164  LRESULT CALLBACK WndProc(HWND hWnd, UINT | 
 |  |  | 
 | case WM_DESTROY: | case WM_DESTROY: | 
 | DestroyMenu(hStat); | DestroyMenu(hStat); | 
 |  | np2class_wmdestroy(hWnd); | 
 | PostQuitMessage(0); | PostQuitMessage(0); | 
 | break; | break; | 
 |  |  | 
| Line 1174  LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 1227  LRESULT CALLBACK WndProc(HWND hWnd, UINT | 
 | } | } | 
 |  |  | 
 |  |  | 
 |  | static void framereset(UINT cnt) { | 
 |  |  | 
 |  | framecnt = 0; | 
 |  | scrnmng_dispclock(); | 
 |  | keydisp_draw((BYTE)cnt); | 
 |  | toolwin_draw((BYTE)cnt); | 
 |  | viewer_allreload(FALSE); | 
 |  | if (np2oscfg.DISPCLK & 3) { | 
 |  | if (sysmng_workclockrenewal()) { | 
 |  | sysmng_updatecaption(3); | 
 |  | } | 
 |  | } | 
 |  | } | 
 |  |  | 
 | static void processwait(UINT cnt) { | static void processwait(UINT cnt) { | 
 |  |  | 
 | if (timing_getcount() >= cnt) { | if (timing_getcount() >= cnt) { | 
 | timing_setcount(0); | timing_setcount(0); | 
| framecnt = 0; | framereset(cnt); | 
| scrnmng_dispclock(); |  | 
| keydisp_draw((BYTE)cnt); |  | 
| toolwin_draw((BYTE)cnt); |  | 
| viewer_allreload(FALSE); |  | 
| if (np2oscfg.DISPCLK & 3) { |  | 
| if (sysmng_workclockrenewal()) { |  | 
| sysmng_updatecaption(3); |  | 
| } |  | 
| } |  | 
 | } | } | 
 | else { | else { | 
 | Sleep(1); | Sleep(1); | 
| Line 1197  static void processwait(UINT cnt) { | Line 1255  static void processwait(UINT cnt) { | 
 |  |  | 
 | int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPreInst, | int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPreInst, | 
 | LPSTR lpszCmdLine, int nCmdShow) { | LPSTR lpszCmdLine, int nCmdShow) { | 
| WNDCLASS        np2; | WNDCLASS        wc; | 
 | MSG                     msg; | MSG                     msg; | 
 | HMENU           hMenu; | HMENU           hMenu; | 
 | HWND            hwndorg; | HWND            hwndorg; | 
| Line 1248  int WINAPI WinMain(HINSTANCE hInstance, | Line 1306  int WINAPI WinMain(HINSTANCE hInstance, | 
 |  |  | 
 | np2class_initialize(hInstance); | np2class_initialize(hInstance); | 
 | if (!hPreInst) { | if (!hPreInst) { | 
| np2.style = CS_BYTEALIGNCLIENT | CS_HREDRAW | CS_VREDRAW; | wc.style = CS_BYTEALIGNCLIENT | CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; | 
| np2.lpfnWndProc = WndProc; | wc.lpfnWndProc = WndProc; | 
| np2.cbClsExtra = 0; | wc.cbClsExtra = 0; | 
| np2.cbWndExtra = 0; | wc.cbWndExtra = NP2GWL_SIZE; | 
| np2.hInstance = hInstance; | wc.hInstance = hInstance; | 
| np2.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1)); | wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1)); | 
| np2.hCursor = LoadCursor(NULL, IDC_ARROW); | wc.hCursor = LoadCursor(NULL, IDC_ARROW); | 
| np2.hbrBackground = (HBRUSH)GetStockObject(NULL_BRUSH); | wc.hbrBackground = (HBRUSH)GetStockObject(NULL_BRUSH); | 
| np2.lpszMenuName = MAKEINTRESOURCE(IDM_MAIN); | wc.lpszMenuName = MAKEINTRESOURCE(IDR_MAIN); | 
| np2.lpszClassName = szClassName; | wc.lpszClassName = szClassName; | 
| if (!RegisterClass(&np2)) { | if (!RegisterClass(&wc)) { | 
 | return(FALSE); | return(FALSE); | 
 | } | } | 
 | } | } | 
| Line 1268  int WINAPI WinMain(HINSTANCE hInstance, | Line 1326  int WINAPI WinMain(HINSTANCE hInstance, | 
 |  |  | 
 | hWndMain = CreateWindow(szClassName, np2oscfg.titles, | hWndMain = CreateWindow(szClassName, np2oscfg.titles, | 
 | WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION | | WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION | | 
| WS_MINIMIZEBOX, | WS_THICKFRAME | WS_MINIMIZEBOX, | 
 | np2oscfg.winx, np2oscfg.winy, 640, 400, | np2oscfg.winx, np2oscfg.winy, 640, 400, | 
 | NULL, NULL, hInstance, NULL); | NULL, NULL, hInstance, NULL); | 
 | scrnmng_initialize(); | scrnmng_initialize(); | 
| Line 1317  int WINAPI WinMain(HINSTANCE hInstance, | Line 1375  int WINAPI WinMain(HINSTANCE hInstance, | 
 | } | } | 
 | InsertMenu(hMenu, 1, MF_BYPOSITION | MF_POPUP, (UINT)hStat, "S&tat"); | InsertMenu(hMenu, 1, MF_BYPOSITION | MF_POPUP, (UINT)hStat, "S&tat"); | 
 | } | } | 
| sysmenu_init(); | sysmenu_initialize(); | 
 | DrawMenuBar(hWndMain); | DrawMenuBar(hWndMain); | 
 |  |  | 
 | // ver0.30 | // ver0.30 | 
| Line 1349  int WINAPI WinMain(HINSTANCE hInstance, | Line 1407  int WINAPI WinMain(HINSTANCE hInstance, | 
 | return(FALSE); | return(FALSE); | 
 | } | } | 
 | } | } | 
 | if (!(scrnmode & SCRNMODE_FULLSCREEN)) { |  | 
 | if (np2oscfg.toolwin) { |  | 
 | toolwin_create(); |  | 
 | } |  | 
 | if (np2oscfg.keydisp) { |  | 
 | keydisp_create(); |  | 
 | } |  | 
 | } |  | 
 |  |  | 
 | if (soundmng_initialize() == SUCCESS) { | if (soundmng_initialize() == SUCCESS) { | 
 | soundmng_pcmload(SOUND_PCMSEEK, "SEEKWAV", EXTROMIO_RES); | soundmng_pcmload(SOUND_PCMSEEK, "SEEKWAV", EXTROMIO_RES); | 
| Line 1370  int WINAPI WinMain(HINSTANCE hInstance, | Line 1420  int WINAPI WinMain(HINSTANCE hInstance, | 
 | juliet_prepare(); | juliet_prepare(); | 
 | #endif | #endif | 
 |  |  | 
 |  | mousemng_initialize(); | 
 | if (np2oscfg.MOUSE_SW) {                                                                                // ver0.30 | if (np2oscfg.MOUSE_SW) {                                                                                // ver0.30 | 
| mouse_running(MOUSE_ON); | mousemng_enable(MOUSEPROC_SYSTEM); | 
 | } | } | 
 |  |  | 
 | commng_initialize(); | commng_initialize(); | 
| Line 1381  int WINAPI WinMain(HINSTANCE hInstance, | Line 1432  int WINAPI WinMain(HINSTANCE hInstance, | 
 | pccore_init(); | pccore_init(); | 
 | S98_init(); | S98_init(); | 
 |  |  | 
 |  |  | 
 | sstpmsg_welcome(); | sstpmsg_welcome(); | 
 |  |  | 
 | #ifdef OPENING_WAIT | #ifdef OPENING_WAIT | 
| Line 1392  int WINAPI WinMain(HINSTANCE hInstance, | Line 1442  int WINAPI WinMain(HINSTANCE hInstance, | 
 |  |  | 
 | pccore_reset(); | pccore_reset(); | 
 |  |  | 
 |  | if (!(scrnmode & SCRNMODE_FULLSCREEN)) { | 
 |  | if (np2oscfg.toolwin) { | 
 |  | toolwin_create(); | 
 |  | } | 
 |  | if (np2oscfg.keydisp) { | 
 |  | keydisp_create(); | 
 |  | } | 
 |  | } | 
 |  |  | 
 | np2opening = 0; | np2opening = 0; | 
 |  |  | 
 | // れじうむ | // れじうむ | 
| Line 1404  int WINAPI WinMain(HINSTANCE hInstance, | Line 1463  int WINAPI WinMain(HINSTANCE hInstance, | 
 | } | } | 
 | else if (id == IDCANCEL) { | else if (id == IDCANCEL) { | 
 | DestroyWindow(hWndMain); | DestroyWindow(hWndMain); | 
| mouse_running(MOUSE_OFF); | mousemng_disable(MOUSEPROC_WINUI); | 
 | S98_trash(); | S98_trash(); | 
 | pccore_term(); | pccore_term(); | 
 | sstp_destruct(); | sstp_destruct(); | 
| Line 1441  int WINAPI WinMain(HINSTANCE hInstance, | Line 1500  int WINAPI WinMain(HINSTANCE hInstance, | 
 | else { | else { | 
 | if (np2oscfg.NOWAIT) { | if (np2oscfg.NOWAIT) { | 
 | joy_flash(); | joy_flash(); | 
| mouse_callback(); | mousemng_callback(); | 
 | pccore_exec(framecnt == 0); | pccore_exec(framecnt == 0); | 
 | dclock_callback(); | dclock_callback(); | 
 | if (np2oscfg.DRAW_SKIP) {               // nowait frame skip | if (np2oscfg.DRAW_SKIP) {               // nowait frame skip | 
| Line 1460  int WINAPI WinMain(HINSTANCE hInstance, | Line 1519  int WINAPI WinMain(HINSTANCE hInstance, | 
 | else if (np2oscfg.DRAW_SKIP) {          // frame skip | else if (np2oscfg.DRAW_SKIP) {          // frame skip | 
 | if (framecnt < np2oscfg.DRAW_SKIP) { | if (framecnt < np2oscfg.DRAW_SKIP) { | 
 | joy_flash(); | joy_flash(); | 
| mouse_callback(); | mousemng_callback(); | 
 | pccore_exec(framecnt == 0); | pccore_exec(framecnt == 0); | 
 | dclock_callback(); | dclock_callback(); | 
 | framecnt++; | framecnt++; | 
| Line 1473  int WINAPI WinMain(HINSTANCE hInstance, | Line 1532  int WINAPI WinMain(HINSTANCE hInstance, | 
 | if (!waitcnt) { | if (!waitcnt) { | 
 | UINT cnt; | UINT cnt; | 
 | joy_flash(); | joy_flash(); | 
| mouse_callback(); | mousemng_callback(); | 
 | pccore_exec(framecnt == 0); | pccore_exec(framecnt == 0); | 
 | dclock_callback(); | dclock_callback(); | 
 | framecnt++; | framecnt++; | 
| Line 1494  int WINAPI WinMain(HINSTANCE hInstance, | Line 1553  int WINAPI WinMain(HINSTANCE hInstance, | 
 | else { | else { | 
 | timing_setcount(cnt - framecnt); | timing_setcount(cnt - framecnt); | 
 | } | } | 
| processwait(0); | framereset(0); | 
 | } | } | 
 | } | } | 
 | else { | else { | 
| Line 1517  int WINAPI WinMain(HINSTANCE hInstance, | Line 1576  int WINAPI WinMain(HINSTANCE hInstance, | 
 |  |  | 
 | pccore_cfgupdate(); | pccore_cfgupdate(); | 
 |  |  | 
| mouse_running(MOUSE_OFF); | mousemng_disable(MOUSEPROC_WINUI); | 
 | S98_trash(); | S98_trash(); | 
 |  |  | 
 | if (np2oscfg.resume) { | if (np2oscfg.resume) { |