Skip to content

Commit d157c2d

Browse files
committed
Added a cheat to remove the D-Pad Options display
1 parent 7435928 commit d157c2d

File tree

7 files changed

+57
-11
lines changed

7 files changed

+57
-11
lines changed

USER_MANUAL.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ This menu allows you to modify your entire inventory, including standard items,
5353
14. **Levitate** allows you to levitate in the air. The button combination must be held for this code to work.
5454
15. **Lock Mario's HP To Max** locks Mario's current HP to the max.
5555
16. **Allow Running From Any Battle** allows you to run from any battle, even if the battle would normally not allow this.
56-
17. **Disable Pause Menu/Z Menu Sounds** disables the sound effects that play when the pause menu and the Z menu are opened/closed.
57-
18. **Bobbery Early** clears some values, which allows you to perform Bobbery Early more than once on a save file without the need to reload.
58-
19. **Force NPC Item Drop** forces any defeared enemy to drop a specified item. The item can be changed at will.
59-
20. **Manage Flags** allows you to manually change a lot of the important flags in the game.
60-
21. **Clear Area Flags** allows you to clear most of the flags for a specified area. A confirmation message is displayed when trying to do so, to prevent accidently clearing flags. The flags will be cleared on the next screen transition.
56+
17. **Disable D-Pad Options Display** prevents the D-Pad options display at the bottom-left of the screen from appearing. More specifically, this is the display that shows which D-Pad button opens which menu in the pause menu. These buttons can still be used, regardless of whether the display is disabled or not.
57+
18. **Disable Pause Menu/Z Menu Sounds** disables the sound effects that play when the pause menu and the Z menu are opened/closed.
58+
19. **Bobbery Early** clears some values, which allows you to perform Bobbery Early more than once on a save file without the need to reload.
59+
20. **Force NPC Item Drop** forces any defeared enemy to drop a specified item. The item can be changed at will.
60+
21. **Manage Flags** allows you to manually change a lot of the important flags in the game.
61+
22. **Clear Area Flags** allows you to clear most of the flags for a specified area. A confirmation message is displayed when trying to do so, to prevent accidently clearing flags. The flags will be cleared on the next screen transition.
6162

6263
### Stats
6364
This menu allows you to modify Mario's stats, all of your partner's stats, whether or not partners are enabled or not, whether a partner is out or not, and whether or not a follower is out or not.

ttyd-tools/rel/include/global.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ enum CHEATS_OPTIONS
7979
LEVITATE,
8080
LOCK_MARIO_HP_TO_MAX,
8181
RUN_FROM_BATTLES,
82+
DISABLE_DPAD_OPTIONS_DISPLAY,
8283
DISABLE_MENU_SOUNDS,
8384
BOBBERY_EARLY,
8485
FORCE_ITEM_DROP,
@@ -632,7 +633,7 @@ struct WarpByIndexStruct
632633
};
633634

634635
extern Menus Menu[27];
635-
extern Cheats Cheat[20];
636+
extern Cheats Cheat[22];
636637
extern bool Displays[9];
637638
extern char DisplayBuffer[256];
638639
extern char HeapBuffer[1024];
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.global StartDisableDPadOptionsDisplay
2+
.global BranchBackDisableDPadOptionsDisplay
3+
4+
StartDisableDPadOptionsDisplay:
5+
stwu %sp,-0x10(%sp)
6+
stmw %r30,0x8(%sp)
7+
mr %r30,%r3
8+
mr %r31,%r4
9+
10+
mr %r3,%r0 # unkVar
11+
bl disableDPadOptionsDisplay
12+
13+
# Check the returned bool
14+
cmpwi %r3,0 # False
15+
16+
mr %r3,%r30
17+
mr %r4,%r31
18+
lmw %r30,0x8(%sp)
19+
addi %sp,%sp,0x10
20+
21+
BranchBackDisableDPadOptionsDisplay:
22+
b 0

