Emu: Add functionality to add Memory and PUs

This commit is contained in:
Frank
2022-08-17 23:41:46 +02:00
parent a37818d5ee
commit f15c560b5d
4 changed files with 46 additions and 13 deletions
+19
View File
@@ -0,0 +1,19 @@
#include "emu.h"
void Emu::update() {
for (auto unit : m_processing_units) {
if (m_cycle % int(m_frequency / unit.frequency()) == 0) {
unit.update();
}
}
}
void Emu::addProcessingUnit(ProcessingUnit processing_unit) {
m_processing_units.push_back(processing_unit);
}
void Emu::addMemorySpace(const char* name, int size) {
std::vector<uint8_t> memory;
memory.reserve(size);
m_memory_spaces.emplace(name, memory);
}