Emulator: Add error message when reading unloaded cartridge header

This commit is contained in:
Riyyi
2022-08-25 14:56:33 +02:00
parent c9e2bf9e94
commit be3ee22086
+6
View File
@@ -12,6 +12,7 @@
#include "cpu.h" #include "cpu.h"
#include "emu.h" #include "emu.h"
#include "ruc/format/log.h"
#include "ruc/format/print.h" #include "ruc/format/print.h"
#include "ruc/meta/assert.h" #include "ruc/meta/assert.h"
@@ -82,6 +83,11 @@ 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!");
}
VERIFY_NOT_REACHED(); VERIFY_NOT_REACHED();
return 0; return 0;
} }