mirror of https://github.com/mgba-emu/mgba.git
GBA: Make GBA BIOS check endian-agnostic
This commit is contained in:
parent
f960a3bb2a
commit
fe9c73dd6f
|
@ -660,15 +660,13 @@ bool GBAIsBIOS(struct VFile* vf) {
|
||||||
if (vf->seek(vf, 0, SEEK_SET) < 0) {
|
if (vf->seek(vf, 0, SEEK_SET) < 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
uint32_t interruptTable[7];
|
uint8_t interruptTable[7 * 4];
|
||||||
if (vf->read(vf, &interruptTable, sizeof(interruptTable)) != sizeof(interruptTable)) {
|
if (vf->read(vf, &interruptTable, sizeof(interruptTable)) != sizeof(interruptTable)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < 7; ++i) {
|
for (i = 0; i < 7; ++i) {
|
||||||
uint32_t interrupt;
|
if (interruptTable[4 * i + 3] != 0xEA || interruptTable[4 * i + 2]) {
|
||||||
LOAD_32(interrupt, i * sizeof(uint32_t), interruptTable);
|
|
||||||
if ((interrupt & 0xFFFF0000) != 0xEA000000) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue