Invalidate GPU cache in sceDmacMemcpy().

This commit is contained in:
Unknown W. Brackets 2013-06-08 03:50:12 -07:00
parent 30536fa7cf
commit f628b4319f

View File

@ -16,13 +16,23 @@
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "Globals.h"
#include "HLE.h"
#include "Core/HLE/HLE.h"
#include "GPU/GPUInterface.h"
#include "GPU/GPUState.h"
u32 sceDmacMemcpy(u32 dst, u32 src, u32 size)
{
if (!Memory::IsValidAddress(dst) || !Memory::IsValidAddress(src))
{
ERROR_LOG(HLE, "sceDmacMemcpy(dest=%08x, src=%08x, size=%i): invalid address", dst, src, size);
return 0;
}
DEBUG_LOG(HLE, "sceDmacMemcpy(dest=%08x, src=%08x, size=%i)", dst, src, size);
// TODO: check the addresses.
Memory::Memcpy(dst, Memory::GetPointer(src), size);
gpu->InvalidateCache(dst, size, GPU_INVALIDATE_HINT);
return 0;
}