diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2012-05-20 22:16:21 +0200 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2012-05-20 22:16:21 +0200 |
| commit | fee2d83f68d92a6f3b7461b06f4dce2dbd6f1c07 (patch) | |
| tree | 56838f54723f7535ffbf6211bdeabce5c13254c4 /Source/Core | |
| parent | c95baf614d2699233b7bf7a474d96aa6c4cf2b78 (diff) | |
Fix a data endianness problem introduced by r7cccb4baa724.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/VideoCommon/Src/XFStructs.cpp | 17 |
1 files 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]); } } |
