From 4d1280c69bab288411694c032e8d89aa62d09a8e Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Mon, 22 Sep 2008 22:12:42 +0000 Subject: [PATCH] speedhacks now have "compatibility" and "speed" profiles to help avoid confusion. compatibility mode: most games will work with this setting. speed mode: fast settings, will break games. note: some games will still require manually tweaking the hacks. GT4 for example needs "Extra VU Overflow Checks" (greyed checkbox) but the majority of games should work with "compatibility" mode. there are also some odd games that will work better with "speed" mode, Rogue Galaxy for example. anyways, hopefully these profiles will help avoid confusion. git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@138 a6443dda-0b58-4228-96e9-037be469359c --- pcsx2/windows/WinMain.c | 119 +++++++++++++++++++++++++++------------ pcsx2/windows/pcsx2.rc | 10 ++-- pcsx2/windows/resource.h | 3 +- 3 files changed, 90 insertions(+), 42 deletions(-) diff --git a/pcsx2/windows/WinMain.c b/pcsx2/windows/WinMain.c index cd16a035c5..e20d8d6f61 100644 --- a/pcsx2/windows/WinMain.c +++ b/pcsx2/windows/WinMain.c @@ -751,52 +751,97 @@ BOOL APIENTRY GameFixes(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) return FALSE; } +#define HacksInit() \ +{ \ + if(Config.Hacks & 0x1) CheckDlgButton(hDlg, IDC_SYNCHACK, TRUE); \ + if(Config.Hacks & 0x2) CheckDlgButton(hDlg, IDC_VU_OVERFLOWHACK, TRUE); \ + if(Config.Hacks & 0x4) CheckDlgButton(hDlg, IDC_SOUNDHACK, TRUE); \ + if(Config.Hacks & 0x8) CheckDlgButton(hDlg, IDC_DENORMALS, TRUE); \ + if(Config.Hacks & 0x10) CheckDlgButton(hDlg, IDC_SYNCHACK2, TRUE); \ + if(Config.Hacks & 0x20) CheckDlgButton(hDlg, IDC_SYNCHACK3, TRUE); \ + if(Config.Hacks & 0x40) CheckDlgButton(hDlg, IDC_VU_OVERFLOWHACK, 2); \ + if(Config.Hacks & 0x80) CheckDlgButton(hDlg, IDC_FASTBRANCHES, TRUE); \ + if(Config.Hacks & 0x100) CheckDlgButton(hDlg, IDC_VU_FLAGS, TRUE); \ + if(Config.Hacks & 0x200) CheckDlgButton(hDlg, IDC_FPU_FLAGS, TRUE); \ + if(Config.Hacks & 0x400) CheckDlgButton(hDlg, IDC_ESCHACK, TRUE); \ + if(Config.Hacks & 0x800) CheckDlgButton(hDlg, IDC_FPU_OVERFLOWHACK, TRUE); \ + if(Config.Hacks & 0x1000) CheckDlgButton(hDlg, IDC_FPU_OVERFLOWHACK, 2); \ +} + +#define HacksChecked() \ +{ \ + Config.Hacks = 0; \ + Config.Hacks |= IsDlgButtonChecked(hDlg, IDC_SYNCHACK) ? 0x1 : 0; \ + /* 0x40 == greyed checkbox (extra overflow checking); 0x2 == checked (disable overflow checking) */ \ + Config.Hacks |= ( IsDlgButtonChecked(hDlg, IDC_VU_OVERFLOWHACK) == 2 ) ? 0x40 : (IsDlgButtonChecked(hDlg, IDC_VU_OVERFLOWHACK) ? 0x2 : 0); \ + Config.Hacks |= IsDlgButtonChecked(hDlg, IDC_SOUNDHACK) ? 0x4 : 0; \ + Config.Hacks |= IsDlgButtonChecked(hDlg, IDC_DENORMALS) ? 0x8 : 0; \ + Config.Hacks |= IsDlgButtonChecked(hDlg, IDC_SYNCHACK2) ? 0x10 : 0; \ + Config.Hacks |= IsDlgButtonChecked(hDlg, IDC_SYNCHACK3) ? 0x20 : 0; \ + Config.Hacks |= IsDlgButtonChecked(hDlg, IDC_FASTBRANCHES) ? 0x80 : 0; \ + Config.Hacks |= IsDlgButtonChecked(hDlg, IDC_VU_FLAGS) ? 0x100 : 0; \ + Config.Hacks |= IsDlgButtonChecked(hDlg, IDC_FPU_FLAGS) ? 0x200 : 0; \ + Config.Hacks |= IsDlgButtonChecked(hDlg, IDC_ESCHACK) ? 0x400 : 0; \ + /* 0x1000 == greyed checkbox (extra overflow checking); 0x800 == checked (disable overflow checking)*/ \ + Config.Hacks |= ( IsDlgButtonChecked(hDlg, IDC_FPU_OVERFLOWHACK) == 2 ) ? 0x1000 : (IsDlgButtonChecked(hDlg, IDC_FPU_OVERFLOWHACK) ? 0x800 : 0); \ +} + BOOL APIENTRY HacksProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { //char str[256]; switch (message) { case WM_INITDIALOG: - if(Config.Hacks & 0x1) CheckDlgButton(hDlg, IDC_SYNCHACK, TRUE); - if(Config.Hacks & 0x2) CheckDlgButton(hDlg, IDC_VU_OVERFLOWHACK, TRUE); - if(Config.Hacks & 0x4) CheckDlgButton(hDlg, IDC_SOUNDHACK, TRUE); - if(Config.Hacks & 0x8) CheckDlgButton(hDlg, IDC_DENORMALS, TRUE); - if(Config.Hacks & 0x10) CheckDlgButton(hDlg, IDC_SYNCHACK2, TRUE); - if(Config.Hacks & 0x20) CheckDlgButton(hDlg, IDC_SYNCHACK3, TRUE); - if(Config.Hacks & 0x40) CheckDlgButton(hDlg, IDC_VU_OVERFLOWHACK, 2); - if(Config.Hacks & 0x80) CheckDlgButton(hDlg, IDC_FASTBRANCHES, TRUE); - if(Config.Hacks & 0x100) CheckDlgButton(hDlg, IDC_VU_FLAGS, TRUE); - if(Config.Hacks & 0x200) CheckDlgButton(hDlg, IDC_FPU_FLAGS, TRUE); - if(Config.Hacks & 0x400) CheckDlgButton(hDlg, IDC_ESCHACK, TRUE); - if(Config.Hacks & 0x800) CheckDlgButton(hDlg, IDC_FPU_OVERFLOWHACK, TRUE); - if(Config.Hacks & 0x1000) CheckDlgButton(hDlg, IDC_FPU_OVERFLOWHACK, 2); - - + HacksInit(); return TRUE; case WM_COMMAND: - if (LOWORD(wParam) == IDOK) { - Config.Hacks = 0; - Config.Hacks |= IsDlgButtonChecked(hDlg, IDC_SYNCHACK) ? 0x1 : 0; - Config.Hacks |= ( IsDlgButtonChecked(hDlg, IDC_VU_OVERFLOWHACK) == 2 ) ? 0x40 : (IsDlgButtonChecked(hDlg, IDC_VU_OVERFLOWHACK) ? 0x2 : 0); // 0x40 == greyed checkbox (extra overflow checking); 0x2 == checked (disable overflow checking) - Config.Hacks |= IsDlgButtonChecked(hDlg, IDC_SOUNDHACK) ? 0x4 : 0; - Config.Hacks |= IsDlgButtonChecked(hDlg, IDC_DENORMALS) ? 0x8 : 0; - Config.Hacks |= IsDlgButtonChecked(hDlg, IDC_SYNCHACK2) ? 0x10 : 0; - Config.Hacks |= IsDlgButtonChecked(hDlg, IDC_SYNCHACK3) ? 0x20 : 0; - Config.Hacks |= IsDlgButtonChecked(hDlg, IDC_FASTBRANCHES) ? 0x80 : 0; - Config.Hacks |= IsDlgButtonChecked(hDlg, IDC_VU_FLAGS) ? 0x100 : 0; - Config.Hacks |= IsDlgButtonChecked(hDlg, IDC_FPU_FLAGS) ? 0x200 : 0; - Config.Hacks |= IsDlgButtonChecked(hDlg, IDC_ESCHACK) ? 0x400 : 0; - //Config.Hacks |= ( IsDlgButtonChecked(hDlg, IDC_DENORMALS) == 2 ) ? 0x408 : (IsDlgButtonChecked(hDlg, IDC_DENORMALS) ? 0x8 : 0); // 0x408 == greyed checkbox (DaZ SSE flag; so the CPU sets denormals to zero) - Config.Hacks |= ( IsDlgButtonChecked(hDlg, IDC_FPU_OVERFLOWHACK) == 2 ) ? 0x1000 : (IsDlgButtonChecked(hDlg, IDC_FPU_OVERFLOWHACK) ? 0x800 : 0); // 0x1000 == greyed checkbox (extra overflow checking); 0x800 == checked (disable overflow checking) - - SaveConfig(); + switch (LOWORD(wParam)) { + case IDOK: + HacksChecked(); + SaveConfig(); + EndDialog(hDlg, TRUE); + break; - EndDialog(hDlg, TRUE); - } else - if (LOWORD(wParam) == IDCANCEL) { - EndDialog(hDlg, FALSE); - } else - return TRUE; + case IDCANCEL: + EndDialog(hDlg, FALSE); + break; + + case IDBUTTON1: + CheckDlgButton(hDlg, IDC_VU_OVERFLOWHACK, FALSE); + CheckDlgButton(hDlg, IDC_FPU_OVERFLOWHACK, FALSE); + CheckDlgButton(hDlg, IDC_DENORMALS, TRUE); + CheckDlgButton(hDlg, IDC_VU_FLAGS, TRUE); + CheckDlgButton(hDlg, IDC_FPU_FLAGS, TRUE); + CheckDlgButton(hDlg, IDC_SYNCHACK, FALSE); + CheckDlgButton(hDlg, IDC_SYNCHACK2, FALSE); + CheckDlgButton(hDlg, IDC_SYNCHACK3, FALSE); + CheckDlgButton(hDlg, IDC_FASTBRANCHES, FALSE); + //CheckDlgButton(hDlg, IDC_SOUNDHACK, TRUE); + //CheckDlgButton(hDlg, IDC_ESCHACK, TRUE); + + HacksChecked(); + HacksInit(); + break; + + case IDBUTTON2: + CheckDlgButton(hDlg, IDC_VU_OVERFLOWHACK, TRUE); + CheckDlgButton(hDlg, IDC_FPU_OVERFLOWHACK, TRUE); + CheckDlgButton(hDlg, IDC_DENORMALS, TRUE); + CheckDlgButton(hDlg, IDC_VU_FLAGS, TRUE); + CheckDlgButton(hDlg, IDC_FPU_FLAGS, TRUE); + CheckDlgButton(hDlg, IDC_SYNCHACK, TRUE); + CheckDlgButton(hDlg, IDC_SYNCHACK2, TRUE); + CheckDlgButton(hDlg, IDC_SYNCHACK3, TRUE); + CheckDlgButton(hDlg, IDC_FASTBRANCHES, FALSE); + CheckDlgButton(hDlg, IDC_SOUNDHACK, FALSE); + //CheckDlgButton(hDlg, IDC_ESCHACK, TRUE); + + HacksChecked(); + HacksInit(); + break; + + default: return TRUE; + } } return FALSE; diff --git a/pcsx2/windows/pcsx2.rc b/pcsx2/windows/pcsx2.rc index f17e03255c..00a3c7f850 100644 --- a/pcsx2/windows/pcsx2.rc +++ b/pcsx2/windows/pcsx2.rc @@ -1035,13 +1035,13 @@ BEGIN CONTROL 132,IDC_PS2SILVER_RECT,"Static",SS_BITMAP,0,167,70,74 END -IDD_HACKS DIALOGEX 0, 0, 511, 313 +IDD_HACKS DIALOGEX 0, 0, 511, 314 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "PCSX2 Speed Hacks" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - DEFPUSHBUTTON "OK",IDOK,205,292,50,14 - PUSHBUTTON "Cancel",IDCANCEL,261,292,50,14 + DEFPUSHBUTTON "OK",IDOK,205,293,50,14 + PUSHBUTTON "Cancel",IDCANCEL,261,293,50,14 CONTROL "EE Sync Hack (x2) - Doubles the cycle rate of the EE. ( Big Speedup in most games! )",IDC_SYNCHACK, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,162,418,10 CONTROL "Disable VU Overflow Checks - *Checked = Disables overflow checks. ( Speedup! ) *Greyed = Extra overflow checks. ( Helps SPS, Slow! )",IDC_VU_OVERFLOWHACK, @@ -1070,6 +1070,8 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,126,414,10 CONTROL "Escape Hack - Use Esc key to fully exit PCSX2.",IDC_ESCHACK, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,259,421,10 + PUSHBUTTON "Compatibility",IDBUTTON1,15,293,50,14 + PUSHBUTTON "Speed",IDBUTTON2,73,293,50,14 END @@ -1093,7 +1095,7 @@ BEGIN RIGHTMARGIN, 504 VERTGUIDE, 15 TOPMARGIN, 7 - BOTTOMMARGIN, 306 + BOTTOMMARGIN, 307 END END #endif // APSTUDIO_INVOKED diff --git a/pcsx2/windows/resource.h b/pcsx2/windows/resource.h index 06782a4fb9..fe0d120dfd 100644 --- a/pcsx2/windows/resource.h +++ b/pcsx2/windows/resource.h @@ -2,8 +2,9 @@ // Microsoft Visual C++ generated include file. // Used by pcsx2.rc // -#define IDCANCEL2 3 #define IDDEFAULT 3 +#define IDBUTTON1 3 +#define IDBUTTON2 4 #define IDR_MENU 101 #define IDD_CONFIG 101 #define IDD_MCDCONF 102