diff --git a/GPU/Debugger/Debugger.cpp b/GPU/Debugger/Debugger.cpp index 7745a9d93a..3801b03b82 100644 --- a/GPU/Debugger/Debugger.cpp +++ b/GPU/Debugger/Debugger.cpp @@ -38,6 +38,7 @@ const char *BreakNextToString(BreakNext next) { case BreakNext::CURVE: return "CURVE"; case BreakNext::BLOCK_TRANSFER: return "BLOCK_TRANSFER"; case BreakNext::COUNT: return "COUNT"; + case BreakNext::DEBUG_RUN: return "DEBUG_RUN"; default: return "N/A"; } } diff --git a/GPU/Debugger/Debugger.h b/GPU/Debugger/Debugger.h index 4fa0c61ddb..360a9e729d 100644 --- a/GPU/Debugger/Debugger.h +++ b/GPU/Debugger/Debugger.h @@ -35,6 +35,7 @@ enum class BreakNext { PRIM, CURVE, BLOCK_TRANSFER, + DEBUG_RUN, // This is just running as normal, but with debug instrumentation. COUNT, }; diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 0cc1caca0d..6bde1ff615 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -2074,9 +2074,10 @@ GPUDebug::NotifyResult GPUCommon::NotifyCommand(u32 pc, GPUBreakpoints *breakpoi bool isPrim = false; - bool process = true; + bool process = true; // Process is only for the restrictPrimRanges functionality if (cmd == GE_CMD_PRIM || cmd == GE_CMD_BEZIER || cmd == GE_CMD_SPLINE || cmd == GE_CMD_VAP || cmd == GE_CMD_TRANSFERSTART) { // VAP is immediate mode prims. isPrim = true; + primsThisFrame_++; // TODO: Should restricted prim ranges also avoid breakpoints? @@ -2103,7 +2104,9 @@ GPUDebug::NotifyResult GPUCommon::NotifyCommand(u32 pc, GPUBreakpoints *breakpoi if (debugBreak && pc == skipPcOnce_) { INFO_LOG(Log::GeDebugger, "Skipping GE break at %08x (last break was here)", skipPcOnce_); skipPcOnce_ = 0; - goto bail; + if (isPrim) + primsThisFrame_--; // Compensate for the wrong increment above - we didn't run anything. + return process ? NotifyResult::Execute : NotifyResult::Skip; } skipPcOnce_ = 0; @@ -2112,7 +2115,7 @@ GPUDebug::NotifyResult GPUCommon::NotifyCommand(u32 pc, GPUBreakpoints *breakpoi if (coreState == CORE_POWERDOWN) { breakNext_ = BreakNext::NONE; - goto bail; + return process ? NotifyResult::Execute : NotifyResult::Skip; } u32 op = Memory::Read_U32(pc); @@ -2125,14 +2128,7 @@ GPUDebug::NotifyResult GPUCommon::NotifyCommand(u32 pc, GPUBreakpoints *breakpoi return NotifyResult::Break; // caller will call GPUStepping::EnterStepping(). } -bail: - if (process) { - if (isPrim) - primsThisFrame_++; - return NotifyResult::Execute; - } else { - return NotifyResult::Skip; - } + return process ? NotifyResult::Execute : NotifyResult::Skip; } void GPUCommon::NotifyFlush() { diff --git a/UI/ImDebugger/ImGe.cpp b/UI/ImDebugger/ImGe.cpp index 8111b8a4da..e2c14320ec 100644 --- a/UI/ImDebugger/ImGe.cpp +++ b/UI/ImDebugger/ImGe.cpp @@ -751,7 +751,19 @@ void ImGeDebuggerWindow::Draw(ImConfig &cfg, ImControl &control, GPUDebugInterfa ImGui::BeginDisabled(coreState != CORE_STEPPING_GE); if (ImGui::Button("Run/Resume")) { - Core_Resume(); + // Core_Resume(); + gpuDebug->SetBreakNext(GPUDebug::BreakNext::DEBUG_RUN); + } + ImGui::SameLine(); + if (ImGui::Button("...")) { + ImGui::OpenPopup("dotdotdot"); + } + if (ImGui::BeginPopup("dotdotdot")) { + if (ImGui::MenuItem("RunFast")) { + gpuDebug->ClearBreakNext(); + Core_Resume(); + } + ImGui::EndPopup(); } ImGui::EndDisabled(); ImGui::SameLine(); @@ -762,7 +774,7 @@ void ImGeDebuggerWindow::Draw(ImConfig &cfg, ImControl &control, GPUDebugInterfa // GPUDebug::SetBreakNext(GPUDebug::BreakNext::FRAME); //} - bool disableStepButtons = gpuDebug->GetBreakNext() != GPUDebug::BreakNext::NONE; + bool disableStepButtons = gpuDebug->GetBreakNext() != GPUDebug::BreakNext::NONE && gpuDebug->GetBreakNext() != GPUDebug::BreakNext::DEBUG_RUN; if (disableStepButtons) { ImGui::BeginDisabled(); @@ -828,7 +840,7 @@ void ImGeDebuggerWindow::Draw(ImConfig &cfg, ImControl &control, GPUDebugInterfa disasmView_.GotoPC(); } ImGui::SameLine(); - if (ImGui::SmallButton("Settings")) { + if (ImGui::Button("Settings")) { ImGui::OpenPopup("disSettings"); } if (ImGui::BeginPopup("disSettings")) { @@ -837,7 +849,7 @@ void ImGeDebuggerWindow::Draw(ImConfig &cfg, ImControl &control, GPUDebugInterfa } // Display any pending step event. - if (gpuDebug->GetBreakNext() != GPUDebug::BreakNext::NONE) { + if (gpuDebug->GetBreakNext() != GPUDebug::BreakNext::NONE && gpuDebug->GetBreakNext() != GPUDebug::BreakNext::DEBUG_RUN) { if (showBannerInFrames_ > 0) { showBannerInFrames_--; }