* This function is called when the dialog closes. * * @param hwndDlg Handle of the timing dialog. **/
| 13 | * @param hwndDlg Handle of the timing dialog. |
| 14 | **/ |
| 15 | void CloseTimingDialog(HWND hwndDlg) |
| 16 | { |
| 17 | if(IsDlgButtonChecked(hwndDlg, CB_SET_HIGH_PRIORITY) == BST_CHECKED) |
| 18 | { |
| 19 | eoptions |= EO_HIGHPRIO; |
| 20 | } |
| 21 | else |
| 22 | { |
| 23 | eoptions &= ~EO_HIGHPRIO; |
| 24 | } |
| 25 | |
| 26 | if(IsDlgButtonChecked(hwndDlg, CB_DISABLE_SPEED_THROTTLING)==BST_CHECKED) |
| 27 | { |
| 28 | eoptions |= EO_NOTHROTTLE; |
| 29 | } |
| 30 | else |
| 31 | { |
| 32 | eoptions &= ~EO_NOTHROTTLE; |
| 33 | } |
| 34 | |
| 35 | overclock_enabled = (IsDlgButtonChecked(hwndDlg, CB_OVERCLOCKING) == BST_CHECKED); |
| 36 | skip_7bit_overclocking = (IsDlgButtonChecked(hwndDlg, CB_SKIP_7BIT) == BST_CHECKED); |
| 37 | |
| 38 | GetDlgItemText(hwndDlg, IDC_EXTRA_SCANLINES, str, 4); |
| 39 | sscanf(str,"%d",&postrenderscanlines); |
| 40 | |
| 41 | GetDlgItemText(hwndDlg, IDC_VBLANK_SCANLINES, str, 4); |
| 42 | sscanf(str,"%d",&vblankscanlines); |
| 43 | |
| 44 | if (postrenderscanlines < 0) |
| 45 | { |
| 46 | postrenderscanlines = 0; |
| 47 | MessageBox(hwndDlg, "Overclocking is when you speed up your CPU, not slow it down!", "Error", MB_OK | MB_ICONERROR); |
| 48 | sprintf(str,"%d",postrenderscanlines); |
| 49 | SetDlgItemText(hwndDlg,IDC_EXTRA_SCANLINES,str); |
| 50 | SetFocus(GetDlgItem(hwndDlg, IDC_EXTRA_SCANLINES)); |
| 51 | } |
| 52 | else if (vblankscanlines < 0) |
| 53 | { |
| 54 | vblankscanlines = 0; |
| 55 | MessageBox(hwndDlg, "Overclocking is when you speed up your CPU, not slow it down!", "Error", MB_OK | MB_ICONERROR); |
| 56 | sprintf(str,"%d",vblankscanlines); |
| 57 | SetDlgItemText(hwndDlg,IDC_VBLANK_SCANLINES,str); |
| 58 | SetFocus(GetDlgItem(hwndDlg, IDC_VBLANK_SCANLINES)); |
| 59 | } |
| 60 | else if (overclock_enabled && newppu) |
| 61 | { |
| 62 | MessageBox(hwndDlg, "Overclocking doesn't work with new PPU!", "Error", MB_OK | MB_ICONERROR); |
| 63 | SetFocus(GetDlgItem(hwndDlg, CB_OVERCLOCKING)); |
| 64 | } |
| 65 | else |
| 66 | EndDialog(hwndDlg, 0); |
| 67 | |
| 68 | totalscanlines = normalscanlines + (overclock_enabled ? postrenderscanlines : 0); |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Callback function of the Timing configuration dialog. |
no test coverage detected