From e7e1b58d01c90b423e153274ff14e2a1a67fc994 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Fri, 26 Aug 2022 06:11:57 +0200 Subject: [PATCH] Emulator: Add error message when reading/writing unmapped memory space --- src/emu.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/emu.cpp b/src/emu.cpp index 6be7de5..d646bac 100644 --- a/src/emu.cpp +++ b/src/emu.cpp @@ -71,6 +71,8 @@ void Emu::writeMemory(uint32_t address, uint32_t value) } } + ruc::error("writing into address '{:#06x}' which is not in a memory space!", address); + VERIFY_NOT_REACHED(); } @@ -85,7 +87,10 @@ uint32_t Emu::readMemory(uint32_t address) const // When trying to access the cartridge header if (address >= 0x100 && address <= 0x14f) { - ruc::error("No cartridge loaded!"); + ruc::error("no cartridge loaded!"); + } + else { + ruc::error("reading from address '{:#06x}' which is not in a memory space!", address); } VERIFY_NOT_REACHED();