fix Key1 code to source the DS-mode key data from the ARM9i BIOS, so it works even if no DS BIOSes are provided

(had to rework the loading code to make it work -- if carts are passed to the DSi constructor, they get initialized before the DSi stuff is initialized, and can't read the DSi BIOSes)
This commit is contained in:
Arisotura
2024-11-17 19:04:13 +01:00
parent f0a023b572
commit 5e3d2d07c3
3 changed files with 52 additions and 31 deletions

View File

@ -1296,8 +1296,10 @@ bool EmuInstance::updateConsole() noexcept
#endif
NDSArgs ndsargs {
std::move(nextndscart),
std::move(nextgbacart),
//std::move(nextndscart),
//std::move(nextgbacart),
nullptr,
nullptr,
std::move(arm9bios),
std::move(arm7bios),
std::move(*firmware),
@ -1365,8 +1367,6 @@ bool EmuInstance::updateConsole() noexcept
nds->SetARM7BIOS(*args->ARM7BIOS);
nds->SetARM9BIOS(*args->ARM9BIOS);
nds->SetFirmware(std::move(args->Firmware));
nds->SetNDSCart(std::move(args->NDSROM));
nds->SetGBACart(std::move(args->GBAROM));
nds->SetJITArgs(args->JIT);
// TODO GDB stub shit
nds->SPU.SetInterpolation(args->Interpolation);
@ -1384,10 +1384,16 @@ bool EmuInstance::updateConsole() noexcept
dsi->SetSDCard(std::move(_dsiargs.DSiSDCard));
// We're moving the optional, not the card
// (inserting std::nullopt here is okay, it means no card)
dsi->EjectGBACart();
}
}
// loads the carts later -- to be sure that everything else is initialized
nds->SetNDSCart(std::move(nextndscart));
if (consoleType == 1)
nds->EjectGBACart();
else
nds->SetGBACart(std::move(nextgbacart));
renderLock.unlock();
loadCheats();