From e017ccaa5d15819e2bf394c6304a7ac225119921 Mon Sep 17 00:00:00 2001 From: "sudonim1@gmail.com" Date: Fri, 23 Mar 2012 21:00:22 +0000 Subject: [PATCH] GSDx: Found the likely actual cause for the FFXII hack problems, probably introduced with index buffers. Also made the hack a little more crash proof and maybe fixed an off by one pixel error. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5135 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSRendererHW.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/GSdx/GSRendererHW.cpp b/plugins/GSdx/GSRendererHW.cpp index 5968b7a76..cb27133ca 100644 --- a/plugins/GSdx/GSRendererHW.cpp +++ b/plugins/GSdx/GSRendererHW.cpp @@ -424,17 +424,17 @@ bool GSRendererHW::OI_FFXII(GSTexture* rt, GSTexture* ds, GSTextureCache::Source if(!video) video = new uint32[512 * 512]; - int ox = m_context->XYOFFSET.OFX; - int oy = m_context->XYOFFSET.OFY; + int ox = m_context->XYOFFSET.OFX - 8; + int oy = m_context->XYOFFSET.OFY - 8; const GSVertex* RESTRICT v = m_vertex.buff; - for(int i = (int)m_vertex.next; i >= 0; i--, v++) + for(int i = (int)m_vertex.next; i > 0; i--, v++) { int x = (v->XYZ.X - ox) >> 4; int y = (v->XYZ.Y - oy) >> 4; - if (x >= 448 || y >= (int)lines) return false; // sigh + if (x < 0 || x >= 448 || y < 0 || y >= (int)lines) return false; // le sigh video[(y << 8) + (y << 7) + (y << 6) + x] = v->RGBAQ.u32[0]; } @@ -506,7 +506,7 @@ bool GSRendererHW::OI_MetalSlug6(GSTexture* rt, GSTexture* ds, GSTextureCache::S GSVertex* RESTRICT v = m_vertex.buff; - for(int i = (int)m_vertex.next; i >= 0; i--, v++) + for(int i = (int)m_vertex.next; i > 0; i--, v++) { uint32 c = v->RGBAQ.u32[0];