diff --git a/ld/stage1.ld b/ld/stage1.ld index 0861cdb02..b512f7424 100644 --- a/ld/stage1.ld +++ b/ld/stage1.ld @@ -17,7 +17,7 @@ SECTIONS inflateSegmentRomStart = 0x4e850; ziplistSegmentRomStart = 0x4fc40; - _anticheatUncloakPoisonAddress = 0x7002a324; + _antipiracyUncloakWriteAddress = 0x7002a324; __rompos = 0; .boot 0x70001000 : AT(__rompos) { diff --git a/src/game/cheats.c b/src/game/cheats.c index f086fe12e..478681b86 100644 --- a/src/game/cheats.c +++ b/src/game/cheats.c @@ -1,4 +1,5 @@ #include +#include "boot/boot.h" #include "constants.h" #include "gvars/gvars.h" #include "setup/setup_000000.h" @@ -479,6 +480,52 @@ glabel cheatMenuHandleDialog /* f107a74: 00000000 */ sll $zero,$zero,0x0 ); +// Mismatch because it optimises the `end = &ptr[4]` line. +// It's calculating it as &func00002148 + 24 rather than ptr + 4. +//bool cheatMenuHandleDialog(u32 operation, struct menu_dialog *dialog, struct menustackitem *stackitem) +//{ +// if (operation == MENUOP_100) { +// func0f14a52c(); +// +// if (func0f11e78c()) { +// savefileSetFlag(SAVEFILEFLAG_USED_TRANSFERPAK); +// } +// +//#if PIRACYCHECKS +// { +// u32 *ptr = (u32 *)&func00002148; +// u32 *end = (u32 *)&func000022e0; +// u32 checksum = 0; +// +// while (ptr < end) { +// checksum ^= ~*ptr; +// ptr++; +// } +// +// if (checksum != 0x6f764531) { +// ptr = (u32 *)&func00002148 + 20; +// end = &ptr[4]; +// +// while (ptr < end) { +// *ptr = 0x00000012; +// ptr++; +// } +// } +// } +//#endif +// } +// +// if (operation == MENUOP_101) { +// if (func0f11e78c()) { +// savefileSetFlag(SAVEFILEFLAG_USED_TRANSFERPAK); +// } +// +// func0f14a560(); +// } +// +// return 0; +//} + char *cheatGetMarquee(struct menu_item *arg0) { u32 cheat_id; diff --git a/src/game/chr/chr.c b/src/game/chr/chr.c index 876b33484..66a42174b 100644 --- a/src/game/chr/chr.c +++ b/src/game/chr/chr.c @@ -5671,8 +5671,8 @@ void chrUncloak(struct chrdata *chr, bool value) } if (checksum != 0x5874f34e) { - extern volatile u32 _anticheatUncloakPoisonAddress[]; - _anticheatUncloakPoisonAddress[-2] = 0; + extern volatile u32 _antipiracyUncloakWriteAddress[]; + _antipiracyUncloakWriteAddress[-2] = 0; } } #endif diff --git a/src/include/boot/boot.h b/src/include/boot/boot.h index 6e9096ee2..89cf60666 100644 --- a/src/include/boot/boot.h +++ b/src/include/boot/boot.h @@ -10,6 +10,8 @@ s32 func000018ac(void); s32 func00001b28(void); s32 func00001e30(void); s32 func00001fa8(void); +s32 func00002148(void); +s32 func000022e0(void); s32 func00002ff0(void); #endif diff --git a/src/include/game/cheats.h b/src/include/game/cheats.h index 8531aa74b..c1f71950d 100644 --- a/src/include/game/cheats.h +++ b/src/include/game/cheats.h @@ -15,7 +15,7 @@ s32 cheatGetByTimedStageIndex(s32 stage_index, s32 difficulty); s32 cheatGetByCompletedStageIndex(s32 stage_index); s32 cheatGetTime(s32 cheat_id); char *cheatGetName(s32 cheat_id); -s32 cheatMenuHandleDialog(u32, u32, u32 *); +bool cheatMenuHandleDialog(u32 operation, struct menu_dialog *dialog, struct menustackitem *stackitem); s32 cheatMenuHandleCheatCheckbox(u32 arg0, struct menu_item *item, s32 arg2); s32 cheatMenuHandleBuddyCheckbox(s32 arg0, struct menu_item *item, s32 arg2); bool cheatMenuHandleTurnOffAllCheats(u32 arg0, u32 arg1, u32 *arg2);