Skip to content

Commit

Permalink
B4DS: Add support for *ACT Series: Tangocho*
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed Jan 11, 2024
1 parent 35b6978 commit 02c3600
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 0 deletions.
3 changes: 3 additions & 0 deletions retail/arm9/include/dsiwaresSetForBootloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ static const char dsiWareForBootloader1[][4] = {
"KXG", // Abyss
"KT3", // Academy Tic-Tac-Toe
"KQK", // Ace Mathician
"KE5", // ACT Series: Tangocho: Ni Chi Hen
"KCS", // ACT Series: Tangocho: Ni Chu Hen
"KRE", // ACT Series: Tangocho: Ni Kan Hen
"KAC", // Advanced Circuits
"K5H", // Ah! Heaven
"K25", // G.G Series: Air Pinball Hockey
Expand Down
62 changes: 62 additions & 0 deletions retail/bootloader/source/arm7/dsi2ds_patches.c
Original file line number Diff line number Diff line change
Expand Up @@ -2172,6 +2172,68 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) {
*(u32*)0x02039B90 = 0xE1A00000; // nop
}

// ACT Series: Tangocho: Ni Chi Hen (Japan)
// Saving not supported due to using more than one file in filesystem
else if (strcmp(romTid, "KE5J") == 0) {
/* setBL(0x0200BFC4, (u32)dsiSaveOpen);
setBL(0x0200BFFC, (u32)dsiSaveGetLength);
setBL(0x0200C010, (u32)dsiSaveRead);
setBL(0x0200C024, (u32)dsiSaveClose);
setBL(0x0200C034, (u32)dsiSaveClose);
setBL(0x0200C088, (u32)dsiSaveCreate);
setBL(0x0200C09C, (u32)dsiSaveOpen);
setBL(0x0200C0D8, (u32)dsiSaveSetLength);
setBL(0x0200C0E8, (u32)dsiSaveWrite);
setBL(0x0200C0F0, (u32)dsiSaveClose); */
*(u32*)0x0200C1A8 = 0xE12FFF1E; // bx lr (Skip Manual screen)
*(u32*)0x0203B5B0 = 0xE1A00000; // nop
*(u32*)0x0203EFEC = 0xE1A00000; // nop
patchInitDSiWare(0x0204574C, heapEnd);
patchUserSettingsReadDSiWare(0x02046C18);
}

// ACT Series: Tangocho: Ni Chu Hen (Japan)
// Saving not supported due to using more than one file in filesystem
else if (strcmp(romTid, "KCSJ") == 0) {
/* setBL(0x0200BC84, (u32)dsiSaveOpen);
setBL(0x0200BCBC, (u32)dsiSaveGetLength);
setBL(0x0200BCD0, (u32)dsiSaveRead);
setBL(0x0200BCE4, (u32)dsiSaveClose);
setBL(0x0200BCF4, (u32)dsiSaveClose);
setBL(0x0200BD48, (u32)dsiSaveCreate);
setBL(0x0200BD5C, (u32)dsiSaveOpen);
setBL(0x0200BD98, (u32)dsiSaveSetLength);
setBL(0x0200BDA8, (u32)dsiSaveWrite);
setBL(0x0200BDB0, (u32)dsiSaveClose); */
*(u32*)0x0200BE68 = 0xE12FFF1E; // bx lr (Skip Manual screen)
*(u32*)0x0203777C = 0xE1A00000; // nop
*(u32*)0x0203B1B8 = 0xE1A00000; // nop
patchInitDSiWare(0x02041918, heapEnd);
patchUserSettingsReadDSiWare(0x02042DE4);
}

// ACT Series: Tangocho: Ni Kan Hen (Japan)
// Saving not supported due to using more than one file in filesystem
else if (strcmp(romTid, "KREJ") == 0) {
*(u32*)0x020050A4 = 0xE1A00000; // nop
/* setBL(0x0200C0F0, (u32)dsiSaveOpen);
setBL(0x0200C128, (u32)dsiSaveGetLength);
setBL(0x0200C13C, (u32)dsiSaveRead);
setBL(0x0200C150, (u32)dsiSaveClose);
setBL(0x0200C160, (u32)dsiSaveClose);
setBL(0x0200C1B4, (u32)dsiSaveCreate);
setBL(0x0200C1C8, (u32)dsiSaveOpen);
setBL(0x0200C204, (u32)dsiSaveSetLength);
setBL(0x0200C214, (u32)dsiSaveWrite);
setBL(0x0200C21C, (u32)dsiSaveClose); */
*(u32*)0x0200C2D4 = 0xE12FFF1E; // bx lr (Skip Manual screen)
*(u32*)0x0200C618 = 0xE12FFF1E; // bx lr
*(u32*)0x0203B974 = 0xE1A00000; // nop
*(u32*)0x0203F3B0 = 0xE1A00000; // nop
patchInitDSiWare(0x02045B10, heapEnd);
patchUserSettingsReadDSiWare(0x02046FDC);
}

