From 1815cf065eeb61851eef8871030cb7f35ef6b9b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 31 Oct 2026 16:53:49 +0100 Subject: [PATCH] Debugger: A screenshot of a display that's off is black gpu.buffer.screenshot failed with "Could not download output" while a game had the display off (sceDisplaySetFrameBuf with 0) and there was no backbuffer to read instead, as in headless Vulkan. Pangya: Fantasy Golf does that around its loading screens, which ended the game scripts waiting for its next screen. Co-Authored-By: Claude Opus 5.5 --- Core/Debugger/WebSocket/GPUBufferSubscriber.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Core/Debugger/WebSocket/GPUBufferSubscriber.cpp b/Core/Debugger/WebSocket/GPUBufferSubscriber.cpp index 637b89fcc2..09d4e3a743 100644 --- a/Core/Debugger/WebSocket/GPUBufferSubscriber.cpp +++ b/Core/Debugger/WebSocket/GPUBufferSubscriber.cpp @@ -22,6 +22,8 @@ #include "Common/StringUtils.h" #include "Core/Debugger/WebSocket/GPUBufferSubscriber.h" #include "Core/Debugger/WebSocket/WebSocketUtils.h" +#include "Core/HLE/sceDisplay.h" +#include "Core/MemMap.h" #include "Core/MIPS/MIPSDebugInterface.h" #include "Core/Screenshot.h" #include "GPU/Debugger/Stepping.h" @@ -255,7 +257,7 @@ static void GenericStreamBuffer(DebuggerRequest &req, std::function displayAddr; + __DisplayGetFramebuf(&displayAddr, nullptr, nullptr, 0); + if (!Memory::IsValidAddress(displayAddr.ptr)) { + // The game has turned the display off (sceDisplaySetFrameBuf with 0), so the screen is black. + static GPUDebugBuffer black; + black.Allocate(480, 272, GE_FORMAT_8888); + memset(black.GetData(), 0, 480 * 272 * 4); + buf = &black; + return true; + } *isFramebuffer = true; return GPUStepping::GPU_GetCurrentFramebuffer(buf, GPU_DBG_FRAMEBUF_DISPLAY); });