436 changes: 248 additions & 188 deletions Source/Core/Core/HW/DSP.cpp

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions Source/Core/Core/HW/DSP.h
Expand Up @@ -3,6 +3,8 @@

#pragma once

#include <memory>

#include "Common/CommonTypes.h"

class PointerWrap;
Expand All @@ -14,6 +16,23 @@ class Mapping;

namespace DSP
{
class DSPState
{
public:
DSPState();
DSPState(const DSPState&) = delete;
DSPState(DSPState&&) = delete;
DSPState& operator=(const DSPState&) = delete;
DSPState& operator=(DSPState&&) = delete;
~DSPState();

struct Data;
Data& GetData() { return *m_data; }

private:
std::unique_ptr<Data> m_data;
};

enum DSPInterruptType
{
INT_DSP = 0x80,
Expand Down
7 changes: 7 additions & 0 deletions Source/Core/Core/System.cpp
Expand Up @@ -8,6 +8,7 @@
#include "AudioCommon/SoundStream.h"
#include "Core/Config/MainSettings.h"
#include "Core/HW/AudioInterface.h"
#include "Core/HW/DSP.h"
#include "Core/HW/DVD/DVDInterface.h"
#include "Core/HW/DVD/DVDThread.h"
#include "Core/HW/Sram.h"
Expand All @@ -21,6 +22,7 @@ struct System::Impl
bool m_audio_dump_started = false;

AudioInterface::AudioInterfaceState m_audio_interface_state;
DSP::DSPState m_dsp_state;
DVDInterface::DVDInterfaceState m_dvd_interface_state;
DVDThread::DVDThreadState m_dvd_thread_state;
Sram m_sram;
Expand Down Expand Up @@ -74,6 +76,11 @@ AudioInterface::AudioInterfaceState& System::GetAudioInterfaceState() const
return m_impl->m_audio_interface_state;
}

DSP::DSPState& System::GetDSPState() const
{
return m_impl->m_dsp_state;
}

DVDInterface::DVDInterfaceState& System::GetDVDInterfaceState() const
{
return m_impl->m_dvd_interface_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 DSP
{
class DSPState;
}
namespace DVDInterface
{
class DVDInterfaceState;
Expand Down Expand Up @@ -56,6 +60,7 @@ class System
void SetAudioDumpStarted(bool started);

AudioInterface::AudioInterfaceState& GetAudioInterfaceState() const;
DSP::DSPState& GetDSPState() const;
DVDInterface::DVDInterfaceState& GetDVDInterfaceState() const;
DVDThread::DVDThreadState& GetDVDThreadState() const;
Sram& GetSRAM() const;
Expand Down