Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #11307 from AdmiralCurtiss/globals-command-processor
VideoCommon/CommandProcessor: Refactor to class, move to Core::System.
  • Loading branch information
lioncash committed Nov 29, 2022
2 parents 421af09 + 6941d2e commit ff830c0
Show file tree
Hide file tree
Showing 11 changed files with 267 additions and 194 deletions.
4 changes: 3 additions & 1 deletion Source/Core/Core/HW/GPFifo.cpp
Expand Up @@ -13,6 +13,7 @@
#include "Core/HW/ProcessorInterface.h"
#include "Core/PowerPC/JitInterface.h"
#include "Core/PowerPC/PowerPC.h"
#include "Core/System.h"
#include "VideoCommon/CommandProcessor.h"

namespace GPFifo
Expand Down Expand Up @@ -103,7 +104,8 @@ void UpdateGatherPipe()
ProcessorInterface::Fifo_CPUWritePointer += GATHER_PIPE_SIZE;
}

CommandProcessor::GatherPipeBursted();
auto& system = Core::System::GetInstance();
system.GetCommandProcessor().GatherPipeBursted(system);
}

// move back the spill bytes
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Core/HW/Memmap.cpp
Expand Up @@ -130,7 +130,8 @@ static void InitMMIO(bool is_wii)
{
mmio_mapping = std::make_unique<MMIO::Mapping>();

CommandProcessor::RegisterMMIO(mmio_mapping.get(), 0x0C000000);
auto& system = Core::System::GetInstance();
system.GetCommandProcessor().RegisterMMIO(system, mmio_mapping.get(), 0x0C000000);
PixelEngine::RegisterMMIO(mmio_mapping.get(), 0x0C001000);
VideoInterface::RegisterMMIO(mmio_mapping.get(), 0x0C002000);
ProcessorInterface::RegisterMMIO(mmio_mapping.get(), 0x0C003000);
Expand Down
7 changes: 7 additions & 0 deletions Source/Core/Core/System.cpp
Expand Up @@ -17,6 +17,7 @@
#include "Core/HW/SI/SI.h"
#include "Core/HW/Sram.h"
#include "Core/HW/VideoInterface.h"
#include "VideoCommon/CommandProcessor.h"

namespace Core
{
Expand All @@ -28,6 +29,7 @@ struct System::Impl

AudioInterface::AudioInterfaceState m_audio_interface_state;
CoreTiming::CoreTimingManager m_core_timing;
CommandProcessor::CommandProcessorManager m_command_processor;
DSP::DSPState m_dsp_state;
DVDInterface::DVDInterfaceState m_dvd_interface_state;
DVDThread::DVDThreadState m_dvd_thread_state;
Expand Down Expand Up @@ -91,6 +93,11 @@ CoreTiming::CoreTimingManager& System::GetCoreTiming() const
return m_impl->m_core_timing;
}

CommandProcessor::CommandProcessorManager& System::GetCommandProcessor() const
{
return m_impl->m_command_processor;
}

DSP::DSPState& System::GetDSPState() const
{
return m_impl->m_dsp_state;
Expand Down
5 changes: 5 additions & 0 deletions Source/Core/Core/System.h
Expand Up @@ -12,6 +12,10 @@ namespace AudioInterface
{
class AudioInterfaceState;
};
namespace CommandProcessor
{
class CommandProcessorManager;
}
namespace CoreTiming
{
class CoreTimingManager;
Expand Down Expand Up @@ -81,6 +85,7 @@ class System

AudioInterface::AudioInterfaceState& GetAudioInterfaceState() const;
CoreTiming::CoreTimingManager& GetCoreTiming() const;
CommandProcessor::CommandProcessorManager& GetCommandProcessor() const;
DSP::DSPState& GetDSPState() const;
DVDInterface::DVDInterfaceState& GetDVDInterfaceState() const;
DVDThread::DVDThreadState& GetDVDThreadState() const;
Expand Down

0 comments on commit ff830c0

Please sign in to comment.