GBA: Widen multiboot search

This commit is contained in:
Vicki Pfau 2022-02-20 21:23:40 -08:00
parent 91911fe092
commit 862bd15afc
1 changed files with 6 additions and 6 deletions

View File

@ -677,16 +677,16 @@ bool GBAIsMB(struct VFile* vf) {
int romAddrs = 0; int romAddrs = 0;
int romLoads = 0; int romLoads = 0;
int i; int i;
for (i = 0; i < 80; ++i) { for (i = 0; i < 128; ++i) {
if (vf->read(vf, &signature, sizeof(signature)) != sizeof(signature)) { if (vf->read(vf, &signature, sizeof(signature)) != sizeof(signature)) {
break; break;
} }
pc += 4; pc += 4;
LOAD_32(opcode, 0, &signature); LOAD_32(opcode, 0, &signature);
if ((opcode & ~0x7FF) == BASE_WORKING_RAM) { if ((opcode & ~0x1FFFF) == BASE_WORKING_RAM) {
++wramAddrs; ++wramAddrs;
} }
if ((opcode & ~0x7FF) == BASE_CART0) { if ((opcode & ~0x1FFFF) == BASE_CART0) {
++romAddrs; ++romAddrs;
} }
ARMDecodeARM(opcode, &info); ARMDecodeARM(opcode, &info);
@ -709,15 +709,15 @@ bool GBAIsMB(struct VFile* vf) {
if (vf->seek(vf, pc, SEEK_SET) < 0) { if (vf->seek(vf, pc, SEEK_SET) < 0) {
break; break;
} }
if ((immediate & ~0x7FF) == BASE_WORKING_RAM) { if ((immediate & ~0x1FFFF) == BASE_WORKING_RAM) {
++wramLoads; ++wramLoads;
} }
if ((immediate & ~0x7FF) == BASE_CART0) { if ((immediate & ~0x1FFFF) == BASE_CART0) {
++romLoads; ++romLoads;
} }
} }
} }
if (romLoads + romAddrs > 2) { if (romLoads + romAddrs >= 2) {
return false; return false;
} }
if (wramLoads + wramAddrs) { if (wramLoads + wramAddrs) {