Fix a data endianness problem introduced by r7cccb4baa724.

This commit is contained in:
Pierre Bourdon 2012-05-20 22:16:21 +02:00
parent c95baf614d
commit fee2d83f68
1 changed files with 14 additions and 3 deletions

View File

@ -293,10 +293,21 @@ void LoadIndexedXF(u32 val, int refarray)
int size = ((val >> 12) & 0xF) + 1;
//load stuff from array to address in xf mem
u32* currData = (u32*)(xfmem + address);
u32* newData = (u32*)Memory::GetPointer(arraybases[refarray] + arraystrides[refarray] * index);
if (memcmp(xfmem + address, newData, size * 4))
bool changed = false;
for (int i = 0; i < size; ++i)
{
if (currData[i] != Common::swap32(newData[i]))
{
changed = true;
XFMemWritten(size, address);
memcpy_gc(xfmem + address, newData, size * 4);
break;
}
}
if (changed)
{
for (int i = 0; i < size; ++i)
currData[i] = Common::swap32(newData[i]);
}
}