diff --git a/retail/bootloader/source/arm7/dsi2ds_patches.c b/retail/bootloader/source/arm7/dsi2ds_patches.c index e38393612..e8f3d66ab 100644 --- a/retail/bootloader/source/arm7/dsi2ds_patches.c +++ b/retail/bootloader/source/arm7/dsi2ds_patches.c @@ -11087,7 +11087,13 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) { *(u32*)0x020117D4 = 0xE1A00000; // nop tonccpy((u32*)0x0201234C, dsiSaveGetResultCode, 0xC); *(u32*)0x020152F0 = 0xE1A00000; // nop - patchInitDSiWare(0x0201BFB4, heapEnd8MBHack); + patchInitDSiWare(0x0201BFB4, heapEnd); + *(u32*)0x0201C340 = *(u32*)0x02004FD0; + if (!extendedMemory) { + // Shrink heap from 0x60E000 + *(u32*)0x020250B4 = 0xE2822602; // add r2, r2, 0x200000 + *(u32*)0x020250EC = 0x20E000; + } *(u32*)0x020381BC = 0xE1A00000; // nop setBL(0x02038250, (u32)dsiSaveGetInfo); setBL(0x02038294, (u32)dsiSaveOpen); diff --git a/retail/bootloader/source/arm7/main.arm7.c b/retail/bootloader/source/arm7/main.arm7.c index 2a779dddb..6086754ac 100644 --- a/retail/bootloader/source/arm7/main.arm7.c +++ b/retail/bootloader/source/arm7/main.arm7.c @@ -273,6 +273,7 @@ static void resetMemory_ARM7(void) { toncset((u32*)0x02380000, 0, 0x38000); // clear part of EWRAM - except before 0x023DA000, which has the arm9 code toncset((u32*)0x023C0000, 0, 0x20000); toncset((u32*)0x023F0000, 0, 0xD000); + toncset((u32*)0x023FE000, 0, 0x400); toncset((u32*)0x023FF000, 0, 0x1000); if (extendedMemory) { toncset((u32*)0x02400000, 0, 0x3FC000);