|
|
|
@ -1,8 +1,10 @@
|
|
|
|
|
#include "emu.h" |
|
|
|
|
#include <cstdint> // uint8_t, uint32_t |
|
|
|
|
|
|
|
|
|
#include "cpu.h" |
|
|
|
|
#include "emu.h" |
|
|
|
|
#include "ruc/format/print.h" |
|
|
|
|
|
|
|
|
|
void Emu::init(unsigned int frequency) |
|
|
|
|
void Emu::init(uint32_t frequency) |
|
|
|
|
{ |
|
|
|
|
m_frequency = frequency; |
|
|
|
|
} |
|
|
|
@ -28,13 +30,13 @@ void Emu::addMemorySpace(const char* name, int size)
|
|
|
|
|
m_memory_spaces.emplace(name, memory); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Emu::writeMemory(const char* memory_space, unsigned int location, uint8_t value) |
|
|
|
|
void Emu::writeMemory(const char* memory_space, uint32_t location, uint8_t value) |
|
|
|
|
{ |
|
|
|
|
print("{} {} {}\n", memory_space, location, value); |
|
|
|
|
m_memory_spaces[memory_space][location] = value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
uint8_t Emu::readMemory(const char* memory_space, unsigned int location) |
|
|
|
|
uint8_t Emu::readMemory(const char* memory_space, uint32_t location) |
|
|
|
|
{ |
|
|
|
|
// return m_memory_spaces[memory_space][location];
|
|
|
|
|
return m_memory_spaces[memory_space][location]; |
|
|
|
|
} |
|
|
|
|