From b1f8830bd8392a900644ccbb348d524ea47331e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 17 Apr 2023 12:24:31 +0200 Subject: [PATCH] Don't try to present from little temp framebuffers used by Godfather to draw text. The framebuffer does contain the top of the video frame at the present time though, so things have partially gone well. However the rest of the frame lies after it in VRAM. What we probably technically should do when we see this is to assemble an image from both the framebuffer we find and VRAM contents exceeding the range of that image, but seems kinda impractical. This works, but there seems to be some other issue with how the text is rendered or copied. Could be a color precision issue confusing the game I suppose. --- Core/HLE/sceKernelModule.cpp | 2 +- GPU/Common/FramebufferManagerCommon.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Core/HLE/sceKernelModule.cpp b/Core/HLE/sceKernelModule.cpp index 72b63b2733..5bcc701393 100644 --- a/Core/HLE/sceKernelModule.cpp +++ b/Core/HLE/sceKernelModule.cpp @@ -1267,7 +1267,7 @@ static PSPModule *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 load // Copy the name to ensure it's null terminated. char name[32]{}; strncpy(name, head->modname, ARRAY_SIZE(head->modname)); - SaveDecryptedEbootToStorageMedia(ptr, elfSize, name); + SaveDecryptedEbootToStorageMedia(ptr, (u32)elfSize, name); } } } diff --git a/GPU/Common/FramebufferManagerCommon.cpp b/GPU/Common/FramebufferManagerCommon.cpp index e086e56ef5..6f4687efdd 100644 --- a/GPU/Common/FramebufferManagerCommon.cpp +++ b/GPU/Common/FramebufferManagerCommon.cpp @@ -1525,6 +1525,11 @@ void FramebufferManagerCommon::CopyDisplayToOutput(bool reallyDirty) { } } + // Reject too-tiny framebuffers to display (Godfather, see issue #16915). + if (vfb && vfb->height < 64) { + vfb = nullptr; + } + if (!vfb) { if (Memory::IsValidAddress(fbaddr)) { // The game is displaying something directly from RAM. In GTA, it's decoded video.