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("/home/emufan/Desktop/gcnemu/build/bin/bios30004.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>
std::cout << "Written: 0x" << std::hex << (uint64_t)data << " to address: 0x" << addr << '\n';
uint32_t vaddr = addr & KUSEG_MASKS[addr >> 29];
}
/* Template definitions. */
template uint32_t ComponentManager::read<uint32_t>(uint32_t);
template uint128_t ComponentManager::read<uint128_t>(uint32_t);
template void ComponentManager::write<uint32_t>(uint32_t, uint32_t);
template void ComponentManager::write<uint64_t>(uint32_t, uint64_t);