From eaaa8eef5915a260f5e2fde54ff4fe8179b9eab3 Mon Sep 17 00:00:00 2001 From: shadowladyngemu Date: Mon, 25 Apr 2011 13:47:29 +0000 Subject: [PATCH] GSdx: CRC hackfixes for Silent Hill 2/3 (half screen issue), Castlevania (removes shadows which were broken and caused darkness in different areas) and Bleach Blade Battlers 1/2 (shadows that caused a huge slowdown when casted on the characters). Few changes to the Simpsons hackfix. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4593 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSCrc.cpp | 11 +++++++ plugins/GSdx/GSCrc.h | 5 +++ plugins/GSdx/GSRendererHW.h | 2 +- plugins/GSdx/GSState.cpp | 64 +++++++++++++++++++++++++++++++++++-- 4 files changed, 79 insertions(+), 3 deletions(-) diff --git a/plugins/GSdx/GSCrc.cpp b/plugins/GSdx/GSCrc.cpp index b31c992025..7b3e9a0fe9 100644 --- a/plugins/GSdx/GSCrc.cpp +++ b/plugins/GSdx/GSCrc.cpp @@ -162,6 +162,8 @@ CRC::Game CRC::m_games[] = {0x8C913264, SonicUnleashed, EU, 0}, {0x4C7BB3C8, SimpsonsGame, NoRegion, 0}, {0x4C94B32C, SimpsonsGame, NoRegion, 0}, + {0x206779D8, SimpsonsGame, EU, 0}, + {0xBBE4D862, SimpsonsGame, US, 0}, {0xD71B57F4, Genji, NoRegion, 0}, {0xE04EA200, StarOcean3, EU, 0}, {0x23A97857, StarOcean3, US, 0}, @@ -213,6 +215,15 @@ CRC::Game CRC::m_games[] = {0xE2E67E23, RedDeadRevolver, EU, 0}, {0xEDDD6573, SpidermanWoS, US, 0}, //Web of Shadows {0xF56C7948, HeavyMetalThunder, JP, 0}, + {0x2498951B, SilentHill3, US, 0}, + {0x5088CCDB, SilentHill3, EU, 0}, + {0x8E8E384B, SilentHill2, US, 0}, + {0x6DF62AEA, BleachBladeBattlers, JP, 0}, + {0x6EB71AB0, BleachBladeBattlers, JP, 0}, //2nd + {0x3A446111, CastlevaniaCoD, US, 0}, + {0xF321BC38, CastlevaniaCoD, EU, 0}, + {0x28270F7D, CastlevaniaLoI, US, 0}, + {0xA36CFF6C, CastlevaniaLoI, JP, 0}, }; hash_map CRC::m_map; diff --git a/plugins/GSdx/GSCrc.h b/plugins/GSdx/GSCrc.h index b24bc1d2af..ae6e60e5f7 100644 --- a/plugins/GSdx/GSCrc.h +++ b/plugins/GSdx/GSCrc.h @@ -96,6 +96,11 @@ public: RedDeadRevolver, SpidermanWoS, HeavyMetalThunder, + SilentHill3, + SilentHill2, + BleachBladeBattlers, + CastlevaniaCoD, + CastlevaniaLoI, TitleCount, }; diff --git a/plugins/GSdx/GSRendererHW.h b/plugins/GSdx/GSRendererHW.h index 71ba55228c..4bc5e349a5 100644 --- a/plugins/GSdx/GSRendererHW.h +++ b/plugins/GSdx/GSRendererHW.h @@ -185,7 +185,7 @@ class GSRendererHW : public GSRendererT uint32 FBW = m_context->FRAME.FBW; uint32 FPSM = m_context->FRAME.PSM; - if(FBP == 0x01800 && FPSM == PSM_PSMZ24) + if((FBP == 0x01500 || FBP == 0x01800) && FPSM == PSM_PSMZ24) //0x1800 pal, 0x1500 ntsc { // instead of just simply drawing a full height 512x512 sprite to clear the z buffer, // it uses a 512x256 sprite only, yet it is still able to fill the whole surface with zeros, diff --git a/plugins/GSdx/GSState.cpp b/plugins/GSdx/GSState.cpp index 0cef3077ba..7a7fba498b 100644 --- a/plugins/GSdx/GSState.cpp +++ b/plugins/GSdx/GSState.cpp @@ -339,8 +339,18 @@ GSVector2i GSState::GetDeviceSize(int i) }*/ //Fixme : Just slightly better than the hack above - if(m_regs->SMODE2.INT && m_regs->SMODE2.FFMD && h > 1){ - if (!IsEnabled(0) || !IsEnabled(1)){h >>= 1;} + if(m_regs->SMODE2.INT && m_regs->SMODE2.FFMD && h > 1) + { + if (IsEnabled(0) || IsEnabled(1)) + { + h >>= 1; + } + } + + //Fixme: These games elude the code above, worked with the old hack + else if(m_game.title == CRC::SilentHill2 || m_game.title == CRC::SilentHill3) + { + h /= 2; } return GSVector2i(w, h); @@ -2418,6 +2428,26 @@ bool GSC_SonicUnleashed(const GSFrameInfo& fi, int& skip) return true; } +bool GSC_SimpsonsGame(const GSFrameInfo& fi, int& skip) +{ + if(skip == 0) + { + if(fi.TME && fi.FBP == fi.TBP0 && fi.FPSM == fi.TPSM && fi.TBP0 == 0x03000 && fi.TPSM == PSM_PSMCT32) + { + skip = 100; + } + } + else + { + if(fi.TME && fi.FBP == 0x03000 && fi.FPSM == PSM_PSMCT32 && fi.TPSM == PSM_PSMT8H) + { + skip = 2; + } + } + + return true; +} + bool GSC_Genji(const GSFrameInfo& fi, int& skip) { if(skip == 0) @@ -2734,6 +2764,32 @@ bool GSC_HeavyMetalThunder(const GSFrameInfo& fi, int& skip) return true; } +bool GSC_BleachBladeBattlers(const GSFrameInfo& fi, int& skip) +{ + if(skip == 0) + { + if(fi.TME && fi.FBP == 0x01180 && fi.FPSM == fi.TPSM && fi.TBP0 == 0x03fc0 && fi.TPSM == PSM_PSMCT32) + { + skip = 1; + } + } + + return true; +} + +bool GSC_Castlevania(const GSFrameInfo& fi, int& skip) +{ + if(skip == 0) + { + if(fi.TME && fi.FBP == 0x00000 && fi.FPSM == PSM_PSMCT32 && fi.TPSM == PSM_PSMCT16S && fi.FBMSK == 0x00FFFFFF) + { + skip = 2; + } + } + + return true; +} + bool GSState::IsBadFrame(int& skip, int UserHacks_SkipDraw) { GSFrameInfo fi; @@ -2785,6 +2841,7 @@ bool GSState::IsBadFrame(int& skip, int UserHacks_SkipDraw) map[CRC::Onimusha3] = GSC_Onimusha3; map[CRC::TalesOfAbyss] = GSC_TalesOfAbyss; map[CRC::SonicUnleashed] = GSC_SonicUnleashed; + map[CRC::SimpsonsGame] = GSC_SimpsonsGame; map[CRC::Genji] = GSC_Genji; map[CRC::StarOcean3] = GSC_StarOcean3; map[CRC::ValkyrieProfile2] = GSC_ValkyrieProfile2; @@ -2802,6 +2859,9 @@ bool GSState::IsBadFrame(int& skip, int UserHacks_SkipDraw) map[CRC::LordOfTheRingsTwoTowers] = GSC_LordOfTheRingsTwoTowers; map[CRC::RedDeadRevolver] = GSC_RedDeadRevolver; map[CRC::HeavyMetalThunder] = GSC_HeavyMetalThunder; + map[CRC::BleachBladeBattlers] = GSC_BleachBladeBattlers; + map[CRC::CastlevaniaCoD] = GSC_Castlevania; + map[CRC::CastlevaniaLoI] = GSC_Castlevania; } // TODO: just set gsc in SetGameCRC once