698 changes: 382 additions & 316 deletions Source/Core/Core/HW/VideoInterface.cpp

Large diffs are not rendered by default.

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

#pragma once

#include <memory>

#include "Common/CommonTypes.h"

class PointerWrap;
Expand All @@ -13,6 +15,23 @@ class Mapping;

namespace VideoInterface
{
class VideoInterfaceState
{
public:
VideoInterfaceState();
VideoInterfaceState(const VideoInterfaceState&) = delete;
VideoInterfaceState(VideoInterfaceState&&) = delete;
VideoInterfaceState& operator=(const VideoInterfaceState&) = delete;
VideoInterfaceState& operator=(VideoInterfaceState&&) = delete;
~VideoInterfaceState();

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

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

// VI Internal Hardware Addresses
enum
{
Expand Down
7 changes: 7 additions & 0 deletions Source/Core/Core/System.cpp
Expand Up @@ -12,6 +12,7 @@
#include "Core/HW/DVD/DVDInterface.h"
#include "Core/HW/DVD/DVDThread.h"
#include "Core/HW/Sram.h"
#include "Core/HW/VideoInterface.h"

namespace Core
{
Expand All @@ -26,6 +27,7 @@ struct System::Impl
DVDInterface::DVDInterfaceState m_dvd_interface_state;
DVDThread::DVDThreadState m_dvd_thread_state;
Sram m_sram;
VideoInterface::VideoInterfaceState m_video_interface_state;
};

System::System() : m_impl{std::make_unique<Impl>()}
Expand Down Expand Up @@ -95,4 +97,9 @@ Sram& System::GetSRAM() const
{
return m_impl->m_sram;
}

VideoInterface::VideoInterfaceState& System::GetVideoInterfaceState() const
{
return m_impl->m_video_interface_state;
}
} // namespace Core
5 changes: 5 additions & 0 deletions Source/Core/Core/System.h
Expand Up @@ -24,6 +24,10 @@ namespace DVDThread
{
class DVDThreadState;
}
namespace VideoInterface
{
class VideoInterfaceState;
};

namespace Core
{
Expand Down Expand Up @@ -64,6 +68,7 @@ class System
DVDInterface::DVDInterfaceState& GetDVDInterfaceState() const;
DVDThread::DVDThreadState& GetDVDThreadState() const;
Sram& GetSRAM() const;
VideoInterface::VideoInterfaceState& GetVideoInterfaceState() const;

private:
System();
Expand Down