From 8f26e128bffed08444888733d57168d83d7a538e Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Fri, 4 Jan 2013 00:32:18 +0100 Subject: [PATCH] Ignore bogus invalidate cache calls, fixes slowdown in some games --- Core/HLE/sceKernel.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Core/HLE/sceKernel.cpp b/Core/HLE/sceKernel.cpp index e21876fd41..7aab757c54 100644 --- a/Core/HLE/sceKernel.cpp +++ b/Core/HLE/sceKernel.cpp @@ -241,24 +241,30 @@ void sceKernelGetGPI() // textures, and in the future display lists, in some cases though. int sceKernelDcacheInvalidateRange(u32 addr, int size) { - gpu->InvalidateCache(addr, size); + if (size > 0 && addr != 0) { + gpu->InvalidateCache(addr, size); + } return 0; } int sceKernelDcacheWritebackAll() { - // Some games seem to use this a lot, it doesn't make sense + // Some games seem to use this a lot, it doesn't make sense // to zap the whole texture cache. // gpu->InvalidateCache(0, -1); return 0; } int sceKernelDcacheWritebackRange(u32 addr, int size) { - gpu->InvalidateCache(addr, size); + if (size > 0 && addr != 0) { + gpu->InvalidateCache(addr, size); + } return 0; } int sceKernelDcacheWritebackInvalidateRange(u32 addr, int size) { - gpu->InvalidateCache(addr, size); + if (size > 0 && addr != 0) { + gpu->InvalidateCache(addr, size); + } return 0; } int sceKernelDcacheWritebackInvalidateAll()