ttyd-tools/rel/source/codes.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ int32_t forceNPCItemDrop(void *ptr)
6969
return *reinterpret_cast<int32_t *>(
7070
reinterpret_cast<uint32_t>(ptr) + 0x23C);
7171
}
72+
73+
bool disableDPadOptionsDisplay(uint16_t unkVar)
74+
{
75+
if (Cheat[DISABLE_DPAD_OPTIONS_DISPLAY].Active)
76+
{
77+
return false;
78+
}
79+
80+
return (unkVar & (1 << 8)); // Check the 8 bit
81+
}
7282
}
7383

7484
void Mod::performBattleChecks()

ttyd-tools/rel/source/global.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ uint8_t CheatsOrder[] =
6464
FORCE_ITEM_DROP,
6565
CLEAR_AREA_FLAGS,
6666
MANAGE_FLAGS,
67+
DISABLE_DPAD_OPTIONS_DISPLAY,
6768
};
6869

6970
const char *CheatsLines[] =
@@ -85,6 +86,7 @@ const char *CheatsLines[] =
8586
"Levitate",
8687
"Lock Mario's HP To Its Max",
8788
"Allow Running From Any Battle",
89+
"Disable D-Pad Options Display",
8890
"Disable Pause Menu/Z Menu Sounds",
8991
"Bobbery Early",
9092
"Force NPC Item Drop",
@@ -1318,7 +1320,7 @@ const char ButtonInputDisplay[] =
13181320
#endif
13191321

13201322
struct Menus Menu[27];
1321-
struct Cheats Cheat[20];
1323+
struct Cheats Cheat[22];
13221324
bool Displays[9];
13231325
char DisplayBuffer[256];
13241326
char HeapBuffer[1024];
@@ -1599,6 +1601,7 @@ void initMenuVars()
15991601
Cheat[LOCK_MARIO_HP_TO_MAX].Active = false;
16001602
Cheat[RUN_FROM_BATTLES].Active = false;
16011603
Cheat[SPAWN_ITEM].Active = false;
1604+
// Cheat[DISABLE_DPAD_OPTIONS_DISPLAY].Active = false;
16021605
// Cheat[DISABLE_MENU_SOUNDS].Active = false;
16031606
// Cheat[BOBBERY_EARLY].Active = false;
16041607
Cheat[FORCE_ITEM_DROP].Active = false;

ttyd-tools/rel/source/main.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ extern "C"
5454
void BranchBackPreventJumpAndHammer();
5555
void StartFixRoomProblems();
5656
void BranchBackFixRoomProblems();
57+
void StartDisableDPadOptionsDisplay();
58+
void BranchBackDisableDPadOptionsDisplay();
5759
}
5860

