-
Geo Ster authored
* This commit adds a most basic CPU class that acts as a template which we will slowly build. * The architecture is pretty simple; the ComponentManager will create all the seperate components (EE, VP, IOP, GS etc) as unique_ptr's since it owns them and only it has access to them. All the other components must pass through the manager to read/write data to memory. To achieve this they are given a pointer to the ComponentManger in their constructor. * For now the CPU directly accesses the bios which shouldn't happen but will be fixed eventually when I implement generic read/writes. The goal is to start implementing the CPU as fast as possible in order to get to the GPU/VPU's and display something!
Geo Ster authored* This commit adds a most basic CPU class that acts as a template which we will slowly build. * The architecture is pretty simple; the ComponentManager will create all the seperate components (EE, VP, IOP, GS etc) as unique_ptr's since it owns them and only it has access to them. All the other components must pass through the manager to read/write data to memory. To achieve this they are given a pointer to the ComponentManger in their constructor. * For now the CPU directly accesses the bios which shouldn't happen but will be fixed eventually when I implement generic read/writes. The goal is to start implementing the CPU as fast as possible in order to get to the GPU/VPU's and display something!
ee.cpp 419 B
#include <cpu/ee.hpp>
#include <common/manager.hpp>
EmotionEngine::EmotionEngine(ComponentManager* parent)
{
this->manager = parent;
/* Reset CPU state. */
this->reset_state();
}
void EmotionEngine::tick()
{
/* Fetch next instruction. */
this->fetch_instruction();
}
void EmotionEngine::reset_state()
{
/* Reset PC. */
pc = 0xbfc00000;
}
void EmotionEngine::fetch_instruction()
{
}