From 51e7980d95b4ffd5f7dd74740833e3d52ab995e1 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Wed, 11 Jan 2023 06:01:50 +0100 Subject: [PATCH] Core: Add PowerPCState reference to System. --- Source/Core/Core/System.cpp | 9 ++++++++- Source/Core/Core/System.h | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/System.cpp b/Source/Core/Core/System.cpp index fc4272ed12..85bbb94481 100644 --- a/Source/Core/Core/System.cpp +++ b/Source/Core/Core/System.cpp @@ -20,6 +20,7 @@ #include "Core/HW/SI/SI.h" #include "Core/HW/Sram.h" #include "Core/HW/VideoInterface.h" +#include "Core/PowerPC/PowerPC.h" #include "IOS/USB/Emulated/Skylander.h" #include "VideoCommon/CommandProcessor.h" #include "VideoCommon/Fifo.h" @@ -32,7 +33,7 @@ namespace Core { struct System::Impl { - explicit Impl(System& system) : m_gp_fifo(system) {} + explicit Impl(System& system) : m_gp_fifo(system), m_ppc_state(PowerPC::ppcState) {} std::unique_ptr m_sound_stream; bool m_sound_stream_running = false; @@ -53,6 +54,7 @@ struct System::Impl MemoryInterface::MemoryInterfaceState m_memory_interface_state; PixelEngine::PixelEngineManager m_pixel_engine; PixelShaderManager m_pixel_shader_manager; + PowerPC::PowerPCState& m_ppc_state; ProcessorInterface::ProcessorInterfaceManager m_processor_interface; SerialInterface::SerialInterfaceState m_serial_interface_state; Sram m_sram; @@ -178,6 +180,11 @@ PixelShaderManager& System::GetPixelShaderManager() const return m_impl->m_pixel_shader_manager; } +PowerPC::PowerPCState& System::GetPPCState() const +{ + return m_impl->m_ppc_state; +} + ProcessorInterface::ProcessorInterfaceManager& System::GetProcessorInterface() const { return m_impl->m_processor_interface; diff --git a/Source/Core/Core/System.h b/Source/Core/Core/System.h index 159a73bb99..64ac9fc7e1 100644 --- a/Source/Core/Core/System.h +++ b/Source/Core/Core/System.h @@ -63,6 +63,10 @@ namespace PixelEngine { class PixelEngineManager; }; +namespace PowerPC +{ +struct PowerPCState; +} namespace ProcessorInterface { class ProcessorInterfaceManager; @@ -125,6 +129,7 @@ public: MemoryInterface::MemoryInterfaceState& GetMemoryInterfaceState() const; PixelEngine::PixelEngineManager& GetPixelEngine() const; PixelShaderManager& GetPixelShaderManager() const; + PowerPC::PowerPCState& GetPPCState() const; ProcessorInterface::ProcessorInterfaceManager& GetProcessorInterface() const; SerialInterface::SerialInterfaceState& GetSerialInterfaceState() const; Sram& GetSRAM() const;