Impl HandleiQueRegionFreePatching to bypass region locking on certain iQue games (#83)

This commit is contained in:
TY
2026-01-04 23:13:24 +08:00
committed by GitHub
parent f1e5f0cddc
commit a424b25263
2 changed files with 11 additions and 0 deletions

View File

@@ -220,6 +220,7 @@ void NdsLoader::Load(BootMode bootMode)
if (bootMode == BootMode::Normal)
{
bootType = _romHeader.IsDsiWare() ? BOOT_TYPE_NAND : BOOT_TYPE_CARD;
HandleIQueRegionFreePatching();
}
else if (bootMode == BootMode::Multiboot)
{
@@ -1013,6 +1014,15 @@ bool NdsLoader::TryDecryptSecureArea()
return true;
}
void NdsLoader::HandleIQueRegionFreePatching()
{
if ((_romHeader.flags & 0x80) == 0x80)
{
_romHeader.flags &= ~0x80;
_romHeader.headerCrc = swi_getCrc16(0xFFFF, (void*)&_romHeader, 0x15E);
}
}
ConsoleRegion NdsLoader::GetRomRegion(u32 gameCode)
{
u8 gameRegionCode = (gameCode >> 24) & 0xFF;