Skip to content

Commit f98e6ad

Browse files
committed
Allow cheats to be used with DSi Sound as donor ROM
1 parent 21736cd commit f98e6ad

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

retail/bootloaderi/source/arm7/hook_arm7.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,12 @@ int hookNdsRetailArm7(
468468
extern u32 cheatEngineOffset;
469469
extern char cheatEngineBuffer[0x400];
470470
u16 cheatSizeLimit = (ce7NotFound ? 0x1C00 : 0x8000);
471-
if (!ce7NotFound && (cheatEngineOffset == CHEAT_ENGINE_DSIWARE_LOCATION)) {
472-
cheatSizeLimit -= 0x1800;
471+
if (!ce7NotFound) {
472+
if (cheatEngineOffset == CHEAT_ENGINE_DSIWARE_LOCATION) {
473+
cheatSizeLimit -= 0x1800;
474+
} else if (cheatEngineOffset == CHEAT_ENGINE_DSIWARE_LOCATION3) {
475+
cheatSizeLimit -= 0x1000;
476+
}
473477
}
474478
char* cheatDataOffset = (char*)cheatEngineOffset+0x3E8;
475479
/*if (ce7NotFound) {

retail/bootloaderi/source/arm7/patch_arm7.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,12 +436,12 @@ void patchRamClearI(const tNDSHeader* ndsHeader, const module_params_t* modulePa
436436
}
437437

438438
if (*(u32*)0x02FFE1A0 != 0x00403000) {
439-
extern u8 consoleModel;
439+
// extern u8 consoleModel;
440440
extern u32 ce7Location;
441-
extern u32 cheatSizeTotal;
442-
const bool cheatsEnabled = (cheatSizeTotal > 4 && cheatSizeTotal <= 0x8000);
441+
// extern u32 cheatSizeTotal;
442+
// const bool cheatsEnabled = (cheatSizeTotal > 4 && cheatSizeTotal <= 0x8000);
443443

444-
ramClearOffset[0] = (consoleModel == 0 && _isDSiWare && cheatsEnabled && newArm7binarySize != 0x28E54) ? CHEAT_ENGINE_DSIWARE_LOCATION3 : 0x02FFC000;
444+
// ramClearOffset[0] = (consoleModel == 0 && _isDSiWare && cheatsEnabled && newArm7binarySize != 0x28E54) ? CHEAT_ENGINE_DSIWARE_LOCATION3 : 0x02FFC000;
445445
ramClearOffset[2] = ce7Location;
446446
} else {
447447
extern u32 ce9Location;

retail/common/include/locations.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
#define CHEAT_ENGINE_TWLSDK_LOCATION 0x02F60000
7878
#define CHEAT_ENGINE_TWLSDK_LOCATION_3DS 0x0DFF7C00
7979
#define CHEAT_ENGINE_DSIWARE_LOCATION 0x02FD9400
80-
#define CHEAT_ENGINE_DSIWARE_LOCATION3 0x02FF3C00
80+
#define CHEAT_ENGINE_DSIWARE_LOCATION3 0x02F80C00
8181
#define CARDENGINEI_ARM7_LOCATION 0x037C0400
8282
#define CARDENGINEI_ARM7_LOCATION_ALT 0x03008400
8383
#define CARDENGINEI_ARM7_TWLSDK_LOCATION 0x03037A00

0 commit comments

Comments
 (0)