mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
PowerPC: Remove PC macro.
This commit is contained in:
@@ -60,7 +60,7 @@ InstructionAttributes CodeTrace::GetInstructionAttributes(const TraceOutput& ins
|
||||
// decision has to be made, otherwise used afterwards on a log file.
|
||||
InstructionAttributes tmp_attributes;
|
||||
tmp_attributes.instruction = instruction.instruction;
|
||||
tmp_attributes.address = PC;
|
||||
tmp_attributes.address = PowerPC::ppcState.pc;
|
||||
std::string instr = instruction.instruction;
|
||||
std::smatch match;
|
||||
|
||||
@@ -108,9 +108,9 @@ TraceOutput CodeTrace::SaveCurrentInstruction() const
|
||||
{
|
||||
// Quickly save instruction and memory target for fast logging.
|
||||
TraceOutput output;
|
||||
const std::string instr = PowerPC::debug_interface.Disassemble(PC);
|
||||
const std::string instr = PowerPC::debug_interface.Disassemble(PowerPC::ppcState.pc);
|
||||
output.instruction = instr;
|
||||
output.address = PC;
|
||||
output.address = PowerPC::ppcState.pc;
|
||||
|
||||
if (IsInstructionLoadStore(output.instruction))
|
||||
output.memory_target = PowerPC::debug_interface.GetMemoryAddressFromInstruction(instr);
|
||||
|
||||
@@ -473,7 +473,7 @@ bool CBoot::Load_BS2(Core::System& system, const std::string& boot_rom_filename)
|
||||
PowerPC::ppcState.spr[SPR_DBAT3L] = 0xfff00001;
|
||||
SetupBAT(/*is_wii*/ false);
|
||||
|
||||
PC = 0x81200150;
|
||||
PowerPC::ppcState.pc = 0x81200150;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -572,7 +572,7 @@ bool CBoot::BootUp(Core::System& system, std::unique_ptr<BootParameters> boot)
|
||||
|
||||
SConfig::OnNewTitleLoad();
|
||||
|
||||
PC = executable.reader->GetEntryPoint();
|
||||
PowerPC::ppcState.pc = executable.reader->GetEntryPoint();
|
||||
|
||||
if (executable.reader->LoadSymbols())
|
||||
{
|
||||
|
||||
@@ -57,10 +57,10 @@ void PresetTimeBaseTicks()
|
||||
|
||||
void CBoot::RunFunction(u32 address)
|
||||
{
|
||||
PC = address;
|
||||
PowerPC::ppcState.pc = address;
|
||||
LR = 0x00;
|
||||
|
||||
while (PC != 0x00)
|
||||
while (PowerPC::ppcState.pc != 0x00)
|
||||
PowerPC::SingleStep();
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ bool CBoot::RunApploader(bool is_wii, const DiscIO::VolumeDisc& volume,
|
||||
HLE::UnPatch("AppLoaderReport");
|
||||
|
||||
// return
|
||||
PC = PowerPC::ppcState.gpr[3];
|
||||
PowerPC::ppcState.pc = PowerPC::ppcState.gpr[3];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ void PrintCallstack(Common::Log::LogType type, Common::Log::LogLevel level)
|
||||
GENERIC_LOG_FMT(type, level, " LR = 0 - this is bad");
|
||||
}
|
||||
|
||||
if (g_symbolDB.GetDescription(PC) != g_symbolDB.GetDescription(LR))
|
||||
if (g_symbolDB.GetDescription(PowerPC::ppcState.pc) != g_symbolDB.GetDescription(LR))
|
||||
{
|
||||
GENERIC_LOG_FMT(type, level, " * {} [ LR = {:08x} ]", g_symbolDB.GetDescription(LR), LR);
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ void RunCodeHandler()
|
||||
PowerPC::HostWrite_U32(SP + 8, SP);
|
||||
// SP + 4 is reserved for the codehandler to save LR to the stack.
|
||||
PowerPC::HostWrite_U32(SFP, SP + 8); // Real stack frame
|
||||
PowerPC::HostWrite_U32(PC, SP + 12);
|
||||
PowerPC::HostWrite_U32(PowerPC::ppcState.pc, SP + 12);
|
||||
PowerPC::HostWrite_U32(LR, SP + 16);
|
||||
PowerPC::HostWrite_U32(PowerPC::ppcState.cr.Get(), SP + 20);
|
||||
// Registers FPR0->13 are volatile
|
||||
@@ -280,9 +280,9 @@ void RunCodeHandler()
|
||||
DEBUG_LOG_FMT(ACTIONREPLAY,
|
||||
"GeckoCodes: Initiating phantom branch-and-link. "
|
||||
"PC = {:#010x}, SP = {:#010x}, SFP = {:#010x}",
|
||||
PC, SP, SFP);
|
||||
PowerPC::ppcState.pc, SP, SFP);
|
||||
LR = HLE_TRAMPOLINE_ADDRESS;
|
||||
PC = NPC = ENTRY_POINT;
|
||||
PowerPC::ppcState.pc = NPC = ENTRY_POINT;
|
||||
}
|
||||
|
||||
} // namespace Gecko
|
||||
|
||||
@@ -37,7 +37,8 @@ void HLE_OSPanic()
|
||||
StringPopBackIf(&msg, '\n');
|
||||
|
||||
PanicAlertFmt("OSPanic: {}: {}", error, msg);
|
||||
ERROR_LOG_FMT(OSREPORT_HLE, "{:08x}->{:08x}| OSPanic: {}: {}", LR, PC, error, msg);
|
||||
ERROR_LOG_FMT(OSREPORT_HLE, "{:08x}->{:08x}| OSPanic: {}: {}", LR, PowerPC::ppcState.pc, error,
|
||||
msg);
|
||||
|
||||
NPC = LR;
|
||||
}
|
||||
@@ -79,7 +80,8 @@ void HLE_GeneralDebugPrint(ParameterType parameter_type)
|
||||
|
||||
StringPopBackIf(&report_message, '\n');
|
||||
|
||||
NOTICE_LOG_FMT(OSREPORT_HLE, "{:08x}->{:08x}| {}", LR, PC, SHIFTJISToUTF8(report_message));
|
||||
NOTICE_LOG_FMT(OSREPORT_HLE, "{:08x}->{:08x}| {}", LR, PowerPC::ppcState.pc,
|
||||
SHIFTJISToUTF8(report_message));
|
||||
}
|
||||
|
||||
// Generalized function for printing formatted string using parameter list.
|
||||
@@ -115,7 +117,8 @@ void HLE_write_console()
|
||||
|
||||
StringPopBackIf(&report_message, '\n');
|
||||
|
||||
NOTICE_LOG_FMT(OSREPORT_HLE, "{:08x}->{:08x}| {}", LR, PC, SHIFTJISToUTF8(report_message));
|
||||
NOTICE_LOG_FMT(OSREPORT_HLE, "{:08x}->{:08x}| {}", LR, PowerPC::ppcState.pc,
|
||||
SHIFTJISToUTF8(report_message));
|
||||
}
|
||||
|
||||
// Log (v)dprintf message if fd is 1 (stdout) or 2 (stderr)
|
||||
@@ -126,7 +129,8 @@ void HLE_LogDPrint(ParameterType parameter_type)
|
||||
|
||||
std::string report_message = GetStringVA(4, parameter_type);
|
||||
StringPopBackIf(&report_message, '\n');
|
||||
NOTICE_LOG_FMT(OSREPORT_HLE, "{:08x}->{:08x}| {}", LR, PC, SHIFTJISToUTF8(report_message));
|
||||
NOTICE_LOG_FMT(OSREPORT_HLE, "{:08x}->{:08x}| {}", LR, PowerPC::ppcState.pc,
|
||||
SHIFTJISToUTF8(report_message));
|
||||
}
|
||||
|
||||
// Log dprintf message
|
||||
@@ -164,7 +168,8 @@ void HLE_LogFPrint(ParameterType parameter_type)
|
||||
|
||||
std::string report_message = GetStringVA(4, parameter_type);
|
||||
StringPopBackIf(&report_message, '\n');
|
||||
NOTICE_LOG_FMT(OSREPORT_HLE, "{:08x}->{:08x}| {}", LR, PC, SHIFTJISToUTF8(report_message));
|
||||
NOTICE_LOG_FMT(OSREPORT_HLE, "{:08x}->{:08x}| {}", LR, PowerPC::ppcState.pc,
|
||||
SHIFTJISToUTF8(report_message));
|
||||
}
|
||||
|
||||
// Log fprintf message
|
||||
|
||||
@@ -111,7 +111,8 @@ void Run()
|
||||
// If watchpoints are enabled, any instruction could be a breakpoint.
|
||||
if (PowerPC::GetMode() != PowerPC::CoreMode::Interpreter)
|
||||
{
|
||||
if (PowerPC::breakpoints.IsAddressBreakPoint(PC) || PowerPC::memchecks.HasAny())
|
||||
if (PowerPC::breakpoints.IsAddressBreakPoint(PowerPC::ppcState.pc) ||
|
||||
PowerPC::memchecks.HasAny())
|
||||
{
|
||||
s_state = State::Stepping;
|
||||
PowerPC::CoreMode old_mode = PowerPC::GetMode();
|
||||
|
||||
@@ -572,7 +572,8 @@ static void Do_ARAM_DMA()
|
||||
{
|
||||
// ARAM -> MRAM
|
||||
DEBUG_LOG_FMT(DSPINTERFACE, "DMA {:08x} bytes from ARAM {:08x} to MRAM {:08x} PC: {:08x}",
|
||||
state.aram_dma.Cnt.count, state.aram_dma.ARAddr, state.aram_dma.MMAddr, PC);
|
||||
state.aram_dma.Cnt.count, state.aram_dma.ARAddr, state.aram_dma.MMAddr,
|
||||
PowerPC::ppcState.pc);
|
||||
|
||||
// Outgoing data from ARAM is mirrored every 64MB (verified on real HW)
|
||||
state.aram_dma.ARAddr &= 0x3ffffff;
|
||||
@@ -620,7 +621,8 @@ static void Do_ARAM_DMA()
|
||||
{
|
||||
// MRAM -> ARAM
|
||||
DEBUG_LOG_FMT(DSPINTERFACE, "DMA {:08x} bytes from MRAM {:08x} to ARAM {:08x} PC: {:08x}",
|
||||
state.aram_dma.Cnt.count, state.aram_dma.MMAddr, state.aram_dma.ARAddr, PC);
|
||||
state.aram_dma.Cnt.count, state.aram_dma.MMAddr, state.aram_dma.ARAddr,
|
||||
PowerPC::ppcState.pc);
|
||||
|
||||
// Incoming data into ARAM is mirrored every 64MB (verified on real HW)
|
||||
state.aram_dma.ARAddr &= 0x3ffffff;
|
||||
|
||||
@@ -482,7 +482,8 @@ u8* MemoryManager::GetPointer(u32 address) const
|
||||
return m_exram + (address & GetExRamMask());
|
||||
}
|
||||
|
||||
PanicAlertFmt("Unknown Pointer {:#010x} PC {:#010x} LR {:#010x}", address, PC, LR);
|
||||
PanicAlertFmt("Unknown Pointer {:#010x} PC {:#010x} LR {:#010x}", address, PowerPC::ppcState.pc,
|
||||
LR);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ static void ResetAndPausePPC()
|
||||
auto& memory = system.GetMemory();
|
||||
memory.Write_U32(0x48000000, 0x00000000); // b 0x0
|
||||
PowerPC::Reset();
|
||||
PC = 0;
|
||||
PowerPC::ppcState.pc = 0;
|
||||
}
|
||||
|
||||
static void ReleasePPC()
|
||||
@@ -212,7 +212,7 @@ static void ReleasePPC()
|
||||
// NAND titles start with address translation off at 0x3400 (via the PPC bootstub)
|
||||
// The state of other CPU registers (like the BAT registers) doesn't matter much
|
||||
// because the realmode code at 0x3400 initializes everything itself anyway.
|
||||
PC = 0x3400;
|
||||
PowerPC::ppcState.pc = 0x3400;
|
||||
}
|
||||
|
||||
static void ReleasePPCAncast()
|
||||
@@ -223,7 +223,7 @@ static void ReleasePPCAncast()
|
||||
// On a real console the Espresso verifies and decrypts the Ancast image,
|
||||
// then jumps to the decrypted ancast body.
|
||||
// The Ancast loader already did this, so just jump to the decrypted body.
|
||||
PC = ESPRESSO_ANCAST_LOCATION_VIRT + sizeof(EspressoAncastHeader);
|
||||
PowerPC::ppcState.pc = ESPRESSO_ANCAST_LOCATION_VIRT + sizeof(EspressoAncastHeader);
|
||||
}
|
||||
|
||||
void RAMOverrideForIOSMemoryValues(MemorySetupType setup_type)
|
||||
|
||||
@@ -79,7 +79,7 @@ bool Load()
|
||||
const PowerPC::CoreMode core_mode = PowerPC::GetMode();
|
||||
PowerPC::SetMode(PowerPC::CoreMode::Interpreter);
|
||||
MSR.Hex = 0;
|
||||
PC = 0x3400;
|
||||
PowerPC::ppcState.pc = 0x3400;
|
||||
NOTICE_LOG_FMT(IOS, "Loaded MIOS and bootstrapped PPC.");
|
||||
|
||||
// IOS writes 0 to 0x30f8 before bootstrapping the PPC. Once started, the IPL eventually writes
|
||||
|
||||
@@ -320,7 +320,7 @@ bool ApplyFramePatches()
|
||||
DEBUG_LOG_FMT(ACTIONREPLAY,
|
||||
"Need to retry later. CPU configuration is currently incorrect. PC = {:#010x}, "
|
||||
"MSR = {:#010x}",
|
||||
PC, MSR.Hex);
|
||||
PowerPC::ppcState.pc, MSR.Hex);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ void CachedInterpreter::ExecuteOneBlock()
|
||||
const u8* normal_entry = m_block_cache.Dispatch();
|
||||
if (!normal_entry)
|
||||
{
|
||||
Jit(PC);
|
||||
Jit(PowerPC::ppcState.pc);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ void CachedInterpreter::SingleStep()
|
||||
|
||||
static void EndBlock(UGeckoInstruction data)
|
||||
{
|
||||
PC = NPC;
|
||||
PowerPC::ppcState.pc = NPC;
|
||||
PowerPC::ppcState.downcount -= data.hex;
|
||||
PowerPC::UpdatePerformanceMonitor(data.hex, 0, 0);
|
||||
}
|
||||
@@ -153,7 +153,7 @@ static void UpdateNumFloatingPointInstructions(UGeckoInstruction data)
|
||||
|
||||
static void WritePC(UGeckoInstruction data)
|
||||
{
|
||||
PC = data.hex;
|
||||
PowerPC::ppcState.pc = data.hex;
|
||||
NPC = data.hex + 4;
|
||||
}
|
||||
|
||||
@@ -239,7 +239,8 @@ void CachedInterpreter::Jit(u32 address)
|
||||
ClearCache();
|
||||
}
|
||||
|
||||
const u32 nextPC = analyzer.Analyze(PC, &code_block, &m_code_buffer, m_code_buffer.size());
|
||||
const u32 nextPC =
|
||||
analyzer.Analyze(PowerPC::ppcState.pc, &code_block, &m_code_buffer, m_code_buffer.size());
|
||||
if (code_block.m_memory_exception)
|
||||
{
|
||||
// Address of instruction could not be translated
|
||||
@@ -250,9 +251,9 @@ void CachedInterpreter::Jit(u32 address)
|
||||
return;
|
||||
}
|
||||
|
||||
JitBlock* b = m_block_cache.AllocateBlock(PC);
|
||||
JitBlock* b = m_block_cache.AllocateBlock(PowerPC::ppcState.pc);
|
||||
|
||||
js.blockStart = PC;
|
||||
js.blockStart = PowerPC::ppcState.pc;
|
||||
js.firstFPInstructionFound = false;
|
||||
js.fifoBytesSinceCheck = 0;
|
||||
js.downcountAmount = 0;
|
||||
|
||||
@@ -264,7 +264,7 @@ void Expression::SynchronizeBindings(SynchronizeDirection dir) const
|
||||
break;
|
||||
case VarBindingType::PCtr:
|
||||
if (dir == SynchronizeDirection::From)
|
||||
v->value = static_cast<double>(PC);
|
||||
v->value = static_cast<double>(PowerPC::ppcState.pc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,7 +429,7 @@ static void ReadRegister()
|
||||
switch (id)
|
||||
{
|
||||
case 64:
|
||||
wbe32hex(reply, PC);
|
||||
wbe32hex(reply, PowerPC::ppcState.pc);
|
||||
break;
|
||||
case 65:
|
||||
wbe32hex(reply, MSR.Hex);
|
||||
@@ -641,7 +641,7 @@ static void WriteRegister()
|
||||
switch (id)
|
||||
{
|
||||
case 64:
|
||||
PC = re32hex(bufptr);
|
||||
PowerPC::ppcState.pc = re32hex(bufptr);
|
||||
break;
|
||||
case 65:
|
||||
MSR.Hex = re32hex(bufptr);
|
||||
@@ -1122,8 +1122,8 @@ bool JustConnected()
|
||||
void SendSignal(Signal signal)
|
||||
{
|
||||
char bfr[128] = {};
|
||||
fmt::format_to(bfr, "T{:02x}{:02x}:{:08x};{:02x}:{:08x};", static_cast<u8>(signal), 64, PC, 1,
|
||||
GPR(1));
|
||||
fmt::format_to(bfr, "T{:02x}{:02x}:{:08x};{:02x}:{:08x};", static_cast<u8>(signal), 64,
|
||||
PowerPC::ppcState.pc, 1, GPR(1));
|
||||
SendReply(bfr);
|
||||
}
|
||||
} // namespace GDBStub
|
||||
|
||||
@@ -73,8 +73,8 @@ bool IsInvalidPairedSingleExecution(UGeckoInstruction inst)
|
||||
|
||||
void UpdatePC()
|
||||
{
|
||||
last_pc = PC;
|
||||
PC = NPC;
|
||||
last_pc = PowerPC::ppcState.pc;
|
||||
PowerPC::ppcState.pc = NPC;
|
||||
}
|
||||
} // Anonymous namespace
|
||||
|
||||
@@ -126,12 +126,13 @@ static void Trace(const UGeckoInstruction& inst)
|
||||
fregs += fmt::format("f{:02d}: {:08x} {:08x} ", i, ps.PS0AsU64(), ps.PS1AsU64());
|
||||
}
|
||||
|
||||
const std::string ppc_inst = Common::GekkoDisassembler::Disassemble(inst.hex, PC);
|
||||
const std::string ppc_inst =
|
||||
Common::GekkoDisassembler::Disassemble(inst.hex, PowerPC::ppcState.pc);
|
||||
DEBUG_LOG_FMT(POWERPC,
|
||||
"INTER PC: {:08x} SRR0: {:08x} SRR1: {:08x} CRval: {:016x} "
|
||||
"FPSCR: {:08x} MSR: {:08x} LR: {:08x} {} {:08x} {}",
|
||||
PC, SRR0, SRR1, PowerPC::ppcState.cr.fields[0], FPSCR.Hex, MSR.Hex,
|
||||
PowerPC::ppcState.spr[8], regs, inst.hex, ppc_inst);
|
||||
PowerPC::ppcState.pc, SRR0, SRR1, PowerPC::ppcState.cr.fields[0], FPSCR.Hex,
|
||||
MSR.Hex, PowerPC::ppcState.spr[8], regs, inst.hex, ppc_inst);
|
||||
}
|
||||
|
||||
bool Interpreter::HandleFunctionHooking(u32 address)
|
||||
@@ -144,20 +145,25 @@ bool Interpreter::HandleFunctionHooking(u32 address)
|
||||
|
||||
int Interpreter::SingleStepInner()
|
||||
{
|
||||
if (HandleFunctionHooking(PC))
|
||||
if (HandleFunctionHooking(PowerPC::ppcState.pc))
|
||||
{
|
||||
UpdatePC();
|
||||
return PPCTables::GetOpInfo(m_prev_inst)->numCycles;
|
||||
}
|
||||
|
||||
NPC = PC + sizeof(UGeckoInstruction);
|
||||
m_prev_inst.hex = PowerPC::Read_Opcode(PC);
|
||||
NPC = PowerPC::ppcState.pc + sizeof(UGeckoInstruction);
|
||||
m_prev_inst.hex = PowerPC::Read_Opcode(PowerPC::ppcState.pc);
|
||||
|
||||
// Uncomment to trace the interpreter
|
||||
// if ((PC & 0x00FFFFFF) >= 0x000AB54C && (PC & 0x00FFFFFF) <= 0x000AB624)
|
||||
// if ((PowerPC::ppcState.pc & 0x00FFFFFF) >= 0x000AB54C &&
|
||||
// (PowerPC::ppcState.pc & 0x00FFFFFF) <= 0x000AB624)
|
||||
// {
|
||||
// s_start_trace = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// s_start_trace = false;
|
||||
// }
|
||||
|
||||
if (s_start_trace)
|
||||
{
|
||||
@@ -228,7 +234,7 @@ void Interpreter::SingleStep()
|
||||
if (PowerPC::ppcState.Exceptions != 0)
|
||||
{
|
||||
PowerPC::CheckExceptions();
|
||||
PC = NPC;
|
||||
PowerPC::ppcState.pc = NPC;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,7 +262,7 @@ void Interpreter::Run()
|
||||
if (Config::Get(Config::MAIN_ENABLE_DEBUGGING))
|
||||
{
|
||||
#ifdef SHOW_HISTORY
|
||||
s_pc_block_vec.push_back(PC);
|
||||
s_pc_block_vec.push_back(PowerPC::ppcState.pc);
|
||||
if (s_pc_block_vec.size() > s_show_blocks)
|
||||
s_pc_block_vec.erase(s_pc_block_vec.begin());
|
||||
#endif
|
||||
@@ -270,13 +276,13 @@ void Interpreter::Run()
|
||||
while (!m_end_block)
|
||||
{
|
||||
#ifdef SHOW_HISTORY
|
||||
s_pc_vec.push_back(PC);
|
||||
s_pc_vec.push_back(PowerPC::ppcState.pc);
|
||||
if (s_pc_vec.size() > s_show_steps)
|
||||
s_pc_vec.erase(s_pc_vec.begin());
|
||||
#endif
|
||||
|
||||
// 2: check for breakpoint
|
||||
if (PowerPC::breakpoints.IsAddressBreakPoint(PC))
|
||||
if (PowerPC::breakpoints.IsAddressBreakPoint(PowerPC::ppcState.pc))
|
||||
{
|
||||
#ifdef SHOW_HISTORY
|
||||
NOTICE_LOG_FMT(POWERPC, "----------------------------");
|
||||
@@ -297,12 +303,12 @@ void Interpreter::Run()
|
||||
NOTICE_LOG_FMT(POWERPC, "PC: {:#010x}", s_pc_vec[j]);
|
||||
}
|
||||
#endif
|
||||
INFO_LOG_FMT(POWERPC, "Hit Breakpoint - {:08x}", PC);
|
||||
INFO_LOG_FMT(POWERPC, "Hit Breakpoint - {:08x}", PowerPC::ppcState.pc);
|
||||
CPU::Break();
|
||||
if (GDBStub::IsActive())
|
||||
GDBStub::TakeControl();
|
||||
if (PowerPC::breakpoints.IsTempBreakPoint(PC))
|
||||
PowerPC::breakpoints.Remove(PC);
|
||||
if (PowerPC::breakpoints.IsTempBreakPoint(PowerPC::ppcState.pc))
|
||||
PowerPC::breakpoints.Remove(PowerPC::ppcState.pc);
|
||||
|
||||
Host_UpdateDisasmDialog();
|
||||
return;
|
||||
@@ -339,7 +345,7 @@ void Interpreter::unknown_instruction(UGeckoInstruction inst)
|
||||
NOTICE_LOG_FMT(
|
||||
POWERPC,
|
||||
"\nIntCPU: Unknown instruction {:08x} at PC = {:08x} last_PC = {:08x} LR = {:08x}\n",
|
||||
inst.hex, PC, last_pc, LR);
|
||||
inst.hex, PowerPC::ppcState.pc, last_pc, LR);
|
||||
for (int i = 0; i < 32; i += 4)
|
||||
{
|
||||
NOTICE_LOG_FMT(POWERPC, "r{}: {:#010x} r{}: {:#010x} r{}: {:#010x} r{}: {:#010x}", i, rGPR[i],
|
||||
@@ -347,7 +353,7 @@ void Interpreter::unknown_instruction(UGeckoInstruction inst)
|
||||
}
|
||||
ASSERT_MSG(POWERPC, 0,
|
||||
"\nIntCPU: Unknown instruction {:08x} at PC = {:08x} last_PC = {:08x} LR = {:08x}\n",
|
||||
inst.hex, PC, last_pc, LR);
|
||||
inst.hex, PowerPC::ppcState.pc, last_pc, LR);
|
||||
if (Core::System::GetInstance().IsPauseOnPanicMode())
|
||||
CPU::Break();
|
||||
}
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
void Interpreter::bx(UGeckoInstruction inst)
|
||||
{
|
||||
if (inst.LK)
|
||||
LR = PC + 4;
|
||||
LR = PowerPC::ppcState.pc + 4;
|
||||
|
||||
const auto address = u32(SignExt26(inst.LI << 2));
|
||||
|
||||
if (inst.AA)
|
||||
NPC = address;
|
||||
else
|
||||
NPC = PC + address;
|
||||
NPC = PowerPC::ppcState.pc + address;
|
||||
|
||||
m_end_block = true;
|
||||
}
|
||||
@@ -42,14 +42,14 @@ void Interpreter::bcx(UGeckoInstruction inst)
|
||||
if (counter && condition)
|
||||
{
|
||||
if (inst.LK)
|
||||
LR = PC + 4;
|
||||
LR = PowerPC::ppcState.pc + 4;
|
||||
|
||||
const auto address = u32(SignExt16(s16(inst.BD << 2)));
|
||||
|
||||
if (inst.AA)
|
||||
NPC = address;
|
||||
else
|
||||
NPC = PC + address;
|
||||
NPC = PowerPC::ppcState.pc + address;
|
||||
}
|
||||
|
||||
m_end_block = true;
|
||||
@@ -67,7 +67,7 @@ void Interpreter::bcctrx(UGeckoInstruction inst)
|
||||
{
|
||||
NPC = CTR & (~3);
|
||||
if (inst.LK_3)
|
||||
LR = PC + 4;
|
||||
LR = PowerPC::ppcState.pc + 4;
|
||||
}
|
||||
|
||||
m_end_block = true;
|
||||
@@ -86,7 +86,7 @@ void Interpreter::bclrx(UGeckoInstruction inst)
|
||||
{
|
||||
NPC = LR & (~3);
|
||||
if (inst.LK_3)
|
||||
LR = PC + 4;
|
||||
LR = PowerPC::ppcState.pc + 4;
|
||||
}
|
||||
|
||||
m_end_block = true;
|
||||
@@ -95,7 +95,7 @@ void Interpreter::bclrx(UGeckoInstruction inst)
|
||||
void Interpreter::HLEFunction(UGeckoInstruction inst)
|
||||
{
|
||||
m_end_block = true;
|
||||
HLE::Execute(PC, inst.hex);
|
||||
HLE::Execute(PowerPC::ppcState.pc, inst.hex);
|
||||
}
|
||||
|
||||
void Interpreter::rfi(UGeckoInstruction inst)
|
||||
|
||||
@@ -372,7 +372,8 @@ void Interpreter::mtspr(UGeckoInstruction inst)
|
||||
|
||||
case SPR_WPAR:
|
||||
ASSERT_MSG(POWERPC, rSPR(SPR_WPAR) == GPFifo::GATHER_PIPE_PHYSICAL_ADDRESS,
|
||||
"Gather pipe changed to unexpected address {:08x} @ PC {:08x}", rSPR(SPR_WPAR), PC);
|
||||
"Gather pipe changed to unexpected address {:08x} @ PC {:08x}", rSPR(SPR_WPAR),
|
||||
PowerPC::ppcState.pc);
|
||||
Core::System::GetInstance().GetGPFifo().ResetGatherPipe();
|
||||
break;
|
||||
|
||||
|
||||
@@ -504,16 +504,16 @@ static void ImHere()
|
||||
if (!f)
|
||||
f.Open("log64.txt", "w");
|
||||
|
||||
f.WriteString(fmt::format("{0:08x}\n", PC));
|
||||
f.WriteString(fmt::format("{0:08x}\n", PowerPC::ppcState.pc));
|
||||
}
|
||||
if (been_here.find(PC) != been_here.end())
|
||||
if (been_here.find(PowerPC::ppcState.pc) != been_here.end())
|
||||
{
|
||||
been_here.find(PC)->second++;
|
||||
if ((been_here.find(PC)->second) & 1023)
|
||||
been_here.find(PowerPC::ppcState.pc)->second++;
|
||||
if ((been_here.find(PowerPC::ppcState.pc)->second) & 1023)
|
||||
return;
|
||||
}
|
||||
INFO_LOG_FMT(DYNA_REC, "I'm here - PC = {:08x} , LR = {:08x}", PC, LR);
|
||||
been_here[PC] = 1;
|
||||
INFO_LOG_FMT(DYNA_REC, "I'm here - PC = {:08x} , LR = {:08x}", PowerPC::ppcState.pc, LR);
|
||||
been_here[PowerPC::ppcState.pc] = 1;
|
||||
}
|
||||
|
||||
bool Jit64::Cleanup()
|
||||
@@ -758,7 +758,8 @@ void Jit64::Trace()
|
||||
DEBUG_LOG_FMT(DYNA_REC,
|
||||
"JIT64 PC: {:08x} SRR0: {:08x} SRR1: {:08x} FPSCR: {:08x} "
|
||||
"MSR: {:08x} LR: {:08x} {} {}",
|
||||
PC, SRR0, SRR1, FPSCR.Hex, MSR.Hex, PowerPC::ppcState.spr[8], regs, fregs);
|
||||
PowerPC::ppcState.pc, SRR0, SRR1, FPSCR.Hex, MSR.Hex, PowerPC::ppcState.spr[8],
|
||||
regs, fregs);
|
||||
}
|
||||
|
||||
void Jit64::Jit(u32 em_address)
|
||||
|
||||
@@ -705,7 +705,8 @@ void JitArm64::Trace()
|
||||
DEBUG_LOG_FMT(DYNA_REC,
|
||||
"JitArm64 PC: {:08x} SRR0: {:08x} SRR1: {:08x} FPSCR: {:08x} "
|
||||
"MSR: {:08x} LR: {:08x} {} {}",
|
||||
PC, SRR0, SRR1, FPSCR.Hex, MSR.Hex, PowerPC::ppcState.spr[8], regs, fregs);
|
||||
PowerPC::ppcState.pc, SRR0, SRR1, FPSCR.Hex, MSR.Hex, PowerPC::ppcState.spr[8],
|
||||
regs, fregs);
|
||||
}
|
||||
|
||||
void JitArm64::Jit(u32 em_address)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user