Diff for /np2/win9x/dialog/d_screen.cpp between versions 1.3 and 1.9

version 1.3, 2003/10/22 14:13:25 version 1.9, 2005/02/09 20:11:36
Line 6 Line 6
 #include        "np2.h"  #include        "np2.h"
 #include        "scrnmng.h"  #include        "scrnmng.h"
 #include        "sysmng.h"  #include        "sysmng.h"
   #include        "np2class.h"
 #include        "dialog.h"  #include        "dialog.h"
 #include        "dialogs.h"  #include        "dialogs.h"
 #include        "pccore.h"  #include        "pccore.h"
Line 14 Line 15
 #include        "palettes.h"  #include        "palettes.h"
   
   
 static const char str_scropt[] = "Screen option";  static const OEMCHAR str_scropt[] = OEMTEXT("Screen option");
   
   
 static LRESULT CALLBACK Scropt1DlgProc(HWND hWnd, UINT msg,  static LRESULT CALLBACK Scropt1DlgProc(HWND hWnd, UINT msg,
                                                                                                         WPARAM wp, LPARAM lp) {                                                                                                          WPARAM wp, LPARAM lp) {
         char    work[32];          OEMCHAR work[32];
         WORD    ret;          UINT16  ret;
         BYTE    b;          UINT8   b;
         int             renewal;          int             renewal;
   
         switch(msg) {          switch(msg) {
Line 35  static LRESULT CALLBACK Scropt1DlgProc(H Line 36  static LRESULT CALLBACK Scropt1DlgProc(H
                                                                                         MAKELONG(0, 255));                                                                                          MAKELONG(0, 255));
                         SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, TBM_SETPOS, TRUE,                          SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, TBM_SETPOS, TRUE,
                                                                                         np2cfg.skiplight);                                                                                          np2cfg.skiplight);
                         wsprintf(work, str_d, np2cfg.skiplight);                          OEMSPRINTF(work, str_d, np2cfg.skiplight);
                         SetDlgItemText(hWnd, IDC_LIGHTSTR, work);                          SetDlgItemText(hWnd, IDC_LIGHTSTR, work);
                         return(TRUE);                          return(TRUE);
   
                 case WM_COMMAND:                  case WM_COMMAND:
                         switch (LOWORD(wp)) {                          switch(LOWORD(wp)) {
                                 case IDC_LCD:                                  case IDC_LCD:
                                         EnableWindow(GetDlgItem(hWnd, IDC_LCDX),                                          EnableWindow(GetDlgItem(hWnd, IDC_LCDX),
                                                                                         GetDlgItemCheck(hWnd, IDC_LCD));                                                                                          GetDlgItemCheck(hWnd, IDC_LCD));
Line 51  static LRESULT CALLBACK Scropt1DlgProc(H Line 52  static LRESULT CALLBACK Scropt1DlgProc(H
                 case WM_HSCROLL:                  case WM_HSCROLL:
                         switch(GetDlgCtrlID((HWND)lp)) {                          switch(GetDlgCtrlID((HWND)lp)) {
                                 case IDC_SKIPLIGHT:                                  case IDC_SKIPLIGHT:
                                         ret = (WORD)SendDlgItemMessage(hWnd, IDC_SKIPLIGHT,                                          ret = (UINT16)SendDlgItemMessage(hWnd, IDC_SKIPLIGHT,
                                                                                                         TBM_GETPOS, 0, 0);                                                                                                          TBM_GETPOS, 0, 0);
                                         wsprintf(work, str_d, ret);                                          OEMSPRINTF(work, str_d, ret);
                                         SetDlgItemText(hWnd, IDC_LIGHTSTR, work);                                          SetDlgItemText(hWnd, IDC_LIGHTSTR, work);
                                         break;                                          break;
                         }                          }
Line 67  static LRESULT CALLBACK Scropt1DlgProc(H Line 68  static LRESULT CALLBACK Scropt1DlgProc(H
                                         np2cfg.skipline = b;                                          np2cfg.skipline = b;
                                         renewal = 1;                                          renewal = 1;
                                 }                                  }
                                 if ((ret = (WORD)SendDlgItemMessage(hWnd, IDC_SKIPLIGHT,                                  if ((ret = (UINT16)SendDlgItemMessage(hWnd, IDC_SKIPLIGHT,
                                                                                                 TBM_GETPOS, 0, 0)) > 255) {                                                                                                  TBM_GETPOS, 0, 0)) > 255) {
                                         ret = 255;                                          ret = 255;
                                 }                                  }
Line 86  static LRESULT CALLBACK Scropt1DlgProc(H Line 87  static LRESULT CALLBACK Scropt1DlgProc(H
                                         renewal = 1;                                          renewal = 1;
                                 }                                  }
                                 if (renewal) {                                  if (renewal) {
                                         sysmng_update(SYS_UPDATECFG);  
                                         scrndraw_redraw();                                          scrndraw_redraw();
                                           sysmng_update(SYS_UPDATECFG);
                                 }                                  }
                                 return(TRUE);                                  return(TRUE);
                         }                          }
Line 101  static const int gdcchip[4] = {IDC_GRCGN Line 102  static const int gdcchip[4] = {IDC_GRCGN
 static LRESULT CALLBACK Scropt2DlgProc(HWND hWnd, UINT msg,  static LRESULT CALLBACK Scropt2DlgProc(HWND hWnd, UINT msg,
                                                                                                         WPARAM wp, LPARAM lp) {                                                                                                          WPARAM wp, LPARAM lp) {
   
         BYTE    b;          UINT8   b;
         UINT    update;          UINT    update;
   
         switch(msg) {          switch(msg) {
Line 114  static LRESULT CALLBACK Scropt2DlgProc(H Line 115  static LRESULT CALLBACK Scropt2DlgProc(H
                         }                          }
                         SetDlgItemCheck(hWnd, gdcchip[np2cfg.grcg & 3], TRUE);                          SetDlgItemCheck(hWnd, gdcchip[np2cfg.grcg & 3], TRUE);
                         SetDlgItemCheck(hWnd, IDC_PC980124, np2cfg.color16);                          SetDlgItemCheck(hWnd, IDC_PC980124, np2cfg.color16);
   #if defined(SUPPORT_PC9821)
                           EnableWindow(GetDlgItem(hWnd, IDC_GCBOX), FALSE);
                           EnableWindow(GetDlgItem(hWnd, IDC_GRCGNON), FALSE);
                           EnableWindow(GetDlgItem(hWnd, IDC_GRCG), FALSE);
                           EnableWindow(GetDlgItem(hWnd, IDC_GRCG2), FALSE);
                           EnableWindow(GetDlgItem(hWnd, IDC_EGC), FALSE);
                           EnableWindow(GetDlgItem(hWnd, IDC_PC980124), FALSE);
   #endif
                         return(TRUE);                          return(TRUE);
   
                 case WM_NOTIFY:                  case WM_NOTIFY:
Line 148  static LRESULT CALLBACK Scropt2DlgProc(H Line 157  static LRESULT CALLBACK Scropt2DlgProc(H
 static LRESULT CALLBACK Scropt3DlgProc(HWND hWnd, UINT msg,  static LRESULT CALLBACK Scropt3DlgProc(HWND hWnd, UINT msg,
                                                                                                         WPARAM wp, LPARAM lp) {                                                                                                          WPARAM wp, LPARAM lp) {
   
         char    work[32];          OEMCHAR work[32];
         BYTE    value[6];          UINT8   value[6];
         BYTE    b;          UINT8   b;
         UINT    update;          UINT    update;
   
         switch(msg) {          switch(msg) {
Line 159  static LRESULT CALLBACK Scropt3DlgProc(H Line 168  static LRESULT CALLBACK Scropt3DlgProc(H
                                                                                         MAKELONG(0, 32));                                                                                          MAKELONG(0, 32));
                         SendDlgItemMessage(hWnd, IDC_TRAMWAIT, TBM_SETPOS, TRUE,                          SendDlgItemMessage(hWnd, IDC_TRAMWAIT, TBM_SETPOS, TRUE,
                                                                                         np2cfg.wait[0]);                                                                                          np2cfg.wait[0]);
                         wsprintf(work, str_u, np2cfg.wait[0]);                          OEMSPRINTF(work, str_u, np2cfg.wait[0]);
                         SetDlgItemText(hWnd, IDC_TRAMSTR, work);                          SetDlgItemText(hWnd, IDC_TRAMSTR, work);
                         SendDlgItemMessage(hWnd, IDC_VRAMWAIT, TBM_SETRANGE, TRUE,                          SendDlgItemMessage(hWnd, IDC_VRAMWAIT, TBM_SETRANGE, TRUE,
                                                                                         MAKELONG(0, 32));                                                                                          MAKELONG(0, 32));
                         SendDlgItemMessage(hWnd, IDC_VRAMWAIT, TBM_SETPOS, TRUE,                          SendDlgItemMessage(hWnd, IDC_VRAMWAIT, TBM_SETPOS, TRUE,
                                                                                         np2cfg.wait[2]);                                                                                          np2cfg.wait[2]);
                         wsprintf(work, str_u, np2cfg.wait[2]);                          OEMSPRINTF(work, str_u, np2cfg.wait[2]);
                         SetDlgItemText(hWnd, IDC_VRAMSTR, work);                          SetDlgItemText(hWnd, IDC_VRAMSTR, work);
                         SendDlgItemMessage(hWnd, IDC_GRCGWAIT, TBM_SETRANGE, TRUE,                          SendDlgItemMessage(hWnd, IDC_GRCGWAIT, TBM_SETRANGE, TRUE,
                                                                                         MAKELONG(0, 32));                                                                                          MAKELONG(0, 32));
                         SendDlgItemMessage(hWnd, IDC_GRCGWAIT, TBM_SETPOS, TRUE,                          SendDlgItemMessage(hWnd, IDC_GRCGWAIT, TBM_SETPOS, TRUE,
                                                                                         np2cfg.wait[4]);                                                                                          np2cfg.wait[4]);
                         wsprintf(work, str_u, np2cfg.wait[4]);                          OEMSPRINTF(work, str_u, np2cfg.wait[4]);
                         SetDlgItemText(hWnd, IDC_GRCGSTR, work);                          SetDlgItemText(hWnd, IDC_GRCGSTR, work);
   
                         SendDlgItemMessage(hWnd, IDC_REALPAL, TBM_SETRANGE, TRUE,                          SendDlgItemMessage(hWnd, IDC_REALPAL, TBM_SETRANGE, TRUE,
                                                                                         MAKELONG(0, 64));                                                                                          MAKELONG(0, 64));
                         SendDlgItemMessage(hWnd, IDC_REALPAL, TBM_SETPOS, TRUE,                          SendDlgItemMessage(hWnd, IDC_REALPAL, TBM_SETPOS, TRUE,
                                                                                         np2cfg.realpal);                                                                                          np2cfg.realpal);
                         wsprintf(work, str_d, (int)np2cfg.realpal - 32);                          OEMSPRINTF(work, str_d, (int)np2cfg.realpal - 32);
                         SetDlgItemText(hWnd, IDC_REALPALSTR, work);                          SetDlgItemText(hWnd, IDC_REALPALSTR, work);
   
                         return(TRUE);                          return(TRUE);
Line 186  static LRESULT CALLBACK Scropt3DlgProc(H Line 195  static LRESULT CALLBACK Scropt3DlgProc(H
                 case WM_HSCROLL:                  case WM_HSCROLL:
                         switch(GetDlgCtrlID((HWND)lp)) {                          switch(GetDlgCtrlID((HWND)lp)) {
                                 case IDC_TRAMWAIT:                                  case IDC_TRAMWAIT:
                                         b = (BYTE)SendDlgItemMessage(hWnd, IDC_TRAMWAIT,                                          b = (UINT8)SendDlgItemMessage(hWnd, IDC_TRAMWAIT,
                                                                                                         TBM_GETPOS, 0, 0);                                                                                                          TBM_GETPOS, 0, 0);
                                         wsprintf(work, str_u, b);                                          OEMSPRINTF(work, str_u, b);
                                         SetDlgItemText(hWnd, IDC_TRAMSTR, work);                                          SetDlgItemText(hWnd, IDC_TRAMSTR, work);
                                         break;                                          break;
                                 case IDC_VRAMWAIT:                                  case IDC_VRAMWAIT:
                                         b = (BYTE)SendDlgItemMessage(hWnd, IDC_VRAMWAIT,                                          b = (UINT8)SendDlgItemMessage(hWnd, IDC_VRAMWAIT,
                                                                                                         TBM_GETPOS, 0, 0);                                                                                                          TBM_GETPOS, 0, 0);
                                         wsprintf(work, str_u, b);                                          OEMSPRINTF(work, str_u, b);
                                         SetDlgItemText(hWnd, IDC_VRAMSTR, work);                                          SetDlgItemText(hWnd, IDC_VRAMSTR, work);
                                         break;                                          break;
                                 case IDC_GRCGWAIT:                                  case IDC_GRCGWAIT:
                                         b = (BYTE)SendDlgItemMessage(hWnd, IDC_GRCGWAIT,                                          b = (UINT8)SendDlgItemMessage(hWnd, IDC_GRCGWAIT,
                                                                                                         TBM_GETPOS, 0, 0);                                                                                                          TBM_GETPOS, 0, 0);
                                         wsprintf(work, str_u, b);                                          OEMSPRINTF(work, str_u, b);
                                         SetDlgItemText(hWnd, IDC_GRCGSTR, work);                                          SetDlgItemText(hWnd, IDC_GRCGSTR, work);
                                         break;                                          break;
                                 case IDC_REALPAL:                                  case IDC_REALPAL:
                                         b = (BYTE)SendDlgItemMessage(hWnd, IDC_REALPAL,                                          b = (UINT8)SendDlgItemMessage(hWnd, IDC_REALPAL,
                                                                                                         TBM_GETPOS, 0, 0);                                                                                                          TBM_GETPOS, 0, 0);
                                         wsprintf(work, str_d, (int)b - 32);                                          OEMSPRINTF(work, str_d, (int)b - 32);
                                         SetDlgItemText(hWnd, IDC_REALPALSTR, work);                                          SetDlgItemText(hWnd, IDC_REALPALSTR, work);
                         }                          }
                         break;                          break;
Line 215  static LRESULT CALLBACK Scropt3DlgProc(H Line 224  static LRESULT CALLBACK Scropt3DlgProc(H
                         if ((((NMHDR *)lp)->code) == (UINT)PSN_APPLY) {                          if ((((NMHDR *)lp)->code) == (UINT)PSN_APPLY) {
                                 update = 0;                                  update = 0;
                                 ZeroMemory(value, sizeof(value));                                  ZeroMemory(value, sizeof(value));
                                 value[0] = (BYTE)SendDlgItemMessage(hWnd, IDC_TRAMWAIT,                                  value[0] = (UINT8)SendDlgItemMessage(hWnd, IDC_TRAMWAIT,
                                                                                                         TBM_GETPOS, 0, 0);                                                                                                          TBM_GETPOS, 0, 0);
                                 if (value[0]) {                                  if (value[0]) {
                                         value[1] = 1;                                          value[1] = 1;
                                 }                                  }
                                 value[2] = (BYTE)SendDlgItemMessage(hWnd, IDC_VRAMWAIT,                                  value[2] = (UINT8)SendDlgItemMessage(hWnd, IDC_VRAMWAIT,
                                                                                                         TBM_GETPOS, 0, 0);                                                                                                          TBM_GETPOS, 0, 0);
                                 if (value[2]) {                                  if (value[2]) {
                                         value[3] = 1;                                          value[3] = 1;
                                 }                                  }
                                 value[4] = (BYTE)SendDlgItemMessage(hWnd, IDC_GRCGWAIT,                                  value[4] = (UINT8)SendDlgItemMessage(hWnd, IDC_GRCGWAIT,
                                                                                                         TBM_GETPOS, 0, 0);                                                                                                          TBM_GETPOS, 0, 0);
                                 if (value[4]) {                                  if (value[4]) {
                                         value[5] = 1;                                          value[5] = 1;
Line 236  static LRESULT CALLBACK Scropt3DlgProc(H Line 245  static LRESULT CALLBACK Scropt3DlgProc(H
                                                 update |= SYS_UPDATECFG;                                                  update |= SYS_UPDATECFG;
                                         }                                          }
                                 }                                  }
                                 b = (BYTE)SendDlgItemMessage(hWnd, IDC_REALPAL,                                  b = (UINT8)SendDlgItemMessage(hWnd, IDC_REALPAL,
                                                                                                                 TBM_GETPOS, 0, 0);                                                                                                                  TBM_GETPOS, 0, 0);
                                 if (np2cfg.realpal != b) {                                  if (np2cfg.realpal != b) {
                                         np2cfg.realpal = b;                                          np2cfg.realpal = b;
Line 278  void dialog_scropt(HWND hWnd) { Line 287  void dialog_scropt(HWND hWnd) {
   
         ZeroMemory(&psh, sizeof(psh));          ZeroMemory(&psh, sizeof(psh));
         psh.dwSize = sizeof(PROPSHEETHEADER);          psh.dwSize = sizeof(PROPSHEETHEADER);
         psh.dwFlags = PSH_NOAPPLYNOW;          psh.dwFlags = PSH_NOAPPLYNOW | PSH_USEHICON | PSH_USECALLBACK;
         psh.hwndParent = hWnd;          psh.hwndParent = hWnd;
         psh.hInstance = hinst;          psh.hInstance = hinst;
           psh.hIcon = LoadIcon(hinst, MAKEINTRESOURCE(IDI_ICON2));
         psh.nPages = 3;          psh.nPages = 3;
         psh.phpage = hpsp;          psh.phpage = hpsp;
         psh.pszCaption = str_scropt;          psh.pszCaption = str_scropt;
           psh.pfnCallback = np2class_propetysheet;
         PropertySheet(&psh);          PropertySheet(&psh);
         InvalidateRect(hWndMain, NULL, TRUE);          InvalidateRect(hWndMain, NULL, TRUE);
 }  }

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


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