| version 1.4, 2003/10/18 10:00:29 | version 1.10, 2003/10/25 16:01:21 | 
| Line 1 | Line 1 | 
 | #include        "compiler.h" | #include        "compiler.h" | 
 | #include        <time.h> | #include        <time.h> | 
 |  | #ifndef __GNUC__ | 
 | #include        <winnls32.h> | #include        <winnls32.h> | 
 |  | #endif | 
 | #include        "resource.h" | #include        "resource.h" | 
 | #include        "strres.h" | #include        "strres.h" | 
 | #include        "np2.h" | #include        "np2.h" | 
| Line 16 | Line 18 | 
 | #include        "winkbd.h" | #include        "winkbd.h" | 
 | #include        "ini.h" | #include        "ini.h" | 
 | #include        "menu.h" | #include        "menu.h" | 
 | #include        "dialog.h" |  | 
 | #include        "winloc.h" | #include        "winloc.h" | 
 | #include        "sstp.h" | #include        "sstp.h" | 
 | #include        "sstpmsg.h" | #include        "sstpmsg.h" | 
 | #include        "dclock.h" | #include        "dclock.h" | 
 |  | #ifdef USE_ROMEO | 
 |  | #include        "juliet.h" | 
 |  | #endif | 
 |  | #include        "dialog.h" | 
 | #include        "memory.h" | #include        "memory.h" | 
 | #include        "pccore.h" | #include        "pccore.h" | 
 | #include        "iocore.h" | #include        "iocore.h" | 
 | #include        "pc9861k.h" | #include        "pc9861k.h" | 
 | #include        "mpu98ii.h" | #include        "mpu98ii.h" | 
 | #include        "timing.h" |  | 
 | #include        "debugsub.h" |  | 
 | #include        "bios.h" | #include        "bios.h" | 
 | #include        "scrndraw.h" | #include        "scrndraw.h" | 
 | #include        "sound.h" | #include        "sound.h" | 
| Line 35 | Line 38 | 
 | #include        "s98.h" | #include        "s98.h" | 
 | #include        "diskdrv.h" | #include        "diskdrv.h" | 
 | #include        "fddfile.h" | #include        "fddfile.h" | 
|  | #include        "timing.h" | 
| #ifdef USE_ROMEO | #include        "statsave.h" | 
| #include        "juliet.h" | #include        "debugsub.h" | 
| #endif |  | 
|  |  | 
 | #include        "keydisp.h" | #include        "keydisp.h" | 
 | #include        "viewer.h" | #include        "viewer.h" | 
 | #include        "statsave.h" |  | 
 |  |  | 
 |  |  | 
 | #ifdef BETA_RELEASE | #ifdef BETA_RELEASE | 
