GPU: Base work for hardware renderer
This commit is contained in:
@ -1,21 +1,32 @@
|
||||
#include "system.h"
|
||||
#include "bus.h"
|
||||
#include "cpu_core.h"
|
||||
#include "dma.h"
|
||||
#include "gpu.h"
|
||||
|
||||
System::System() = default;
|
||||
System::System()
|
||||
{
|
||||
m_cpu = std::make_unique<CPU::Core>();
|
||||
m_bus = std::make_unique<Bus>();
|
||||
m_dma = std::make_unique<DMA>();
|
||||
m_gpu = std::make_unique<GPU>();
|
||||
// m_gpu = GPU::CreateHardwareOpenGLRenderer();
|
||||
}
|
||||
|
||||
System::~System() = default;
|
||||
|
||||
bool System::Initialize()
|
||||
{
|
||||
if (!m_cpu.Initialize(&m_bus))
|
||||
if (!m_cpu->Initialize(m_bus.get()))
|
||||
return false;
|
||||
|
||||
if (!m_bus.Initialize(this, &m_dma, &m_gpu))
|
||||
if (!m_bus->Initialize(this, m_dma.get(), m_gpu.get()))
|
||||
return false;
|
||||
|
||||
if (!m_dma.Initialize(&m_bus, &m_gpu))
|
||||
if (!m_dma->Initialize(m_bus.get(), m_gpu.get()))
|
||||
return false;
|
||||
|
||||
if (!m_gpu.Initialize(&m_bus, &m_dma))
|
||||
if (!m_gpu->Initialize(m_bus.get(), m_dma.get()))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@ -23,13 +34,13 @@ bool System::Initialize()
|
||||
|
||||
void System::Reset()
|
||||
{
|
||||
m_cpu.Reset();
|
||||
m_bus.Reset();
|
||||
m_dma.Reset();
|
||||
m_gpu.Reset();
|
||||
m_cpu->Reset();
|
||||
m_bus->Reset();
|
||||
m_dma->Reset();
|
||||
m_gpu->Reset();
|
||||
}
|
||||
|
||||
void System::RunFrame()
|
||||
{
|
||||
m_cpu.Execute();
|
||||
m_cpu->Execute();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user