5961
// Functions accessed by assembly overwrites
@@ -515,7 +517,7 @@ void initAddressOverwrites()
515517
#ifdef TTYD_US
516518
void *PreventPreBattleSoftlockAddress = reinterpret_cast<void *>(0x80046600);
517519
void *DisableBattlesAddress = reinterpret_cast<void *>(0x800448CC);
518-
void *AllowRunningFromBattles = reinterpret_cast<void *>(0x80123CA4);
520+
void *AllowRunningFromBattlesAddress = reinterpret_cast<void *>(0x80123CA4);
519521
void *ForceNPCItemDropAddress = reinterpret_cast<void *>(0x8004EC10);
520522
void *DebugModeInitialzeAddress = reinterpret_cast<void *>(0x80009B2C);
521523
void *DebugModeShowBuildDateAddress = reinterpret_cast<void *>(0x80008FE8);
@@ -535,10 +537,11 @@ void initAddressOverwrites()
535537
void *BacktraceScreenEndBranchAddress = reinterpret_cast<void *>(0x8025E4A8);
536538
void *FixRoomProblemsAddress = reinterpret_cast<void *>(0x800087C8);
537539
void *ArtAttackHitboxesAddress = reinterpret_cast<void *>(0x80231938);
540+
void *DisableDPadOptionsDisplayAddress = reinterpret_cast<void *>(0x8013D148);
538541
#elif defined TTYD_JP
539542
void *PreventPreBattleSoftlockAddress = reinterpret_cast<void *>(0x80045F5C);
540543
void *DisableBattlesAddress = reinterpret_cast<void *>(0x80044228);
541-
void *AllowRunningFromBattles = reinterpret_cast<void *>(0x8011E7DC);
544+
void *AllowRunningFromBattlesAddress = reinterpret_cast<void *>(0x8011E7DC);
542545
void *ForceNPCItemDropAddress = reinterpret_cast<void *>(0x8004DFB0);
543546
void *DebugModeInitialzeAddress = reinterpret_cast<void *>(0x8000999C);
544547
void *DebugModeShowBuildDateAddress = reinterpret_cast<void *>(0x80008EB8);
@@ -556,10 +559,11 @@ void initAddressOverwrites()
556559
void *BacktraceScreenFontSizeAddress = reinterpret_cast<void *>(0x80422618);
557560
void *FixRoomProblemsAddress = reinterpret_cast<void *>(0x800086F0);
558561
void *ArtAttackHitboxesAddress = reinterpret_cast<void *>(0x8022C288);
562+
void *DisableDPadOptionsDisplayAddress = reinterpret_cast<void *>(0x80137C1C);
559563
#elif defined TTYD_EU
560564
void *PreventPreBattleSoftlockAddress = reinterpret_cast<void *>(0x800466E8);
561565
void *DisableBattlesAddress = reinterpret_cast<void *>(0x800449B4);
562-
void *AllowRunningFromBattles = reinterpret_cast<void *>(0x80124BE4);
566+
void *AllowRunningFromBattlesAddress = reinterpret_cast<void *>(0x80124BE4);
563567
void *ForceNPCItemDropAddress = reinterpret_cast<void *>(0x8004ECDC);
564568
void *DebugModeInitialzeAddress = reinterpret_cast<void *>(0x80009CF0);
565569
void *DebugModeShowBuildDateAddress = reinterpret_cast<void *>(0x800091B4);
@@ -579,12 +583,13 @@ void initAddressOverwrites()
579583
void *BacktraceScreenEndBranchAddress = reinterpret_cast<void *>(0x80262080);
580584
void *FixRoomProblemsAddress = reinterpret_cast<void *>(0x80008994);
581585
void *ArtAttackHitboxesAddress = reinterpret_cast<void *>(0x802353C8);
586+
void *DisableDPadOptionsDisplayAddress = reinterpret_cast<void *>(0x8013EC30);
582587
#endif
583588

584589
writeStandardBranch(DisableBattlesAddress,
585590
StartDisableBattles, BranchBackDisableBattles);
586591

587-
writeStandardBranch(AllowRunningFromBattles,
592+
writeStandardBranch(AllowRunningFromBattlesAddress,
588593
StartAllowRunningFromBattles, BranchBackAllowRunningFromBattles);
589594

590595
writeStandardBranch(ForceNPCItemDropAddress,
@@ -614,6 +619,9 @@ void initAddressOverwrites()
614619
writeStandardBranch(FixRoomProblemsAddress,
615620
StartFixRoomProblems, BranchBackFixRoomProblems);
616621

622+
writeStandardBranch(DisableDPadOptionsDisplayAddress,
623+
StartDisableDPadOptionsDisplay, BranchBackDisableDPadOptionsDisplay);
624+
617625
patch::writeBranch(PreventPreBattleSoftlockAddress, reinterpret_cast<void *>(preventPreBattleSoftlock));
618626

619627
patch::writeBranch(ArtAttackHitboxesAddress, reinterpret_cast<void *>(displayArtAttackHitboxes));

ttyd-tools/rel/source/menu.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@ void menuCheckButton()
575575
}
576576
case LOCK_MARIO_HP_TO_MAX:
577577
case RUN_FROM_BATTLES:
578+
case DISABLE_DPAD_OPTIONS_DISPLAY:
578579
case DISABLE_MENU_SOUNDS:
579580
case BOBBERY_EARLY:
580581
{

0 commit comments

Comments
 (0)