diff --git a/plugins/GSdx/GSRendererHW.cpp b/plugins/GSdx/GSRendererHW.cpp index 6a31f1306b..da6504591a 100644 --- a/plugins/GSdx/GSRendererHW.cpp +++ b/plugins/GSdx/GSRendererHW.cpp @@ -1140,8 +1140,8 @@ GSRendererHW::Hacks::Hacks() m_oi_list.push_back(HackEntry(CRC::MetalSlug6, CRC::RegionCount, &GSRendererHW::OI_MetalSlug6)); m_oi_list.push_back(HackEntry(CRC::RozenMaidenGebetGarden, CRC::RegionCount, &GSRendererHW::OI_RozenMaidenGebetGarden)); m_oi_list.push_back(HackEntry(CRC::StarWarsForceUnleashed, CRC::RegionCount, &GSRendererHW::OI_StarWarsForceUnleashed)); - m_oi_list.push_back(HackEntry(CRC::SpyroNewBeginning, CRC::RegionCount, &GSRendererHW::OI_SpyroGames)); - m_oi_list.push_back(HackEntry(CRC::SpyroEternalNight, CRC::RegionCount, &GSRendererHW::OI_SpyroGames)); + m_oi_list.push_back(HackEntry(CRC::SpyroNewBeginning, CRC::RegionCount, &GSRendererHW::OI_SpyroNewBeginning)); + m_oi_list.push_back(HackEntry(CRC::SpyroEternalNight, CRC::RegionCount, &GSRendererHW::OI_SpyroEternalNight)); m_oi_list.push_back(HackEntry(CRC::SuperManReturns, CRC::RegionCount, &GSRendererHW::OI_SuperManReturns)); m_oi_list.push_back(HackEntry(CRC::TalesOfLegendia, CRC::RegionCount, &GSRendererHW::OI_TalesOfLegendia)); m_oi_list.push_back(HackEntry(CRC::ArTonelico2, CRC::RegionCount, &GSRendererHW::OI_ArTonelico2)); @@ -1581,7 +1581,29 @@ bool GSRendererHW::OI_StarWarsForceUnleashed(GSTexture* rt, GSTexture* ds, GSTex return true; } -bool GSRendererHW::OI_SpyroGames(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t) +bool GSRendererHW::OI_SpyroNewBeginning(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t) +{ + // uint32 FBP = m_context->FRAME.Block(); + uint32 TBP = m_context->TEX0.TBP0; + uint32 FPSM = m_context->FRAME.PSM; + + // Spyro A New Beginning PAL doesn't play well with FBP so let's use TBP to fix the menu/ui flickering. + // We can't merge the two hacks OI_SpyroNewBeginning and OI_SpyroEternalNight because Eternal Night PAL flickers with TBP, the opposite of New Beginning. + + if(PRIM->TME) + { + // Old code (FBP == 0x0 || FBP == 0x01180) + // First two TBP NTSC, other two PAL. + if((TBP == 0x37c0 || TBP == 0x3020 || TBP == 0x34a0 || TBP == 0x3a00) && FPSM == PSM_PSMCT32 && (m_vt.m_eq.z && m_vt.m_min.p.z == 0)) + { + m_dev->ClearDepth(ds); + } + } + + return true; +} + +bool GSRendererHW::OI_SpyroEternalNight(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t) { uint32 FBP = m_context->FRAME.Block(); uint32 FPSM = m_context->FRAME.PSM; diff --git a/plugins/GSdx/GSRendererHW.h b/plugins/GSdx/GSRendererHW.h index b9fa4685b5..ff6a48ad4e 100644 --- a/plugins/GSdx/GSRendererHW.h +++ b/plugins/GSdx/GSRendererHW.h @@ -59,7 +59,8 @@ private: bool OI_GodOfWar2(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t); bool OI_RozenMaidenGebetGarden(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t); bool OI_StarWarsForceUnleashed(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t); - bool OI_SpyroGames(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t); + bool OI_SpyroNewBeginning(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t); + bool OI_SpyroEternalNight(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t); bool OI_TalesOfLegendia(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t); bool OI_SMTNocturne(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t); bool OI_PointListPalette(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t);