Skip to content

Commit

Permalink
B4DS: Add support for *Academy Tic-Tac-Toe*
Browse files Browse the repository at this point in the history
Requires DS Debug console
  • Loading branch information
RocketRobz committed Jan 11, 2024
1 parent 1ccbd78 commit 35b6978
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions retail/arm9/include/dsiwaresSetForBootloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ static const char dsiWareForBootloader1[][4] = {
"KCZ", // Absolute Chess (bootloaderi-exclusive)
"KA8", // Absolute Reversi (bootloaderi-exclusive)
"KXG", // Abyss
"KT3", // Academy Tic-Tac-Toe
"KQK", // Ace Mathician
"KAC", // Advanced Circuits
"K5H", // Ah! Heaven
Expand Down
19 changes: 19 additions & 0 deletions retail/bootloader/source/arm7/dsi2ds_patches.c
Original file line number Diff line number Diff line change
Expand Up @@ -2112,6 +2112,23 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) {
*(u32*)(0x02070920+offsetChange) = 0xE1A00000; // nop
}

// Academy Tic-Tac-Toe (USA)
// Academy Tic-Tac-Toe: Noughts and Crosses (Europe, Australia)
// Saving not supported due to a weird bug
// Requires 8MB of RAM
else if (strncmp(romTid, "KT3", 3) == 0 && extendedMemory) {
u8 offsetChange = (romTid[3] == 'E') ? 0 : 0x78;

*(u32*)0x02005098 = 0xE1A00000; // nop (Disable NFTR font loading from TWLNAND)
*(u32*)0x02005128 = 0xE1A00000; // nop
*(u32*)0x02005140 = 0xE1A00000; // nop
*(u32*)(0x02039378-offsetChange) = 0xE1A00000; // nop
*(u32*)(0x0203CCF0-offsetChange) = 0xE1A00000; // nop
patchInitDSiWare(0x020420A0-offsetChange, heapEnd);
*(u32*)(0x0204242C-offsetChange) = *(u32*)0x02004FD0;
patchUserSettingsReadDSiWare(0x0204356C-offsetChange);
}

// Ace Mathician (USA)
// Saving not supported due to using more than one file in filesystem
else if (strcmp(romTid, "KQKE") == 0) {
Expand Down Expand Up @@ -5264,6 +5281,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) {
}*/

// Boom Boom Squaries (USA)
// Saving not supported due to a weird bug
else if (strcmp(romTid, "KBME") == 0) {
*(u32*)0x02005150 = 0xE1A00000; // nop (Disable NFTR font loading from TWLNAND)
*(u32*)0x020051CC = 0xE1A00000; // nop
Expand Down Expand Up @@ -5292,6 +5310,7 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) {
}

// Boom Boom Squaries (Europe, Australia)
// Saving not supported due to a weird bug
else if (strcmp(romTid, "KBMV") == 0) {
*(u32*)0x02005150 = 0xE1A00000; // nop (Disable NFTR font loading from TWLNAND)
*(u32*)0x020051CC = 0xE1A00000; // nop
Expand Down
6 changes: 6 additions & 0 deletions retail/bootloaderi/source/arm7/patch_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,12 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) {
setBL(0x02031AC4+offsetChange, (u32)dsiSaveClose);
}

// Academy Tic-Tac-Toe (USA)
// Academy Tic-Tac-Toe: Noughts and Crosses (Europe, Australia)
else if (strncmp(romTid, "KT3", 3) == 0 && !twlFontFound) {
*(u32*)0x02005098 = 0xE1A00000; // nop (Disable NFTR font loading from TWLNAND)
}

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

0 comments on commit 35b6978

Please sign in to comment.