| version 1.1, 2003/10/21 14:57:41 | version 1.4, 2003/10/25 16:01:21 | 
| Line 29 | Line 29 | 
 | #include        "debugsub.h" | #include        "debugsub.h" | 
 |  |  | 
 |  |  | 
| static  const char      szAppCaption[] = STRLITERAL("Neko Project II"); | static const TCHAR szAppCaption[] = STRLITERAL("Neko Project II"); | 
| static  const char      szClassName[] = STRLITERAL("NP2-MainWindow"); | static const TCHAR szClassName[] = STRLITERAL("NP2-MainWindow"); | 
 |  |  | 
 |  |  | 
 | NP2OSCFG        np2oscfg = {0, 2}; | NP2OSCFG        np2oscfg = {0, 2}; | 
| Line 97  LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 97  LRESULT CALLBACK WndProc(HWND hWnd, UINT | 
 | PostQuitMessage(0); | PostQuitMessage(0); | 
 | break; | break; | 
 |  |  | 
| case WM_NP2CMD: | #if defined(WAVEMNG_CBMAIN) | 
| switch(LOWORD(lParam)) { | case MM_WOM_DONE: | 
| case NP2CMD_EXIT: | soundmng_cb(MM_WOM_DONE, (HWAVEOUT)wParam, (WAVEHDR *)lParam); | 
| case NP2CMD_EXIT2: |  | 
| PostQuitMessage(0); |  | 
| break; |  | 
|  |  | 
| case NP2CMD_RESET: |  | 
| pccore_cfgupdate(); |  | 
| pccore_reset(); |  | 
| break; |  | 
| } |  | 
 | break; | break; | 
 |  | #endif | 
 |  |  | 
 | default: | default: | 
 | return(DefWindowProc(hWnd, msg, wParam, lParam)); | return(DefWindowProc(hWnd, msg, wParam, lParam)); | 
| Line 131  static void processwait(UINT waitcnt) { | Line 123  static void processwait(UINT waitcnt) { | 
 |  |  | 
 |  |  | 
 | int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPreInst, | int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPreInst, | 
| LPSTR lpszCmdLine, int nCmdShow) { | LPTSTR lpszCmdLine, int nCmdShow) { | 
 | WNDCLASS        np2; | WNDCLASS        np2; | 
 | MSG                     msg; | MSG                     msg; | 
 | HWND            hwndorg; | HWND            hwndorg; | 
 |  |  | 
 |  | hwndorg = FindWindow(szClassName, NULL); | 
 |  | if (hwndorg != NULL) { | 
 |  | ShowWindow(hwndorg, SW_RESTORE); | 
 |  | SetForegroundWindow(hwndorg); | 
 |  | return(FALSE); | 
 |  | } | 
 |  |  | 
 | GetModuleFileName(NULL, modulefile, sizeof(modulefile)); | GetModuleFileName(NULL, modulefile, sizeof(modulefile)); | 
 | dosio_init(); | dosio_init(); | 
 | file_setcd(modulefile); | file_setcd(modulefile); | 
| Line 143  int WINAPI WinMain(HINSTANCE hInstance, | Line 142  int WINAPI WinMain(HINSTANCE hInstance, | 
 |  |  | 
 | srand((unsigned)time(NULL)); | srand((unsigned)time(NULL)); | 
 |  |  | 
 | if ((hwndorg = FindWindow(szClassName, NULL)) != NULL) { |  | 
 | ShowWindow(hwndorg, SW_RESTORE); |  | 
 | SetForegroundWindow(hwndorg); |  | 
 | dosio_term(); |  | 
 | return(FALSE); |  | 
 | } |  | 
 |  |  | 
 | hInst = hInstance; | hInst = hInstance; | 
 | hPrev = hPreInst; | hPrev = hPreInst; | 
 | TRACEINIT(); | TRACEINIT(); | 
| Line 235  int WINAPI WinMain(HINSTANCE hInstance, | Line 227  int WINAPI WinMain(HINSTANCE hInstance, | 
 | } | } | 
 | else {                                                          // auto skip | else {                                                          // auto skip | 
 | if (!waitcnt) { | if (!waitcnt) { | 
 |  | UINT cnt; | 
 | pccore_exec(framecnt == 0); | pccore_exec(framecnt == 0); | 
 | framecnt++; | framecnt++; | 
| if (timing_getcount() < framecnt) { | cnt = timing_getcount(); | 
|  | if (framecnt > cnt) { | 
 | waitcnt = framecnt; | waitcnt = framecnt; | 
 | if (framemax > 1) { | if (framemax > 1) { | 
 | framemax--; | framemax--; | 
 | } | } | 
 | } | } | 
 | else if (framecnt >= framemax) { | else if (framecnt >= framemax) { | 
 | waitcnt = framecnt; |  | 
 | if (framemax < 12) { | if (framemax < 12) { | 
 | framemax++; | framemax++; | 
 | } | } | 
 |  | if (cnt >= 12) { | 
 |  | timing_reset(); | 
 |  | } | 
 |  | else { | 
 |  | timing_setcount(cnt - framecnt); | 
 |  | } | 
 |  | processwait(0); | 
 | } | } | 
 | } | } | 
 | else { | else { |