From 999ff5c457fb4c927578fa1ccc6bd711dcc4cde9 Mon Sep 17 00:00:00 2001 From: avihal Date: Wed, 13 Jun 2012 23:53:08 +0000 Subject: [PATCH] GSdx: Add GUI for disabling all CRC hacks (for testing purposes only, disabled by default). The new checkbox is at the "HW Hacks" section, and is only relevant when the global "Enable HW Hacks" box is checked. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5294 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSSettingsDlg.cpp | 10 ++++++++++ plugins/GSdx/GSState.cpp | 3 ++- plugins/GSdx/GSState.h | 1 + plugins/GSdx/GSdx.rc | 1 + plugins/GSdx/resource.h | 3 ++- 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/plugins/GSdx/GSSettingsDlg.cpp b/plugins/GSdx/GSSettingsDlg.cpp index 235ee273b8..357b3d217b 100644 --- a/plugins/GSdx/GSSettingsDlg.cpp +++ b/plugins/GSdx/GSSettingsDlg.cpp @@ -423,6 +423,7 @@ void GSHacksDlg::OnInit() CheckDlgButton(m_hWnd, IDC_SPRITEHACK, theApp.GetConfig("UserHacks_SpriteHack", 0)); CheckDlgButton(m_hWnd, IDC_WILDHACK, theApp.GetConfig("UserHacks_WildHack", 0)); CheckDlgButton(m_hWnd, IDC_AGGRESSIVECRC, theApp.GetConfig("UserHacks_AggressiveCRC", 0)); + CheckDlgButton(m_hWnd, IDC_CHECK_DISABLE_ALL_HACKS, theApp.GetConfig("UserHacks_DisableCrcHacks", 0)); SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_SETRANGE, 0, MAKELPARAM(1000, 0)); SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfig("UserHacks_SkipDraw", 0), 0)); @@ -489,6 +490,14 @@ bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam) "Only affects few games, removing some effects which might make the image sharper/clearer.\n" "Affected games: FFX, FFX2, FFXII, GOW2, ICO, SoTC, SSX3."; break; + case IDC_CHECK_DISABLE_ALL_HACKS: + helpstr = "FOR TESTING ONLY!!\n\n" + "Disable all CRC hacks - will break many games. Overrides CrcHacksExclusion at gsdx.ini\n" + "\n" + "It's possible to exclude CRC hacks also via the gsdx.ini. E.g.:\n" + "CrcHacksExclusions=all\n" + "CrcHacksExclusions=0x0F0C4A9C, 0x0EE5646B, 0x7ACF7E03"; + break; default: helpstr = "Hover over an item to get a description."; break; @@ -513,6 +522,7 @@ bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam) theApp.SetConfig("UserHacks_SkipDraw", (int)SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_GETPOS, 0, 0)); theApp.SetConfig("UserHacks_WildHack", (int)IsDlgButtonChecked(m_hWnd, IDC_WILDHACK)); theApp.SetConfig("UserHacks_AggressiveCRC", (int)IsDlgButtonChecked(m_hWnd, IDC_AGGRESSIVECRC)); + theApp.SetConfig("UserHacks_DisableCrcHacks", (int)IsDlgButtonChecked(m_hWnd, IDC_CHECK_DISABLE_ALL_HACKS)); EndDialog(m_hWnd, id); } break; } diff --git a/plugins/GSdx/GSState.cpp b/plugins/GSdx/GSState.cpp index 898b19279f..d95438fb2a 100644 --- a/plugins/GSdx/GSState.cpp +++ b/plugins/GSdx/GSState.cpp @@ -120,6 +120,7 @@ GSState::GSState() s_saven = theApp.GetConfig("saven", 0); userHacks_AggressiveCRC = !!theApp.GetConfig("UserHacks", 0) ? theApp.GetConfig("UserHacks_AggressiveCRC", 0) : 0; + userHacks_DisableCrcHacks = !!theApp.GetConfig("UserHacks", 0) ? theApp.GetConfig( "UserHacks_DisableCrcHacks", 0 ) : 0; } GSState::~GSState() @@ -5319,7 +5320,7 @@ bool GSState::IsBadFrame(int& skip, int UserHacks_SkipDraw) #ifdef ENABLE_DYNAMIC_CRC_HACK bool res=false; if(IsInvokedDynamicCrcHack(fi, skip, g_crc_region, res, m_crc)){ if( !res ) return false; } else #endif - if(gsc && !gsc(fi, skip)) + if(gsc && !userHacks_DisableCrcHacks && !gsc(fi, skip)) { return false; } diff --git a/plugins/GSdx/GSState.h b/plugins/GSdx/GSState.h index b453bb67c4..1675c677f5 100644 --- a/plugins/GSdx/GSState.h +++ b/plugins/GSdx/GSState.h @@ -139,6 +139,7 @@ class GSState : public GSAlignedClass<32> protected: bool IsBadFrame(int& skip, int UserHacks_SkipDraw); int userHacks_AggressiveCRC; + int userHacks_DisableCrcHacks; GSVertex m_v; float m_q; diff --git a/plugins/GSdx/GSdx.rc b/plugins/GSdx/GSdx.rc index efc09a3514..0b4e191fc8 100644 --- a/plugins/GSdx/GSdx.rc +++ b/plugins/GSdx/GSdx.rc @@ -94,6 +94,7 @@ BEGIN CONTROL "WildArmsOffset",IDC_WILDHACK,"Button",BS_AUTO3STATE | WS_TABSTOP,14,105,64,10 LTEXT "TEXT_GOES_HERE",IDC_HACK_DESCRIPTION,92,20,209,145 CONTROL "Aggressive-CRC",IDC_AGGRESSIVECRC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,122,66,10 + CONTROL "Disable CRCs",IDC_CHECK_DISABLE_ALL_HACKS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,157,58,10 END IDD_SHADEBOOST DIALOGEX 0, 0, 316, 129 diff --git a/plugins/GSdx/resource.h b/plugins/GSdx/resource.h index c6dfe79ebb..0e9646696d 100644 --- a/plugins/GSdx/resource.h +++ b/plugins/GSdx/resource.h @@ -93,6 +93,7 @@ #define IDC_STATIC_MSAA 2074 #define IDC_STATIC_SKIPDRAW 2075 #define IDC_AGGRESSIVECRC 2076 +#define IDC_CHECK_DISABLE_ALL_HACKS 2077 #define IDC_COLORSPACE 3000 #define IDR_CONVERT_FX 10000 #define IDR_TFX_FX 10001 @@ -111,7 +112,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 10012 #define _APS_NEXT_COMMAND_VALUE 32771 -#define _APS_NEXT_CONTROL_VALUE 2077 +#define _APS_NEXT_CONTROL_VALUE 2078 #define _APS_NEXT_SYMED_VALUE 5000 #endif #endif