From dd4b19100321fb7251273bbcc050be0f3f540774 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 10 Jun 2014 22:56:45 -0700 Subject: [PATCH] Correct Gods Eater Burst tex download size. Probably takes care of #6289, although it doesn't crash for me. --- Core/HLE/ReplaceTables.cpp | 4 ++-- GPU/GLES/Framebuffer.cpp | 4 ++++ GPU/GLES/GLES_GPU.cpp | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Core/HLE/ReplaceTables.cpp b/Core/HLE/ReplaceTables.cpp index 5d9370b127..1e2f72b7eb 100644 --- a/Core/HLE/ReplaceTables.cpp +++ b/Core/HLE/ReplaceTables.cpp @@ -476,8 +476,8 @@ static int Hook_godseaterburst_blit_texture() { const u32 fb_info = Memory::Read_U32(fb_infoaddr); const u32 fb_address = Memory::Read_U32(fb_info); if (Memory::IsVRAMAddress(fb_address)) { - gpu->PerformMemoryDownload(fb_address, 0x00048000); - CBreakPoints::ExecMemCheck(fb_address, true, 0x00048000, currentMIPS->pc); + gpu->PerformMemoryDownload(fb_address, 0x00044000); + CBreakPoints::ExecMemCheck(fb_address, true, 0x00044000, currentMIPS->pc); } return 0; } diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index a89f4b6896..2944869014 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -2075,6 +2075,10 @@ bool FramebufferManager::NotifyFramebufferCopy(u32 src, u32 dst, int size, bool // Maybe at least if x offset is 0, in case a game manually copies or memsets by stride. const u32 srcBpp = srcBuffer->format == GE_FORMAT_8888 ? 4 : 2; int h = size / (srcBuffer->fb_stride * srcBpp); + if (h > srcBuffer->height) { + WARN_LOG_REPORT_ONCE(btdcpybig, G3D, "Memcpy fbo download too large at %08x size=%08x height=%d", src, size, srcBuffer->height); + h = srcBuffer->height; + } if (h > 0) { ReadFramebufferToMemory(srcBuffer, true, 0, 0, srcBuffer->width, h); } diff --git a/GPU/GLES/GLES_GPU.cpp b/GPU/GLES/GLES_GPU.cpp index c251dba9b5..f53ddef8ef 100644 --- a/GPU/GLES/GLES_GPU.cpp +++ b/GPU/GLES/GLES_GPU.cpp @@ -2069,7 +2069,7 @@ bool GLES_GPU::PerformMemoryDownload(u32 dest, int size) { } bool GLES_GPU::PerformMemoryUpload(u32 dest, int size) { - // Cheat a bit to force a download of the framebuffer. + // Cheat a bit to force an upload of the framebuffer. // VRAM + 0x00400000 is simply a VRAM mirror. return gpu->PerformMemoryCopy(dest, dest ^ 0x00400000, size); }