GSdx: CRC hacks: "Aggressive" mode (and related stuff).

- Added "Aggressive-CRC" checkbox at the HW hacks section of the config dialog.
- The following hacks are now activated only in aggressive mode:
  - God of War 2: disable water effect/lines, disable global haze.
  - FFX, FFX2, SSX3 (the full crc hack from r5214).
  - Shadow of the Colossus: disable (over)bloom.
- Reverted the Valkyrie Profile 2 hack to pre- r5214.
- Some CRC fixes by comments on r5214.
- Regression fix of dynamic crc hack (INITIAL_MODE = 0 didn't compile)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5221 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
avihal 2012-05-23 06:38:37 +00:00
parent de62189834
commit 31956dcb87
7 changed files with 37 additions and 15 deletions

View File

@ -335,7 +335,7 @@ CRC::Game CRC::m_games[] =
{0xE0347841, XE3, JP, 0}, //異域傳說3 {0xE0347841, XE3, JP, 0}, //異域傳說3
{0xA4E88698, XE3, CH, 0}, {0xA4E88698, XE3, CH, 0},
{0x2088950A, XE3, US, 0}, {0x2088950A, XE3, US, 0},
{0x79B8A95F, DevilMayCry3, US, 0}, // DMC(1)? {0x79B8A95F, DevilMayCry3, US, 0},
{0x7F3D692D, DevilMayCry3, CH, 0}, {0x7F3D692D, DevilMayCry3, CH, 0},
{0x1A85E924, DevilMayCry3, CH, 0}, //惡魔獵人3三合一中文特別版 {0x1A85E924, DevilMayCry3, CH, 0}, //惡魔獵人3三合一中文特別版
{0x0a8ef911, ArctheLad, US, 0}, //亞克傳承-精靈之黃昏 {0x0a8ef911, ArctheLad, US, 0}, //亞克傳承-精靈之黃昏
@ -350,6 +350,7 @@ CRC::Game CRC::m_games[] =
{0xB05805B6, TombRaiderAnniversary, JP, 0}, //十週年紀念版 重返禁地 {0xB05805B6, TombRaiderAnniversary, JP, 0}, //十週年紀念版 重返禁地
{0xBC8B3F50, TombRaiderLegend, US, 0}, //7代傳奇 {0xBC8B3F50, TombRaiderLegend, US, 0}, //7代傳奇
{0x08FFF00D, SSX3, JP, 0}, //極限滑雪3 {0x08FFF00D, SSX3, JP, 0}, //極限滑雪3
{0xCE942B2A, SSX3, EU, 0},
{0x5C891FF1, Black, US, 0}, {0x5C891FF1, Black, US, 0},
{0xCAA04879, Black, EU, 0}, {0xCAA04879, Black, EU, 0},
{0xADDFF505, Black, EU, 0}, //? {0xADDFF505, Black, EU, 0}, //?
@ -465,7 +466,9 @@ CRC::Game CRC::m_games[] =
{0xCDEE4B19, RogueGalaxy, JP, 0}, {0xCDEE4B19, RogueGalaxy, JP, 0},
{0xF7F181C3, DeathByDegreesTekkenNinaWilliams, CH, 0}, //鐵拳妮娜 {0xF7F181C3, DeathByDegreesTekkenNinaWilliams, CH, 0}, //鐵拳妮娜
{0xF088FA5B, DeathByDegreesTekkenNinaWilliams, KO, 0}, {0xF088FA5B, DeathByDegreesTekkenNinaWilliams, KO, 0},
{0x59683BB0, DeathByDegreesTekkenNinaWilliams, EU, 0},
{0x771C3B47, AlpineRacer3, JP, 0}, //阿爾卑斯山滑雪大賽3 {0x771C3B47, AlpineRacer3, JP, 0}, //阿爾卑斯山滑雪大賽3
{0x7367D841, AlpineRacer3, EU, 0},
{0x449E1F6B, HummerBadlands, US, 0}, {0x449E1F6B, HummerBadlands, US, 0},
{0xAEA1B3AD, SengokuBasara, JP, 0}, {0xAEA1B3AD, SengokuBasara, JP, 0},
{0x5B659BED, Grandia3, JP, 0}, {0x5B659BED, Grandia3, JP, 0},
@ -482,6 +485,7 @@ CRC::Game CRC::m_games[] =
{0x027C604C, SoulCalibur3, US, 0}, {0x027C604C, SoulCalibur3, US, 0},
{0x24090A12, SoulCalibur3, EU, 0}, {0x24090A12, SoulCalibur3, EU, 0},
{0x37B99B14, SoulCalibur3, KO, 0}, {0x37B99B14, SoulCalibur3, KO, 0},
{0xBC5480A3, SoulCalibur3, EU, 0},
{0xFC0F8A5B, Simple2000Vol114, JP, 0}, {0xFC0F8A5B, Simple2000Vol114, JP, 0},
{0x0098F740, SeintoSeiya, NoRegion, 0}, //聖鬥士星矢-黃道十二宮 {0x0098F740, SeintoSeiya, NoRegion, 0}, //聖鬥士星矢-黃道十二宮
{0xBDD9BAAD, UrbanReign, US, 0}, //街頭爭霸 {0xBDD9BAAD, UrbanReign, US, 0}, //街頭爭霸

View File

@ -422,6 +422,7 @@ void GSHacksDlg::OnInit()
CheckDlgButton(m_hWnd, IDC_OFFSETHACK, theApp.GetConfig("UserHacks_HalfPixelOffset", 0)); CheckDlgButton(m_hWnd, IDC_OFFSETHACK, theApp.GetConfig("UserHacks_HalfPixelOffset", 0));
CheckDlgButton(m_hWnd, IDC_SPRITEHACK, theApp.GetConfig("UserHacks_SpriteHack", 0)); CheckDlgButton(m_hWnd, IDC_SPRITEHACK, theApp.GetConfig("UserHacks_SpriteHack", 0));
CheckDlgButton(m_hWnd, IDC_WILDHACK, theApp.GetConfig("UserHacks_WildHack", 0)); CheckDlgButton(m_hWnd, IDC_WILDHACK, theApp.GetConfig("UserHacks_WildHack", 0));
CheckDlgButton(m_hWnd, IDC_AGGRESSIVECRC, theApp.GetConfig("UserHacks_AggressiveCRC", 0));
SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_SETRANGE, 0, MAKELPARAM(1000, 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)); SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfig("UserHacks_SkipDraw", 0), 0));
@ -483,6 +484,11 @@ bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
helpstr = "Multisample Anti-Aliasing\n\nEnables hardware Anti-Aliasing. Needs lots of memory." helpstr = "Multisample Anti-Aliasing\n\nEnables hardware Anti-Aliasing. Needs lots of memory."
" The Z-24 modes might need to have LogarithmicZ to compensate for the bits lost (only in DX9 mode)."; " The Z-24 modes might need to have LogarithmicZ to compensate for the bits lost (only in DX9 mode).";
break; break;
case IDC_AGGRESSIVECRC:
helpstr = "Use more aggressive CRC hacks on some games\n\n"
"Only affects few games, removing some effects which might make the image sharper/clearer.\n"
"Affected games: FFX, FFX2, GOW2, SoTC, SSX3.";
break;
default: default:
helpstr = "Hover over an item to get a description."; helpstr = "Hover over an item to get a description.";
break; break;
@ -506,6 +512,7 @@ bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
theApp.SetConfig("UserHacks_SpriteHack", (int)IsDlgButtonChecked(m_hWnd, IDC_SPRITEHACK)); theApp.SetConfig("UserHacks_SpriteHack", (int)IsDlgButtonChecked(m_hWnd, IDC_SPRITEHACK));
theApp.SetConfig("UserHacks_SkipDraw", (int)SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_GETPOS, 0, 0)); 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_WildHack", (int)IsDlgButtonChecked(m_hWnd, IDC_WILDHACK));
theApp.SetConfig("UserHacks_AggressiveCRC", (int)IsDlgButtonChecked(m_hWnd, IDC_AGGRESSIVECRC));
EndDialog(m_hWnd, id); EndDialog(m_hWnd, id);
} break; } break;
} }

