mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-25 17:19:42 +00:00
Flush icache before memcpys.
Maybe there's a way to optimize this better...
This commit is contained in:
parent
d2e7dfcc51
commit
2910f7e7a2
@ -107,6 +107,9 @@ static int Replace_memcpy() {
|
||||
u32 srcPtr = PARAM(1);
|
||||
u32 bytes = PARAM(2);
|
||||
bool skip = false;
|
||||
|
||||
// Some games use memcpy on executable code. We need to flush emuhack ops.
|
||||
currentMIPS->InvalidateICache(srcPtr, bytes);
|
||||
if (Memory::IsVRAMAddress(destPtr) || Memory::IsVRAMAddress(srcPtr)) {
|
||||
skip = gpu->PerformMemoryCopy(destPtr, srcPtr, bytes);
|
||||
}
|
||||
@ -140,6 +143,9 @@ static int Replace_memcpy16() {
|
||||
u32 srcPtr = PARAM(1);
|
||||
u32 bytes = PARAM(2) * 16;
|
||||
bool skip = false;
|
||||
|
||||
// Some games use memcpy on executable code. We need to flush emuhack ops.
|
||||
currentMIPS->InvalidateICache(srcPtr, bytes);
|
||||
if (Memory::IsVRAMAddress(destPtr) || Memory::IsVRAMAddress(srcPtr)) {
|
||||
skip = gpu->PerformMemoryCopy(destPtr, srcPtr, bytes);
|
||||
}
|
||||
@ -195,6 +201,9 @@ static int Replace_memmove() {
|
||||
u32 srcPtr = PARAM(1);
|
||||
u32 bytes = PARAM(2);
|
||||
bool skip = false;
|
||||
|
||||
// Some games use memcpy on executable code. We need to flush emuhack ops.
|
||||
currentMIPS->InvalidateICache(srcPtr, bytes);
|
||||
if (Memory::IsVRAMAddress(destPtr) || Memory::IsVRAMAddress(srcPtr)) {
|
||||
skip = gpu->PerformMemoryCopy(destPtr, srcPtr, bytes);
|
||||
}
|
||||
|
@ -623,6 +623,9 @@ u32 sceKernelMemcpy(u32 dst, u32 src, u32 size)
|
||||
{
|
||||
DEBUG_LOG(SCEKERNEL, "sceKernelMemcpy(dest=%08x, src=%08x, size=%i)", dst, src, size);
|
||||
|
||||
// Some games copy from executable code. We need to flush emuhack ops.
|
||||
currentMIPS->InvalidateICache(src, size);
|
||||
|
||||
bool skip = false;
|
||||
if (Memory::IsVRAMAddress(src) || Memory::IsVRAMAddress(dst)) {
|
||||
skip = gpu->PerformMemoryCopy(dst, src, size);
|
||||
|
Loading…
Reference in New Issue
Block a user