VideoCommon/CommandProcessor: Pass System to HandleUnknownOpcode().

This commit is contained in:
Admiral H. Curtiss 2023-03-28 22:07:50 +02:00
parent e5941428d1
commit 192d8b6e40
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
3 changed files with 8 additions and 6 deletions

View File

@ -637,7 +637,8 @@ void CommandProcessorManager::SetCpClearRegister()
{ {
} }
void CommandProcessorManager::HandleUnknownOpcode(u8 cmd_byte, const u8* buffer, bool preprocess) void CommandProcessorManager::HandleUnknownOpcode(Core::System& system, u8 cmd_byte,
const u8* buffer, bool preprocess)
{ {
const auto& fifo = m_fifo; const auto& fifo = m_fifo;
@ -665,6 +666,7 @@ void CommandProcessorManager::HandleUnknownOpcode(u8 cmd_byte, const u8* buffer,
// PC and LR are meaningless when using the fifoplayer, and will generally not be helpful if the // PC and LR are meaningless when using the fifoplayer, and will generally not be helpful if the
// unknown opcode is inside of a display list. Also note that the changes in GPFifo.h are not // unknown opcode is inside of a display list. Also note that the changes in GPFifo.h are not
// accurate and may introduce timing issues. // accurate and may introduce timing issues.
const auto& ppc_state = system.GetPPCState();
GENERIC_LOG_FMT( GENERIC_LOG_FMT(
Common::Log::LogType::VIDEO, log_level, Common::Log::LogType::VIDEO, log_level,
"FIFO: Unknown Opcode {:#04x} @ {}, preprocessing = {}, CPBase: {:#010x}, CPEnd: " "FIFO: Unknown Opcode {:#04x} @ {}, preprocessing = {}, CPBase: {:#010x}, CPEnd: "
@ -686,8 +688,8 @@ void CommandProcessorManager::HandleUnknownOpcode(u8 cmd_byte, const u8* buffer,
fifo.bFF_Breakpoint.load(std::memory_order_relaxed) ? "true" : "false", fifo.bFF_Breakpoint.load(std::memory_order_relaxed) ? "true" : "false",
fifo.bFF_GPLinkEnable.load(std::memory_order_relaxed) ? "true" : "false", fifo.bFF_GPLinkEnable.load(std::memory_order_relaxed) ? "true" : "false",
fifo.bFF_HiWatermarkInt.load(std::memory_order_relaxed) ? "true" : "false", fifo.bFF_HiWatermarkInt.load(std::memory_order_relaxed) ? "true" : "false",
fifo.bFF_LoWatermarkInt.load(std::memory_order_relaxed) ? "true" : "false", fifo.bFF_LoWatermarkInt.load(std::memory_order_relaxed) ? "true" : "false", ppc_state.pc,
PowerPC::ppcState.pc, LR(PowerPC::ppcState)); LR(ppc_state));
if (!m_is_fifo_error_seen && !suppress_panic_alert) if (!m_is_fifo_error_seen && !suppress_panic_alert)
{ {

View File

@ -177,7 +177,7 @@ public:
void SetCpControlRegister(Core::System& system); void SetCpControlRegister(Core::System& system);
void SetCpStatusRegister(Core::System& system); void SetCpStatusRegister(Core::System& system);
void HandleUnknownOpcode(u8 cmd_byte, const u8* buffer, bool preprocess); void HandleUnknownOpcode(Core::System& system, u8 cmd_byte, const u8* buffer, bool preprocess);
// This one is shared between gfx thread and emulator thread. // This one is shared between gfx thread and emulator thread.
// It is only used by the Fifo and by the CommandProcessor. // It is only used by the Fifo and by the CommandProcessor.

View File

@ -219,8 +219,8 @@ public:
} }
else else
{ {
Core::System::GetInstance().GetCommandProcessor().HandleUnknownOpcode(opcode, data, auto& system = Core::System::GetInstance();
is_preprocess); system.GetCommandProcessor().HandleUnknownOpcode(system, opcode, data, is_preprocess);
m_cycles += 1; m_cycles += 1;
} }
} }