all repos — mgba @ ddaaf4ed688f4d736ce937aae8b72662e4fec53c

mGBA Game Boy Advance Emulator

GBA: Make GBA BIOS check endian-agnostic
Jeffrey Pfau jeffrey@endrift.com
Tue, 15 Sep 2015 00:21:48 -0700
commit

ddaaf4ed688f4d736ce937aae8b72662e4fec53c

parent

d85548ac181988e544adc84c869bdbf0009930c0

1 files changed, 2 insertions(+), 4 deletions(-)

jump to
M src/gba/gba.csrc/gba/gba.c

@@ -682,15 +682,13 @@ bool GBAIsBIOS(struct VFile* vf) {

if (vf->seek(vf, 0, SEEK_SET) < 0) { return false; } - uint32_t interruptTable[7]; + uint8_t interruptTable[7 * 4]; if (vf->read(vf, &interruptTable, sizeof(interruptTable)) != sizeof(interruptTable)) { return false; } int i; for (i = 0; i < 7; ++i) { - uint32_t interrupt; - LOAD_32(interrupt, i * sizeof(uint32_t), interruptTable); - if ((interrupt & 0xFFFF0000) != 0xEA000000) { + if (interruptTable[4 * i + 3] != 0xEA || interruptTable[4 * i + 2]) { return false; } }