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
This commit is contained in:
sudonim1@gmail.com 2012-03-23 21:00:22 +00:00
parent e8b96f51cb
commit e017ccaa5d
1 changed files with 5 additions and 5 deletions

View File

@ -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];