Skip to content

Commit 7c8c5b8

Browse files
committed
Added additional features
Shine Sprites and Star Pieces are now reset with the Clear Area Flags code. The Pause Menu/Z Menu sound effects can now be enabled/disabled via the Cheats menu.
1 parent 48cffb0 commit 7c8c5b8

File tree

6 files changed

+179
-65
lines changed

6 files changed

+179
-65
lines changed

ttyd-tools/rel/include/commonfunctions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@ void removeFollowerFromOverworld();
3636
bool checkIfBadgeEquipped(int16_t badge);
3737
void recheckJumpAndHammerLevels();
3838
uint32_t getCurrentPitFloor();
39+
void clearGSWFsRange(uint32_t lowerBound, uint32_t upperBound);
3940

4041
}

ttyd-tools/rel/include/global.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ enum CHEATS_OPTIONS
7070
LEVITATE,
7171
LOCK_MARIO_HP_TO_MAX,
7272
RUN_FROM_BATTLES,
73+
DISABLE_MENU_SOUNDS,
7374
BOBBERY_EARLY,
7475
FORCE_ITEM_DROP,
7576
CLEAR_AREA_FLAGS,
@@ -464,7 +465,7 @@ struct DisplayActionCommandTiming
464465
};
465466

466467
extern Menus Menu[20];
467-
extern Cheats Cheat[18];
468+
extern Cheats Cheat[19];
468469
extern bool Displays[8];
469470
extern char DisplayBuffer[256];
470471

ttyd-tools/rel/source/codes.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -953,18 +953,19 @@ void displayPalaceSkipDetails()
953953
int32_t Mod::preventMenuSounds(int32_t soundId, uint32_t unk1,
954954
uint32_t unk2, uint32_t unk3)
955955
{
956-
const int32_t OpenMenu = 1169;
957-
const int32_t CloseMenu = 1168;
958-
959-
if ((soundId == OpenMenu) || (soundId == CloseMenu))
956+
if (Cheat[DISABLE_MENU_SOUNDS].Active)
960957
{
961-
return -1;
962-
}
963-
else
964-
{
965-
// Call original function
966-
return mPFN_SoundEfxPlayEx_trampoline(soundId, unk1, unk2, unk3);
958+
const int32_t OpenMenu = 1169;
959+
const int32_t CloseMenu = 1168;
960+
961+
if ((soundId == OpenMenu) || (soundId == CloseMenu))
962+
{
963+
return -1;
964+
}
967965
}
966+
967+
// Call original function
968+
return mPFN_SoundEfxPlayEx_trampoline(soundId, unk1, unk2, unk3);
968969
}
969970

970971
void actionCommandsTimingsInit()

ttyd-tools/rel/source/commonfunctions.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,4 +264,12 @@ uint32_t getCurrentPitFloor()
264264
return ttyd::swdrv::swByteGet(1321) + 1; // GSW(1321);
265265
}
266266

267+
void clearGSWFsRange(uint32_t lowerBound, uint32_t upperBound)
268+
{
269+
for (uint32_t i = lowerBound; i <= upperBound; i++)
270+
{
271+
ttyd::swdrv::swClear(i);
272+
}
273+
}
274+
267275
}

ttyd-tools/rel/source/global.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const char *CheatsLines[] =
5555
"Levitate",
5656
"Lock Mario's HP To Its Max",
5757
"Allow Running From Any Battle",
58+
"Disable Pause Menu/Z Menu Sounds",
5859
"Bobbery Early",
5960
"Force NPC Item Drop",
6061
"Clear Area Flags",
@@ -768,7 +769,7 @@ const char *ButtonInputDisplay[] =
768769
#endif
769770

770771
struct Menus Menu[20];
771-
struct Cheats Cheat[18];
772+
struct Cheats Cheat[19];
772773
bool Displays[8];
773774
char DisplayBuffer[256];
774775

@@ -963,10 +964,22 @@ void initMenuVars()
963964
Menu[DISPLAYS_NO_BUTTON_COMBO].Line = CheatsNoButtonComboOptionsLines;
964965

965966
Cheat[WALK_THROUGH_WALLS].Active = false;
967+
// Cheat[SAVE_COORDINATES].Active = false;
968+
// Cheat[LOAD_COORDINATES].Active = false;
966969
Cheat[SAVE_ANYWHERE].Active = false;
970+
// Cheat[TEXT_STORAGE].Active = false;
971+
// Cheat[TIME_STOP_TEXT_STORAGE].Active = false;
972+
// Cheat[SPEED_UP_MARIO].Active = false;
973+
// Cheat[DISABLE_BATTLES].Active = false;
974+
// Cheat[AUTO_ACTION_COMMANDS].Active = false;
975+
// Cheat[INFINITE_ITEM_USAGE].Active = false;
976+
// Cheat[RELOAD_ROOM].Active = false;
977+
// Cheat[LEVITATE].Active = false;
967978
Cheat[LOCK_MARIO_HP_TO_MAX].Active = false;
968979
Cheat[RUN_FROM_BATTLES].Active = false;
969980
Cheat[SPAWN_ITEM].Active = false;
981+
// Cheat[DISABLE_MENU_SOUNDS].Active = false;
982+
// Cheat[BOBBERY_EARLY].Active = false;
970983
Cheat[FORCE_ITEM_DROP].Active = false;
971984

972985
Cheat[WALK_THROUGH_WALLS].ButtonCombo = PAD_Z;

0 commit comments

Comments
 (0)