summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
diff options
context:
space:
mode:
authorMai <mai.iam2048@gmail.com>2023-03-08 11:52:30 -0500
committerGitHub <noreply@github.com>2023-03-08 11:52:30 -0500
commitc592c94395c8ef271eef331ba27d2afaa694c5e9 (patch)
tree626a968236d3964fc343e7bd5c38b0e18ddd9917 /Source/Core/DolphinQt/Debugger/CodeWidget.cpp
parentf1e4b6a1418c87b3968b35ae78d82d7e9be70636 (diff)
parent3b364c5c16d519902bdc3e1e07434a9f8b916ac6 (diff)
Merge pull request #11630 from AdmiralCurtiss/globals-cpu
HW/CPU: Refactor to class, move to System.
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/CodeWidget.cpp')
-rw-r--r--Source/Core/DolphinQt/Debugger/CodeWidget.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
index 391152abc9..f5fa095166 100644
--- a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
@@ -435,7 +435,10 @@ void CodeWidget::UpdateFunctionCallers(const Common::Symbol* symbol)
void CodeWidget::Step()
{
- if (!CPU::IsStepping())
+ auto& system = Core::System::GetInstance();
+ auto& cpu = system.GetCPU();
+
+ if (!cpu.IsStepping())
return;
Common::Event sync_event;
@@ -443,7 +446,7 @@ void CodeWidget::Step()
PowerPC::CoreMode old_mode = PowerPC::GetMode();
PowerPC::SetMode(PowerPC::CoreMode::Interpreter);
PowerPC::breakpoints.ClearAllTemporary();
- CPU::StepOpcode(&sync_event);
+ cpu.StepOpcode(&sync_event);
sync_event.WaitFor(std::chrono::milliseconds(20));
PowerPC::SetMode(old_mode);
Core::DisplayMessage(tr("Step successful!").toStdString(), 2000);
@@ -452,7 +455,10 @@ void CodeWidget::Step()
void CodeWidget::StepOver()
{
- if (!CPU::IsStepping())
+ auto& system = Core::System::GetInstance();
+ auto& cpu = system.GetCPU();
+
+ if (!cpu.IsStepping())
return;
const UGeckoInstruction inst = [] {
@@ -464,7 +470,7 @@ void CodeWidget::StepOver()
{
PowerPC::breakpoints.ClearAllTemporary();
PowerPC::breakpoints.Add(PowerPC::ppcState.pc + 4, true);
- CPU::EnableStepping(false);
+ cpu.EnableStepping(false);
Core::DisplayMessage(tr("Step over in progress...").toStdString(), 2000);
}
else
@@ -489,7 +495,10 @@ static bool WillInstructionReturn(UGeckoInstruction inst)
void CodeWidget::StepOut()
{
- if (!CPU::IsStepping())
+ auto& system = Core::System::GetInstance();
+ auto& cpu = system.GetCPU();
+
+ if (!cpu.IsStepping())
return;
// Keep stepping until the next return instruction or timeout after five seconds