--- np2/wince/wce/Attic/np2.cpp 2003/11/21 06:51:16 1.3 +++ np2/wince/wce/Attic/np2.cpp 2003/11/24 07:40:02 1.6 @@ -31,6 +31,7 @@ #include "vramhdl.h" #include "menubase.h" #include "sysmenu.h" +#include "debugsub.h" static const TCHAR szAppCaption[] = STRLITERAL("Neko Project II"); @@ -131,15 +132,22 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT case WM_KEYDOWN: if (wParam == VK_F11) { -// return(DefWindowProc(hWnd, WM_SYSKEYDOWN, VK_F10, lParam)); + if (menuvram == NULL) { + sysmenu_menuopen(0, 0, 0); + } + else { + menubase_close(); + } + } + else { + winkbd_keydown(wParam, lParam); } - winkbd_keydown(wParam, lParam); break; case WM_KEYUP: winkbd_keyup(wParam, lParam); break; - +#if 0 case WM_SYSKEYDOWN: winkbd_keydown(wParam, lParam); break; @@ -147,7 +155,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT case WM_SYSKEYUP: winkbd_keyup(wParam, lParam); break; - +#endif case WM_MOUSEMOVE: if (scrnmng_mousepos(&lParam) == SUCCESS) { if (menuvram == NULL) { @@ -187,15 +195,18 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT break; case WM_ACTIVATE: - if ((LOWORD(wParam) != WA_INACTIVE) && - ((BOOL)HIWORD(wParam) == FALSE)) { - GXResume(); - scrnmng_enable(TRUE); - scrndraw_redraw(); - } - else { - scrnmng_enable(FALSE); - GXSuspend(); + if (sysrunning) { + if (LOWORD(wParam) != WA_INACTIVE) { + GXResume(); + scrnmng_enable(TRUE); + scrndraw_redraw(); + soundmng_enable(SNDPROC_MAIN); + } + else { + soundmng_disable(SNDPROC_MAIN); + scrnmng_enable(FALSE); + GXSuspend(); + } } break; @@ -345,8 +356,10 @@ int WINAPI WinMain(HINSTANCE hInstance, pccore_init(); S98_init(); - scrndraw_redraw(); pccore_reset(); + scrndraw_redraw(); + + sysrunning = TRUE; if (np2oscfg.resume) { id = flagload(str_sav, str_resume, FALSE); @@ -356,17 +369,20 @@ int WINAPI WinMain(HINSTANCE hInstance, } } - sysrunning = TRUE; - while(taskmng_isavail()) { if (PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE)) { if (!GetMessage(&msg, NULL, 0, 0)) { break; } - if ((msg.message != WM_SYSKEYDOWN) && - (msg.message != WM_SYSKEYUP)) { +#if 1 + TranslateMessage(&msg); +#else + if ((msg.hwnd != hWnd) || + ((msg.message != WM_SYSKEYDOWN) && + (msg.message != WM_SYSKEYUP))) { TranslateMessage(&msg); } +#endif DispatchMessage(&msg); } else { @@ -427,6 +443,7 @@ int WINAPI WinMain(HINSTANCE hInstance, } } + soundmng_disable(SNDPROC_MAIN); sysrunning = FALSE; DestroyWindow(hWnd);