From e45b04a699c8c2c11c7752bacab0e4bdee53cbdd Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 3 Jun 2017 15:02:20 -0700 Subject: [PATCH] GE Debugger: Clear after replay finished. --- GPU/Debugger/Record.cpp | 15 ++++++++++++--- GPU/Debugger/Record.h | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/GPU/Debugger/Record.cpp b/GPU/Debugger/Record.cpp index 8584fff906..993a6a4b03 100644 --- a/GPU/Debugger/Record.cpp +++ b/GPU/Debugger/Record.cpp @@ -366,6 +366,10 @@ bool IsActive() { return active; } +void Activate() { + nextFrame = true; +} + void NotifyCommand(u32 pc) { if (!active) { return; @@ -634,6 +638,9 @@ static void ExecuteFree() { for (int level = 0; level < 8; ++level) { FreePSPPointer(execTexturePtrs[level]); } + + commands.clear(); + pushbuf.clear(); } static bool ExecuteCommands() { @@ -698,8 +705,6 @@ static bool ExecuteCommands() { } } - ExecuteFree(); - return true; } @@ -730,6 +735,7 @@ bool RunMountedReplay() { read += pspFileSystem.ReadFile(fp, (u8 *)&commands[i].ptr, sizeof(commands[i].ptr)); if (read != sizeof(commands[i].type) + sizeof(commands[i].sz) + sizeof(commands[i].ptr)) { ERROR_LOG(SYSTEM, "Truncated GE dump"); + ExecuteFree(); return false; } } @@ -737,12 +743,15 @@ bool RunMountedReplay() { pushbuf.resize(bufsz); if (pspFileSystem.ReadFile(fp, pushbuf.data(), bufsz) != bufsz) { ERROR_LOG(SYSTEM, "Truncated GE dump"); + ExecuteFree(); return false; } pspFileSystem.CloseFile(fp); - return ExecuteCommands(); + bool success = ExecuteCommands(); + ExecuteFree(); + return success; } }; diff --git a/GPU/Debugger/Record.h b/GPU/Debugger/Record.h index 81a6c1bb8e..f3ba37a605 100644 --- a/GPU/Debugger/Record.h +++ b/GPU/Debugger/Record.h @@ -22,6 +22,7 @@ namespace GPURecord { bool IsActive(); +void Activate(); void NotifyCommand(u32 pc); void NotifyMemcpy(u32 dest, u32 src, u32 sz);