You've already forked pico-loader
mirror of
https://github.com/LNH-team/pico-loader.git
synced 2026-01-09 16:28:35 -08:00
Improved handling of DSi roms and DSiWare. Fixes some system tools DSi roms being misdetected as DSiWare (related to #23)
This commit is contained in:
@@ -49,15 +49,18 @@ void* Arm7Patcher::ApplyPatches(const LoaderPlatform* loaderPlatform) const
|
||||
patchCollection.AddPatch(arm7ArenaPatch);
|
||||
|
||||
if (romHeader->unitCode == 0) // seems only present on NITRO, not on HYBRID or LIMITED
|
||||
{
|
||||
patchCollection.AddPatch(new DisableArm7WramClearPatch());
|
||||
}
|
||||
|
||||
if (sdkVersion.IsTwlSdk())
|
||||
{
|
||||
if (gIsDsiMode && romHeader->IsTwlRom() && twlRomHeader->IsDsiWare())
|
||||
if (gIsDsiMode && (twlRomHeader->HasNandAccess() || twlRomHeader->HasSdAccess()))
|
||||
{
|
||||
patchCollection.AddPatch(new Sdk5DsiSdCardRedirectPatch());
|
||||
}
|
||||
else
|
||||
|
||||
if (!twlRomHeader->IsDsiWare())
|
||||
{
|
||||
patchCollection.AddPatch(new CardiDoTaskFromArm9Patch());
|
||||
}
|
||||
|
||||
@@ -153,14 +153,13 @@ void Arm9Patcher::ApplyPatches(const LoaderPlatform* loaderPlatform, const ApLis
|
||||
}
|
||||
else
|
||||
{
|
||||
SecureSysCallsUnusedSpaceLocator secureSysCallsUnusedSpaceLocator;
|
||||
secureSysCallsUnusedSpaceLocator.FindUnusedSpace(romHeader, patchContext.GetPatchHeap());
|
||||
SecureSysCallsUnusedSpaceLocator().FindUnusedSpace(romHeader, patchContext.GetPatchHeap());
|
||||
}
|
||||
}
|
||||
|
||||
if (sdkVersion.IsTwlSdk())
|
||||
{
|
||||
if (!(romHeader->IsTwlRom() && twlRomHeader->IsDsiWare()))
|
||||
if (!twlRomHeader->IsDsiWare())
|
||||
{
|
||||
// if ((romHeader->unitCode & 3) != 3)
|
||||
{
|
||||
@@ -168,7 +167,7 @@ void Arm9Patcher::ApplyPatches(const LoaderPlatform* loaderPlatform, const ApLis
|
||||
}
|
||||
patchCollection.AddPatch(new CardiReadRomWithCpuPatch());
|
||||
|
||||
if (gIsDsiMode && (romHeader->unitCode & 2))
|
||||
if (gIsDsiMode && romHeader->IsTwlRom())
|
||||
{
|
||||
patchCollection.AddPatch(new CardiReadCardWithHashInternalAsyncPatch());
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ static u32 correctAddressForArm7iAutoLoad(u32 address)
|
||||
{
|
||||
auto romHeader = (const nds_header_twl_t*)TWL_SHARED_MEMORY->twlRomHeader;
|
||||
auto arm7iModuleParams = (const module_params_twl_t*)(
|
||||
romHeader->ntrHeader.arm7LoadAddress + romHeader->arm7iModuleParamsAddress);
|
||||
romHeader->arm7LoadAddress + romHeader->arm7iModuleParamsAddress);
|
||||
|
||||
auto autoLoadListEntry = (autoload_list_entry_sdk5_t*)arm7iModuleParams->autoloadListStart;
|
||||
u32 currentAddress = arm7iModuleParams->autoloadStart;
|
||||
|
||||
Reference in New Issue
Block a user