| version 1.10, 2005/02/07 15:39:27 | version 1.14, 2006/12/24 07:53:01 | 
| Line 2 | Line 2 | 
 | #include        "strres.h" | #include        "strres.h" | 
 | #include        "resource.h" | #include        "resource.h" | 
 | #include        "np2.h" | #include        "np2.h" | 
 |  | #include        "oemtext.h" | 
 | #include        "dosio.h" | #include        "dosio.h" | 
 | #include        "sysmng.h" | #include        "sysmng.h" | 
 | #include        "dialog.h" | #include        "dialog.h" | 
| Line 9 | Line 10 | 
 | #include        "pccore.h" | #include        "pccore.h" | 
 |  |  | 
 |  |  | 
| static const char str_2halfmhz[] = "2.4576MHz"; | static const TCHAR str_2halfmhz[] = _T("2.4576MHz"); | 
| static const char str_2mhz[] = "1.9968MHz"; | static const TCHAR str_2mhz[] = _T("1.9968MHz"); | 
| static const char *basecstr[2] = {str_2mhz, str_2halfmhz}; | static const TCHAR *basecstr[2] = {str_2mhz, str_2halfmhz}; | 
 | static const UINT32 mulval[10] = {1, 2, 4, 5, 6, 8, 10, 12, 16, 20}; | static const UINT32 mulval[10] = {1, 2, 4, 5, 6, 8, 10, 12, 16, 20}; | 
