summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/XFStructs.cpp
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2012-05-19 10:54:40 +0200
committerPierre Bourdon <delroth@gmail.com>2012-05-19 10:54:40 +0200
commit7cccb4baa724188ac4af546e2109e988713893aa (patch)
tree7e6aa187ef4a519f30b1ed0756c1c8ca193a6e13 /Source/Core/VideoCommon/Src/XFStructs.cpp
parentb8d4d013f6aa641d823a4a33e1cb09deb06f7f7a (diff)
Check if data was modified in LoadIndexedXF too
Diffstat (limited to 'Source/Core/VideoCommon/Src/XFStructs.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/XFStructs.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/Source/Core/VideoCommon/Src/XFStructs.cpp b/Source/Core/VideoCommon/Src/XFStructs.cpp
index b75e7188af..cd97271526 100644
--- a/Source/Core/VideoCommon/Src/XFStructs.cpp
+++ b/Source/Core/VideoCommon/Src/XFStructs.cpp
@@ -288,13 +288,15 @@ void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData)
// TODO - verify that it is correct. Seems to work, though.
void LoadIndexedXF(u32 val, int refarray)
{
- int index = val >> 16;
- int address = val & 0xFFF; // check mask
- int size = ((val >> 12) & 0xF) + 1;
- //load stuff from array to address in xf mem
+ int index = val >> 16;
+ int address = val & 0xFFF; // check mask
+ int size = ((val >> 12) & 0xF) + 1;
+ //load stuff from array to address in xf mem
- XFMemWritten(size, address);
-
- for (int i = 0; i < size; i++)
- xfmem[address + i] = Memory::Read_U32(arraybases[refarray] + arraystrides[refarray] * index + i * 4);
+ u32* newData = (u32*)Memory::GetPointer(arraybases[refarray] + arraystrides[refarray] * index);
+ if (memcmp(xfmem + address, newData, size * 4))
+ {
+ XFMemWritten(size, address);
+ memcpy_gc(xfmem + address, newData, size * 4);
+ }
}