diff --git a/Core/HLE/ReplaceTables.cpp b/Core/HLE/ReplaceTables.cpp index c042f46e59..efccd43dee 100644 --- a/Core/HLE/ReplaceTables.cpp +++ b/Core/HLE/ReplaceTables.cpp @@ -20,6 +20,7 @@ #include "base/basictypes.h" #include "base/logging.h" +#include "Core/Debugger/Breakpoints.h" #include "Core/MemMap.h" #include "Core/MIPS/JitCommon/JitCommon.h" #include "Core/MIPS/MIPSAnalyst.h" @@ -27,6 +28,7 @@ #include "Core/HLE/FunctionWrappers.h" #include "GPU/Math3D.h" +#include "GPU/GPUInterface.h" #if defined(_M_IX86) || defined(_M_X64) #include @@ -108,6 +110,13 @@ static int Replace_memcpy() { memmove(dst, src, bytes); } RETURN(destPtr); +#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(srcPtr, false, bytes, currentMIPS->pc); + CBreakPoints::ExecMemCheck(destPtr, true, bytes, currentMIPS->pc); +#endif + if (Memory::IsVRAMAddress(destPtr) || Memory::IsVRAMAddress(srcPtr)) { + gpu->UpdateMemory(destPtr, srcPtr, bytes); + } return 10 + bytes / 4; // approximation } @@ -121,6 +130,13 @@ static int Replace_memcpy16() { memmove(dst, src, bytes); } RETURN(destPtr); +#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(srcPtr, false, bytes, currentMIPS->pc); + CBreakPoints::ExecMemCheck(destPtr, true, bytes, currentMIPS->pc); +#endif + if (Memory::IsVRAMAddress(destPtr) || Memory::IsVRAMAddress(srcPtr)) { + gpu->UpdateMemory(destPtr, srcPtr, bytes); + } return 10 + bytes / 4; // approximation } @@ -134,6 +150,13 @@ static int Replace_memmove() { memmove(dst, src, bytes); } RETURN(destPtr); +#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(srcPtr, false, bytes, currentMIPS->pc); + CBreakPoints::ExecMemCheck(destPtr, true, bytes, currentMIPS->pc); +#endif + if (Memory::IsVRAMAddress(destPtr) || Memory::IsVRAMAddress(srcPtr)) { + gpu->UpdateMemory(destPtr, srcPtr, bytes); + } return 10 + bytes / 4; // approximation } @@ -144,6 +167,12 @@ static int Replace_memset() { u32 bytes = PARAM(2); memset(dst, value, bytes); RETURN(destPtr); +#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(destPtr, true, bytes, currentMIPS->pc); +#endif + if (Memory::IsVRAMAddress(destPtr) || Memory::IsVRAMAddress(destPtr)) { + gpu->UpdateMemory(destPtr, destPtr, bytes); + } return 10 + bytes / 4; // approximation } @@ -355,6 +384,12 @@ static int Replace_dl_write_matrix() { #endif } +#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(PARAM(2), false, count * sizeof(float), currentMIPS->pc); + CBreakPoints::ExecMemCheck(PARAM(0) + 2 * sizeof(u32), true, sizeof(u32), currentMIPS->pc); + CBreakPoints::ExecMemCheck(dlStruct[2], true, (count + 1) * sizeof(u32), currentMIPS->pc); +#endif + dlStruct[2] += (1 + count) * 4; RETURN(dlStruct[2]); return 60;