GBA: Clean up BIOS skip detection; add second multiboot entry

This commit is contained in:
Vicki Pfau 2022-12-17 00:21:07 -08:00
parent 83578d915b
commit d2949383d5
2 changed files with 6 additions and 4 deletions

View File

@ -700,8 +700,8 @@ static void _GBACoreReset(struct mCore* core) {
#endif
ARMReset(core->cpu);
bool forceSkip = gba->mbVf;
if (!(forceSkip || core->opts.skipBios) && (gba->romVf || gba->memory.rom) && gba->pristineRomSize >= 0xA0 && gba->biosVf) {
bool forceSkip = gba->mbVf || core->opts.skipBios;
if (!forceSkip && (gba->romVf || gba->memory.rom) && gba->pristineRomSize >= 0xA0 && gba->biosVf) {
uint32_t crc = doCrc32(&gba->memory.rom[1], 0x9C);
if (crc != LOGO_CRC32) {
mLOG(STATUS, WARN, "Invalid logo, skipping BIOS");
@ -709,7 +709,7 @@ static void _GBACoreReset(struct mCore* core) {
}
}
if (forceSkip || (core->opts.skipBios && (gba->romVf || gba->memory.rom))) {
if (forceSkip) {
GBASkipBIOS(core->board);
}

View File

@ -275,8 +275,10 @@ void GBASkipBIOS(struct GBA* gba) {
if (cpu->gprs[ARM_PC] == BASE_RESET + WORD_SIZE_ARM) {
if (gba->memory.rom) {
cpu->gprs[ARM_PC] = BASE_CART0;
} else {
} else if (gba->memory.wram[0x30]) {
cpu->gprs[ARM_PC] = BASE_WORKING_RAM + 0xC0;
} else {
cpu->gprs[ARM_PC] = BASE_WORKING_RAM;
}
gba->video.vcount = 0x7E;
gba->memory.io[REG_VCOUNT >> 1] = 0x7E;