diff --git a/Core/HLE/ReplaceTables.cpp b/Core/HLE/ReplaceTables.cpp index 8dd52b2dcd..dec3f24636 100644 --- a/Core/HLE/ReplaceTables.cpp +++ b/Core/HLE/ReplaceTables.cpp @@ -152,10 +152,10 @@ static int Replace_memcpy() { } } RETURN(destPtr); -#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(srcPtr, false, bytes, currentMIPS->pc); CBreakPoints::ExecMemCheck(destPtr, true, bytes, currentMIPS->pc); -#endif + return 10 + bytes / 4; // approximation } @@ -194,10 +194,10 @@ static int Replace_memcpy_jak() { currentMIPS->r[MIPS_REG_A2] = 0; currentMIPS->r[MIPS_REG_A3] = destPtr + bytes; RETURN(destPtr); -#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(srcPtr, false, bytes, currentMIPS->pc); CBreakPoints::ExecMemCheck(destPtr, true, bytes, currentMIPS->pc); -#endif + return 5 + bytes * 8 + 2; // approximation. This is a slow memcpy - a byte copy loop.. } @@ -222,10 +222,10 @@ static int Replace_memcpy16() { } } RETURN(destPtr); -#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(srcPtr, false, bytes, currentMIPS->pc); CBreakPoints::ExecMemCheck(destPtr, true, bytes, currentMIPS->pc); -#endif + return 10 + bytes / 4; // approximation } @@ -260,10 +260,10 @@ static int Replace_memcpy_swizzled() { } RETURN(0); -#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(srcPtr, false, pitch * h, currentMIPS->pc); CBreakPoints::ExecMemCheck(destPtr, true, pitch * h, currentMIPS->pc); -#endif + return 10 + (pitch * h) / 4; // approximation } @@ -288,10 +288,10 @@ static int Replace_memmove() { } } RETURN(destPtr); -#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(srcPtr, false, bytes, currentMIPS->pc); CBreakPoints::ExecMemCheck(destPtr, true, bytes, currentMIPS->pc); -#endif + return 10 + bytes / 4; // approximation } @@ -310,9 +310,9 @@ static int Replace_memset() { } } RETURN(destPtr); -#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(destPtr, true, bytes, currentMIPS->pc); -#endif + return 10 + bytes / 4; // approximation } @@ -342,9 +342,8 @@ static int Replace_memset_jak() { currentMIPS->r[MIPS_REG_A3] = -1; RETURN(destPtr); -#ifndef MOBILE_DEVICE CBreakPoints::ExecMemCheck(destPtr, true, bytes, currentMIPS->pc); -#endif + return 5 + bytes * 6 + 2; // approximation (hm, inspecting the disasm this should be 5 + 6 * bytes + 2, but this is what works..) } @@ -591,11 +590,9 @@ 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]); diff --git a/Core/HLE/sceKernelInterrupt.cpp b/Core/HLE/sceKernelInterrupt.cpp index ba9d7c1588..29c0cc5c7f 100644 --- a/Core/HLE/sceKernelInterrupt.cpp +++ b/Core/HLE/sceKernelInterrupt.cpp @@ -654,10 +654,10 @@ static u32 sceKernelMemcpy(u32 dst, u32 src, u32 size) *dstp++ = *srcp++; } } -#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(src, false, size, currentMIPS->pc); CBreakPoints::ExecMemCheck(dst, true, size, currentMIPS->pc); -#endif + return dst; } diff --git a/Core/HW/MediaEngine.cpp b/Core/HW/MediaEngine.cpp index cf82e94e1c..1da8800240 100644 --- a/Core/HW/MediaEngine.cpp +++ b/Core/HW/MediaEngine.cpp @@ -766,9 +766,8 @@ int MediaEngine::writeVideoImage(u32 bufferPtr, int frameWidth, int videoPixelMo delete [] imgbuf; } -#ifndef MOBILE_DEVICE CBreakPoints::ExecMemCheck(bufferPtr, true, videoImageSize, currentMIPS->pc); -#endif + return videoImageSize; #endif // USE_FFMPEG return 0; @@ -822,9 +821,7 @@ int MediaEngine::writeVideoImageWithRange(u32 bufferPtr, int frameWidth, int vid writeVideoLineRGBA(imgbuf, data, width); data += m_desWidth * sizeof(u32); imgbuf += videoLineSize; -#ifndef MOBILE_DEVICE CBreakPoints::ExecMemCheck(bufferPtr + y * frameWidth * sizeof(u32), true, width * sizeof(u32), currentMIPS->pc); -#endif } break; @@ -834,9 +831,7 @@ int MediaEngine::writeVideoImageWithRange(u32 bufferPtr, int frameWidth, int vid writeVideoLineABGR5650(imgbuf, data, width); data += m_desWidth * sizeof(u16); imgbuf += videoLineSize; -#ifndef MOBILE_DEVICE CBreakPoints::ExecMemCheck(bufferPtr + y * frameWidth * sizeof(u16), true, width * sizeof(u16), currentMIPS->pc); -#endif } break; @@ -846,9 +841,7 @@ int MediaEngine::writeVideoImageWithRange(u32 bufferPtr, int frameWidth, int vid writeVideoLineABGR5551(imgbuf, data, width); data += m_desWidth * sizeof(u16); imgbuf += videoLineSize; -#ifndef MOBILE_DEVICE CBreakPoints::ExecMemCheck(bufferPtr + y * frameWidth * sizeof(u16), true, width * sizeof(u16), currentMIPS->pc); -#endif } break; @@ -858,9 +851,7 @@ int MediaEngine::writeVideoImageWithRange(u32 bufferPtr, int frameWidth, int vid writeVideoLineABGR4444(imgbuf, data, width); data += m_desWidth * sizeof(u16); imgbuf += videoLineSize; -#ifndef MOBILE_DEVICE CBreakPoints::ExecMemCheck(bufferPtr + y * frameWidth * sizeof(u16), true, width * sizeof(u16), currentMIPS->pc); -#endif } break; @@ -954,9 +945,8 @@ int MediaEngine::getAudioSamples(u32 bufferPtr) { if (!m_audioContext->Decode(audioFrame, frameSize, buffer, &outbytes)) { ERROR_LOG(ME, "Audio (%s) decode failed during video playback", GetCodecName(m_audioType)); } -#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(bufferPtr, true, outbytes, currentMIPS->pc); -#endif } return 0x2000; diff --git a/Core/MemMap.cpp b/Core/MemMap.cpp index eb5d49ab14..8282aac3db 100644 --- a/Core/MemMap.cpp +++ b/Core/MemMap.cpp @@ -446,9 +446,8 @@ void Memset(const u32 _Address, const u8 _iValue, const u32 _iLength) { for (size_t i = 0; i < _iLength; i++) Write_U8(_iValue, (u32)(_Address + i)); } -#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(_Address, true, _iLength, currentMIPS->pc); -#endif } } // namespace diff --git a/Core/MemMapHelpers.h b/Core/MemMapHelpers.h index 1fe06d3ae1..9431db5c0d 100644 --- a/Core/MemMapHelpers.h +++ b/Core/MemMapHelpers.h @@ -33,9 +33,7 @@ inline void Memcpy(const u32 to_address, const void *from_data, const u32 len) u8 *to = GetPointer(to_address); if (to) { memcpy(to, from_data, len); -#ifndef MOBILE_DEVICE CBreakPoints::ExecMemCheck(to_address, true, len, currentMIPS->pc); -#endif } // if not, GetPointer will log. } @@ -45,9 +43,7 @@ inline void Memcpy(void *to_data, const u32 from_address, const u32 len) const u8 *from = GetPointer(from_address); if (from) { memcpy(to_data, from, len); -#ifndef MOBILE_DEVICE CBreakPoints::ExecMemCheck(from_address, false, len, currentMIPS->pc); -#endif } // if not, GetPointer will log. } @@ -55,9 +51,7 @@ inline void Memcpy(void *to_data, const u32 from_address, const u32 len) inline void Memcpy(const u32 to_address, const u32 from_address, const u32 len) { Memcpy(GetPointer(to_address), from_address, len); -#ifndef MOBILE_DEVICE CBreakPoints::ExecMemCheck(to_address, true, len, currentMIPS->pc); -#endif } void Memset(const u32 _Address, const u8 _Data, const u32 _iLength); diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 1950eab058..dd4c4ad0a0 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -2576,10 +2576,8 @@ void GPUCommon::DoBlockTransfer(u32 skipDrawReason) { framebufferManager_->NotifyBlockTransferAfter(dstBasePtr, dstStride, dstX, dstY, srcBasePtr, srcStride, srcX, srcY, width, height, bpp, skipDrawReason); } -#ifndef MOBILE_DEVICE CBreakPoints::ExecMemCheck(srcBasePtr + (srcY * srcStride + srcX) * bpp, false, height * srcStride * bpp, currentMIPS->pc); CBreakPoints::ExecMemCheck(dstBasePtr + (dstY * dstStride + dstX) * bpp, true, height * dstStride * bpp, currentMIPS->pc); -#endif // TODO: Correct timing appears to be 1.9, but erring a bit low since some of our other timing is inaccurate. cyclesExecuted += ((height * width * bpp) * 16) / 10; diff --git a/GPU/Null/NullGpu.cpp b/GPU/Null/NullGpu.cpp index a240840496..29a50f2054 100644 --- a/GPU/Null/NullGpu.cpp +++ b/GPU/Null/NullGpu.cpp @@ -344,10 +344,8 @@ void NullGPU::ExecuteOp(u32 op, u32 diff) { memcpy(dst, src, width * bpp); } -#ifndef MOBILE_DEVICE CBreakPoints::ExecMemCheck(srcBasePtr + (srcY * srcStride + srcX) * bpp, false, height * srcStride * bpp, currentMIPS->pc); CBreakPoints::ExecMemCheck(dstBasePtr + (srcY * dstStride + srcX) * bpp, true, height * dstStride * bpp, currentMIPS->pc); -#endif // TODO: Correct timing appears to be 1.9, but erring a bit low since some of our other timing is inaccurate. cyclesExecuted += ((height * width * bpp) * 16) / 10; diff --git a/GPU/Software/SoftGpu.cpp b/GPU/Software/SoftGpu.cpp index b24d286940..9432ba97ef 100644 --- a/GPU/Software/SoftGpu.cpp +++ b/GPU/Software/SoftGpu.cpp @@ -648,10 +648,8 @@ void SoftGPU::ExecuteOp(u32 op, u32 diff) { memcpy(dst, src, width * bpp); } -#ifndef MOBILE_DEVICE CBreakPoints::ExecMemCheck(srcBasePtr + (srcY * srcStride + srcX) * bpp, false, height * srcStride * bpp, currentMIPS->pc); CBreakPoints::ExecMemCheck(dstBasePtr + (srcY * dstStride + srcX) * bpp, true, height * dstStride * bpp, currentMIPS->pc); -#endif // TODO: Correct timing appears to be 1.9, but erring a bit low since some of our other timing is inaccurate. cyclesExecuted += ((height * width * bpp) * 16) / 10;