Emulator: Add writing of ECHO RAM

This commit is contained in:
Riyyi
2022-08-21 20:05:10 +02:00
parent 65c3797030
commit 46f3009124
+7
View File
@@ -58,8 +58,15 @@ void Emu::writeMemory(uint32_t address, uint32_t value)
{ {
for (auto& memory_space : m_memory_spaces) { for (auto& memory_space : m_memory_spaces) {
auto memory = memory_space.second; auto memory = memory_space.second;
if (address >= memory.start_address && address <= memory.end_address) { if (address >= memory.start_address && address <= memory.end_address) {
// Note: ECHO RAM hack
if (address >= 0xc000 && address <= 0xddff) {
writeMemory(address + (0xe000 - 0xc000), value);
}
memory.memory[memory.active_bank][address] = value; memory.memory[memory.active_bank][address] = value;
break;
} }
} }
} }