| Line 217  static int flagsave(const char *ext) { | Line 217  static int flagsave(const char *ext) { | 
 | return(ret); | return(ret); | 
 | } | } | 
 |  |  | 
 |  | static void flagdelete(const char *ext) { | 
 |  |  | 
 |  | char    path[MAX_PATH]; | 
 |  |  | 
 |  | getstatfilename(path, ext, sizeof(path)); | 
 |  | file_delete(path); | 
 |  | } | 
 |  |  | 
 | static int flagload(const char *ext, const char *title, BOOL force) { | static int flagload(const char *ext, const char *title, BOOL force) { | 
 |  |  | 
 | int             ret; | int             ret; | 
| Line 275  LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 283  LRESULT CALLBACK WndProc(HWND hWnd, UINT | 
 | switch (msg) { | switch (msg) { | 
 | case WM_CREATE: | case WM_CREATE: | 
 | sstp_construct(hWnd); | sstp_construct(hWnd); | 
 |  | #ifndef __GNUC__ | 
 | WINNLSEnableIME(hWnd, FALSE); | WINNLSEnableIME(hWnd, FALSE); | 
 |  | #endif | 
 | //                      DragAcceptFiles(hWnd, TRUE); | //                      DragAcceptFiles(hWnd, TRUE); | 
 | break; | break; | 
 |  |  | 
| Line 808  LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 818  LRESULT CALLBACK WndProc(HWND hWnd, UINT | 
 | if (LOWORD(wParam) != WA_INACTIVE) { | if (LOWORD(wParam) != WA_INACTIVE) { | 
 | np2break &= ~NP2BREAK_MAIN; | np2break &= ~NP2BREAK_MAIN; | 
 | scrnmng_update(); | scrnmng_update(); | 
 |  | keystat_allrelease(); | 
 | mouse_running(MOUSE_CONT_M); | mouse_running(MOUSE_CONT_M); | 
 | } | } | 
 | else { | else { | 
| Line 1069  LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 1080  LRESULT CALLBACK WndProc(HWND hWnd, UINT | 
 | } | } | 
 |  |  | 
 |  |  | 
| static void processwait(WORD cnt) { | static void processwait(UINT cnt) { | 
 |  |  | 
 | if (timing_getcount() >= cnt) { | if (timing_getcount() >= cnt) { | 
 | timing_setcount(0); | timing_setcount(0); | 
| Line 1095  int WINAPI WinMain(HINSTANCE hInstance, | Line 1106  int WINAPI WinMain(HINSTANCE hInstance, | 
 | MSG                     msg; | MSG                     msg; | 
 | HMENU           hMenu; | HMENU           hMenu; | 
 | HWND            hwndorg; | HWND            hwndorg; | 
| int                     i; | UINT            i; | 
 | #ifdef OPENING_WAIT | #ifdef OPENING_WAIT | 
 | UINT32          tick; | UINT32          tick; | 
 | #endif | #endif | 
| Line 1103  int WINAPI WinMain(HINSTANCE hInstance, | Line 1114  int WINAPI WinMain(HINSTANCE hInstance, | 
 | GetModuleFileName(NULL, modulefile, sizeof(modulefile)); | GetModuleFileName(NULL, modulefile, sizeof(modulefile)); | 
 | dosio_init(); | dosio_init(); | 
 | file_setcd(modulefile); | file_setcd(modulefile); | 
| np2arg_analize(lpszCmdLine);                            // タイミング修正       // ver0.29 | np2arg_analize(lpszCmdLine); | 
 | initload(); | initload(); | 
 |  |  | 
 | srand((unsigned)time(NULL)); | srand((unsigned)time(NULL)); | 
 |  |  | 
 | np2arg_analize(lpszCmdLine); |  | 
 |  |  | 
 | CopyMemory(szClassName, np2oscfg.winid, 3); | CopyMemory(szClassName, np2oscfg.winid, 3); | 
 |  |  | 
 | if ((hwndorg = FindWindow(szClassName, NULL)) != NULL) { | if ((hwndorg = FindWindow(szClassName, NULL)) != NULL) { | 
| Line 1367  int WINAPI WinMain(HINSTANCE hInstance, | Line 1376  int WINAPI WinMain(HINSTANCE hInstance, | 
 | } | } | 
 | else {                                                          // auto skip | else {                                                          // auto skip | 
 | if (!waitcnt) { | if (!waitcnt) { | 
 |  | UINT cnt; | 
 | joy_flash(); | joy_flash(); | 
 | mouse_callback(); | mouse_callback(); | 
 | pccore_exec(framecnt == 0); | pccore_exec(framecnt == 0); | 
 | dclock_callback(); | dclock_callback(); | 
 | 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 { | 
| Line 1411  int WINAPI WinMain(HINSTANCE hInstance, | Line 1428  int WINAPI WinMain(HINSTANCE hInstance, | 
 | flagsave(np2resume); | flagsave(np2resume); | 
 | } | } | 
 | else { | else { | 
| //              DeleteFile(file_getcd(np2resume)); | flagdelete(np2resume); | 
 | } | } | 
 |  |  | 
 | #ifdef USE_ROMEO | #ifdef USE_ROMEO |