From cfded56dcdd2fb26a527baaf5524d131a19a1af5 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Tue, 30 Aug 2022 16:24:51 +0200 Subject: [PATCH] Emulator: Fix offset bug in readMemory() function --- src/emu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emu.cpp b/src/emu.cpp index db40a8e..b4de96d 100644 --- a/src/emu.cpp +++ b/src/emu.cpp @@ -90,7 +90,7 @@ uint32_t Emu::readMemory(uint32_t address) const for (const auto& memory_space : m_memory_spaces) { const auto& memory = memory_space.second; if (address >= memory.start_address && address <= memory.end_address) { - return memory.memory[memory.active_bank][address]; + return memory.memory[memory.active_bank][address - memory.start_address]; } }