UpdateMemory() now returns whether to skip the cpy.

This way it can do it itself as necessary in the right order.
This commit is contained in:
Unknown W. Brackets committed 2014-05-25 21:48:41 -07:00
1 parent 8228bee6bf
commit 8275f613ce
12 files changed
+52 -34

No files matched your search

+6 -3
View File
@@ -559,11 +559,14 @@ u32 sceKernelMemset(u32 addr, u32 fillc, u32 n)
u32 sceKernelMemcpy(u32 dst, u32 src, u32 size)
{
DEBUG_LOG(SCEKERNEL, "sceKernelMemcpy(dest=%08x, src=%08x, size=%i)", dst, src, size);
// Hm, sceDmacMemcpy seems to be the popular one for this. Ignoring for now.
// gpu->UpdateMemory(dst, src, size);
bool skip = false;
if (Memory::IsVRAMAddress(src) || Memory::IsVRAMAddress(dst)) {
skip = gpu->UpdateMemory(dst, src, size);
}
// Technically should crash if these are invalid and size > 0...
if (Memory::IsValidAddress(dst) && Memory::IsValidAddress(src) && Memory::IsValidAddress(dst + size - 1) && Memory::IsValidAddress(src + size - 1))
if (!skip && Memory::IsValidAddress(dst) && Memory::IsValidAddress(src) && Memory::IsValidAddress(dst + size - 1) && Memory::IsValidAddress(src + size - 1))
{
u8 *dstp = Memory::GetPointer(dst);
u8 *srcp = Memory::GetPointer(src);