Newer
Older
#include <fstream>
#include <iostream>
#include <memory>
{
ee = std::make_unique<EmotionEngine>(this);
/* Allocate the entire 32MB of RAM */
memory = new uint8_t[MEMORY_RANGE];
/* Load the BIOS in our memory */
/* NOTE: Must make a GUI for this someday */
this->read_bios();
ComponentManager::~ComponentManager()
{
delete[] memory;
}
void ComponentManager::read_bios()
{
/* Yes it's hardcoded for now, don't bite me, I'll change it eventually */
std::ifstream reader;
reader.open("SCPH-30003.BIN", std::ios::in | std::ios::binary);
if (!reader.is_open())
exit(1);
reader.seekg(0);
}
/* Instanciate the templates here so we can limit their types below */
template <typename T>
{
uint32_t vaddr = addr & KUSEG_MASKS[addr >> 29];
}
/* Instanciate the templates here so we can limit their types below */
template <typename T>
{
uint32_t vaddr = addr & KUSEG_MASKS[addr >> 29];
}
/* Template definitions. */
template uint32_t ComponentManager::read<uint32_t>(uint32_t);
template uint64_t ComponentManager::read<uint64_t>(uint32_t);
template uint8_t ComponentManager::read<uint8_t>(uint32_t);
template void ComponentManager::write<uint32_t>(uint32_t, uint32_t);
template void ComponentManager::write<uint64_t>(uint32_t, uint64_t);
template void ComponentManager::write<uint8_t>(uint32_t, uint8_t);