Browse Source

Emulator: Add error message when reading unloaded cartridge header

master
Riyyi 2 years ago
parent
commit
be3ee22086
  1. 6
      src/emu.cpp

6
src/emu.cpp

@ -12,6 +12,7 @@
#include "cpu.h"
#include "emu.h"
#include "ruc/format/log.h"
#include "ruc/format/print.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();
return 0;
}

Loading…
Cancel
Save