From fee2d83f68d92a6f3b7461b06f4dce2dbd6f1c07 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Sun, 20 May 2012 22:16:21 +0200 Subject: [PATCH] Fix a data endianness problem introduced by r7cccb4baa724. --- Source/Core/VideoCommon/Src/XFStructs.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Source/Core/VideoCommon/Src/XFStructs.cpp b/Source/Core/VideoCommon/Src/XFStructs.cpp index cd97271526..f8330604ad 100644 --- a/Source/Core/VideoCommon/Src/XFStructs.cpp +++ b/Source/Core/VideoCommon/Src/XFStructs.cpp @@ -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) { - XFMemWritten(size, address); - memcpy_gc(xfmem + address, newData, size * 4); + if (currData[i] != Common::swap32(newData[i])) + { + changed = true; + XFMemWritten(size, address); + break; + } + } + if (changed) + { + for (int i = 0; i < size; ++i) + currData[i] = Common::swap32(newData[i]); } }