Skip to content

Commit 13dbe84

Browse files
committed
B4DS: Move arm9 bootloader code to 0x023BF000
1 parent 89230bf commit 13dbe84

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

retail/bootloader/load.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ENTRY(_start)
55
MEMORY {
66

77
vram : ORIGIN = 0x06000000, LENGTH = 256K
8-
arm9ram : ORIGIN = 0x02337000, LENGTH = 4K /* Used for the ARM9's functions */
8+
arm9ram : ORIGIN = 0x023BF000, LENGTH = 4K /* Used for the ARM9's functions */
99
}
1010

1111
__vram_start = ORIGIN(vram);

retail/bootloader/source/arm7/main.arm7.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ static void resetMemory_ARM7(void) {
278278

279279
memset_addrs_arm7(0x03800000 - 0x8000, 0x03800000 + 0x10000);
280280
memset_addrs_arm7(0x02000620, 0x02084000); // clear part of EWRAM
281-
memset_addrs_arm7(0x02280000, IMAGES_LOCATION-0x1000); // clear part of EWRAM - except before nds-bootstrap images
282-
toncset((u32*)0x02380000, 0, 0x38000); // clear part of EWRAM - except before 0x023DA000, which has the arm9 code
281+
memset_addrs_arm7(0x02280000, IMAGES_LOCATION); // clear part of EWRAM - except before nds-bootstrap images
282+
toncset((u32*)0x02380000, 0, 0x3F000); // clear part of EWRAM - except before 0x023BF000, which has the arm9 code
283283
toncset((u32*)0x023C0000, 0, 0x20000);
284284
toncset((u32*)0x023F0000, 0, 0xD000);
285285
toncset((u32*)0x023FE000, 0, 0x400);

retail/bootloader2/load.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ENTRY(_start)
55
MEMORY {
66

77
vram : ORIGIN = 0x06000000, LENGTH = 256K
8-
arm9ram : ORIGIN = 0x02337000, LENGTH = 4K /* Used for the ARM9's functions */
8+
arm9ram : ORIGIN = 0x023BF000, LENGTH = 4K /* Used for the ARM9's functions */
99
}
1010

1111
__vram_start = ORIGIN(vram);

retail/bootloaderi/source/arm7/main.arm7.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ static void resetMemory_ARM7(void) {
317317
memset_addrs_arm7(0x02000000, 0x02000400); // clear part of EWRAM - except before TWLCFG
318318
memset_addrs_arm7(0x02000620, 0x02084000); // clear part of EWRAM
319319
memset_addrs_arm7(0x02280000, IMAGES_LOCATION); // clear part of EWRAM - except before nds-bootstrap images
320-
dma_twlFill32(0, 0, (u32*)0x02380000, 0x3F000); // clear part of EWRAM - except before 0x023C0000, which has the arm9 code
320+
dma_twlFill32(0, 0, (u32*)0x02380000, 0x3F000); // clear part of EWRAM - except before 0x023BF000, which has the arm9 code
321321
dma_twlFill32(0, 0, (u32*)0x023C0000, 0x40000); // clear part of EWRAM
322322
memset_addrs_arm7(0x02700000, BLOWFISH_LOCATION); // clear part of EWRAM - except before ce7 and ce9 binaries
323323
dma_twlFill32(0, 0, (u32*)0x027F8000, 0x8000); // clear part of EWRAM

retail/cardengine/arm7/source/cardengine.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ static void initialize(void) {
161161
}
162162

163163
if (!bootloaderCleared) {
164-
toncset((u32*)0x02377000, 0, 0x1000);
165164
toncset((u8*)0x06000000, 0, 0x40000); // Clear bootloader
166165
bootloaderCleared = true;
167166
}

0 commit comments

Comments
 (0)