From 8b99c9f9d9e81609fc4cb693b07fb0365b28d8d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 30 Jan 2024 11:14:38 +0100 Subject: [PATCH] GE dump playback: Don't flip unless DISPLAY is the last command. This messes up the frame structure. --- GPU/Debugger/Playback.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/GPU/Debugger/Playback.cpp b/GPU/Debugger/Playback.cpp index 413fd8de76..f66a9c3e92 100644 --- a/GPU/Debugger/Playback.cpp +++ b/GPU/Debugger/Playback.cpp @@ -308,7 +308,7 @@ private: void Memcpy(u32 ptr, u32 sz); void Texture(int level, u32 ptr, u32 sz); void Framebuf(int level, u32 ptr, u32 sz); - void Display(u32 ptr, u32 sz); + void Display(u32 ptr, u32 sz, bool allowFlip); void EdramTrans(u32 ptr, u32 sz); u32 execMemcpyDest = 0; @@ -616,7 +616,7 @@ void DumpExecute::Framebuf(int level, u32 ptr, u32 sz) { } } -void DumpExecute::Display(u32 ptr, u32 sz) { +void DumpExecute::Display(u32 ptr, u32 sz, bool allowFlip) { struct DisplayBufData { PSPPointer topaddr; int linesize, pixelFormat; @@ -628,7 +628,9 @@ void DumpExecute::Display(u32 ptr, u32 sz) { SyncStall(); __DisplaySetFramebuf(disp->topaddr.ptr, disp->linesize, disp->pixelFormat, 1); - __DisplaySetFramebuf(disp->topaddr.ptr, disp->linesize, disp->pixelFormat, 0); + if (allowFlip) { + __DisplaySetFramebuf(disp->topaddr.ptr, disp->linesize, disp->pixelFormat, 0); + } } void DumpExecute::EdramTrans(u32 ptr, u32 sz) { @@ -657,7 +659,8 @@ bool DumpExecute::Run() { if (gpu) gpu->SetAddrTranslation(0x400); - for (const Command &cmd : commands_) { + for (size_t i = 0; i < commands_.size(); i++) { + const Command &cmd = commands_[i]; switch (cmd.type) { case CommandType::INIT: Init(cmd.ptr, cmd.sz); @@ -726,7 +729,7 @@ bool DumpExecute::Run() { break; case CommandType::DISPLAY: - Display(cmd.ptr, cmd.sz); + Display(cmd.ptr, cmd.sz, i == commands_.size() - 1); break; default: