diff --git a/plugins/GSdx/GSRendererHW.h b/plugins/GSdx/GSRendererHW.h index e343852712..e7b46f7c6f 100644 --- a/plugins/GSdx/GSRendererHW.h +++ b/plugins/GSdx/GSRendererHW.h @@ -507,6 +507,35 @@ protected: #pragma endregion + #pragma region GoW2 z buffer clear + + if(m_game.title == CRC::GodOfWar2) + { + DWORD FBP = m_context->FRAME.Block(); + DWORD FBW = m_context->FRAME.FBW; + DWORD FPSM = m_context->FRAME.PSM; + + if(FBP == 0x00f00 && FPSM == PSM_PSMZ24) + { + GIFRegTEX0 TEX0; + + TEX0.TBP0 = FBP; + TEX0.TBW = FBW; + TEX0.PSM = FPSM; + + if(GSTextureCache::GSDepthStencil* ds = m_tc->GetDepthStencil(TEX0, m_width, m_height)) + { + m_dev.ClearDepth(ds->m_texture, 0); + } + + return false; + } + + return true; + } + + #pragma endregion + return true; } diff --git a/plugins/GSdx/GSState.cpp b/plugins/GSdx/GSState.cpp index ff17150ec4..de18465acd 100644 --- a/plugins/GSdx/GSState.cpp +++ b/plugins/GSdx/GSState.cpp @@ -2081,6 +2081,22 @@ bool GSC_GodOfWar(const GSFrameInfo& fi, int& skip) return true; } +bool GSC_GodOfWar2(const GSFrameInfo& fi, int& skip) +{ + if(skip == 0) + { + if(fi.TME && fi.FBP == 0x00100 && fi.FPSM == PSM_PSMCT16 && fi.TBP0 == 0x00100 && fi.TPSM == PSM_PSMCT16) + { + skip = 30; // shadows + } + } + else + { + } + + return true; +} + bool GSC_GiTS(const GSFrameInfo& fi, int& skip) { if(skip == 0) @@ -2172,7 +2188,7 @@ bool GSState::IsBadFrame(int& skip) map[CRC::Tekken5] = GSC_Tekken5; map[CRC::IkkiTousen] = GSC_IkkiTousen; map[CRC::GodOfWar] = GSC_GodOfWar; - map[CRC::GodOfWar2] = GSC_GodOfWar; + map[CRC::GodOfWar2] = GSC_GodOfWar2; map[CRC::GiTS] = GSC_GiTS; map[CRC::Onimusha3] = GSC_Onimusha3; map[CRC::TalesOfAbyss] = GSC_TalesOfAbyss;