diff --git a/plugins/GSdx/GSHwHack.cpp b/plugins/GSdx/GSHwHack.cpp index ee7d6c7f57..8393dd40ee 100644 --- a/plugins/GSdx/GSHwHack.cpp +++ b/plugins/GSdx/GSHwHack.cpp @@ -1210,37 +1210,6 @@ bool GSC_DeathByDegreesTekkenNinaWilliams(const GSFrameInfo& fi, int& skip) return true; } -bool GSC_ICO(const GSFrameInfo& fi, int& skip) -{ - if(skip == 0) - { - if(Aggressive && fi.TME && fi.FBP == 0x00800 && fi.FPSM == PSM_PSMCT32 && fi.TBP0 == 0x03d00 && fi.TPSM == PSM_PSMCT32) - { - // Removes shadows, shadows can be a little misaligned when upscaled. HPO fixes the issue. - // Can be used as a speed hack. - skip = 3; - } - else if(fi.TME && fi.FBP == 0x00800 && fi.FPSM == PSM_PSMCT32 && fi.TBP0 == 0x02800 && fi.TPSM == PSM_PSMT8H) - { - // Depth effects. - skip = 1; - } - else if(Aggressive && fi.TME && fi.FBP == 0x0800 && (fi.TBP0 == 0x2800 || fi.TBP0 ==0x2c00) && fi.TPSM ==0 && fi.FBMSK == 0) - { - skip = 1; - } - } - else - { - if(fi.TME && fi.TBP0 == 0x00800 && fi.TPSM == PSM_PSMCT32) - { - skip = 0; - } - } - - return true; -} - bool GSC_StarWarsBattlefront(const GSFrameInfo& fi, int& skip) { if(skip == 0) @@ -2253,7 +2222,6 @@ void GSState::SetupCrcHack() lut[CRC::FrontMission5] = GSC_FrontMission5; lut[CRC::GodOfWar2] = GSC_GodOfWar2; lut[CRC::HeavyMetalThunder] = GSC_HeavyMetalThunder; - lut[CRC::ICO] = GSC_ICO; lut[CRC::LordOfTheRingsTwoTowers] = GSC_LordOfTheRingsTwoTowers; lut[CRC::Okami] = GSC_Okami; lut[CRC::SoulCalibur2] = GSC_SoulCaliburGames; diff --git a/plugins/GSdx/GSRendererDX.cpp b/plugins/GSdx/GSRendererDX.cpp index 80c05e2163..de7137039a 100644 --- a/plugins/GSdx/GSRendererDX.cpp +++ b/plugins/GSdx/GSRendererDX.cpp @@ -650,8 +650,24 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc m_ps_sel.tfx = 4; } - // rs + if (m_game.title == CRC::ICO) + { + GSVertex* v = &m_vertex.buff[0]; + const GSVideoMode mode = GetVideoMode(); + if (tex && m_vt.m_primclass == GS_SPRITE_CLASS && m_vertex.next == 2 && PRIM->ABE && // Blend texture + ((v[1].U == 8200 && v[1].V == 7176 && mode == GSVideoMode::NTSC) || // at display resolution 512x448 + (v[1].U == 8200 && v[1].V == 8200 && mode == GSVideoMode::PAL)) && // at display resolution 512x512 + tex->m_TEX0.PSM == PSM_PSMT8H) // i.e. read the alpha channel of a 32 bits texture + { + // Note potentially we can limit to TBP0:0x2800 + // DX doesn't support depth or channel shuffle yet so we can just do a partial port that skips the bad drawcalls, + // this way we can purge any remaining crc hacks. + throw GSDXRecoverableError(); + } + } + + // rs GSVector4i scissor = GSVector4i(GSVector4(rtscale).xyxy() * m_context->scissor.in).rintersect(GSVector4i(rtsize).zwxy()); dev->OMSetRenderTargets(rt, ds, &scissor); diff --git a/plugins/GSdx/GSRendererOGL.cpp b/plugins/GSdx/GSRendererOGL.cpp index 535a53c39b..bbfa092c6c 100644 --- a/plugins/GSdx/GSRendererOGL.cpp +++ b/plugins/GSdx/GSRendererOGL.cpp @@ -1312,7 +1312,7 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour // Depth buffer was moved so GSdx will invalide it which means a // downscale. ICO uses the MSB depth bits as the texture alpha // channel. However this depth of field effect requires - // texel:pixel mapping accuraccy. + // texel:pixel mapping accuracy. // // Use an HLE shader to sample depth directly as the alpha channel GL_INS("ICO sample depth as alpha");