mirror of
https://github.com/Mr-Wiseguy/Zelda64Recomp.git
synced 2024-12-23 11:31:57 +01:00
Add variable to track if we're in the title sequence.
This commit is contained in:
parent
cdaae070d5
commit
b2b13c5d77
@ -69,11 +69,16 @@ 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_printf("FileSelect_Init\n");
|
||||
|
||||
GameState_SetFramerateDivisor(&this->state, 1);
|
||||
Matrix_Init(&this->state);
|
||||
ShrinkWindow_Init();
|
||||
|
@ -164,11 +164,13 @@ extern u8 D_80784600[];
|
||||
// Non-relocatable references to the original addresses of these game state functions.
|
||||
void DayTelop_Init_NORELOCATE(GameState*);
|
||||
void TitleSetup_Init_NORELOCATE(GameState*);
|
||||
void TitleSetup_Init(GameState*);
|
||||
|
||||
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;
|
||||
|
||||
// @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) {
|
||||
@ -189,7 +191,10 @@ RECOMP_PATCH void Play_Init(GameState* thisx) {
|
||||
|
||||
// @recomp_event recomp_on_play_init(PlayState* this): A new PlayState is being initialized.
|
||||
recomp_on_play_init(this);
|
||||
if (!recomp_in_title_sequence) {
|
||||
recomp_set_reset_button_visibility(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ((gSaveContext.respawnFlag == -4) || (gSaveContext.respawnFlag == -0x63)) {
|
||||
|
41
patches/title_patches.c
Normal file
41
patches/title_patches.c
Normal file
@ -0,0 +1,41 @@
|
||||
#include "patches.h"
|
||||
#include "patch_helpers.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);
|
||||
|
||||
RECOMP_PATCH void TitleSetup_Init(GameState* thisx) {
|
||||
TitleSetupState* this = (TitleSetupState*)thisx;
|
||||
|
||||
GameState_SetFramerateDivisor(&this->state, 1);
|
||||
Matrix_Init(&this->state);
|
||||
ShrinkWindow_Init();
|
||||
View_Init(&this->view, this->state.gfxCtx);
|
||||
this->state.main = TitleSetup_Main;
|
||||
this->state.destroy = TitleSetup_Destroy;
|
||||
|
||||
gSaveContext.respawnFlag = 0;
|
||||
gSaveContext.respawn[RESPAWN_MODE_GORON].entrance = 0xFF;
|
||||
gSaveContext.respawn[RESPAWN_MODE_ZORA].entrance = 0xFF;
|
||||
gSaveContext.respawn[RESPAWN_MODE_DEKU].entrance = 0xFF;
|
||||
gSaveContext.respawn[RESPAWN_MODE_HUMAN].entrance = 0xFF;
|
||||
|
||||
recomp_in_title_sequence = true;
|
||||
recomp_printf("TitleSetup_Init\n");
|
||||
}
|
Loading…
Reference in New Issue
Block a user