From ca9eafd015b218644d3d200001817f5c0bc17bbb Mon Sep 17 00:00:00 2001 From: RocketRobz Date: Sun, 2 Feb 2025 01:52:11 -0700 Subject: [PATCH] Derp fix --- title/bootloader/source/boot.c | 3 ++- universal/bootloader_app/source/boot.c | 3 ++- universal/bootloader_menu/source/boot.c | 3 ++- universal/source/nds_loader/nds_loader_arm9.c | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/title/bootloader/source/boot.c b/title/bootloader/source/boot.c index 76f5aeca4d..5c216e89b4 100644 --- a/title/bootloader/source/boot.c +++ b/title/bootloader/source/boot.c @@ -635,8 +635,8 @@ int main (void) { #ifndef NO_SDMMC sdRead = (dsiSD && dsiMode); #endif + toncset((u32*)0x06000000, 0, 0x8000); if (wantToPatchDLDI) { - toncset((u32*)0x06000000, 0, 0x8000); if (*(u32*)0x02FF4184 == 0x69684320) { // DLDI ' Chi' string in bootstub space + bootloader in DLDI driver space const u16 dldiFileSize = 1 << *(u8*)0x02FF418D; tonccpy((u32*)0x06000000, (u32*)0x02FF4180, dldiFileSize); @@ -749,6 +749,7 @@ int main (void) { // Patch with DLDI if desired if (wantToPatchDLDI) { dldiPatchBinary ((u8*)((u32*)NDS_HEAD)[0x0A], ((u32*)NDS_HEAD)[0x0B]); + toncset((u32*)0x06000000, 0, 0x8000); } #endif diff --git a/universal/bootloader_app/source/boot.c b/universal/bootloader_app/source/boot.c index 74d8f8e734..7efb708b77 100644 --- a/universal/bootloader_app/source/boot.c +++ b/universal/bootloader_app/source/boot.c @@ -388,8 +388,8 @@ int main (void) { #ifndef NO_SDMMC sdRead = (dsiSD && dsiMode); #endif + toncset((u32*)0x06000000, 0, 0x8000); if (wantToPatchDLDI) { - toncset((u32*)0x06000000, 0, 0x8000); if (*(u32*)0x02FF4184 == 0x69684320) { // DLDI ' Chi' string in bootstub space + bootloader in DLDI driver space const u16 dldiFileSize = 1 << *(u8*)0x02FF418D; tonccpy((u32*)0x06000000, (u32*)0x02FF4180, dldiFileSize); @@ -478,6 +478,7 @@ int main (void) { // Patch with DLDI if desired if (wantToPatchDLDI) { dldiPatchBinary ((u8*)((u32*)NDS_HEAD)[0x0A], ((u32*)NDS_HEAD)[0x0B]); + toncset((u32*)0x06000000, 0, 0x8000); } #endif diff --git a/universal/bootloader_menu/source/boot.c b/universal/bootloader_menu/source/boot.c index 91018260b6..c279eb5e3c 100644 --- a/universal/bootloader_menu/source/boot.c +++ b/universal/bootloader_menu/source/boot.c @@ -579,8 +579,8 @@ int main (void) { #ifndef NO_SDMMC sdRead = (dsiSD && dsiMode); #endif + toncset((u32*)0x06000000, 0, 0x8000); if (wantToPatchDLDI) { - toncset((u32*)0x06000000, 0, 0x8000); if (*(u32*)0x02FF4184 == 0x69684320) { // DLDI ' Chi' string in bootstub space + bootloader in DLDI driver space const u16 dldiFileSize = 1 << *(u8*)0x02FF418D; tonccpy((u32*)0x06000000, (u32*)0x02FF4180, dldiFileSize); @@ -681,6 +681,7 @@ int main (void) { // Patch with DLDI if desired if (wantToPatchDLDI) { dldiPatchBinary ((u8*)((u32*)NDS_HEAD)[0x0A], ((u32*)NDS_HEAD)[0x0B]); + toncset((u32*)0x06000000, 0, 0x8000); } #endif diff --git a/universal/source/nds_loader/nds_loader_arm9.c b/universal/source/nds_loader/nds_loader_arm9.c index 5ae68c896f..f31c7b702b 100644 --- a/universal/source/nds_loader/nds_loader_arm9.c +++ b/universal/source/nds_loader/nds_loader_arm9.c @@ -271,7 +271,7 @@ int runNds (const void* loader, u32 loaderSize, u32 cluster, bool initDisc, bool VRAM_C_CR = VRAM_ENABLE | VRAM_C_LCD; // Load the loader/patcher into the correct address tonccpy (LCDC_BANK_C, loader, loaderSize); - toncset (LCDC_BANK_C+loaderSize, 0, 0x20000-loaderSize); + toncset (LCDC_BANK_C+loaderSize, 0, 0x18000-loaderSize); // Set the parameters for the loader // STORED_FILE_CLUSTER = cluster;