Skip to content

Commit

Permalink
Derp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed Feb 2, 2025
1 parent 5609e40 commit ca9eafd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion title/bootloader/source/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion universal/bootloader_app/source/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion universal/bootloader_menu/source/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion universal/source/nds_loader/nds_loader_arm9.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ca9eafd

Please sign in to comment.