// Advanced Circuits (USA)
// Advanced Circuits (Europe, Australia)
// Saving not supported due to using more than one file in filesystem
Expand Down
60 changes: 60 additions & 0 deletions retail/bootloaderi/source/arm7/patch_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,66 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) {
*(u32*)0x02005098 = 0xE1A00000; // nop (Disable NFTR font loading from TWLNAND)
}

// ACT Series: Tangocho: Ni Chi Hen (Japan)
// Saving not supported due to using more than one file in filesystem
else if (strcmp(romTid, "KE5J") == 0) {
/* if (saveOnFlashcard) {
setBL(0x0200BFC4, (u32)dsiSaveOpen);
setBL(0x0200BFFC, (u32)dsiSaveGetLength);
setBL(0x0200C010, (u32)dsiSaveRead);
setBL(0x0200C024, (u32)dsiSaveClose);
setBL(0x0200C034, (u32)dsiSaveClose);
setBL(0x0200C088, (u32)dsiSaveCreate);
setBL(0x0200C09C, (u32)dsiSaveOpen);
setBL(0x0200C0D8, (u32)dsiSaveSetLength);
setBL(0x0200C0E8, (u32)dsiSaveWrite);
setBL(0x0200C0F0, (u32)dsiSaveClose);
} */
if (!twlFontFound) {
*(u32*)0x0200C1A8 = 0xE12FFF1E; // bx lr (Skip Manual screen)
}
}

// ACT Series: Tangocho: Ni Chu Hen (Japan)
// Saving not supported due to using more than one file in filesystem
else if (strcmp(romTid, "KCSJ") == 0) {
/* if (saveOnFlashcard) {
setBL(0x0200BC84, (u32)dsiSaveOpen);
setBL(0x0200BCBC, (u32)dsiSaveGetLength);
setBL(0x0200BCD0, (u32)dsiSaveRead);
setBL(0x0200BCE4, (u32)dsiSaveClose);
setBL(0x0200BCF4, (u32)dsiSaveClose);
setBL(0x0200BD48, (u32)dsiSaveCreate);
setBL(0x0200BD5C, (u32)dsiSaveOpen);
setBL(0x0200BD98, (u32)dsiSaveSetLength);
setBL(0x0200BDA8, (u32)dsiSaveWrite);
setBL(0x0200BDB0, (u32)dsiSaveClose);
} */
if (!twlFontFound) {
*(u32*)0x0200BE68 = 0xE12FFF1E; // bx lr (Skip Manual screen)
}
}

// ACT Series: Tangocho: Ni Kan Hen (Japan)
// Saving not supported due to using more than one file in filesystem
else if (strcmp(romTid, "KREJ") == 0) {
/* if (saveOnFlashcard) {
setBL(0x0200C0F0, (u32)dsiSaveOpen);
setBL(0x0200C128, (u32)dsiSaveGetLength);
setBL(0x0200C13C, (u32)dsiSaveRead);
setBL(0x0200C150, (u32)dsiSaveClose);
setBL(0x0200C160, (u32)dsiSaveClose);
setBL(0x0200C1B4, (u32)dsiSaveCreate);
setBL(0x0200C1C8, (u32)dsiSaveOpen);
setBL(0x0200C204, (u32)dsiSaveSetLength);
setBL(0x0200C214, (u32)dsiSaveWrite);
setBL(0x0200C21C, (u32)dsiSaveClose);
} */
if (!twlFontFound) {
*(u32*)0x0200C2D4 = 0xE12FFF1E; // bx lr (Skip Manual screen)
}
}

// Advanced Circuits (USA)
// Advanced Circuits (Europe, Australia)
else if (strncmp(romTid, "KAC", 3) == 0 && saveOnFlashcard) {
Expand Down

0 comments on commit 02c3600

Please sign in to comment.