2019-09-09 17:01:26 +10:00
|
|
|
#include "system.h"
|
|
|
|
|
|
|
|
|
|
System::System() = default;
|
|
|
|
|
|
|
|
|
|
System::~System() = default;
|
|
|
|
|
|
|
|
|
|
bool System::Initialize()
|
|
|
|
|
{
|
|
|
|
|
if (!m_cpu.Initialize(&m_bus))
|
|
|
|
|
return false;
|
|
|
|
|
|
2019-09-11 14:01:19 +10:00
|
|
|
if (!m_bus.Initialize(this, &m_dma, &m_gpu))
|
2019-09-09 17:01:26 +10:00
|
|
|
return false;
|
|
|
|
|
|
2019-09-11 14:01:19 +10:00
|
|
|
if (!m_dma.Initialize(&m_bus, &m_gpu))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (!m_gpu.Initialize(&m_bus, &m_dma))
|
2019-09-09 17:01:26 +10:00
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void System::Reset()
|
|
|
|
|
{
|
|
|
|
|
m_cpu.Reset();
|
|
|
|
|
m_bus.Reset();
|
2019-09-11 14:01:19 +10:00
|
|
|
m_dma.Reset();
|
|
|
|
|
m_gpu.Reset();
|
2019-09-09 17:01:26 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void System::RunFrame()
|
|
|
|
|
{
|
|
|
|
|
m_cpu.Execute();
|
|
|
|
|
}
|