View File

@ -111,6 +111,8 @@ GSState::GSState()
s_save = !!theApp.GetConfig("save", 0); s_save = !!theApp.GetConfig("save", 0);
s_savez = !!theApp.GetConfig("savez", 0); s_savez = !!theApp.GetConfig("savez", 0);
s_saven = theApp.GetConfig("saven", 0); s_saven = theApp.GetConfig("saven", 0);
userHacks_AggressiveCRC = !!theApp.GetConfig("UserHacks", 0) ? theApp.GetConfig("UserHacks_AggressiveCRC", 0) : 0;
} }
GSState::~GSState() GSState::~GSState()
@ -2871,6 +2873,7 @@ struct GSFrameInfo
typedef bool (*GetSkipCount)(const GSFrameInfo& fi, int& skip); typedef bool (*GetSkipCount)(const GSFrameInfo& fi, int& skip);
CRC::Region g_crc_region = CRC::NoRegion; CRC::Region g_crc_region = CRC::NoRegion;
int g_aggressive = 0;
bool GSC_Okami(const GSFrameInfo& fi, int& skip) bool GSC_Okami(const GSFrameInfo& fi, int& skip)
{ {
@ -3044,7 +3047,7 @@ bool GSC_SoTC(const GSFrameInfo& fi, int& skip)
// Not needed anymore? What did it fix anyway? (rama) // Not needed anymore? What did it fix anyway? (rama)
if(skip == 0) if(skip == 0)
{ {
if(fi.TME /*&& fi.FBP == 0x03d80*/ && fi.FPSM == 0 && fi.TBP0 == 0x03fc0 && fi.TPSM == 1) if(g_aggressive && fi.TME /*&& fi.FBP == 0x03d80*/ && fi.FPSM == 0 && fi.TBP0 == 0x03fc0 && fi.TPSM == 1)
{ {
skip = 48; //removes sky bloom skip = 48; //removes sky bloom
} }
@ -3429,13 +3432,13 @@ bool GSC_GodOfWar2(const GSFrameInfo& fi, int& skip)
{ {
skip = 1; // wall of fog skip = 1; // wall of fog
} }
else if(fi.TPSM == PSM_PSMCT24 && fi.TME && (fi.FBP ==0x1300 ) && (fi.TBP0 ==0x0F00 || fi.TBP0 ==0x1300 || fi.TBP0==0x2b00)) // || fi.FBP == 0x0100 //<EFBFBD><EFBFBD><EFBFBD>堵絬蛤<EFBFBD> else if(g_aggressive && fi.TPSM == PSM_PSMCT24 && fi.TME && (fi.FBP ==0x1300 ) && (fi.TBP0 ==0x0F00 || fi.TBP0 ==0x1300 || fi.TBP0==0x2b00)) // || fi.FBP == 0x0100 //®ø¤ô¤U¶Â½u¸ò¥ú·½
{ {
skip = 1; // <EFBFBD> skip = 1; // global haze/halo
} }
else if(fi.TPSM == PSM_PSMCT24 && fi.TME && (fi.FBP ==0x0100 ) && (fi.TBP0==0x2b00 || fi.TBP0==0x2e80)) //480P<EFBFBD>2e80 else if(g_aggressive && fi.TPSM == PSM_PSMCT24 && fi.TME && (fi.FBP ==0x0100 ) && (fi.TBP0==0x2b00 || fi.TBP0==0x2e80)) //480P¤U2e80
{ {
skip = 1; // <EFBFBD><EFBFBD>堵絬 skip = 1; // water effect and water vertical lines
} }
} }
} }
@ -3594,11 +3597,11 @@ bool GSC_ValkyrieProfile2(const GSFrameInfo& fi, int& skip)
/*if(fi.TME && (fi.FBP == 0x018c0 || fi.FBP == 0x02180) && fi.FPSM == fi.TPSM && fi.TBP0 >= 0x03200 && fi.TPSM == PSM_PSMCT32) //NTSC only, !(fi.TBP0 == 0x03580 || fi.TBP0 == 0x03960) /*if(fi.TME && (fi.FBP == 0x018c0 || fi.FBP == 0x02180) && fi.FPSM == fi.TPSM && fi.TBP0 >= 0x03200 && fi.TPSM == PSM_PSMCT32) //NTSC only, !(fi.TBP0 == 0x03580 || fi.TBP0 == 0x03960)
{ {
skip = 1; //red garbage in lost forest, removes other effects... skip = 1; //red garbage in lost forest, removes other effects...
}*/ }
if(fi.TME && fi.FPSM == fi.TPSM && fi.TPSM == PSM_PSMCT16 && fi.FBMSK == 0x03FFF) if(fi.TME && fi.FPSM == fi.TPSM && fi.TPSM == PSM_PSMCT16 && fi.FBMSK == 0x03FFF)
{ {
skip = 1; // CMV<EFBFBD><EFBFBD> skip = 1; // //garbage in cutscenes, doesn't remove completely, better use "Alpha Hack"
} }*/
if(fi.TME && fi.FBP == fi.TBP0 && fi.FPSM == PSM_PSMCT32 && fi.TPSM == PSM_PSMT4HH) if(fi.TME && fi.FBP == fi.TBP0 && fi.FPSM == PSM_PSMCT32 && fi.TPSM == PSM_PSMT4HH)
{ {
skip = 1000; // skip = 1000; //
@ -3912,7 +3915,7 @@ bool GSC_ShadowofRome(const GSFrameInfo& fi, int& skip)
bool GSC_FFXII(const GSFrameInfo& fi, int& skip) bool GSC_FFXII(const GSFrameInfo& fi, int& skip)
{ {
if(skip == 0) if(g_aggressive && skip == 0)
{ {
if(fi.TME) if(fi.TME)
{ {
@ -3930,7 +3933,7 @@ bool GSC_FFXII(const GSFrameInfo& fi, int& skip)
bool GSC_FFX2(const GSFrameInfo& fi, int& skip) bool GSC_FFX2(const GSFrameInfo& fi, int& skip)
{ {
if(skip == 0) if(g_aggressive && skip == 0)
{ {
if(fi.TME) if(fi.TME)
{ {
@ -3948,7 +3951,7 @@ bool GSC_FFX2(const GSFrameInfo& fi, int& skip)
bool GSC_FFX(const GSFrameInfo& fi, int& skip) bool GSC_FFX(const GSFrameInfo& fi, int& skip)
{ {
if(skip == 0) if(g_aggressive && skip == 0)
{ {
if(fi.TME) if(fi.TME)
{ {
@ -4251,7 +4254,7 @@ bool GSC_TombRaiderUnderWorld(const GSFrameInfo& fi, int& skip)
bool GSC_SSX3(const GSFrameInfo& fi, int& skip) bool GSC_SSX3(const GSFrameInfo& fi, int& skip)
{ {
if(skip == 0) if(g_aggressive && skip == 0)
{ {
if(fi.TME) if(fi.TME)
{ {
@ -5313,6 +5316,7 @@ bool GSState::IsBadFrame(int& skip, int UserHacks_SkipDraw)
GetSkipCount gsc = map[m_game.title]; GetSkipCount gsc = map[m_game.title];
g_crc_region = m_game.region; g_crc_region = m_game.region;
g_aggressive = userHacks_AggressiveCRC;
#ifdef ENABLE_DYNAMIC_CRC_HACK #ifdef ENABLE_DYNAMIC_CRC_HACK
bool res=false; if(IsInvokedDynamicCrcHack(fi, skip, g_crc_region, res, m_crc)){ if( !res ) return false; } else bool res=false; if(IsInvokedDynamicCrcHack(fi, skip, g_crc_region, res, m_crc)){ if( !res ) return false; } else

View File

@ -138,6 +138,7 @@ class GSState : public GSAlignedClass<32>
protected: protected:
bool IsBadFrame(int& skip, int UserHacks_SkipDraw); bool IsBadFrame(int& skip, int UserHacks_SkipDraw);
int userHacks_AggressiveCRC;
GSVertex m_v; GSVertex m_v;
float m_q; float m_q;

View File

@ -93,6 +93,7 @@ BEGIN
COMBOBOX IDC_MSAACB,35,18,44,63,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_MSAACB,35,18,44,63,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "WildArmsOffset",IDC_WILDHACK,"Button",BS_AUTO3STATE | WS_TABSTOP,14,105,64,10 CONTROL "WildArmsOffset",IDC_WILDHACK,"Button",BS_AUTO3STATE | WS_TABSTOP,14,105,64,10
LTEXT "TEXT_GOES_HERE",IDC_HACK_DESCRIPTION,92,20,209,145 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
END END
IDD_SHADEBOOST DIALOGEX 0, 0, 316, 129 IDD_SHADEBOOST DIALOGEX 0, 0, 316, 129

View File

@ -92,6 +92,8 @@
#define IDC_HACK_DESCRIPTION 2073 #define IDC_HACK_DESCRIPTION 2073
#define IDC_STATIC_MSAA 2074 #define IDC_STATIC_MSAA 2074
#define IDC_STATIC_SKIPDRAW 2075 #define IDC_STATIC_SKIPDRAW 2075
#define IDC_CHECK_AGGRESSIVECRC 2076
#define IDC_AGGRESSIVECRC 2076
#define IDC_COLORSPACE 3000 #define IDC_COLORSPACE 3000
#define IDR_CONVERT_FX 10000 #define IDR_CONVERT_FX 10000
#define IDR_TFX_FX 10001 #define IDR_TFX_FX 10001
@ -110,7 +112,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 10012 #define _APS_NEXT_RESOURCE_VALUE 10012
#define _APS_NEXT_COMMAND_VALUE 32771 #define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 2076 #define _APS_NEXT_CONTROL_VALUE 2077
#define _APS_NEXT_SYMED_VALUE 5000 #define _APS_NEXT_SYMED_VALUE 5000
#endif #endif
#endif #endif

View File

@ -126,6 +126,9 @@ if( IsCRC(0x086273D2, 0x26A6E286, 0x9F185CE1) ){ // 3 first MGS3 CRCs from GSCrc
return true; return true;
} }
return true;
} }
/*********** Dynamic CRC hack code ends here *****************/ /*********** Dynamic CRC hack code ends here *****************/
@ -216,7 +219,7 @@ typedef struct _stats { uint32 overall, changed, skipped, nextPrint;} Stats;
#define CRC_HACK DynamicCrcHack2 #define CRC_HACK DynamicCrcHack2
#define CRC_HACK_OLD DynamicCrcHack #define CRC_HACK_OLD DynamicCrcHack
#if INITIAL_MODE == 0 #if INITIAL_MODE == 0
#define CRC_HACK Voldemort #define CRC_HACK Voldemort2
#define CRC_HACK_OLD Voldemort #define CRC_HACK_OLD Voldemort
#endif #endif
DLL_EXPORT bool CRC_HACK (uint32 FBP, uint32 FPSM, uint32 FBMSK, uint32 TBP0, uint32 TPSM, uint32 TZTST, DLL_EXPORT bool CRC_HACK (uint32 FBP, uint32 FPSM, uint32 FBMSK, uint32 TBP0, uint32 TPSM, uint32 TZTST,