From efaf7d615a1f5ceabf2824562eb41569abfe9634 Mon Sep 17 00:00:00 2001 From: LT-Schmiddy Date: Sat, 30 Nov 2024 16:59:01 -0500 Subject: [PATCH] Reset button now invisible during title sequence. --- patches/options.c | 6 +++--- patches/play_patches.c | 6 +++++- patches/play_patches.h | 2 ++ patches/title_patches.c | 9 +++------ 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/patches/options.c b/patches/options.c index 1a67af5..98ddc28 100644 --- a/patches/options.c +++ b/patches/options.c @@ -3,6 +3,8 @@ #include "z64shrink_window.h" #include "overlays/gamestates/ovl_file_choose/z_file_select.h" +#include "play_patches.h" + #define FS_BTN_CONFIRM_REWIND 2 INCBIN(rewind_button_texture, "rewind.ia16.bin"); @@ -69,14 +71,12 @@ RECOMP_PATCH void FileSelect_RotateToOptions(GameState* thisx) { recomp_exit(); } -extern int recomp_in_title_sequence; - RECOMP_PATCH void FileSelect_Init(GameState* thisx) { s32 pad; FileSelectState* this = (FileSelectState*)thisx; size_t size; - recomp_in_title_sequence = false; + recomp_set_in_title_sequence(false); recomp_printf("FileSelect_Init\n"); GameState_SetFramerateDivisor(&this->state, 1); diff --git a/patches/play_patches.c b/patches/play_patches.c index 0269dba..c6d0b91 100644 --- a/patches/play_patches.c +++ b/patches/play_patches.c @@ -170,7 +170,11 @@ RECOMP_DECLARE_EVENT(recomp_on_play_init(PlayState* this)); RECOMP_DECLARE_EVENT(recomp_after_play_init(PlayState* this)); bool allow_no_ocarina_tf = false; -bool recomp_in_title_sequence = false; +static bool recomp_in_title_sequence = false; + +void recomp_set_in_title_sequence(bool val) { + recomp_in_title_sequence = val; +} // @recomp_export void recomp_set_allow_no_ocarina_tf(bool new_val): Set whether to force Termina Field to load normally even if Link has no ocarina. RECOMP_EXPORT void recomp_set_allow_no_ocarina_tf(bool new_val) { diff --git a/patches/play_patches.h b/patches/play_patches.h index 5cd51b9..84f5d72 100644 --- a/patches/play_patches.h +++ b/patches/play_patches.h @@ -12,6 +12,8 @@ void analog_cam_post_play_update(PlayState* play); void matrix_play_update(PlayState* play); void autosave_post_play_update(PlayState* play); +void recomp_set_in_title_sequence(bool val); + DECLARE_FUNC(void, recomp_set_reset_button_visibility, u8 visibility); DECLARE_FUNC(bool, recomp_should_reset_game); diff --git a/patches/title_patches.c b/patches/title_patches.c index a45aab2..39b788b 100644 --- a/patches/title_patches.c +++ b/patches/title_patches.c @@ -1,21 +1,19 @@ #include "patches.h" #include "patch_helpers.h" +#include "play_patches.h" + #include "global.h" #include "z64save.h" #include "z64shrink_window.h" #include "z64view.h" #include "regs.h" -DECLARE_FUNC(void, recomp_set_reset_button_visibility, u8 visibility); - typedef struct { /* 0x000 */ GameState state; /* 0x0A8 */ View view; } TitleSetupState; // size = 0x210 -extern int recomp_in_title_sequence; - void TitleSetup_Init(GameState* thisx); void TitleSetup_Main(GameState* thisx); void TitleSetup_Destroy(GameState* thisx); @@ -36,6 +34,5 @@ RECOMP_PATCH void TitleSetup_Init(GameState* thisx) { gSaveContext.respawn[RESPAWN_MODE_DEKU].entrance = 0xFF; gSaveContext.respawn[RESPAWN_MODE_HUMAN].entrance = 0xFF; - recomp_in_title_sequence = true; - recomp_printf("TitleSetup_Init\n"); + recomp_set_in_title_sequence(true); }