diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index 665e37edd6..9daae77299 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -22,6 +22,7 @@ #include "native/thread/threadutil.h" #include "Core/Core.h" #include "Core/Config.h" +#include "Core/Debugger/Breakpoints.h" #include "Core/MemMap.h" #include "Core/System.h" #include "Core/Host.h" @@ -725,6 +726,7 @@ bool __IoRead(int &result, int id, u32 data_addr, int size) { result = ERROR_KERNEL_BAD_FILE_DESCRIPTOR; return true; } else if (Memory::IsValidAddress(data_addr)) { + CBreakPoints::ExecMemCheck(data_addr, true, size, currentMIPS->pc); u8 *data = (u8*) Memory::GetPointer(data_addr); if (f->npdrm) { result = npdrmRead(f, data, size); @@ -855,6 +857,8 @@ bool __IoWrite(int &result, int id, u32 data_addr, int size) { return true; } + CBreakPoints::ExecMemCheck(data_addr, false, size, currentMIPS->pc); + bool useThread = __KernelIsDispatchEnabled() && ioManagerThreadEnabled && size > IO_THREAD_MIN_DATA_SIZE; if (useThread) { // If there's a pending operation on this file, wait for it to finish and don't overwrite it. diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index 981db87c99..75c6ec397a 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -245,8 +245,8 @@ void TextureCache::AttachFramebuffer(TexCacheEntry *entry, u32 address, VirtualF if (!entry->framebuffer || entry->invalidHint == -1) { if (entry->format != framebuffer->format) { WARN_LOG_REPORT_ONCE(diffFormat1, G3D, "Render to texture with different formats %d != %d", entry->format, framebuffer->format); - // If it already has one, let's hope that one is correct. - AttachFramebufferInvalid(entry, framebuffer, fbInfo); + // Let's avoid rendering when we know the format is wrong. May be a video/etc. updating memory. + DetachFramebuffer(entry, address, framebuffer); } else { AttachFramebufferValid(entry, framebuffer, fbInfo); } @@ -313,10 +313,15 @@ void TextureCache::NotifyFramebuffer(u32 address, VirtualFramebuffer *framebuffe // Must be in VRAM so | 0x04000000 it is. const u32 addr = (address | 0x04000000) & 0x0FFFFFFF; + const u32 bpp = framebuffer->format == GE_FORMAT_8888 ? 4 : 2; const u64 cacheKey = (u64)addr << 32; // If it has a clut, those are the low 32 bits, so it'll be inside this range. // Also, if it's a subsample of the buffer, it'll also be within the FBO. - const u64 cacheKeyEnd = cacheKey + ((u64)(framebuffer->fb_stride * MAX_SUBAREA_Y_OFFSET) << 32); + u64 cacheKeyEnd = cacheKey + ((u64)(framebuffer->fb_stride * MAX_SUBAREA_Y_OFFSET * bpp) << 32); + if (addr >= 0x04000000 && addr < 0x04110000) { + // This range usually is dominated by framebuffers. Assume the entire height is up for grabs. + cacheKeyEnd = cacheKey + ((u64)(framebuffer->fb_stride * framebuffer->height * bpp) << 32); + } switch (msg) { case NOTIFY_FB_CREATED: