Diff for /np2/win9x/np2.cpp between versions 1.37 and 1.43

version 1.37, 2004/02/03 08:24:40 version 1.43, 2004/03/07 07:51:26
Line 28 Line 28
 #include        "juliet.h"  #include        "juliet.h"
 #include        "np2class.h"  #include        "np2class.h"
 #include        "dialog.h"  #include        "dialog.h"
 #include        "memory.h"  #include        "cpucore.h"
 #include        "pccore.h"  #include        "pccore.h"
 #include        "iocore.h"  #include        "iocore.h"
 #include        "pc9861k.h"  #include        "pc9861k.h"
Line 41 Line 41
 #include        "diskdrv.h"  #include        "diskdrv.h"
 #include        "fddfile.h"  #include        "fddfile.h"
 #include        "timing.h"  #include        "timing.h"
   #include        "keystat.h"
 #include        "debugsub.h"  #include        "debugsub.h"
 #include        "keydisp.h"  #include        "keydisp.h"
 #include        "kdispwin.h"  #include        "kdispwin.h"
Line 229  void np2active_renewal(void) {         / Line 230  void np2active_renewal(void) {         /
         }          }
 }  }
   
   
   // ---- resume and statsave
   
   #if defined(SUPPORT_RESUME) || defined(SUPPORT_STATSAVE)
 static void getstatfilename(char *path, const char *ext, int size) {  static void getstatfilename(char *path, const char *ext, int size) {
   
         file_cpyname(path, modulefile, size);          file_cpyname(path, modulefile, size);
Line 271  static int flagload(const char *ext, con Line 276  static int flagload(const char *ext, con
         winuienter();          winuienter();
         id = IDYES;          id = IDYES;
         ret = statsave_check(path, buf, sizeof(buf));          ret = statsave_check(path, buf, sizeof(buf));
         if (ret & (~NP2FLAG_DISKCHG)) {          if (ret & (~STATFLAG_DISKCHG)) {
                 MessageBox(hWndMain, "Couldn't restart", title, MB_OK | MB_ICONSTOP);                  MessageBox(hWndMain, "Couldn't restart", title, MB_OK | MB_ICONSTOP);
                 id = IDNO;                  id = IDNO;
         }          }
         else if ((!force) && (ret & NP2FLAG_DISKCHG)) {          else if ((!force) && (ret & STATFLAG_DISKCHG)) {
                 char buf2[1024 + 256];                  char buf2[1024 + 256];
                 wsprintf(buf2, "Conflict!\n\n%s\nContinue?", buf);                  wsprintf(buf2, "Conflict!\n\n%s\nContinue?", buf);
                 id = MessageBox(hWndMain, buf2, title,                  id = MessageBox(hWndMain, buf2, title,
Line 291  static int flagload(const char *ext, con Line 296  static int flagload(const char *ext, con
         winuileave();          winuileave();
         return(id);          return(id);
 }  }
   #endif
   
   
 // ---- proc  // ---- proc
Line 390  static void np2cmd(HWND hWnd, UINT16 cmd Line 396  static void np2cmd(HWND hWnd, UINT16 cmd
                         toolwin_setfdd(1, NULL);                          toolwin_setfdd(1, NULL);
                         break;                          break;
   
                   case IDM_FDD3OPEN:
                           winuienter();
                           dialog_changefdd(hWnd, 2);
                           winuileave();
                           break;
   
                   case IDM_FDD3EJECT:
                           diskdrv_setfdd(2, NULL, 0);
                           toolwin_setfdd(2, NULL);
                           break;
   
                   case IDM_FDD4OPEN:
                           winuienter();
                           dialog_changefdd(hWnd, 3);
                           winuileave();
                           break;
   
                   case IDM_FDD4EJECT:
                           diskdrv_setfdd(3, NULL, 0);
                           toolwin_setfdd(3, NULL);
                           break;
   
                 case IDM_SASI1OPEN:                  case IDM_SASI1OPEN:
                         winuienter();                          winuienter();
                         dialog_changehdd(hWnd, 0x00);                          dialog_changehdd(hWnd, 0x00);
Line 593  static void np2cmd(HWND hWnd, UINT16 cmd Line 621  static void np2cmd(HWND hWnd, UINT16 cmd
                         update |= SYS_UPDATEOSCFG;                          update |= SYS_UPDATEOSCFG;
                         break;                          break;
   
                   case IDM_USERKEY1:
                           xmenu_setf12copy(5);
                           winkbd_resetf12();
                           update |= SYS_UPDATEOSCFG;
                           break;
   
                   case IDM_USERKEY2:
                           xmenu_setf12copy(6);
                           winkbd_resetf12();
                           update |= SYS_UPDATEOSCFG;
                           break;
   
                 case IDM_BEEPOFF:                  case IDM_BEEPOFF:
                         xmenu_setbeepvol(0);                          xmenu_setbeepvol(0);
                         beep_setvol(0);                          beep_setvol(0);
Line 807  static void np2cmd(HWND hWnd, UINT16 cmd Line 847  static void np2cmd(HWND hWnd, UINT16 cmd
                         break;                          break;
   
                 default:                  default:
   #if defined(SUPPORT_STATSAVE)
                         if ((cmd >= IDM_FLAGSAVE) &&                          if ((cmd >= IDM_FLAGSAVE) &&
                                 (cmd < (IDM_FLAGSAVE + STATSAVEMAX))) {                                  (cmd < (IDM_FLAGSAVE + SUPPORT_STATSAVE))) {
                                 char ext[4];                                  char ext[4];
                                 wsprintf(ext, np2flagext, cmd - IDM_FLAGSAVE);                                  SPRINTF(ext, np2flagext, cmd - IDM_FLAGSAVE);
                                 flagsave(ext);                                  flagsave(ext);
                         }                          }
                         if ((cmd >= IDM_FLAGLOAD) &&                          else if ((cmd >= IDM_FLAGLOAD) &&
                                 (cmd < (IDM_FLAGLOAD + STATSAVEMAX))) {                                  (cmd < (IDM_FLAGLOAD + SUPPORT_STATSAVE))) {
                                 char ext[4];                                  char ext[4];
                                 wsprintf(ext, np2flagext, cmd - IDM_FLAGLOAD);                                  SPRINTF(ext, np2flagext, cmd - IDM_FLAGLOAD);
                                 flagload(ext, "Status Load", TRUE);                                  flagload(ext, "Status Load", TRUE);
                         }                          }
   #endif
                         break;                          break;
         }          }
         sysmng_update(update);          sysmng_update(update);
Line 997  LRESULT CALLBACK WndProc(HWND hWnd, UINT Line 1039  LRESULT CALLBACK WndProc(HWND hWnd, UINT
                         break;                          break;
   
                 case WM_MOVE:                  case WM_MOVE:
                         if (!scrnmng_isfullscreen()) {                          if ((!scrnmng_isfullscreen()) &&
                                 if (!(GetWindowLong(hWnd, GWL_STYLE) &                                  (!(GetWindowLong(hWnd, GWL_STYLE) &
                                                                                         (WS_MAXIMIZE | WS_MINIMIZE))) {                                                                          (WS_MAXIMIZE | WS_MINIMIZE)))) {
                                         GetWindowRect(hWnd, &rc);                                  GetWindowRect(hWnd, &rc);
                                         np2oscfg.winx = rc.left;                                  np2oscfg.winx = rc.left;
                                         np2oscfg.winy = rc.top;                                  np2oscfg.winy = rc.top;
                                         sysmng_update(SYS_UPDATEOSCFG);                                  sysmng_update(SYS_UPDATEOSCFG);
                                 }  
                         }                          }
                         break;                          break;
   
Line 1330  int WINAPI WinMain(HINSTANCE hInstance,  Line 1371  int WINAPI WinMain(HINSTANCE hInstance, 
                         np2oscfg.KEYBOARD = KEY_KEY106;                          np2oscfg.KEYBOARD = KEY_KEY106;
                 }                  }
         }          }
         keystat_reset();          keystat_initialize();
   
         np2class_initialize(hInstance);          np2class_initialize(hInstance);
         if (!hPreInst) {          if (!hPreInst) {
Line 1352  int WINAPI WinMain(HINSTANCE hInstance,  Line 1393  int WINAPI WinMain(HINSTANCE hInstance, 
         kdispwin_initialize(hPreInst);          kdispwin_initialize(hPreInst);
         viewer_init(hPreInst);          viewer_init(hPreInst);
   
 #if 1          mousemng_initialize();
         hWndMain = CreateWindowEx(0,  
                                                 szClassName, np2oscfg.titles,          hWnd = CreateWindowEx(0, szClassName, np2oscfg.titles,
                                                 WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION |                                                  WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION |
                                                 WS_THICKFRAME | 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);
 #else   // テスト          hWndMain = hWnd;
         hWndMain = CreateWindowEx(0,  
                                                 szClassName, np2oscfg.titles,  
                                                 WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION |  
                                                 WS_MINIMIZEBOX,  
                                                 np2oscfg.winx, np2oscfg.winy, 640, 400,  
                                                 NULL, NULL, hInstance, NULL);  
 #endif  
         hWnd = hWndMain;  
         scrnmng_initialize();          scrnmng_initialize();
   
         xmenu_setroltate(0);          xmenu_setroltate(0);
Line 1392  int WINAPI WinMain(HINSTANCE hInstance,  Line 1425  int WINAPI WinMain(HINSTANCE hInstance, 
         xmenu_setbtnrapid(np2cfg.BTN_RAPID);          xmenu_setbtnrapid(np2cfg.BTN_RAPID);
         xmenu_setmsrapid(np2cfg.MOUSERAPID);          xmenu_setmsrapid(np2cfg.MOUSERAPID);
         xmenu_setsstp(np2oscfg.sstp);          xmenu_setsstp(np2oscfg.sstp);
         xmenu_seti286save(np2oscfg.I286SAVE);  
   
         ShowWindow(hWnd, nCmdShow);          ShowWindow(hWnd, nCmdShow);
         UpdateWindow(hWnd);          UpdateWindow(hWnd);
Line 1446  int WINAPI WinMain(HINSTANCE hInstance,  Line 1478  int WINAPI WinMain(HINSTANCE hInstance, 
                 juliet_initialize();                  juliet_initialize();
         }          }
   
         mousemng_initialize();  
         if (np2oscfg.MOUSE_SW) {                                                                                // ver0.30          if (np2oscfg.MOUSE_SW) {                                                                                // ver0.30
                 mousemng_enable(MOUSEPROC_SYSTEM);                  mousemng_enable(MOUSEPROC_SYSTEM);
         }          }
 //      mousemng_enable(MOUSEPROC_WINUI);  
 //      mousemng_enable(MOUSEPROC_BG);  
   
         commng_initialize();          commng_initialize();
         sysmng_initialize();          sysmng_initialize();
   
         joy_init();          joymng_initialize();
         pccore_init();          pccore_init();
         S98_init();          S98_init();
   
Line 1473  int WINAPI WinMain(HINSTANCE hInstance,  Line 1502  int WINAPI WinMain(HINSTANCE hInstance, 
         np2opening = 0;          np2opening = 0;
   
         // れじうむ          // れじうむ
   #if defined(SUPPORT_RESUME)
         if (np2oscfg.resume) {          if (np2oscfg.resume) {
                 int             id;                  int             id;
   
Line 1494  int WINAPI WinMain(HINSTANCE hInstance,  Line 1524  int WINAPI WinMain(HINSTANCE hInstance, 
                         return(0);                          return(0);
                 }                  }
         }          }
   #endif
   
 //      リセットしてから… コマンドラインのディスク挿入。                               // ver0.29  //      リセットしてから… コマンドラインのディスク挿入。                               // ver0.29
         for (i=0; i<4; i++) {          for (i=0; i<4; i++) {
Line 1527  int WINAPI WinMain(HINSTANCE hInstance,  Line 1558  int WINAPI WinMain(HINSTANCE hInstance, 
                         }                          }
                         else {                          else {
                                 if (np2oscfg.NOWAIT) {                                  if (np2oscfg.NOWAIT) {
                                         joy_flash();                                          joymng_sync();
                                         mousemng_callback();                                          mousemng_sync();
                                         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 1546  int WINAPI WinMain(HINSTANCE hInstance,  Line 1577  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();                                                  joymng_sync();
                                                 mousemng_callback();                                                  mousemng_sync();
                                                 pccore_exec(framecnt == 0);                                                  pccore_exec(framecnt == 0);
                                                 dclock_callback();                                                  dclock_callback();
                                                 framecnt++;                                                  framecnt++;
Line 1559  int WINAPI WinMain(HINSTANCE hInstance,  Line 1590  int WINAPI WinMain(HINSTANCE hInstance, 
                                 else {                                                          // auto skip                                  else {                                                          // auto skip
                                         if (!waitcnt) {                                          if (!waitcnt) {
                                                 UINT cnt;                                                  UINT cnt;
                                                 joy_flash();                                                  joymng_sync();
                                                 mousemng_callback();                                                  mousemng_sync();
                                                 pccore_exec(framecnt == 0);                                                  pccore_exec(framecnt == 0);
                                                 dclock_callback();                                                  dclock_callback();
                                                 framecnt++;                                                  framecnt++;
Line 1608  int WINAPI WinMain(HINSTANCE hInstance,  Line 1639  int WINAPI WinMain(HINSTANCE hInstance, 
         mousemng_disable(MOUSEPROC_WINUI);          mousemng_disable(MOUSEPROC_WINUI);
         S98_trash();          S98_trash();
   
   #if defined(SUPPORT_RESUME)
         if (np2oscfg.resume) {          if (np2oscfg.resume) {
                 flagsave(str_sav);                  flagsave(str_sav);
         }          }
         else {          else {
                 flagdelete(str_sav);                  flagdelete(str_sav);
         }          }
   #endif
   
         juliet_YMF288Reset();          juliet_YMF288Reset();
         pccore_term();          pccore_term();

Removed from v.1.37  
changed lines
  Added in v.1.43


RetroPC.NET-CVS <cvs@retropc.net>