Skip to content

Commit 05fe5ba

Browse files
committed
B4DS: Only boot *Fizz* (DSiWare) on debug DS consoles
Only the tutorial works outside of debug consoles
1 parent 7f35c14 commit 05fe5ba

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

retail/bootloader/source/arm7/dsi2ds_patches.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) {
7575
heapEndRetail = ((u32)ndsHeader->arm9destination >= 0x02004000) ? ce9DldiOffset : CARDENGINE_ARM9_LOCATION_DLDI_32;
7676
}
7777
const u32 heapEnd = extendedMemory ? (((u32)ndsHeader->arm9destination >= 0x02004000) ? 0x027D8000 : 0x02700000) : heapEndRetail;
78-
const u32 heapEnd8MBHack = extendedMemory ? heapEnd : heapEndRetail+0x400000; // extendedMemory ? #0x27B0000 : #0x27E0000 (mirrors to 0x23E0000 on retail DS units)
78+
// const u32 heapEnd8MBHack = extendedMemory ? heapEnd : heapEndRetail+0x400000; // extendedMemory ? #0x27B0000 : #0x27E0000 (mirrors to 0x23E0000 on retail DS units)
7979
const u32 heapEndExceed = extendedMemory ? heapEnd+0x800000 : heapEndRetail+0xC00000; // extendedMemory ? #0x2FB0000 (mirrors to 0x27B0000 on debug DS units) : #0x2FE0000 (mirrors to 0x23E0000 on retail DS units)
8080
const u32 heapEndMaxForRetail = (maxHeapOpen && !extendedMemory) ? ((_io_dldi_size == 0x0F) ? 0x023F6000 : (_io_dldi_size == 0x0E) ? 0x023FA000 : 0x023FC000) : heapEnd;
8181
const u32 heapEndMaxForRetail2 = (maxHeapOpen && !extendedMemory) ? ((_io_dldi_size == 0x0F) ? heapEndMaxForRetail : 0x023FF000) : heapEnd;
@@ -12066,14 +12066,15 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) {
1206612066
}
1206712067

1206812068
// Fizz (USA)
12069-
else if (strcmp(romTid, "KZZE") == 0) {
12069+
// Requires 8MB of RAM (Only the tutorial works within 4MB of RAM)
12070+
else if (strcmp(romTid, "KZZE") == 0 && extendedMemory) {
1207012071
*(u32*)0x020106E8 = 0xE1A00000; // nop
12071-
tonccpy((u32*)0x02011260, dsiSaveGetResultCode, 0xC);
12072+
// tonccpy((u32*)0x02011260, dsiSaveGetResultCode, 0xC); // Part of .pck file
1207212073
*(u32*)0x0201391C = 0xE1A00000; // nop
12073-
patchInitDSiWare(0x02018BD8, heapEnd8MBHack);
12074-
*(u32*)0x02018F64 = 0x0213B440;
12074+
patchInitDSiWare(0x02018BD8, heapEnd);
12075+
*(u32*)0x02018F64 = *(u32*)0x02004FD0;
1207512076
patchUserSettingsReadDSiWare(0x0201A174);
12076-
setBL(0x02029FE0, (u32)dsiSaveOpen);
12077+
/* setBL(0x02029FE0, (u32)dsiSaveOpen); // Part of .pck file
1207712078
setBL(0x0202A030, (u32)dsiSaveGetLength);
1207812079
setBL(0x0202A044, (u32)dsiSaveRead);
1207912080
setBL(0x0202A05C, (u32)dsiSaveClose);
@@ -12082,7 +12083,10 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) {
1208212083
setBL(0x0202A3F4, (u32)dsiSaveOpen);
1208312084
setBL(0x0202A414, (u32)dsiSaveSetLength);
1208412085
setBL(0x0202A434, (u32)dsiSaveWrite);
12085-
setBL(0x0202A44C, (u32)dsiSaveClose);
12086+
setBL(0x0202A44C, (u32)dsiSaveClose); */
12087+
/* if (!extendedMemory) {
12088+
*(u32*)0x0202D0E4 = 0x22E000; // Shrink heap from 0x2EE000
12089+
} */
1208612090
}
1208712091

1208812092
// Flametail (USA)

retail/bootloaderi/source/arm7/patch_common.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6516,8 +6516,8 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) {
65166516
}
65176517

65186518
// Fizz (USA)
6519-
else if (strcmp(romTid, "KZZE") == 0 && saveOnFlashcardNtr) {
6520-
tonccpy((u32*)0x02011260, dsiSaveGetResultCode, 0xC);
6519+
/* else if (strcmp(romTid, "KZZE") == 0 && saveOnFlashcardNtr) {
6520+
tonccpy((u32*)0x02011260, dsiSaveGetResultCode, 0xC); // Part of .pck file
65216521
setBL(0x02029FE0, (u32)dsiSaveOpen);
65226522
setBL(0x0202A030, (u32)dsiSaveGetLength);
65236523
setBL(0x0202A044, (u32)dsiSaveRead);
@@ -6528,7 +6528,7 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) {
65286528
setBL(0x0202A414, (u32)dsiSaveSetLength);
65296529
setBL(0x0202A434, (u32)dsiSaveWrite);
65306530
setBL(0x0202A44C, (u32)dsiSaveClose);
6531-
}
6531+
} */
65326532

65336533
// Flashlight (USA)
65346534
else if (strcmp(romTid, "KFSE") == 0 && !twlFontFound) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
`GETR��OPEN0�GETLD�READ\�CLOS��OPEN�CREA��OPEN�SETL4�WRITL�CLOS

0 commit comments

Comments
 (0)