Diff for /np2/win9x/np2.cpp between versions 1.9 and 1.20

version 1.9, 2003/10/23 13:31:13 version 1.20, 2003/10/31 04:11:40
Line 5 Line 5
 #endif  #endif
 #include        "resource.h"  #include        "resource.h"
 #include        "strres.h"  #include        "strres.h"
   #include        "parts.h"
 #include        "np2.h"  #include        "np2.h"
 #include        "np2arg.h"  #include        "np2arg.h"
   #include        "cputype.h"
 #include        "dosio.h"  #include        "dosio.h"
 #include        "extromio.h"  #include        "extromio.h"
 #include        "commng.h"  #include        "commng.h"
Line 22 Line 24
 #include        "sstp.h"  #include        "sstp.h"
 #include        "sstpmsg.h"  #include        "sstpmsg.h"
 #include        "dclock.h"  #include        "dclock.h"
   #include        "toolwin.h"
 #ifdef USE_ROMEO  #ifdef USE_ROMEO
 #include        "juliet.h"  #include        "juliet.h"
 #endif  #endif
   #include        "np2class.h"
 #include        "dialog.h"  #include        "dialog.h"
 #include        "memory.h"  #include        "memory.h"
 #include        "pccore.h"  #include        "pccore.h"
Line 55  static char  szClassName[] = "NP2-MainWi Line 59  static char  szClassName[] = "NP2-MainWi
                 HWND            hWndMain;                  HWND            hWndMain;
                 HINSTANCE       hInst;                  HINSTANCE       hInst;
                 HINSTANCE       hPrev;                  HINSTANCE       hPrev;
                   int                     mmxflag;
   
                 NP2OSCFG        np2oscfg = {                  NP2OSCFG        np2oscfg = {
                                                 "Neko Project II", "NP2",                                                  "Neko Project II", "NP2",
Line 66  static char  szClassName[] = "NP2-MainWi Line 71  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};                                     // ver0.34                                                  0, 1, 0, 9801, 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    mimpideffile[MAX_PATH];  
                 char    modulefile[MAX_PATH];                  char    modulefile[MAX_PATH];
   
 static  UINT    framecnt = 0;  static  UINT    framecnt = 0;
Line 82  static BYTE np2stopemulate = 0; Line 86  static BYTE np2stopemulate = 0;
 static  int             np2opening = 1;  static  int             np2opening = 1;
 static  int             np2quitmsg = 0;  static  int             np2quitmsg = 0;
                 HMENU   hStat = NULL;                  HMENU   hStat = NULL;
   static  BYTE    scrnmode;
                   WINLOC  wl;
   
 static const char np2help[] = "np2.hlp";  static const char np2help[] = "np2.hlp";
 static const char np2resume[] = "sav";  static const char np2resume[] = "sav";
   
   
 typedef struct {  
 const char      *str;  
         int             id;  
 } SYSMENU_ITEM;  
   
 static SYSMENU_ITEM smenu_item[] = {  
                         {"&Centering",                  IDM_SCREENCENTER},  
                         {"&Window Snap",                IDM_SNAPENABLE},  
                         {"&Background",                 IDM_BACKGROUND},  
                         {"Background &Sound",   IDM_BGSOUND},  
                         {"&Key display",                IDM_KEYDISP},  
                         {NULL,                                  0},  
                         {" 320x200",                    IDM_SCRNMUL4},  
                         {" 480x300",                    IDM_SCRNMUL6},  
                         {" 640x400",                    IDM_SCRNMUL8},  
                         {" 800x500",                    IDM_SCRNMUL10},  
                         {" 960x600",                    IDM_SCRNMUL12},  
                         {"1280x800",                    IDM_SCRNMUL16},  
                         {NULL,                                  0},  
                 };  
   
   static void winuienter(void) {
   
 static  BYTE    scrnmode;          soundmng_disable(SNDPROC_MAIN);
           scrnmng_topwinui();
   }
   
   static void winuileave(void) {
   
           scrnmng_clearwinui();
           soundmng_enable(SNDPROC_MAIN);
   }
   
 static void changescreen(BYTE newmode) {  static void changescreen(BYTE newmode) {
   
Line 125  static void changescreen(BYTE newmode) { Line 121  static void changescreen(BYTE newmode) {
                 renewal |= (change & SCRNMODE_ROTATEMASK);                  renewal |= (change & SCRNMODE_ROTATEMASK);
         }          }
         if (renewal) {          if (renewal) {
                   if (renewal & SCRNMODE_FULLSCREEN) {
                           toolwin_close();
                   }
                   else if (renewal & SCRNMODE_ROTATEMASK) {
                           toolwin_movingstart();
                   }
                 soundmng_stop();                  soundmng_stop();
                 mouse_running(MOUSE_STOP);                  mouse_running(MOUSE_STOP);
                 keydisp_destroy();                  keydisp_destroy();
Line 139  static void changescreen(BYTE newmode) { Line 141  static void changescreen(BYTE newmode) {
                         }                          }
                 }                  }
                 scrndraw_redraw();                  scrndraw_redraw();
                   if ((renewal & SCRNMODE_FULLSCREEN) &&
                           (!scrnmng_isfullscreen()) && (np2oscfg.toolwin)) {
                           toolwin_open();
                   }
                   else if (renewal & SCRNMODE_ROTATEMASK) {
                           toolwin_movingend();
                   }
                 mouse_running(MOUSE_CONT);                  mouse_running(MOUSE_CONT);
                 soundmng_play();                  soundmng_play();
         }          }
Line 172  void np2active_renewal(void) {         / Line 181  void np2active_renewal(void) {         /
   
         if (np2break & (~NP2BREAK_MAIN)) {          if (np2break & (~NP2BREAK_MAIN)) {
                 np2stopemulate = 2;                  np2stopemulate = 2;
                 soundmng_disable();                  soundmng_disable(SNDPROC_MASTER);
         }          }
         else if (np2break & NP2BREAK_MAIN) {          else if (np2break & NP2BREAK_MAIN) {
                 if (np2oscfg.background & 1) {                  if (np2oscfg.background & 1) {
Line 182  void np2active_renewal(void) {         / Line 191  void np2active_renewal(void) {         /
                         np2stopemulate = 0;                          np2stopemulate = 0;
                 }                  }
                 if (np2oscfg.background) {                  if (np2oscfg.background) {
                         soundmng_disable();                          soundmng_disable(SNDPROC_MASTER);
                 }                  }
                 else {                  else {
                         soundmng_enable();                          soundmng_enable(SNDPROC_MASTER);
                 }                  }
         }          }
         else {          else {
                 np2stopemulate = 0;                  np2stopemulate = 0;
                 soundmng_enable();                  soundmng_enable(SNDPROC_MASTER);
         }          }
 }  }
   
Line 233  static int flagload(const char *ext, con Line 242  static int flagload(const char *ext, con
         char    buf[1024];          char    buf[1024];
   
         getstatfilename(path, ext, sizeof(path));          getstatfilename(path, ext, sizeof(path));
         soundmng_stop();          winuienter();
         scrnmng_topwinui();  
         id = IDYES;          id = IDYES;
         ret = statsave_check(path, buf, sizeof(buf));          ret = statsave_check(path, buf, sizeof(buf));
         if (ret & (~NP2FLAG_DISKCHG)) {          if (ret & (~NP2FLAG_DISKCHG)) {
Line 249  static int flagload(const char *ext, con Line 257  static int flagload(const char *ext, con
         }          }
         if (id == IDYES) {          if (id == IDYES) {
                 statsave_load(path);                  statsave_load(path);
                   toolwin_setfdd(0, fdd_diskname(0));
                   toolwin_setfdd(1, fdd_diskname(1));
         }          }
         sysmng_workclockreset();          sysmng_workclockreset();
         sysmng_updatecaption(1);          sysmng_updatecaption(1);
         scrnmng_clearwinui();          winuileave();
         soundmng_play();  
         return(id);          return(id);
 }  }
   
   
 // ---- proc  // ---- proc
   
 static void winuienter(void) {  
   
         soundmng_stop();  
         scrnmng_topwinui();  
 }  
   
 static void winuileave(void) {  
   
         scrnmng_clearwinui();  
         soundmng_play();  
 }  
   
 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 286  LRESULT CALLBACK WndProc(HWND hWnd, UINT Line 283  LRESULT CALLBACK WndProc(HWND hWnd, UINT
 #ifndef __GNUC__  #ifndef __GNUC__
                         WINNLSEnableIME(hWnd, FALSE);                          WINNLSEnableIME(hWnd, FALSE);
 #endif  #endif
 //                      DragAcceptFiles(hWnd, TRUE);  
                         break;                          break;
   
                 case WM_SYSCOMMAND:                  case WM_SYSCOMMAND:
                         update = 0;                          update = 0;
                         switch(wParam) {                          switch(wParam) {
                                 case IDM_SCREENCENTER:                                                  // ver0.26                                  case IDM_TOOLWIN:
                                           xmenu_settoolwin(np2oscfg.toolwin ^ 1);
                                           if (np2oscfg.toolwin) {
                                                   toolwin_open();
                                           }
                                           else {
                                                   toolwin_close();
                                           }
                                           update |= SYS_UPDATEOSCFG;
                                           break;
   
                                   case IDM_SCREENCENTER:
                                         if ((!scrnmng_isfullscreen()) &&                                          if ((!scrnmng_isfullscreen()) &&
                                                 (!(GetWindowLong(hWnd, GWL_STYLE) &                                                  (!(GetWindowLong(hWnd, GWL_STYLE) &
                                                                                         (WS_MAXIMIZE | WS_MINIMIZE)))) {                                                                                          (WS_MAXIMIZE | WS_MINIMIZE)))) {
                                                   toolwin_movingstart();
                                                 wincentering(hWnd);                                                  wincentering(hWnd);
                                                   toolwin_movingend();
                                         }                                          }
                                         break;                                          break;
   
                                 case IDM_SNAPENABLE:                                  case IDM_SNAPENABLE:
                                         xmenu_setwinsnap(np2oscfg.WINSNAP ^ 1);                                          xmenu_setwinsnap(np2oscfg.WINSNAP ^ 1);
                                         update |= SYS_UPDATECFG;                                          update |= SYS_UPDATEOSCFG;
                                         break;                                          break;
   
                                 case IDM_BACKGROUND:                                  case IDM_BACKGROUND:
                                         xmenu_setbackground(np2oscfg.background ^ 1);                                          xmenu_setbackground(np2oscfg.background ^ 1);
                                         update |= SYS_UPDATECFG;                                          update |= SYS_UPDATEOSCFG;
                                         break;                                          break;
   
                                 case IDM_BGSOUND:                                  case IDM_BGSOUND:
                                         xmenu_setbgsound(np2oscfg.background ^ 2);                                          xmenu_setbgsound(np2oscfg.background ^ 2);
                                         update |= SYS_UPDATECFG;                                          update |= SYS_UPDATEOSCFG;
                                         break;                                          break;
   
                                 case IDM_KEYDISP:                                  case IDM_KEYDISP:
Line 401  LRESULT CALLBACK WndProc(HWND hWnd, UINT Line 410  LRESULT CALLBACK WndProc(HWND hWnd, UINT
   
                                 case IDM_FDD1EJECT:                                  case IDM_FDD1EJECT:
                                         diskdrv_setfdd(0, NULL, 0);                                          diskdrv_setfdd(0, NULL, 0);
                                           toolwin_setfdd(0, NULL);
                                         break;                                          break;
   
                                 case IDM_FDD2OPEN:                                  case IDM_FDD2OPEN:
Line 411  LRESULT CALLBACK WndProc(HWND hWnd, UINT Line 421  LRESULT CALLBACK WndProc(HWND hWnd, UINT
   
                                 case IDM_FDD2EJECT:                                  case IDM_FDD2EJECT:
                                         diskdrv_setfdd(1, NULL, 0);                                          diskdrv_setfdd(1, NULL, 0);
                                           toolwin_setfdd(1, NULL);
                                         break;                                          break;
   
                                 case IDM_SASI1OPEN:                                  case IDM_SASI1OPEN:
Line 542  LRESULT CALLBACK WndProc(HWND hWnd, UINT Line 553  LRESULT CALLBACK WndProc(HWND hWnd, UINT
   
                                 case IDM_F12MOUSE:                                  case IDM_F12MOUSE:
                                         xmenu_setf12copy(0);                                          xmenu_setf12copy(0);
                                         keystat_resetcopyhelp();                                          winkbd_resetf12();
                                         update |= SYS_UPDATECFG;                                          update |= SYS_UPDATECFG;
                                         break;                                          break;
   
                                 case IDM_F12COPY:                                  case IDM_F12COPY:
                                         xmenu_setf12copy(1);                                          xmenu_setf12copy(1);
                                         keystat_resetcopyhelp();                                          winkbd_resetf12();
                                         update |= SYS_UPDATECFG;                                          update |= SYS_UPDATECFG;
                                         break;                                          break;
   
                                 case IDM_F12STOP:                                  case IDM_F12STOP:
                                         xmenu_setf12copy(2);                                          xmenu_setf12copy(2);
                                         keystat_resetcopyhelp();                                          winkbd_resetf12();
                                           update |= SYS_UPDATECFG;
                                           break;
   
                                   case IDM_F12EQU:
                                           xmenu_setf12copy(3);
                                           winkbd_resetf12();
                                           update |= SYS_UPDATECFG;
                                           break;
   
                                   case IDM_F12COMMA:
                                           xmenu_setf12copy(4);
                                           winkbd_resetf12();
                                         update |= SYS_UPDATECFG;                                          update |= SYS_UPDATECFG;
                                         break;                                          break;
   
Line 831  LRESULT CALLBACK WndProc(HWND hWnd, UINT Line 854  LRESULT CALLBACK WndProc(HWND hWnd, UINT
                 case WM_PAINT:                  case WM_PAINT:
                         hdc = BeginPaint(hWnd, &ps);                          hdc = BeginPaint(hWnd, &ps);
                         if (np2opening) {                          if (np2opening) {
                                   HINSTANCE       hinst;
                             HDC                 hmdc;                                  RECT            rect;
                             HBITMAP             hbmp;                                  int                     width;
                             BITMAP              bmp;                                  int                     height;
                             HINSTANCE   hinst;                                  HBITMAP         hbmp;
                                 int                     sx = 640 + np2oscfg.paddingx;                                  BITMAP          bmp;
                                 int                     sy = 400 + np2oscfg.paddingy;                                  HDC                     hmdc;
                                   HBRUSH          hbrush;
                             hinst = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE);                                  hinst = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE);
 #if 1                                  GetClientRect(hWnd, &rect);
                         hbmp = LoadBitmap(hinst, "NP2BMP");                                  width = rect.right - rect.left;
                             GetObject(hbmp, sizeof(BITMAP), &bmp);                                  height = rect.bottom - rect.top;
                             hmdc = CreateCompatibleDC(hdc);                                  hbmp = LoadBitmap(hinst, "NP2BMP");
                             SelectObject(hmdc, hbmp);                                  GetObject(hbmp, sizeof(BITMAP), &bmp);
                             BitBlt(hdc, (sx - 252) / 2, (sy - 28) / 2,                                  hbrush = (HBRUSH)SelectObject(hdc,
                                                                                                   GetStockObject(BLACK_BRUSH));
                                   PatBlt(hdc, 0, 0, width, height, PATCOPY);
                                   SelectObject(hdc, hbrush);
                                   hmdc = CreateCompatibleDC(hdc);
                                   SelectObject(hmdc, hbmp);
                                   BitBlt(hdc, (width - bmp.bmWidth) / 2,
                                                   (height - bmp.bmHeight) / 2,
                                                         bmp.bmWidth, bmp.bmHeight, hmdc, 0, 0, SRCCOPY);                                                          bmp.bmWidth, bmp.bmHeight, hmdc, 0, 0, SRCCOPY);
                             DeleteDC(hmdc);                                  DeleteDC(hmdc);
                         DeleteObject(hbmp);                                  DeleteObject(hbmp);
 #else  
                         hbmp = LoadBitmap(hinst, "NP2EXT");  
                             GetObject(hbmp, sizeof(BITMAP), &bmp);  
                             hmdc = CreateCompatibleDC(hdc);  
                             SelectObject(hmdc, hbmp);  
                             BitBlt(hdc, (sx - 160) / 2, (sy - 140) / 2,  
                                                         bmp.bmWidth, bmp.bmHeight, hmdc, 0, 0, SRCCOPY);  
                             DeleteDC(hmdc);  
                         DeleteObject(hbmp);  
 #endif  
                         }                          }
                         else {                          else {
 //                              scrnmng_update();  //                              scrnmng_update();
Line 872  LRESULT CALLBACK WndProc(HWND hWnd, UINT Line 892  LRESULT CALLBACK WndProc(HWND hWnd, UINT
                         break;                          break;
   
                 case WM_MOVE:                  case WM_MOVE:
                         if ((!scrnmng_isfullscreen()) &&                          if (!scrnmng_isfullscreen()) {
                                 (!(GetWindowLong(hWndMain, GWL_STYLE) &                                  if (!(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);
                                   }
                                   if (GetWindowLong(hWnd, GWL_STYLE) & WS_MINIMIZE) {
                                           toolwin_close();
                                   }
                                   else if (np2oscfg.toolwin) {
                                           toolwin_open();
                                   }
                         }                          }
                         break;                          break;
   
Line 894  LRESULT CALLBACK WndProc(HWND hWnd, UINT Line 921  LRESULT CALLBACK WndProc(HWND hWnd, UINT
                         break;                          break;
   
                 case WM_ENTERSIZEMOVE:                  case WM_ENTERSIZEMOVE:
                         soundmng_stop();                          soundmng_disable(SNDPROC_MAIN);
                         mouse_running(MOUSE_STOP);                          mouse_running(MOUSE_STOP);
                         winloc_movingstart();                          winloc_movingstart(&wl);
                           toolwin_movingstart();
                         break;                          break;
   
                 case WM_EXITSIZEMOVE:                  case WM_EXITSIZEMOVE:
                           toolwin_movingend();
                         mouse_running(MOUSE_CONT);                          mouse_running(MOUSE_CONT);
                         soundmng_play();                          soundmng_enable(SNDPROC_MAIN);
                         break;                          break;
   
                 case WM_MOVING:                  case WM_MOVING:
                         if (np2oscfg.WINSNAP) {                          if (np2oscfg.WINSNAP) {
                                 winloc_movingproc((RECT *)lParam);                                  winloc_movingproc(&wl, (RECT *)lParam);
                         }                          }
                         break;                          break;
   
                 case WM_KEYDOWN:                  case WM_KEYDOWN:
                         if (wParam == VK_F11) {                          if (wParam == VK_F11) {
                                   scrnmng_enablemenubar();
                                 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)) {
Line 920  LRESULT CALLBACK WndProc(HWND hWnd, UINT Line 950  LRESULT CALLBACK WndProc(HWND hWnd, UINT
                                 sysmng_update(SYS_UPDATECFG);                                  sysmng_update(SYS_UPDATECFG);
                         }                          }
                         else {                          else {
                                 winkeydown106(wParam, lParam);                                  winkbd_keydown(wParam, lParam);
                         }                          }
                         break;                          break;
   
                 case WM_KEYUP:                  case WM_KEYUP:
                         if (wParam == VK_F11) {                          if (wParam == VK_F11) {
                                 return(DefWindowProc(hWnd, WM_SYSKEYUP, VK_F10, lParam));                                  return(DefWindowProc(hWnd, WM_SYSKEYUP, VK_F10, lParam));
                         }                          }
                         if ((wParam != VK_F12) || (np2oscfg.F12COPY)) {                          if ((wParam != VK_F12) || (np2oscfg.F12COPY)) {
                                 winkeyup106(wParam, lParam);                                  winkbd_keyup(wParam, lParam);
                         }                          }
                         break;                          break;
   
Line 943  LRESULT CALLBACK WndProc(HWND hWnd, UINT Line 974  LRESULT CALLBACK WndProc(HWND hWnd, UINT
                                         break;                                          break;
                                 }                                  }
                         }                          }
                         winkeydown106(wParam, lParam);                          winkbd_keydown(wParam, lParam);
                         break;                          break;
   
                 case WM_SYSKEYUP:                  case WM_SYSKEYUP:
                         winkeyup106(wParam, lParam);                          winkbd_keyup(wParam, lParam);
                           break;
   
                   case WM_MOUSEMOVE:
                           if (scrnmng_isfullscreen()) {
                                   POINT p;
                                   if (GetCursorPos(&p)) {
                                           scrnmng_fullscrnmenu(p.y);
                                   }
                           }
                         break;                          break;
   
                 case WM_LBUTTONDOWN:                  case WM_LBUTTONDOWN:
                         if (!mouse_btn(MOUSE_LEFTDOWN)) {                          if (!mouse_btn(MOUSE_LEFTDOWN)) {
                                 if (scrnmng_isfullscreen()) {                                  if (scrnmng_isfullscreen()) {
                                         POINT   p;                                          POINT p;
                                         if ((GetCursorPos(&p)) && (p.y >= 466)) {                                          if ((GetCursorPos(&p)) && (p.y >= 466)) {
                                                 np2oscfg.clk_x++;                                                  np2oscfg.clk_x++;
                                                 sysmng_update(SYS_UPDATEOSCFG);                                                  sysmng_update(SYS_UPDATEOSCFG);
Line 963  LRESULT CALLBACK WndProc(HWND hWnd, UINT Line 1003  LRESULT CALLBACK WndProc(HWND hWnd, UINT
                                 return(DefWindowProc(hWnd, msg, wParam, lParam));                                  return(DefWindowProc(hWnd, msg, wParam, lParam));
                         }                          }
                         break;                          break;
   
                 case WM_LBUTTONUP:                  case WM_LBUTTONUP:
                         if (!mouse_btn(MOUSE_LEFTUP)) {                          if (!mouse_btn(MOUSE_LEFTUP)) {
                                 return(DefWindowProc(hWnd, msg, wParam, lParam));                                  return(DefWindowProc(hWnd, msg, wParam, lParam));
Line 1080  LRESULT CALLBACK WndProc(HWND hWnd, UINT Line 1121  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);
                 framecnt = 0;                  framecnt = 0;
                 scrnmng_dispclock();                  scrnmng_dispclock();
                 keydisp_draw(np2oscfg.DRAW_SKIP);                  keydisp_draw((BYTE)cnt);
                   toolwin_draw((BYTE)cnt);
                 viewer_allreload(FALSE);                  viewer_allreload(FALSE);
                 if (np2oscfg.DISPCLK & 3) {                  if (np2oscfg.DISPCLK & 3) {
                         if (sysmng_workclockrenewal()) {                          if (sysmng_workclockrenewal()) {
Line 1116  int WINAPI WinMain(HINSTANCE hInstance,  Line 1158  int WINAPI WinMain(HINSTANCE hInstance, 
         file_setcd(modulefile);          file_setcd(modulefile);
         np2arg_analize(lpszCmdLine);          np2arg_analize(lpszCmdLine);
         initload();          initload();
           toolwin_readini();
   
         srand((unsigned)time(NULL));          rand_setseed((unsigned)time(NULL));
   
         CopyMemory(szClassName, np2oscfg.winid, 3);          CopyMemory(szClassName, np2oscfg.winid, 3);
   
Line 1131  int WINAPI WinMain(HINSTANCE hInstance,  Line 1174  int WINAPI WinMain(HINSTANCE hInstance, 
   
         hInst = hInstance;          hInst = hInstance;
         hPrev = hPreInst;          hPrev = hPreInst;
           mmxflag = (havemmx())?0:MMXFLAG_NOTSUPPORT;
           mmxflag += (np2oscfg.disablemmx)?MMXFLAG_DISABLE:0;
         TRACEINIT();          TRACEINIT();
   
         if (np2oscfg.KEYBOARD >= KEY_TYPEMAX) {                                                 // ver0.28          if (np2oscfg.KEYBOARD >= KEY_TYPEMAX) {                                                 // ver0.28
Line 1147  int WINAPI WinMain(HINSTANCE hInstance,  Line 1192  int WINAPI WinMain(HINSTANCE hInstance, 
         }          }
         keystat_reset();          keystat_reset();
   
           np2class_initialize(hInstance);
         if (!hPreInst) {          if (!hPreInst) {
                 np2.style = CS_BYTEALIGNCLIENT | CS_HREDRAW | CS_VREDRAW;                  np2.style = CS_BYTEALIGNCLIENT | CS_HREDRAW | CS_VREDRAW;
                 np2.lpfnWndProc = WndProc;                  np2.lpfnWndProc = WndProc;
Line 1155  int WINAPI WinMain(HINSTANCE hInstance,  Line 1201  int WINAPI WinMain(HINSTANCE hInstance, 
                 np2.hInstance = hInstance;                  np2.hInstance = hInstance;
                 np2.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));                  np2.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
                 np2.hCursor = LoadCursor(NULL, IDC_ARROW);                  np2.hCursor = LoadCursor(NULL, IDC_ARROW);
                 np2.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);                  np2.hbrBackground = (HBRUSH)GetStockObject(NULL_BRUSH);
                 np2.lpszMenuName = MAKEINTRESOURCE(IDM_MAIN);                  np2.lpszMenuName = MAKEINTRESOURCE(IDM_MAIN);
                 np2.lpszClassName = szClassName;                  np2.lpszClassName = szClassName;
                 if (!RegisterClass(&np2)) {                  if (!RegisterClass(&np2)) {
                         return(FALSE);                          return(FALSE);
                 }                  }
         }          }
           toolwin_initapp(hInstance);
         keydisp_initialize(hPreInst);          keydisp_initialize(hPreInst);
         viewer_init(hPreInst);                                                                          // ver0.30          viewer_init(hPreInst);                                                                          // ver0.30
   
         hWndMain = CreateWindowEx(0, szClassName, np2oscfg.titles,          hWndMain = CreateWindow(szClassName, np2oscfg.titles,
                                                 WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION |                                                  WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION |
                                                 WS_MINIMIZEBOX,                                                  WS_MINIMIZEBOX,
                                                 np2oscfg.winx, np2oscfg.winy, 640, 400,                                                  np2oscfg.winx, np2oscfg.winy, 640, 400,
Line 1216  int WINAPI WinMain(HINSTANCE hInstance,  Line 1263  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();
         hMenu = GetSystemMenu(hWndMain, FALSE);                                         // ver0.26  
         for (i=0; i<(sizeof(smenu_item)/sizeof(SYSMENU_ITEM)); i++) {  
                 if (smenu_item[i].str) {  
                         InsertMenu(hMenu, i, MF_BYPOSITION | MF_STRING,  
                                                         smenu_item[i].id, smenu_item[i].str);  
                 }  
                 else {  
                         InsertMenu(hMenu, i, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);  
                 }  
         }  
   
         if (np2oscfg.I286SAVE) {  
                 InsertMenu(hMenu, 5, MF_BYPOSITION | MF_STRING, IDM_MEMORYDUMP,  
                                                         "&Memory Dump");  
                 InsertMenu(hMenu, 6, MF_BYPOSITION | MF_STRING, IDM_DEBUGUTY,  
                                                         "&Debug Utility");  
         }  
         DrawMenuBar(hWndMain);          DrawMenuBar(hWndMain);
   
         // ver0.30          // ver0.30
Line 1241  int WINAPI WinMain(HINSTANCE hInstance,  Line 1271  int WINAPI WinMain(HINSTANCE hInstance, 
                 EnableMenuItem(GetMenu(hWndMain), IDM_HELP, MF_GRAYED);                  EnableMenuItem(GetMenu(hWndMain), IDM_HELP, MF_GRAYED);
         }          }
   
           xmenu_settoolwin(np2oscfg.toolwin);
         xmenu_setwinsnap(np2oscfg.WINSNAP);          xmenu_setwinsnap(np2oscfg.WINSNAP);
         xmenu_setbackground(np2oscfg.background);          xmenu_setbackground(np2oscfg.background);
         xmenu_setbgsound(np2oscfg.background);          xmenu_setbgsound(np2oscfg.background);
         xmenu_setscrnmul(8);                                                                            // ver0.26          xmenu_setscrnmul(8);                                                                            // ver0.26
   
           if (np2oscfg.toolwin) {
                   toolwin_open();
           }
   
         scrnmode = 0;          scrnmode = 0;
         if (np2arg.fullscreen) {          if (np2arg.fullscreen) {
                 scrnmode |= SCRNMODE_FULLSCREEN;                  scrnmode |= SCRNMODE_FULLSCREEN;
Line 1399  int WINAPI WinMain(HINSTANCE hInstance,  Line 1434  int WINAPI WinMain(HINSTANCE hInstance, 
                                                         else {                                                          else {
                                                                 timing_setcount(cnt - framecnt);                                                                  timing_setcount(cnt - framecnt);
                                                         }                                                          }
                                                         framecnt = 0;                                                          processwait(0);
                                                 }                                                  }
                                         }                                          }
                                         else {                                          else {
Line 1418  int WINAPI WinMain(HINSTANCE hInstance,  Line 1453  int WINAPI WinMain(HINSTANCE hInstance, 
                         DispatchMessage(&msg);                          DispatchMessage(&msg);
                 }                  }
         }          }
           toolwin_close();
   
         pccore_cfgupdate();          pccore_cfgupdate();
   
Line 1447  int WINAPI WinMain(HINSTANCE hInstance,  Line 1483  int WINAPI WinMain(HINSTANCE hInstance, 
   
         if (sys_updates & (SYS_UPDATECFG | SYS_UPDATEOSCFG)) {          if (sys_updates & (SYS_UPDATECFG | SYS_UPDATEOSCFG)) {
                 initsave();                  initsave();
                   toolwin_writeini();
         }          }
   
         TRACETERM();          TRACETERM();

Removed from v.1.9  
changed lines
  Added in v.1.20


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