From 1fbf685504dc57bd32d800b60b155218637e47ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 4 Feb 2024 11:26:20 +0100 Subject: [PATCH] Avoid vertically merging the two main framebuffers, even if FramebufferAllowLargeVerticalOffset is on. --- GPU/Common/FramebufferManagerCommon.cpp | 7 +++++-- UI/EmuScreen.cpp | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/GPU/Common/FramebufferManagerCommon.cpp b/GPU/Common/FramebufferManagerCommon.cpp index f705277f58..e5fb5d0df9 100644 --- a/GPU/Common/FramebufferManagerCommon.cpp +++ b/GPU/Common/FramebufferManagerCommon.cpp @@ -425,7 +425,8 @@ VirtualFramebuffer *FramebufferManagerCommon::DoSetRenderFrameBuffer(Framebuffer vfb->height = drawing_height; } break; - } else if (!PSP_CoreParameter().compat.flags().DisallowFramebufferAtOffset && v->fb_stride == params.fb_stride && v->fb_format == params.fb_format && !PSP_CoreParameter().compat.flags().SplitFramebufferMargin) { + } else if (!PSP_CoreParameter().compat.flags().DisallowFramebufferAtOffset && !PSP_CoreParameter().compat.flags().SplitFramebufferMargin && + v->fb_stride == params.fb_stride && v->fb_format == params.fb_format) { u32 v_fb_first_line_end_ptr = v->fb_address + v->fb_stride * bpp; u32 v_fb_end_ptr = v->fb_address + v->fb_stride * v->height * bpp; @@ -441,7 +442,9 @@ VirtualFramebuffer *FramebufferManagerCommon::DoSetRenderFrameBuffer(Framebuffer drawing_width += x_offset; break; } - } else if (PSP_CoreParameter().compat.flags().FramebufferAllowLargeVerticalOffset && params.fb_address > v->fb_address && v->fb_stride > 0 && (params.fb_address - v->fb_address) % v->FbStrideInBytes() == 0) { + } else if (PSP_CoreParameter().compat.flags().FramebufferAllowLargeVerticalOffset && + params.fb_address > v->fb_address && v->fb_stride > 0 && (params.fb_address - v->fb_address) % v->FbStrideInBytes() == 0 && + params.fb_address != 0x04088000 && v->fb_address != 0x04000000) { // Heuristic to avoid merging the main framebuffers. int y_offset = (params.fb_address - v->fb_address) / v->FbStrideInBytes(); if (y_offset <= v->bufferHeight) { // note: v->height is misdetected as 256 instead of 272 here in tokimeki. Note that 272 is just the height of the upper part, it's supersampling vertically. vfb = v; diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 24d517d09c..03fdf2de55 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1460,7 +1460,6 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) { Achievements::FrameUpdate(); } - _dbg_assert_(gpu); if (gpu && gpu->PresentedThisFrame()) { framebufferBound = true; }