| static const char str_clockfmt[] = "%2u.%.4u"; | static const TCHAR str_clockfmt[] = _T("%2u.%.4u"); | 
 |  |  | 
 |  |  | 
 | static void setclock(HWND hWnd, UINT multiple) { | static void setclock(HWND hWnd, UINT multiple) { | 
 |  |  | 
 | UINT32  clock; | UINT32  clock; | 
| char    work[32]; | TCHAR   work[32]; | 
 |  |  | 
| GetDlgItemText(hWnd, IDC_BASECLOCK, work, sizeof(work)); | GetDlgItemText(hWnd, IDC_BASECLOCK, work, NELEMENTS(work)); | 
 | if (work[0] == '1') { | if (work[0] == '1') { | 
 | clock = PCBASECLOCK20 / 100; | clock = PCBASECLOCK20 / 100; | 
 | } | } | 
| Line 29  static void setclock(HWND hWnd, UINT mul | Line 30  static void setclock(HWND hWnd, UINT mul | 
 | clock = PCBASECLOCK25 / 100; | clock = PCBASECLOCK25 / 100; | 
 | } | } | 
 | if (multiple == 0) { | if (multiple == 0) { | 
| GetDlgItemText(hWnd, IDC_MULTIPLE, work, sizeof(work)); | GetDlgItemText(hWnd, IDC_MULTIPLE, work, NELEMENTS(work)); | 
| multiple = (UINT)milstr_solveINT(work); | multiple = (UINT)miltchar_solveINT(work); | 
 | } | } | 
 | if (multiple < 1) { | if (multiple < 1) { | 
 | multiple = 1; | multiple = 1; | 
| Line 45  static void setclock(HWND hWnd, UINT mul | Line 46  static void setclock(HWND hWnd, UINT mul | 
 |  |  | 
 | static void cfgcreate(HWND hWnd) { | static void cfgcreate(HWND hWnd) { | 
 |  |  | 
| char    work[32]; | TCHAR   work[32]; | 
 | UINT    val; | UINT    val; | 
 |  |  | 
 | SETLISTSTR(hWnd, IDC_BASECLOCK, basecstr); | SETLISTSTR(hWnd, IDC_BASECLOCK, basecstr); | 
| Line 57  static void cfgcreate(HWND hWnd) { | Line 58  static void cfgcreate(HWND hWnd) { | 
 | } | } | 
 | SendDlgItemMessage(hWnd, IDC_BASECLOCK, CB_SETCURSEL, val, 0); | SendDlgItemMessage(hWnd, IDC_BASECLOCK, CB_SETCURSEL, val, 0); | 
 | SETLISTUINT32(hWnd, IDC_MULTIPLE, mulval); | SETLISTUINT32(hWnd, IDC_MULTIPLE, mulval); | 
| wsprintf(work, str_u, np2cfg.multiple); | wsprintf(work, tchar_u, np2cfg.multiple); | 
 | SetDlgItemText(hWnd, IDC_MULTIPLE, work); | SetDlgItemText(hWnd, IDC_MULTIPLE, work); | 
 |  |  | 
 | if (!milstr_cmp(np2cfg.model, str_VM)) { | if (!milstr_cmp(np2cfg.model, str_VM)) { | 
| Line 81  static void cfgcreate(HWND hWnd) { | Line 82  static void cfgcreate(HWND hWnd) { | 
 | val = IDC_RATE44; | val = IDC_RATE44; | 
 | } | } | 
 | SetDlgItemCheck(hWnd, val, TRUE); | SetDlgItemCheck(hWnd, val, TRUE); | 
| wsprintf(work, str_u, np2cfg.delayms); | wsprintf(work, tchar_u, np2cfg.delayms); | 
 | SetDlgItemText(hWnd, IDC_SOUNDBUF, work); | SetDlgItemText(hWnd, IDC_SOUNDBUF, work); | 
 |  |  | 
 | SetDlgItemCheck(hWnd, IDC_ALLOWRESIZE, np2oscfg.thickframe); | SetDlgItemCheck(hWnd, IDC_ALLOWRESIZE, np2oscfg.thickframe); | 
 |  | #if !defined(_WIN64) | 
 | if (mmxflag & MMXFLAG_NOTSUPPORT) { | if (mmxflag & MMXFLAG_NOTSUPPORT) { | 
 | EnableWindow(GetDlgItem(hWnd, IDC_DISABLEMMX), FALSE); | EnableWindow(GetDlgItem(hWnd, IDC_DISABLEMMX), FALSE); | 
 | SetDlgItemCheck(hWnd, IDC_DISABLEMMX, TRUE); | SetDlgItemCheck(hWnd, IDC_DISABLEMMX, TRUE); | 
| Line 92  static void cfgcreate(HWND hWnd) { | Line 94  static void cfgcreate(HWND hWnd) { | 
 | else { | else { | 
 | SetDlgItemCheck(hWnd, IDC_DISABLEMMX, np2oscfg.disablemmx); | SetDlgItemCheck(hWnd, IDC_DISABLEMMX, np2oscfg.disablemmx); | 
 | } | } | 
 |  | #endif | 
 | SetDlgItemCheck(hWnd, IDC_COMFIRM, np2oscfg.comfirm); | SetDlgItemCheck(hWnd, IDC_COMFIRM, np2oscfg.comfirm); | 
 | SetDlgItemCheck(hWnd, IDC_RESUME, np2oscfg.resume); | SetDlgItemCheck(hWnd, IDC_RESUME, np2oscfg.resume); | 
 | setclock(hWnd, 0); | setclock(hWnd, 0); | 
| Line 100  static void cfgcreate(HWND hWnd) { | Line 103  static void cfgcreate(HWND hWnd) { | 
 |  |  | 
 | static void cfgupdate(HWND hWnd) { | static void cfgupdate(HWND hWnd) { | 
 |  |  | 
| UINT    update; | UINT            update; | 
| char    work[32]; | TCHAR           work[32]; | 
| UINT    val; | UINT            val; | 
| const char      *str; | const OEMCHAR   *str; | 
 |  |  | 
 | update = 0; | update = 0; | 
| GetDlgItemText(hWnd, IDC_BASECLOCK, work, sizeof(work)); | GetDlgItemText(hWnd, IDC_BASECLOCK, work, NELEMENTS(work)); | 
 | if (work[0] == '1') { | if (work[0] == '1') { | 
 | val = PCBASECLOCK20; | val = PCBASECLOCK20; | 
 | } | } | 
| Line 119  const char *str; | Line 122  const char *str; | 
 | } | } | 
 |  |  | 
 | GetDlgItemText(hWnd, IDC_MULTIPLE, work, sizeof(work)); | GetDlgItemText(hWnd, IDC_MULTIPLE, work, sizeof(work)); | 
| val = (UINT)milstr_solveINT(work); | val = (UINT)miltchar_solveINT(work); | 
 | if (val < 1) { | if (val < 1) { | 
 | val = 1; | val = 1; | 
 | } | } | 
| Line 141  const char *str; | Line 144  const char *str; | 
 | str = str_VX; | str = str_VX; | 
 | } | } | 
 | if (milstr_cmp(np2cfg.model, str)) { | if (milstr_cmp(np2cfg.model, str)) { | 
| milstr_ncpy(np2cfg.model, str, sizeof(np2cfg.model)); | milstr_ncpy(np2cfg.model, str, NELEMENTS(np2cfg.model)); | 
 | update |= SYS_UPDATECFG; | update |= SYS_UPDATECFG; | 
 | } | } | 
 |  |  | 
| Line 160  const char *str; | Line 163  const char *str; | 
 | soundrenewal = 1; | soundrenewal = 1; | 
 | } | } | 
 |  |  | 
| GetDlgItemText(hWnd, IDC_SOUNDBUF, work, sizeof(work)); | GetDlgItemText(hWnd, IDC_SOUNDBUF, work, NELEMENTS(work)); | 
| val = (UINT)milstr_solveINT(work); | val = (UINT)miltchar_solveINT(work); | 
 | if (val < 40) { | if (val < 40) { | 
 | val = 40; | val = 40; | 
 | } | } | 
| Line 180  const char *str; | Line 183  const char *str; | 
 | update |= SYS_UPDATEOSCFG; | update |= SYS_UPDATEOSCFG; | 
 | } | } | 
 |  |  | 
 |  | #if !defined(_WIN64) | 
 | if (!(mmxflag & MMXFLAG_NOTSUPPORT)) { | if (!(mmxflag & MMXFLAG_NOTSUPPORT)) { | 
 | val = GetDlgItemCheck(hWnd, IDC_DISABLEMMX); | val = GetDlgItemCheck(hWnd, IDC_DISABLEMMX); | 
 | if (np2oscfg.disablemmx != (UINT8)val) { | if (np2oscfg.disablemmx != (UINT8)val) { | 
| Line 189  const char *str; | Line 193  const char *str; | 
 | update |= SYS_UPDATEOSCFG; | update |= SYS_UPDATEOSCFG; | 
 | } | } | 
 | } | } | 
 |  | #endif | 
 |  |  | 
 | val = GetDlgItemCheck(hWnd, IDC_COMFIRM); | val = GetDlgItemCheck(hWnd, IDC_COMFIRM); | 
 | if (np2oscfg.comfirm != (UINT8)val) { | if (np2oscfg.comfirm != (UINT8)val) { |