Map slot 1 and 2 to arm7 on boot

This commit is contained in:
Gericom
2025-12-20 18:36:20 +01:00
parent 61463ca39a
commit 4fd7fde362

View File

@@ -218,22 +218,15 @@ static void handleBootCommand()
REG_EXMEMCNT &= ~0x0880; // map ds and gba slot to arm9 REG_EXMEMCNT &= ~0x0880; // map ds and gba slot to arm9
sLoaderPlatform->PrepareRomBoot(sRomDirSector, sRomDirSectorOffset); sLoaderPlatform->PrepareRomBoot(sRomDirSector, sRomDirSectorOffset);
Arm9IoRegisterClearer().ClearNtrIoRegisters(isSdkResetSystem); Arm9IoRegisterClearer().ClearNtrIoRegisters(isSdkResetSystem);
REG_EXMEMCNT |= 0x0880; // map ds and gba slot to arm7
auto ntrRomHeader = (const nds_header_ntr_t*)TWL_SHARED_MEMORY->ntrSharedMem.romHeader; auto ntrRomHeader = (const nds_header_ntr_t*)TWL_SHARED_MEMORY->ntrSharedMem.romHeader;
if (ntrRomHeader->IsTwlRom()) if (gIsDsiMode && ntrRomHeader->IsTwlRom())
{ {
if (gIsDsiMode) Arm9IoRegisterClearer().ClearTwlIoRegisters();
{ REG_SCFG_EXT = 0x8307F100;
Arm9IoRegisterClearer().ClearTwlIoRegisters(); scfg_setArm9Clock(ScfgArm9Clock::Twl134MHz);
REG_SCFG_EXT = 0x8307F100; REG_SCFG_CLK = 0x87;
scfg_setArm9Clock(ScfgArm9Clock::Twl134MHz); REG_SCFG_RST = 1;
REG_SCFG_CLK = 0x87;
REG_SCFG_RST = 1;
}
auto twlRomHeader = (const nds_header_twl_t*)TWL_SHARED_MEMORY->twlRomHeader;
if (twlRomHeader->IsDsiWare())
{
REG_EXMEMCNT |= 0x0880; // map ds and gba slot to arm7
}
} }
bootArm9(); bootArm9();
} }