Browse Source

Emulator: Add error message when reading/writing unmapped memory space

master
Riyyi 2 years ago
parent
commit
e7e1b58d01
  1. 7
      src/emu.cpp

7
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(); VERIFY_NOT_REACHED();
} }
@ -85,7 +87,10 @@ uint32_t Emu::readMemory(uint32_t address) const
// When trying to access the cartridge header // When trying to access the cartridge header
if (address >= 0x100 && address <= 0x14f) { 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(); VERIFY_NOT_REACHED();

Loading…
Cancel
Save