Skip to content

Commit

Permalink
B4DS: Add support for JPN version of *Ivy the Kiwi? mini*
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed Jan 11, 2024
1 parent 02c3600 commit 7507692
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
25 changes: 25 additions & 0 deletions retail/bootloader/source/arm7/dsi2ds_patches.c
Original file line number Diff line number Diff line change
Expand Up @@ -12797,6 +12797,31 @@ void patchDSiModeToDSMode(cardengineArm9* ce9, const tNDSHeader* ndsHeader) {
*(u32*)(0x020B1470+offsetChangeS) = 0xE1A00000; // nop
}

// Ivy the Kiwi? mini (Japan)
else if (strcmp(romTid, "KIKJ") == 0) {
*(u32*)0x020124D4 = 0xE1A00000; // nop
tonccpy((u32*)0x02013058, dsiSaveGetResultCode, 0xC);
*(u32*)0x02015B74 = 0xE1A00000; // nop
patchInitDSiWare(0x0202546C, heapEnd);
patchUserSettingsReadDSiWare(0x02026994);
*(u32*)0x0202E978 = wirelessReturnCodeArm;
*(u32*)0x0202E97C = 0xE12FFF1E; // bx lr
*(u32*)0x020683A4 = 0xE1A00000; // nop
*(u32*)0x020683B8 = 0xE1A00000; // nop
setBL(0x020B9174, (u32)dsiSaveCreate);
*(u32*)0x020B9450 = 0xE1A00000; // nop
setBL(0x020B9734, (u32)dsiSaveCreate);
setBL(0x020B9744, (u32)dsiSaveOpen);
setBL(0x020B9764, (u32)dsiSaveSetLength);
setBL(0x020B97A4, (u32)dsiSaveWrite);
setBL(0x020B97AC, (u32)dsiSaveClose);
*(u32*)0x020B97F8 = 0xE1A00000; // nop
setBL(0x020B9880, (u32)dsiSaveOpen);
setBL(0x020B98A4, (u32)dsiSaveRead);
setBL(0x020B98AC, (u32)dsiSaveClose);
*(u32*)0x020B9B94 = 0xE1A00000; // nop
}

// Jazzy Billiards (USA)
// Saving not supported due to code taking place in the overlays
else if (strcmp(romTid, "K9BE") == 0) {
Expand Down
21 changes: 21 additions & 0 deletions retail/bootloaderi/source/arm7/patch_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -7186,21 +7186,42 @@ void dsiWarePatch(cardengineArm9* ce9, const tNDSHeader* ndsHeader) {
u16 offsetChangeS = (romTid[3] == 'X') ? 0 : 0x344;
tonccpy((u32*)0x02013058, dsiSaveGetResultCode, 0xC);
setBL(0x020B0AB8+offsetChangeS, (u32)dsiSaveCreate);
*(u32*)(0x020B0D94+offsetChangeS) = 0xE1A00000; // nop
setBL(0x020B1078+offsetChangeS, (u32)dsiSaveCreate);
setBL(0x020B1088+offsetChangeS, (u32)dsiSaveOpen);
setBL(0x020B10A8+offsetChangeS, (u32)dsiSaveSetLength);
setBL(0x020B10E8+offsetChangeS, (u32)dsiSaveWrite);
setBL(0x020B10F0+offsetChangeS, (u32)dsiSaveClose);
*(u32*)(0x020B113C+offsetChangeS) = 0xE1A00000; // nop
setBL(0x020B11D8+offsetChangeS, (u32)dsiSaveOpen);
setBL(0x020B1200+offsetChangeS, (u32)dsiSaveRead);
setBL(0x020B1208+offsetChangeS, (u32)dsiSaveClose);
*(u32*)(0x020B128C+offsetChangeS) = 0xE1A00000; // nop
setBL(0x020B1324+offsetChangeS, (u32)dsiSaveCreate);
setBL(0x020B1334+offsetChangeS, (u32)dsiSaveOpen);
setBL(0x020B135C+offsetChangeS, (u32)dsiSaveSetLength);
setBL(0x020B13A4+offsetChangeS, (u32)dsiSaveWrite); // dsiSaveWriteAsync
setBL(0x020B13E8+offsetChangeS, (u32)dsiSaveClose);
setBL(0x020B1448+offsetChangeS, (u32)dsiSaveClose);
setBL(0x020B1464+offsetChangeS, (u32)dsiSaveClose);
*(u32*)(0x020B1470+offsetChangeS) = 0xE1A00000; // nop
}

// Ivy the Kiwi? mini (Japan)
else if (strcmp(romTid, "KIKJ") == 0 && saveOnFlashcard) {
tonccpy((u32*)0x02013058, dsiSaveGetResultCode, 0xC);
setBL(0x020B9174, (u32)dsiSaveCreate);
*(u32*)0x020B9450 = 0xE1A00000; // nop
setBL(0x020B9734, (u32)dsiSaveCreate);
setBL(0x020B9744, (u32)dsiSaveOpen);
setBL(0x020B9764, (u32)dsiSaveSetLength);
setBL(0x020B97A4, (u32)dsiSaveWrite);
setBL(0x020B97AC, (u32)dsiSaveClose);
*(u32*)0x020B97F8 = 0xE1A00000; // nop
setBL(0x020B9880, (u32)dsiSaveOpen);
setBL(0x020B98A4, (u32)dsiSaveRead);
setBL(0x020B98AC, (u32)dsiSaveClose);
*(u32*)0x020B9B94 = 0xE1A00000; // nop
}

// JellyCar 2 (USA)
Expand Down

0 comments on commit 7507692

Please sign in to comment.