PowerPC: Refactor to class, move to System.

This commit is contained in:
Admiral H. Curtiss committed 2023-04-09 21:48:37 +02:00
1 parent ebbbdc49ab
commit 23843583bf
50 files changed
+705 -531

No files matched your search

@@ -206,7 +206,7 @@ void Interpreter::SingleStep()
if (m_ppc_state.Exceptions != 0)
{
PowerPC::CheckExceptions();
m_system.GetPowerPC().CheckExceptions();
m_ppc_state.pc = m_ppc_state.npc;
}
}
@@ -224,6 +224,7 @@ void Interpreter::Run()
{
auto& core_timing = m_system.GetCoreTiming();
auto& cpu = m_system.GetCPU();
auto& power_pc = m_system.GetPowerPC();
while (cpu.GetState() == CPU::State::Running)
{
// CoreTiming Advance() ends the previous slice and declares the start of the next
@@ -255,7 +256,7 @@ void Interpreter::Run()
#endif
// 2: check for breakpoint
if (PowerPC::breakpoints.IsAddressBreakPoint(m_ppc_state.pc))
if (power_pc.GetBreakPoints().IsAddressBreakPoint(m_ppc_state.pc))
{
#ifdef SHOW_HISTORY
NOTICE_LOG_FMT(POWERPC, "----------------------------");
@@ -280,8 +281,8 @@ void Interpreter::Run()
cpu.Break();
if (GDBStub::IsActive())
GDBStub::TakeControl();
if (PowerPC::breakpoints.IsTempBreakPoint(m_ppc_state.pc))
PowerPC::breakpoints.Remove(m_ppc_state.pc);
if (power_pc.GetBreakPoints().IsTempBreakPoint(m_ppc_state.pc))
power_pc.GetBreakPoints().Remove(m_ppc_state.pc);
Host_UpdateDisasmDialog();
return;
@@ -347,7 +348,7 @@ void Interpreter::ClearCache()
void Interpreter::CheckExceptions()
{
PowerPC::CheckExceptions();
m_system.GetPowerPC().CheckExceptions();
m_end_block = true;
}
@@ -145,6 +145,6 @@ void Interpreter::sc(Interpreter& interpreter, UGeckoInstruction inst)
auto& ppc_state = interpreter.m_ppc_state;
ppc_state.Exceptions |= EXCEPTION_SYSCALL;
PowerPC::CheckExceptions();
interpreter.m_system.GetPowerPC().CheckExceptions();
interpreter.m_end_block = true;
}
@@ -10,6 +10,7 @@
#include "Common/Logging/Log.h"
#include "Core/PowerPC/Interpreter/ExceptionUtils.h"
#include "Core/PowerPC/PowerPC.h"
#include "Core/System.h"
void Interpreter::Helper_UpdateCR0(PowerPC::PowerPCState& ppc_state, u32 value)
{
@@ -150,7 +151,7 @@ void Interpreter::twi(Interpreter& interpreter, UGeckoInstruction inst)
(u32(a) < u32(b) && (TO & 0x02) != 0) || (u32(a) > u32(b) && (TO & 0x01) != 0))
{
GenerateProgramException(ppc_state, ProgramExceptionCause::Trap);
PowerPC::CheckExceptions();
interpreter.m_system.GetPowerPC().CheckExceptions();
interpreter.m_end_block = true; // Dunno about this
}
}
@@ -381,7 +382,7 @@ void Interpreter::tw(Interpreter& interpreter, UGeckoInstruction inst)
((u32(a) < u32(b)) && (TO & 0x02) != 0) || ((u32(a) > u32(b)) && (TO & 0x01) != 0))
{
GenerateProgramException(ppc_state, ProgramExceptionCause::Trap);
PowerPC::CheckExceptions();
interpreter.m_system.GetPowerPC().CheckExceptions();
interpreter.m_end_block = true; // Dunno about this
}
}
@@ -29,7 +29,7 @@ mffsx: 80036650 (huh?)
static void FPSCRUpdated(PowerPC::PowerPCState& ppc_state)
{
UpdateFPExceptionSummary(ppc_state);
PowerPC::RoundingModeUpdated();
PowerPC::RoundingModeUpdated(ppc_state);
}
void Interpreter::mtfsb0x(Interpreter& interpreter, UGeckoInstruction inst)
@@ -184,7 +184,7 @@ void Interpreter::mtmsr(Interpreter& interpreter, UGeckoInstruction inst)
// FE0/FE1 may have been set
CheckFPExceptions(ppc_state);
PowerPC::CheckExceptions();
interpreter.m_system.GetPowerPC().CheckExceptions();
interpreter.m_end_block = true;
}
@@ -249,7 +249,7 @@ void Interpreter::mfspr(Interpreter& interpreter, UGeckoInstruction inst)
case SPR_TL:
case SPR_TU:
PowerPC::WriteFullTimeBaseValue(SystemTimers::GetFakeTimeBase());
interpreter.m_system.GetPowerPC().WriteFullTimeBaseValue(SystemTimers::GetFakeTimeBase());
break;
case SPR_WPAR: