Skip to content

Commit 0b46393

Browse files
committed
Added a cheat for automatically mashing through text
1 parent 865a1bb commit 0b46393

File tree

6 files changed

+41
-4
lines changed

6 files changed

+41
-4
lines changed

ttyd-tools/rel/include/codes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ void checkIfSystemLevelShouldBeLowered();
1515
void reloadRoomMain();
1616
void reloadRoom();
1717
void levitate();
18+
uint32_t autoMashText(uint32_t controllerPort);
1819
void lockMarioHPToMax();
1920
void bobberyEarly();
2021
void spawnItem();

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
INFINITE_ITEM_USAGE,
8080
RELOAD_ROOM,
8181
LEVITATE,
82+
AUTO_MASH_TEXT,
8283
LOCK_MARIO_HP_TO_MAX,
8384
RUN_FROM_BATTLES,
8485
DISABLE_MENU_SOUNDS,
@@ -817,7 +818,7 @@ struct NpcNameToPtrErrorStruct
817818

818819
extern MenuVars MenuVar;
819820
extern Menus Menu[30];
820-
extern Cheats Cheat[24];
821+
extern Cheats Cheat[25];
821822
extern bool Displays[13];
822823
extern char DisplayBuffer[256];
823824
extern char HeapBuffer[512];

ttyd-tools/rel/source/codes.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,24 @@ void levitate()
617617
player->wJumpVelocityY = 4.540000915527344;
618618
}
619619

620+
uint32_t autoMashText(uint32_t controllerPort)
621+
{
622+
if (!Cheat[AUTO_MASH_TEXT].Active)
623+
{
624+
// Return the intended value
625+
return ttyd::system::keyGetButtonTrg(controllerPort);
626+
}
627+
628+
if (!checkButtonComboEveryFrame(Cheat[AUTO_MASH_TEXT].ButtonCombo))
629+
{
630+
// Return the intended value
631+
return ttyd::system::keyGetButtonTrg(controllerPort);
632+
}
633+
634+
// Return the value for B to make sure the text is being mashed through as fast as possible
635+
return PAD_B;
636+
}
637+
620638
void lockMarioHPToMax()
621639
{
622640
if (!Cheat[LOCK_MARIO_HP_TO_MAX].Active)

ttyd-tools/rel/source/global.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace mod {
55

6-
const char *VersionNumber = "v3.0.43";
6+
const char *VersionNumber = "v3.0.44";
77

88
const char *RootLines[] =
99
{
@@ -52,6 +52,7 @@ const char *CheatsLines[] =
5252
"Infinite Item Usage",
5353
"Reload Room",
5454
"Levitate",
55+
"Auto Mash Through Text",
5556
"Lock Mario's HP To Its Max",
5657
"Allow Running From Any Battle",
5758
"Disable Pause Menu/Z Menu Sounds",
@@ -1801,6 +1802,7 @@ uint8_t CheatsOrder[] =
18011802
RESOLVE_FADES,
18021803
FALL_THROUGH_FLOORS,
18031804
LOCK_FLAGS,
1805+
AUTO_MASH_TEXT,
18041806
};
18051807

18061808
uint8_t DisplaysOrder[] =
@@ -1822,7 +1824,7 @@ uint8_t DisplaysOrder[] =
18221824

18231825
struct MenuVars MenuVar;
18241826
struct Menus Menu[30];
1825-
struct Cheats Cheat[24];
1827+
struct Cheats Cheat[25];
18261828
bool Displays[13];
18271829
char DisplayBuffer[256];
18281830
char HeapBuffer[512];
@@ -1983,6 +1985,7 @@ void setInitialSettings()
19831985
// Cheat[INFINITE_ITEM_USAGE].Active = false;
19841986
// Cheat[RELOAD_ROOM].Active = false;
19851987
// Cheat[LEVITATE].Active = false;
1988+
// Cheat[AUTO_MASH_TEXT].Active = false;
19861989
Cheat[LOCK_MARIO_HP_TO_MAX].Active = false;
19871990
Cheat[RUN_FROM_BATTLES].Active = false;
19881991
// Cheat[DISABLE_MENU_SOUNDS].Active = false;
@@ -2004,6 +2007,7 @@ void setInitialSettings()
20042007
Cheat[INFINITE_ITEM_USAGE].ButtonCombo = PAD_Y;
20052008
Cheat[RELOAD_ROOM].ButtonCombo = PAD_L | PAD_B;
20062009
Cheat[LEVITATE].ButtonCombo = PAD_L | PAD_A;
2010+
Cheat[AUTO_MASH_TEXT].ButtonCombo = PAD_Y;
20072011

20082012
// Set the Displays bools
20092013
// Displays[ONSCREEN_TIMER] = true;

ttyd-tools/rel/source/main.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,9 @@ void initAddressOverwrites()
690690
void *FallThroughMostObjectsStandAddress = reinterpret_cast<void *>(0x8008E9DC);
691691
void *FallThroughMostObjectsTubeAddress = reinterpret_cast<void *>(0x8008E1E8);
692692
void *FallThroughMostObjectsBowserAddress = reinterpret_cast<void *>(0x8021A30C);
693+
void *AutoMashThroughText1Address = reinterpret_cast<void *>(0x80080FCC);
694+
void *AutoMashThroughText2Address = reinterpret_cast<void *>(0x80080FF0);
695+
void *AutoMashThroughText3Address = reinterpret_cast<void *>(0x80084268);
693696
#elif defined TTYD_JP
694697
void *AllowRunningFromBattlesAddress = reinterpret_cast<void *>(0x8011E7DC);
695698
void *ForceNPCItemDropAddress = reinterpret_cast<void *>(0x8004DFB0);
@@ -713,6 +716,9 @@ void initAddressOverwrites()
713716
void *FallThroughMostObjectsStandAddress = reinterpret_cast<void *>(0x8008D428);
714717
void *FallThroughMostObjectsTubeAddress = reinterpret_cast<void *>(0x8008CC4C);
715718
void *FallThroughMostObjectsBowserAddress = reinterpret_cast<void *>(0x80215668);
719+
void *AutoMashThroughText1Address = reinterpret_cast<void *>(0x8008047C);
720+
void *AutoMashThroughText2Address = reinterpret_cast<void *>(0x800804A0);
721+
void *AutoMashThroughText3Address = reinterpret_cast<void *>(0x80083390);
716722
#elif defined TTYD_EU
717723
void *AllowRunningFromBattlesAddress = reinterpret_cast<void *>(0x80124BE4);
718724
void *ForceNPCItemDropAddress = reinterpret_cast<void *>(0x8004ECDC);
@@ -736,6 +742,9 @@ void initAddressOverwrites()
736742
void *FallThroughMostObjectsStandAddress = reinterpret_cast<void *>(0x8008FD38);
737743
void *FallThroughMostObjectsTubeAddress = reinterpret_cast<void *>(0x8008F544);
738744
void *FallThroughMostObjectsBowserAddress = reinterpret_cast<void *>(0x8021DD9C);
745+
void *AutoMashThroughText1Address = reinterpret_cast<void *>(0x80082288);
746+
void *AutoMashThroughText2Address = reinterpret_cast<void *>(0x800822AC);
747+
void *AutoMashThroughText3Address = reinterpret_cast<void *>(0x800855BC);
739748
#endif
740749

741750
patch::writeBranchBL(AllowRunningFromBattlesAddress, reinterpret_cast<void *>(StartAllowRunningFromBattles));
@@ -765,11 +774,14 @@ void initAddressOverwrites()
765774
patch::writeBranchBL(InitStageEventsAddress, reinterpret_cast<void *>(initStageEvents));
766775

767776
patch::writeBranchBL(FallThroughMostObjectsStandAddress, reinterpret_cast<void *>(StartFallThroughMostObjectsStandard));
768-
769777
patch::writeBranchBL(FallThroughMostObjectsTubeAddress, reinterpret_cast<void *>(StartFallThroughMostObjectsStandard));
770778

771779
patch::writeBranchBL(FallThroughMostObjectsBowserAddress, reinterpret_cast<void *>(StartFallThroughMostObjectsBowser));
772780

781+
patch::writeBranchBL(AutoMashThroughText1Address, reinterpret_cast<void *>(autoMashText));
782+
patch::writeBranchBL(AutoMashThroughText2Address, reinterpret_cast<void *>(autoMashText));
783+
patch::writeBranchBL(AutoMashThroughText3Address, reinterpret_cast<void *>(autoMashText));
784+
773785
*reinterpret_cast<uint32_t *>(DebugModeInitialzeAddress) = 0x3800FFFF; // li r0,-1
774786
*reinterpret_cast<uint32_t *>(DebugModeShowBuildDateAddress) = 0x60000000; // nop
775787

ttyd-tools/rel/source/menu.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ void menuCheckButton()
529529
case INFINITE_ITEM_USAGE:
530530
case RELOAD_ROOM:
531531
case LEVITATE:
532+
case AUTO_MASH_TEXT:
532533
{
533534
MenuToEnter = CHEATS_STANDARD;
534535
break;

0 commit comments

Comments
 (0)