|  | 
| version 1.11, 2005/02/09 20:11:36 | 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 OEMCHAR str_2halfmhz[] = OEMTEXT("2.4576MHz"); | static const TCHAR str_2halfmhz[] = _T("2.4576MHz"); | 
| static const OEMCHAR str_2mhz[] = OEMTEXT("1.9968MHz"); | static const TCHAR str_2mhz[] = _T("1.9968MHz"); | 
| static const OEMCHAR *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 OEMCHAR str_clockfmt[] = OEMTEXT("%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; | 
| OEMCHAR work[32]; | TCHAR work[32]; | 
| GetDlgItemText(hWnd, IDC_BASECLOCK, work, NELEMENTS(work)); | GetDlgItemText(hWnd, IDC_BASECLOCK, work, NELEMENTS(work)); | 
| if (work[0] == '1') { | if (work[0] == '1') { | 
| Line 30 static void setclock(HWND hWnd, UINT mul | Line 31 static void setclock(HWND hWnd, UINT mul | 
| } | } | 
| if (multiple == 0) { | if (multiple == 0) { | 
| GetDlgItemText(hWnd, IDC_MULTIPLE, work, NELEMENTS(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 39 static void setclock(HWND hWnd, UINT mul | Line 40 static void setclock(HWND hWnd, UINT mul | 
| multiple = 32; | multiple = 32; | 
| } | } | 
| clock *= multiple; | clock *= multiple; | 
| OEMSPRINTF(work, str_clockfmt, clock / 10000, clock % 10000); | wsprintf(work, str_clockfmt, clock / 10000, clock % 10000); | 
| SetDlgItemText(hWnd, IDC_CLOCKMSG, work); | SetDlgItemText(hWnd, IDC_CLOCKMSG, work); | 
| } | } | 
| static void cfgcreate(HWND hWnd) { | static void cfgcreate(HWND hWnd) { | 
| OEMCHAR 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); | 
| OEMSPRINTF(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); | 
| OEMSPRINTF(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 101 static void cfgcreate(HWND hWnd) { | Line 104 static void cfgcreate(HWND hWnd) { | 
| static void cfgupdate(HWND hWnd) { | static void cfgupdate(HWND hWnd) { | 
| UINT update; | UINT update; | 
| OEMCHAR work[32]; | TCHAR work[32]; | 
| UINT val; | UINT val; | 
| const OEMCHAR *str; | const OEMCHAR *str; | 
| Line 119 const OEMCHAR *str; | Line 122 const OEMCHAR *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 161 const OEMCHAR *str; | Line 164 const OEMCHAR *str; | 
| } | } | 
| GetDlgItemText(hWnd, IDC_SOUNDBUF, work, NELEMENTS(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 OEMCHAR *str; | Line 183 const OEMCHAR *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 OEMCHAR *str; | Line 193 const OEMCHAR *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) { |