From fcfbe8cabb5f5b303516aed897b77c7f999e8597 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 3 Jun 2017 15:03:59 -0700 Subject: [PATCH] GE Debugger: Fix matrix dumping. Record wasn't seeing the commands to dump them. --- GPU/Debugger/Record.cpp | 4 +--- GPU/GPUCommon.cpp | 13 +++++++------ GPU/GPUCommon.h | 1 + 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/GPU/Debugger/Record.cpp b/GPU/Debugger/Record.cpp index 993a6a4b03..35a42efac0 100644 --- a/GPU/Debugger/Record.cpp +++ b/GPU/Debugger/Record.cpp @@ -644,9 +644,7 @@ static void ExecuteFree() { } static bool ExecuteCommands() { - //for (const Command &cmd : commands) { - for (size_t i = 0; i < commands.size(); ++i) { - const Command &cmd = commands[i]; + for (const Command &cmd : commands) { switch (cmd.type) { case CommandType::INIT: ExecuteInit(cmd.ptr, cmd.sz); diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 8cf869e62f..0737a73ba1 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -903,7 +903,8 @@ bool GPUCommon::InterpretList(DisplayList &list) { gpuState = list.pc == list.stall ? GPUSTATE_STALL : GPUSTATE_RUNNING; guard.unlock(); - const bool useDebugger = host->GPUDebuggingActive() || GPURecord::IsActive(); + debugRecording_ = GPURecord::IsActive(); + const bool useDebugger = host->GPUDebuggingActive() || debugRecording_; const bool useFastRunLoop = !dumpThisFrame_ && !useDebugger; while (gpuState == GPUSTATE_RUNNING) { { @@ -1582,7 +1583,7 @@ void GPUCommon::Execute_WorldMtxNum(u32 op, u32 diff) { } } - const int count = i; + const int count = debugRecording_ ? 0 : i; gstate.worldmtxnum = (GE_CMD_WORLDMATRIXNUMBER << 24) | ((op + count) & 0xF); // Skip over the loaded data, it's done now. @@ -1623,7 +1624,7 @@ void GPUCommon::Execute_ViewMtxNum(u32 op, u32 diff) { } } - const int count = i; + const int count = debugRecording_ ? 0 : i; gstate.viewmtxnum = (GE_CMD_VIEWMATRIXNUMBER << 24) | ((op + count) & 0xF); // Skip over the loaded data, it's done now. @@ -1664,7 +1665,7 @@ void GPUCommon::Execute_ProjMtxNum(u32 op, u32 diff) { } } - const int count = i; + const int count = debugRecording_ ? 0 : i; gstate.projmtxnum = (GE_CMD_PROJMATRIXNUMBER << 24) | ((op + count) & 0x1F); // Skip over the loaded data, it's done now. @@ -1706,7 +1707,7 @@ void GPUCommon::Execute_TgenMtxNum(u32 op, u32 diff) { } } - const int count = i; + const int count = debugRecording_ ? 0 : i; gstate.texmtxnum = (GE_CMD_TGENMATRIXNUMBER << 24) | ((op + count) & 0xF); // Skip over the loaded data, it's done now. @@ -1766,7 +1767,7 @@ void GPUCommon::Execute_BoneMtxNum(u32 op, u32 diff) { } } - const int count = i; + const int count = debugRecording_ ? 0 : i; gstate.boneMatrixNumber = (GE_CMD_BONEMATRIXNUMBER << 24) | ((op + count) & 0x7F); // Skip over the loaded data, it's done now. diff --git a/GPU/GPUCommon.h b/GPU/GPUCommon.h index 95e9d42465..9e1b75f456 100644 --- a/GPU/GPUCommon.h +++ b/GPU/GPUCommon.h @@ -337,6 +337,7 @@ protected: bool dumpNextFrame_; bool dumpThisFrame_; + bool debugRecording_; bool interruptsEnabled_; bool resized_; DrawType lastDraw_;