Skip to content

Commit 0be8ba7

Browse files
committed
B4DS: Add support for *Saikyou Ginsei Igo*
Memory Expansion Pak or debug DS console required
1 parent c6ffe2e commit 0be8ba7

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

retail/arm9/include/dsiwaresSetForBootloader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ static const char dsiWareForBootloader3[][4] = {
452452
"KRP", // RPG Dashutsu Game
453453
"K5F", // G.G Series: Run & Strike
454454
"K8X", // Sagittarius-A-Star
455+
"KGE", // Saikyou Ginsei Igo
455456
"KG4", // Saikyou Ginsei Shougi
456457
"K3P", // Sakurai Miho No Kouno: Megami Serapi Uranai
457458
"K7T", // Save the Turtles

retail/bootloader/source/arm7/dsi2ds_patches.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23557,6 +23557,35 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) {
2355723557
*(u32*)0x02054EF0 = 0xE1A00000; // nop */
2355823558
}
2355923559

23560+
// Saikyou Ginsei Igo (Japan)
23561+
// Saving not supported due to using more than one file in filesystem
23562+
// Requires either 8MB of RAM or Memory Expansion Pak
23563+
// Audio does not play on retail consoles
23564+
else if (strcmp(romTid, "KGEJ") == 0 && debugOrMep) {
23565+
useSharedFont = (twlFontFound && extendedMemory);
23566+
*(u32*)0x02011754 = 0xE1A00000; // nop
23567+
*(u32*)0x0201540C = 0xE1A00000; // nop
23568+
*(u32*)0x02020450 = 0xE3A00001; // mov r0, #1
23569+
patchInitDSiWare(0x02020468, heapEnd);
23570+
if (!extendedMemory) {
23571+
*(u32*)0x020207D8 = *(u32*)0x02193E80;
23572+
}
23573+
patchUserSettingsReadDSiWare(0x02021A98);
23574+
*(u32*)0x02021AC0 = wirelessReturnCodeArm;
23575+
*(u32*)0x02021AC4 = 0xE12FFF1E; // bx lr
23576+
*(u32*)0x02021ACC = 0xE3A00000; // mov r0, #0
23577+
*(u32*)0x02021AD0 = 0xE12FFF1E; // bx lr
23578+
if (!extendedMemory) {
23579+
// *(u32*)0x0203FEDC = 0xE3A04702; // mov r4, #0x80000 (Shrink sound heap from 0x100000)
23580+
*(u32*)0x0203FEDC = 0xE3A04901; // mov r4, #0x4000 (Shrink sound heap from 0x100000: Disables sound and fixes multiplayer crashing)
23581+
*(u32*)0x0205DE58 = 0xE12FFF1E; // bx lr
23582+
*(u32*)0x0205F438 = (s2FlashcardId == ezFlash) ? 0xE3A00408 : 0xE3A00409; // mov r0, (s2FlashcardId == ezFlash) ? #0x08000000 : #0x09000000
23583+
}
23584+
if (!useSharedFont) {
23585+
*(u32*)0x0218E65C = 0xE1A00000; // nop (Skip Manual screen)
23586+
}
23587+
}
23588+
2356023589
// Saikyou Ginsei Shougi (Japan)
2356123590
// Saving not supported due to using more than one file in filesystem
2356223591
else if (strcmp(romTid, "KG4J") == 0) {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,8 @@ static bool isROMLoadableInRAM(const tDSiHeader* dsiHeader, const tNDSHeader* nd
654654
// || strncmp(romTid, "KWC", 3) == 0 // Animal Crossing Clock
655655
|| strncmp(romTid, "KWF", 3) == 0) { // Mario Calculator
656656
romSizeLimitChange = 0x280000;
657+
} else if (strncmp(romTid, "KGE", 3) == 0) { // Saikyou Ginsei Igo
658+
romSizeLimitChange = 0x180000;
657659
} else if (strncmp(romTid, "KSC", 3) == 0) { // Sudoku Challenge!
658660
romSizeLimitChange = 0x44AC90;
659661
}

retail/bootloaderi/source/arm7/patch_common.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13205,6 +13205,12 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) {
1320513205
*(u32*)0x02054EF0 = 0xE1A00000; // nop
1320613206
} */
1320713207

13208+
// Saikyou Ginsei Igo (Japan)
13209+
// Saving not supported due to using more than one file in filesystem
13210+
else if (strcmp(romTid, "KGEJ") == 0 && !twlFontFound) {
13211+
*(u32*)0x0218E65C = 0xE1A00000; // nop (Skip Manual screen)
13212+
}
13213+
1320813214
// Saikyou Ginsei Shougi (Japan)
1320913215
// Saving not supported due to using more than one file in filesystem
1321013216
else if (strcmp(romTid, "KG4J") == 0 && !twlFontFound) {

0 commit comments

Comments
 (0)