1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-05-10 02:54:24 +00:00

Document Timers (#1412)

* Document Timers, First Draft

* some progress

* more timer docs

* cleanup

* small cleanup

* more cleanup

* comments

* more cleanup

* extra comment

* more docs

* brackets

* PR Suggestions

* cleanup, missed some

* more suggestions

* more PR Suggestions

* small change

* environmental
This commit is contained in:
engineer124 2022-11-16 13:41:27 -05:00 committed by GitHub
parent cc2409606e
commit 40639e698d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 550 additions and 435 deletions

View file

@ -996,9 +996,9 @@ void Inventory_ChangeAmmo(s16 item, s16 ammoChange);
void Magic_Fill(PlayState* play);
void Magic_Reset(PlayState* play);
s32 Magic_RequestChange(PlayState* play, s16 amount, s16 type);
void func_80088AA0(s16 arg0);
void func_80088AF0(PlayState* play);
void func_80088B34(s16 arg0);
void Interface_SetSubTimer(s16 seconds);
void Interface_SetSubTimerToFinalSecond(PlayState* play);
void Interface_SetTimer(s16 seconds);
void Interface_Draw(PlayState* play);
void Interface_Update(PlayState* play);
Path* Path_GetByIndex(PlayState* play, s16 index, s16 max);
@ -1040,7 +1040,7 @@ s32 Player_GetBottleHeld(Player* this);
s32 Player_ActionToExplosive(Player* this, s32 itemAction);
s32 Player_GetExplosiveHeld(Player* this);
s32 func_8008F2BC(Player* this, s32 itemAction);
s32 func_8008F2F8(PlayState* play);
s32 Player_GetEnvironmentalHazard(PlayState* play);
void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, s32 lod, s32 tunic,
s32 boots, s32 face, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw,
void* data);

View file

@ -61,6 +61,14 @@ typedef enum {
/* 0x09 */ PLAYER_MASK_MAX
} PlayerMask;
typedef enum {
/* 0x0 */ PLAYER_ENV_HAZARD_NONE,
/* 0x1 */ PLAYER_ENV_HAZARD_HOTROOM,
/* 0x2 */ PLAYER_ENV_HAZARD_UNDERWATER_FLOOR,
/* 0x3 */ PLAYER_ENV_HAZARD_SWIMMING,
/* 0x4 */ PLAYER_ENV_HAZARD_UNDERWATER_FREE
} PlayerEnvHazard;
typedef enum {
/* 0x00 */ PLAYER_IA_NONE,
/* 0x01 */ PLAYER_IA_LAST_USED,
@ -571,7 +579,7 @@ typedef struct Player {
/* 0x0838 */ f32 linearVelocity;
/* 0x083C */ s16 currentYaw;
/* 0x083E */ s16 targetYaw;
/* 0x0840 */ u16 unk_840;
/* 0x0840 */ u16 underwaterTimer;
/* 0x0842 */ s8 meleeWeaponAnimation;
/* 0x0843 */ s8 meleeWeaponState;
/* 0x0844 */ s8 unk_844;

View file

@ -99,6 +99,49 @@ typedef struct {
/* 0x24 */ s32 tempCollectFlags;
} FaroresWindData; // size = 0x28
typedef enum {
/* 0x0 */ TIMER_STATE_OFF,
/* 0x1 */ TIMER_STATE_ENV_HAZARD_INIT, // Init env timer that counts down, total time based on health, resets on void-out, kills at 0
/* 0x2 */ TIMER_STATE_ENV_HAZARD_PREVIEW, // Display initial time, keep it fixed at the screen center
/* 0x3 */ TIMER_STATE_ENV_HAZARD_MOVE, // Move to top-left corner
/* 0x4 */ TIMER_STATE_ENV_HAZARD_TICK, // Counting down
/* 0x5 */ TIMER_STATE_DOWN_INIT, // Init timer that counts down
/* 0x6 */ TIMER_STATE_DOWN_PREVIEW, // Display initial time, keep it fixed at the screen center
/* 0x7 */ TIMER_STATE_DOWN_MOVE, // Move to top-left corner
/* 0x8 */ TIMER_STATE_DOWN_TICK, // Counting down
/* 0xA */ TIMER_STATE_STOP = 10,
/* 0xB */ TIMER_STATE_UP_INIT, // Init timer that counts up
/* 0xC */ TIMER_STATE_UP_PREVIEW, // Display initial time, keep it fixed at the screen center
/* 0xD */ TIMER_STATE_UP_MOVE, // Move to top-left corner
/* 0xE */ TIMER_STATE_UP_TICK, // Counting up
/* 0xF */ TIMER_STATE_UP_FREEZE // Stop counting the timer
} TimerState;
typedef enum {
/* 0x0 */ SUBTIMER_STATE_OFF,
/* 0x1 */ SUBTIMER_STATE_DOWN_INIT, // Init timer that counts down
/* 0x2 */ SUBTIMER_STATE_DOWN_PREVIEW, // Display initial time, keep it fixed at the screen center
/* 0x3 */ SUBTIMER_STATE_DOWN_MOVE, // Move to top-left corner
/* 0x4 */ SUBTIMER_STATE_DOWN_TICK, // Counting down
/* 0x5 */ SUBTIMER_STATE_RESPAWN, // Time is up, trigger a transition, reset button items, spoil trade quest items
/* 0x6 */ SUBTIMER_STATE_STOP, // Time is up, stop counting
/* 0x7 */ SUBTIMER_STATE_UP_INIT, // Init timer that counts up
/* 0x8 */ SUBTIMER_STATE_UP_PREVIEW, // Display initial time, keep it fixed at the screen center
/* 0x9 */ SUBTIMER_STATE_UP_MOVE, // Move to top-left corner
/* 0xA */ SUBTIMER_STATE_UP_TICK // Counting up
} SubTimerState;
typedef enum {
/* 0 */ TIMER_ID_MAIN, // Takes priority in both counting and drawing. See `timerState` and `timerSeconds`
/* 1 */ TIMER_ID_SUB, // See `subTimerState` and `subTimerSeconds`
/* 2 */ TIMER_ID_MAX
} TimerId;
#define MARATHON_TIME_LIMIT 240 // 4 minutes
#define ENV_HAZARD_TEXT_TRIGGER_HOTROOM (1 << 0)
#define ENV_HAZARD_TEXT_TRIGGER_UNDERWATER (1 << 1)
typedef struct {
/* 0x0000 */ s32 entranceIndex; // start of `save` substruct, originally called "memory"
/* 0x0004 */ s32 linkAge; // 0: Adult; 1: Child (see enum `LinkAge`)
@ -162,17 +205,17 @@ typedef struct {
/* 0x13C2 */ char unk_13C2[0x0001];
/* 0x13C3 */ u8 retainWeatherMode;
/* 0x13C4 */ s16 dogParams;
/* 0x13C6 */ u8 textTriggerFlags;
/* 0x13C6 */ u8 envHazardTextTriggerFlags;
/* 0x13C7 */ u8 showTitleCard;
/* 0x13C8 */ s16 nayrusLoveTimer;
/* 0x13CA */ char unk_13CA[0x0002];
/* 0x13CC */ s16 rupeeAccumulator;
/* 0x13CE */ s16 timer1State;
/* 0x13D0 */ s16 timer1Value;
/* 0x13D2 */ s16 timer2State;
/* 0x13D4 */ s16 timer2Value;
/* 0x13D6 */ s16 timerX[2];
/* 0x13DA */ s16 timerY[2];
/* 0x13CE */ s16 timerState; // See `TimerState`
/* 0x13D0 */ s16 timerSeconds;
/* 0x13D2 */ s16 subTimerState; // See `SubTimerState`
/* 0x13D4 */ s16 subTimerSeconds;
/* 0x13D6 */ s16 timerX[TIMER_ID_MAX];
/* 0x13DA */ s16 timerY[TIMER_ID_MAX];
/* 0x13DE */ char unk_13DE[0x0002];
/* 0x13E0 */ u8 seqId;
/* 0x13E1 */ u8 natureAmbienceId;
@ -748,7 +791,8 @@ typedef enum {
(gSaveContext.eventInf[EVENTINF_HORSES_INDEX] & ~EVENTINF_HORSES_0F_MASK) | ((v) << EVENTINF_HORSES_0F_SHIFT)
#define EVENTINF_10 0x10
// Is the running man race active
#define EVENTINF_MARATHON_ACTIVE 0x10
// 0x20-0x24
#define EVENTINF_20_21_22_23_24_INDEX 2

View file

@ -8,7 +8,7 @@ void Interface_Init(PlayState* play) {
InterfaceContext* interfaceCtx = &play->interfaceCtx;
u32 parameterSize;
u16 doActionOffset;
u8 temp;
u8 timerId;
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
gSaveContext.unk_13E8 = gSaveContext.unk_13EA = 0;
@ -109,39 +109,42 @@ void Interface_Init(PlayState* play) {
0x1000, "../z_construct.c", 219);
}
osSyncPrintf("%d\n", ((void)0, gSaveContext.timer1State));
osSyncPrintf("%d\n", ((void)0, gSaveContext.timerState));
if ((gSaveContext.timer1State == 4) || (gSaveContext.timer1State == 8) || (gSaveContext.timer2State == 4) ||
(gSaveContext.timer2State == 10)) {
if ((gSaveContext.timerState == TIMER_STATE_ENV_HAZARD_TICK) ||
(gSaveContext.timerState == TIMER_STATE_DOWN_TICK) ||
(gSaveContext.subTimerState == SUBTIMER_STATE_DOWN_TICK) ||
(gSaveContext.subTimerState == SUBTIMER_STATE_UP_TICK)) {
osSyncPrintf("restart_flag=%d\n", ((void)0, gSaveContext.respawnFlag));
if ((gSaveContext.respawnFlag == -1) || (gSaveContext.respawnFlag == 1)) {
if (gSaveContext.timer1State == 4) {
gSaveContext.timer1State = 1;
gSaveContext.timerX[0] = 140;
gSaveContext.timerY[0] = 80;
if (gSaveContext.timerState == TIMER_STATE_ENV_HAZARD_TICK) {
gSaveContext.timerState = TIMER_STATE_ENV_HAZARD_INIT;
gSaveContext.timerX[TIMER_ID_MAIN] = 140;
gSaveContext.timerY[TIMER_ID_MAIN] = 80;
}
}
if ((gSaveContext.timer1State == 4) || (gSaveContext.timer1State == 8)) {
temp = 0;
if ((gSaveContext.timerState == TIMER_STATE_ENV_HAZARD_TICK) ||
(gSaveContext.timerState == TIMER_STATE_DOWN_TICK)) {
timerId = TIMER_ID_MAIN;
} else {
temp = 1;
timerId = TIMER_ID_SUB;
}
gSaveContext.timerX[temp] = 26;
gSaveContext.timerX[timerId] = 26;
if (gSaveContext.healthCapacity > 0xA0) {
gSaveContext.timerY[temp] = 54;
gSaveContext.timerY[timerId] = 54; // two rows of hearts
} else {
gSaveContext.timerY[temp] = 46;
gSaveContext.timerY[timerId] = 46; // one row of hearts
}
}
if ((gSaveContext.timer1State >= 11) && (gSaveContext.timer1State < 16)) {
gSaveContext.timer1State = 0;
if ((gSaveContext.timerState >= TIMER_STATE_UP_INIT) && (gSaveContext.timerState <= TIMER_STATE_UP_FREEZE)) {
gSaveContext.timerState = TIMER_STATE_OFF;
// "Timer Stop!!!!!!!!!!!!!!!!!!!!!!"
osSyncPrintf("タイマー停止!!!!!!!!!!!!!!!!!!!!! = %d\n", gSaveContext.timer1State);
osSyncPrintf("タイマー停止!!!!!!!!!!!!!!!!!!!!! = %d\n", gSaveContext.timerState);
}
osSyncPrintf("PARAMETER領域=%x\n", parameterSize + 0x5300); // "Parameter Area = %x"

View file

@ -28,9 +28,9 @@ void GameOver_Update(PlayState* play) {
case GAMEOVER_DEATH_START:
Message_CloseTextbox(play);
gSaveContext.timer1State = 0;
gSaveContext.timer2State = 0;
CLEAR_EVENTINF(EVENTINF_10);
gSaveContext.timerState = TIMER_STATE_OFF;
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
CLEAR_EVENTINF(EVENTINF_MARATHON_ACTIVE);
// search inventory for spoiling items and revert if necessary
for (i = 0; i < ARRAY_COUNT(gSpoilingItems); i++) {

View file

@ -1283,9 +1283,9 @@ void Message_Decode(PlayState* play) {
osSyncPrintf("\nEVENTタイマー ");
digits[0] = digits[1] = digits[2] = 0;
if (curChar == MESSAGE_RACE_TIME) {
digits[3] = gSaveContext.timer1Value;
digits[3] = gSaveContext.timerSeconds;
} else {
digits[3] = gSaveContext.timer2Value;
digits[3] = gSaveContext.subTimerSeconds;
}
while (digits[3] >= 60) {

View file

@ -154,8 +154,8 @@ static s16 sExtraItemBases[] = {
ITEM_DEKU_NUT, // ITEM_DEKU_NUT_UPGRADE_40
};
static s16 D_80125A58 = 0;
static s16 D_80125A5C = false;
static s16 sEnvHazard = PLAYER_ENV_HAZARD_NONE;
static s16 sEnvHazardActive = false;
static Gfx sSetupDL_80125A60[] = {
gsDPPipeSync(),
@ -722,7 +722,8 @@ void func_80083108(PlayState* play) {
Interface_ChangeAlpha(50);
}
} else if (msgCtx->msgMode == MSGMODE_NONE) {
if ((func_8008F2F8(play) >= 2) && (func_8008F2F8(play) < 5)) {
if ((Player_GetEnvironmentalHazard(play) >= PLAYER_ENV_HAZARD_UNDERWATER_FLOOR) &&
(Player_GetEnvironmentalHazard(play) <= PLAYER_ENV_HAZARD_UNDERWATER_FREE)) {
if (gSaveContext.buttonStatus[0] != BTN_DISABLED) {
sp28 = true;
}
@ -730,7 +731,7 @@ void func_80083108(PlayState* play) {
gSaveContext.buttonStatus[0] = BTN_DISABLED;
for (i = 1; i < 4; i++) {
if (func_8008F2F8(play) == 2) {
if (Player_GetEnvironmentalHazard(play) == PLAYER_ENV_HAZARD_UNDERWATER_FLOOR) {
if ((gSaveContext.equips.buttonItems[i] != ITEM_HOOKSHOT) &&
(gSaveContext.equips.buttonItems[i] != ITEM_LONGSHOT)) {
if (gSaveContext.buttonStatus[i] == BTN_ENABLED) {
@ -2523,7 +2524,9 @@ void Magic_Update(PlayState* play) {
if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0) && (msgCtx->msgMode == MSGMODE_NONE) &&
(play->gameOverCtx.state == GAMEOVER_INACTIVE) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
(play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play)) {
if ((gSaveContext.magic == 0) || ((func_8008F2F8(play) >= 2) && (func_8008F2F8(play) < 5)) ||
if ((gSaveContext.magic == 0) ||
((Player_GetEnvironmentalHazard(play) >= PLAYER_ENV_HAZARD_UNDERWATER_FLOOR) &&
(Player_GetEnvironmentalHazard(play) <= PLAYER_ENV_HAZARD_UNDERWATER_FREE)) ||
((gSaveContext.equips.buttonItems[1] != ITEM_LENS_OF_TRUTH) &&
(gSaveContext.equips.buttonItems[2] != ITEM_LENS_OF_TRUTH) &&
(gSaveContext.equips.buttonItems[3] != ITEM_LENS_OF_TRUTH)) ||
@ -2672,39 +2675,47 @@ void Magic_DrawMeter(PlayState* play) {
CLOSE_DISPS(play->state.gfxCtx, "../z_parameter.c", 2731);
}
void func_80088AA0(s16 arg0) {
gSaveContext.timerX[1] = 140;
gSaveContext.timerY[1] = 80;
D_80125A5C = false;
gSaveContext.timer2Value = arg0;
void Interface_SetSubTimer(s16 seconds) {
gSaveContext.timerX[TIMER_ID_SUB] = 140;
gSaveContext.timerY[TIMER_ID_SUB] = 80;
sEnvHazardActive = false;
gSaveContext.subTimerSeconds = seconds;
if (arg0 != 0) {
gSaveContext.timer2State = 1;
if (seconds != 0) {
// count down
gSaveContext.subTimerState = SUBTIMER_STATE_DOWN_INIT;
} else {
gSaveContext.timer2State = 7;
// count up
gSaveContext.subTimerState = SUBTIMER_STATE_UP_INIT;
}
}
void func_80088AF0(PlayState* play) {
if (gSaveContext.timer2State != 0) {
if (GET_EVENTINF(EVENTINF_10)) {
gSaveContext.timer2Value = 239;
/**
* Set the subTimer to 1 second left
*/
void Interface_SetSubTimerToFinalSecond(PlayState* play) {
if (gSaveContext.subTimerState != SUBTIMER_STATE_OFF) {
if (GET_EVENTINF(EVENTINF_MARATHON_ACTIVE)) {
// The running-man race counts up and finished at MARATHON_TIME_LIMIT
gSaveContext.subTimerSeconds = MARATHON_TIME_LIMIT - 1;
} else {
gSaveContext.timer2Value = 1;
gSaveContext.subTimerSeconds = 1;
}
}
}
void func_80088B34(s16 arg0) {
gSaveContext.timerX[0] = 140;
gSaveContext.timerY[0] = 80;
D_80125A5C = false;
gSaveContext.timer1Value = arg0;
void Interface_SetTimer(s16 seconds) {
gSaveContext.timerX[TIMER_ID_MAIN] = 140;
gSaveContext.timerY[TIMER_ID_MAIN] = 80;
sEnvHazardActive = false;
gSaveContext.timerSeconds = seconds;
if (arg0 != 0) {
gSaveContext.timer1State = 5;
if (seconds != 0) {
// count down
gSaveContext.timerState = TIMER_STATE_DOWN_INIT;
} else {
gSaveContext.timer1State = 11;
// count up
gSaveContext.timerState = TIMER_STATE_UP_INIT;
}
}
@ -2802,7 +2813,8 @@ void Interface_DrawItemButtons(PlayState* play) {
if ((gSaveContext.unk_13EA == 1) || (gSaveContext.unk_13EA == 2) || (gSaveContext.unk_13EA == 5)) {
temp = 0;
} else if ((player->stateFlags1 & PLAYER_STATE1_21) || (func_8008F2F8(play) == 4) ||
} else if ((player->stateFlags1 & PLAYER_STATE1_21) ||
(Player_GetEnvironmentalHazard(play) == PLAYER_ENV_HAZARD_UNDERWATER_FREE) ||
(player->stateFlags2 & PLAYER_STATE2_CRAWLING)) {
temp = 70;
} else {
@ -3062,7 +3074,7 @@ void Interface_Draw(PlayState* play) {
static s16 magicArrowEffectsG[] = { 0, 100, 255 };
static s16 magicArrowEffectsB[] = { 0, 255, 100 };
static s16 timerDigitLeftPos[] = { 16, 25, 34, 42, 51 };
static s16 digitWidth[] = { 9, 9, 8, 9, 9 };
static s16 sDigitWidths[] = { 9, 9, 8, 9, 9 };
// unused, most likely colors
static s16 D_80125B1C[][3] = {
{ 0, 150, 0 }, { 100, 255, 0 }, { 255, 255, 255 }, { 0, 0, 0 }, { 255, 255, 255 },
@ -3072,11 +3084,11 @@ void Interface_Draw(PlayState* play) {
static s16 spoilingItemEntrances[] = { ENTR_SPOT10_2, ENTR_SPOT07_3, ENTR_SPOT07_3 };
static f32 D_80125B54[] = { -40.0f, -35.0f }; // unused
static s16 D_80125B5C[] = { 91, 91 }; // unused
static s16 D_8015FFE0;
static s16 D_8015FFE2;
static s16 D_8015FFE4;
static s16 D_8015FFE6;
static s16 timerDigits[5];
static s16 sTimerNextSecondTimer;
static s16 sTimerStateTimer;
static s16 sSubTimerNextSecondTimer;
static s16 sSubTimerStateTimer;
static s16 sTimerDigits[5];
InterfaceContext* interfaceCtx = &play->interfaceCtx;
PauseContext* pauseCtx = &play->pauseCtx;
MessageContext* msgCtx = &play->msgCtx;
@ -3086,7 +3098,7 @@ void Interface_Draw(PlayState* play) {
s16 svar3;
s16 svar4;
s16 svar5;
s16 svar6;
s16 timerId;
OPEN_DISPS(play->state.gfxCtx, "../z_parameter.c", 3405);
@ -3417,7 +3429,7 @@ void Interface_Draw(PlayState* play) {
if (sHBAScoreDigits[svar1] != 0 || (svar2 != 0) || (svar1 >= 3)) {
OVERLAY_DISP = Gfx_TextureI8(
OVERLAY_DISP, ((u8*)gCounterDigit0Tex + (8 * 16 * sHBAScoreDigits[svar1])), 8, 16, svar5,
(ZREG(15) - 2), digitWidth[0], VREG(42), VREG(43) << 1, VREG(43) << 1);
(ZREG(15) - 2), sDigitWidths[0], VREG(42), VREG(43) << 1, VREG(43) << 1);
svar5 += 9;
svar2++;
}
@ -3428,13 +3440,14 @@ void Interface_Draw(PlayState* play) {
}
}
if ((gSaveContext.timer2State == 5) && (Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT)) {
if ((gSaveContext.subTimerState == SUBTIMER_STATE_RESPAWN) &&
(Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT)) {
// Trade quest timer reached 0
D_8015FFE6 = 40;
sSubTimerStateTimer = 40;
gSaveContext.cutsceneIndex = 0;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.timer2State = 0;
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
if ((gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI) &&
(gSaveContext.equips.buttonItems[0] != ITEM_SWORD_MASTER) &&
@ -3472,112 +3485,123 @@ void Interface_Draw(PlayState* play) {
!(player->stateFlags2 & PLAYER_STATE2_24) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
(play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play) && (gSaveContext.minigameState != 1) &&
(play->shootingGalleryStatus <= 1) && !((play->sceneId == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38))) {
svar6 = 0;
switch (gSaveContext.timer1State) {
case 1:
D_8015FFE2 = 20;
D_8015FFE0 = 20;
gSaveContext.timer1Value = gSaveContext.health >> 1;
gSaveContext.timer1State = 2;
timerId = TIMER_ID_MAIN;
switch (gSaveContext.timerState) {
case TIMER_STATE_ENV_HAZARD_INIT:
sTimerStateTimer = 20;
sTimerNextSecondTimer = 20;
gSaveContext.timerSeconds = gSaveContext.health >> 1;
gSaveContext.timerState = TIMER_STATE_ENV_HAZARD_PREVIEW;
break;
case 2:
D_8015FFE2--;
if (D_8015FFE2 == 0) {
D_8015FFE2 = 20;
gSaveContext.timer1State = 3;
case TIMER_STATE_ENV_HAZARD_PREVIEW:
sTimerStateTimer--;
if (sTimerStateTimer == 0) {
sTimerStateTimer = 20;
gSaveContext.timerState = TIMER_STATE_ENV_HAZARD_MOVE;
}
break;
case 5:
case 11:
D_8015FFE2 = 20;
D_8015FFE0 = 20;
if (gSaveContext.timer1State == 5) {
gSaveContext.timer1State = 6;
case TIMER_STATE_DOWN_INIT:
case TIMER_STATE_UP_INIT:
sTimerStateTimer = 20;
sTimerNextSecondTimer = 20;
if (gSaveContext.timerState == TIMER_STATE_DOWN_INIT) {
gSaveContext.timerState = TIMER_STATE_DOWN_PREVIEW;
} else {
gSaveContext.timer1State = 12;
gSaveContext.timerState = TIMER_STATE_UP_PREVIEW;
}
break;
case 6:
case 12:
D_8015FFE2--;
if (D_8015FFE2 == 0) {
D_8015FFE2 = 20;
if (gSaveContext.timer1State == 6) {
gSaveContext.timer1State = 7;
case TIMER_STATE_DOWN_PREVIEW:
case TIMER_STATE_UP_PREVIEW:
sTimerStateTimer--;
if (sTimerStateTimer == 0) {
sTimerStateTimer = 20;
if (gSaveContext.timerState == TIMER_STATE_DOWN_PREVIEW) {
gSaveContext.timerState = TIMER_STATE_DOWN_MOVE;
} else {
gSaveContext.timer1State = 13;
gSaveContext.timerState = TIMER_STATE_UP_MOVE;
}
}
break;
case 3:
case 7:
svar1 = (gSaveContext.timerX[0] - 26) / D_8015FFE2;
gSaveContext.timerX[0] -= svar1;
case TIMER_STATE_ENV_HAZARD_MOVE:
case TIMER_STATE_DOWN_MOVE:
svar1 = (gSaveContext.timerX[TIMER_ID_MAIN] - 26) / sTimerStateTimer;
gSaveContext.timerX[TIMER_ID_MAIN] -= svar1;
if (gSaveContext.healthCapacity > 0xA0) {
svar1 = (gSaveContext.timerY[0] - 54) / D_8015FFE2;
svar1 = (gSaveContext.timerY[TIMER_ID_MAIN] - 54) / sTimerStateTimer; // two rows of hearts
} else {
svar1 = (gSaveContext.timerY[0] - 46) / D_8015FFE2;
svar1 = (gSaveContext.timerY[TIMER_ID_MAIN] - 46) / sTimerStateTimer; // one row of hearts
}
gSaveContext.timerY[0] -= svar1;
gSaveContext.timerY[TIMER_ID_MAIN] -= svar1;
D_8015FFE2--;
if (D_8015FFE2 == 0) {
D_8015FFE2 = 20;
gSaveContext.timerX[0] = 26;
sTimerStateTimer--;
if (sTimerStateTimer == 0) {
sTimerStateTimer = 20;
gSaveContext.timerX[TIMER_ID_MAIN] = 26;
if (gSaveContext.healthCapacity > 0xA0) {
gSaveContext.timerY[0] = 54;
gSaveContext.timerY[TIMER_ID_MAIN] = 54; // two rows of hearts
} else {
gSaveContext.timerY[0] = 46;
gSaveContext.timerY[TIMER_ID_MAIN] = 46; // one row of hearts
}
if (gSaveContext.timer1State == 3) {
gSaveContext.timer1State = 4;
if (gSaveContext.timerState == TIMER_STATE_ENV_HAZARD_MOVE) {
gSaveContext.timerState = TIMER_STATE_ENV_HAZARD_TICK;
} else {
gSaveContext.timer1State = 8;
gSaveContext.timerState = TIMER_STATE_DOWN_TICK;
}
}
FALLTHROUGH;
case 4:
case 8:
if ((gSaveContext.timer1State == 4) || (gSaveContext.timer1State == 8)) {
case TIMER_STATE_ENV_HAZARD_TICK:
case TIMER_STATE_DOWN_TICK:
if ((gSaveContext.timerState == TIMER_STATE_ENV_HAZARD_TICK) ||
(gSaveContext.timerState == TIMER_STATE_DOWN_TICK)) {
if (gSaveContext.healthCapacity > 0xA0) {
gSaveContext.timerY[0] = 54;
gSaveContext.timerY[TIMER_ID_MAIN] = 54; // two rows of hearts
} else {
gSaveContext.timerY[0] = 46;
gSaveContext.timerY[TIMER_ID_MAIN] = 46; // one row of hearts
}
}
if ((gSaveContext.timer1State >= 3) && (msgCtx->msgLength == 0)) {
D_8015FFE0--;
if (D_8015FFE0 == 0) {
if (gSaveContext.timer1Value != 0) {
gSaveContext.timer1Value--;
if ((gSaveContext.timerState >= TIMER_STATE_ENV_HAZARD_MOVE) && (msgCtx->msgLength == 0)) {
sTimerNextSecondTimer--;
if (sTimerNextSecondTimer == 0) {
if (gSaveContext.timerSeconds != 0) {
gSaveContext.timerSeconds--;
}
D_8015FFE0 = 20;
sTimerNextSecondTimer = 20;
if (gSaveContext.timer1Value == 0) {
gSaveContext.timer1State = 10;
if (D_80125A5C) {
if (gSaveContext.timerSeconds == 0) {
// Out of time
gSaveContext.timerState = TIMER_STATE_STOP;
if (sEnvHazardActive) {
gSaveContext.health = 0;
play->damagePlayer(play, -(gSaveContext.health + 2));
}
D_80125A5C = false;
} else if (gSaveContext.timer1Value > 60) {
if (timerDigits[4] == 1) {
sEnvHazardActive = false;
} else if (gSaveContext.timerSeconds > 60) {
// Beep at "xx:x1" (every 10 seconds)
if (sTimerDigits[4] == 1) {
Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_WOMAN, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
}
} else if (gSaveContext.timer1Value >= 11) {
if (timerDigits[4] & 1) {
} else if (gSaveContext.timerSeconds > 10) {
// Beep on alternating seconds
if ((sTimerDigits[4] % 2) != 0) {
Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
}
} else {
// Beep every second
Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_E, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
@ -3585,48 +3609,49 @@ void Interface_Draw(PlayState* play) {
}
}
break;
case 13:
svar1 = (gSaveContext.timerX[0] - 26) / D_8015FFE2;
gSaveContext.timerX[0] -= svar1;
case TIMER_STATE_UP_MOVE:
svar1 = (gSaveContext.timerX[TIMER_ID_MAIN] - 26) / sTimerStateTimer;
gSaveContext.timerX[TIMER_ID_MAIN] -= svar1;
if (gSaveContext.healthCapacity > 0xA0) {
svar1 = (gSaveContext.timerY[0] - 54) / D_8015FFE2;
svar1 = (gSaveContext.timerY[TIMER_ID_MAIN] - 54) / sTimerStateTimer; // two rows of hearts
} else {
svar1 = (gSaveContext.timerY[0] - 46) / D_8015FFE2;
svar1 = (gSaveContext.timerY[TIMER_ID_MAIN] - 46) / sTimerStateTimer; // one row of hearts
}
gSaveContext.timerY[0] -= svar1;
gSaveContext.timerY[TIMER_ID_MAIN] -= svar1;
D_8015FFE2--;
if (D_8015FFE2 == 0) {
D_8015FFE2 = 20;
gSaveContext.timerX[0] = 26;
sTimerStateTimer--;
if (sTimerStateTimer == 0) {
sTimerStateTimer = 20;
gSaveContext.timerX[TIMER_ID_MAIN] = 26;
if (gSaveContext.healthCapacity > 0xA0) {
gSaveContext.timerY[0] = 54;
gSaveContext.timerY[TIMER_ID_MAIN] = 54; // two rows of hearts
} else {
gSaveContext.timerY[0] = 46;
gSaveContext.timerY[TIMER_ID_MAIN] = 46; // one row of hearts
}
gSaveContext.timer1State = 14;
gSaveContext.timerState = TIMER_STATE_UP_TICK;
}
FALLTHROUGH;
case 14:
if (gSaveContext.timer1State == 14) {
case TIMER_STATE_UP_TICK:
if (gSaveContext.timerState == TIMER_STATE_UP_TICK) {
if (gSaveContext.healthCapacity > 0xA0) {
gSaveContext.timerY[0] = 54;
gSaveContext.timerY[TIMER_ID_MAIN] = 54; // two rows of hearts
} else {
gSaveContext.timerY[0] = 46;
gSaveContext.timerY[TIMER_ID_MAIN] = 46; // one row of hearts
}
}
if (gSaveContext.timer1State >= 3) {
D_8015FFE0--;
if (D_8015FFE0 == 0) {
gSaveContext.timer1Value++;
D_8015FFE0 = 20;
if (gSaveContext.timerState >= TIMER_STATE_ENV_HAZARD_MOVE) {
sTimerNextSecondTimer--;
if (sTimerNextSecondTimer == 0) {
gSaveContext.timerSeconds++;
sTimerNextSecondTimer = 20;
if (gSaveContext.timer1Value == 3599) {
D_8015FFE2 = 40;
gSaveContext.timer1State = 15;
if (gSaveContext.timerSeconds == 3599) { // 59 minutes, 59 seconds
sTimerStateTimer = 40;
gSaveContext.timerState = TIMER_STATE_UP_FREEZE;
} else {
Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
@ -3635,146 +3660,163 @@ void Interface_Draw(PlayState* play) {
}
}
break;
case 10:
if (gSaveContext.timer2State != 0) {
D_8015FFE6 = 20;
D_8015FFE4 = 20;
gSaveContext.timerX[1] = 140;
gSaveContext.timerY[1] = 80;
if (gSaveContext.timer2State < 7) {
gSaveContext.timer2State = 2;
case TIMER_STATE_STOP:
if (gSaveContext.subTimerState != SUBTIMER_STATE_OFF) {
sSubTimerStateTimer = 20;
sSubTimerNextSecondTimer = 20;
gSaveContext.timerX[TIMER_ID_SUB] = 140;
gSaveContext.timerY[TIMER_ID_SUB] = 80;
if (gSaveContext.subTimerState <= SUBTIMER_STATE_STOP) {
gSaveContext.subTimerState = SUBTIMER_STATE_DOWN_PREVIEW;
} else {
gSaveContext.timer2State = 8;
gSaveContext.subTimerState = SUBTIMER_STATE_UP_PREVIEW;
}
gSaveContext.timer1State = 0;
gSaveContext.timerState = TIMER_STATE_OFF;
} else {
gSaveContext.timer1State = 0;
gSaveContext.timerState = TIMER_STATE_OFF;
}
case 15:
FALLTHROUGH;
case TIMER_STATE_UP_FREEZE:
break;
default:
svar6 = 1;
switch (gSaveContext.timer2State) {
case 1:
case 7:
D_8015FFE6 = 20;
D_8015FFE4 = 20;
gSaveContext.timerX[1] = 140;
gSaveContext.timerY[1] = 80;
if (gSaveContext.timer2State == 1) {
gSaveContext.timer2State = 2;
default: // TIMER_STATE_OFF
// Process the subTimer only if the main timer is off
timerId = TIMER_ID_SUB;
switch (gSaveContext.subTimerState) {
case SUBTIMER_STATE_DOWN_INIT:
case SUBTIMER_STATE_UP_INIT:
sSubTimerStateTimer = 20;
sSubTimerNextSecondTimer = 20;
gSaveContext.timerX[TIMER_ID_SUB] = 140;
gSaveContext.timerY[TIMER_ID_SUB] = 80;
if (gSaveContext.subTimerState == SUBTIMER_STATE_DOWN_INIT) {
gSaveContext.subTimerState = SUBTIMER_STATE_DOWN_PREVIEW;
} else {
gSaveContext.timer2State = 8;
gSaveContext.subTimerState = SUBTIMER_STATE_UP_PREVIEW;
}
break;
case 2:
case 8:
D_8015FFE6--;
if (D_8015FFE6 == 0) {
D_8015FFE6 = 20;
if (gSaveContext.timer2State == 2) {
gSaveContext.timer2State = 3;
case SUBTIMER_STATE_DOWN_PREVIEW:
case SUBTIMER_STATE_UP_PREVIEW:
sSubTimerStateTimer--;
if (sSubTimerStateTimer == 0) {
sSubTimerStateTimer = 20;
if (gSaveContext.subTimerState == SUBTIMER_STATE_DOWN_PREVIEW) {
gSaveContext.subTimerState = SUBTIMER_STATE_DOWN_MOVE;
} else {
gSaveContext.timer2State = 9;
gSaveContext.subTimerState = SUBTIMER_STATE_UP_MOVE;
}
}
break;
case 3:
case 9:
osSyncPrintf("event_xp[1]=%d, event_yp[1]=%d TOTAL_EVENT_TM=%d\n",
((void)0, gSaveContext.timerX[1]), ((void)0, gSaveContext.timerY[1]),
gSaveContext.timer2Value);
svar1 = (gSaveContext.timerX[1] - 26) / D_8015FFE6;
gSaveContext.timerX[1] -= svar1;
if (gSaveContext.healthCapacity > 0xA0) {
svar1 = (gSaveContext.timerY[1] - 54) / D_8015FFE6;
} else {
svar1 = (gSaveContext.timerY[1] - 46) / D_8015FFE6;
}
gSaveContext.timerY[1] -= svar1;
D_8015FFE6--;
if (D_8015FFE6 == 0) {
D_8015FFE6 = 20;
gSaveContext.timerX[1] = 26;
case SUBTIMER_STATE_DOWN_MOVE:
case SUBTIMER_STATE_UP_MOVE:
osSyncPrintf("event_xp[1]=%d, event_yp[1]=%d TOTAL_EVENT_TM=%d\n",
((void)0, gSaveContext.timerX[TIMER_ID_SUB]),
((void)0, gSaveContext.timerY[TIMER_ID_SUB]), gSaveContext.subTimerSeconds);
svar1 = (gSaveContext.timerX[TIMER_ID_SUB] - 26) / sSubTimerStateTimer;
gSaveContext.timerX[TIMER_ID_SUB] -= svar1;
if (gSaveContext.healthCapacity > 0xA0) {
// two rows of hearts
svar1 = (gSaveContext.timerY[TIMER_ID_SUB] - 54) / sSubTimerStateTimer;
} else {
// one row of hearts
svar1 = (gSaveContext.timerY[TIMER_ID_SUB] - 46) / sSubTimerStateTimer;
}
gSaveContext.timerY[TIMER_ID_SUB] -= svar1;
sSubTimerStateTimer--;
if (sSubTimerStateTimer == 0) {
sSubTimerStateTimer = 20;
gSaveContext.timerX[TIMER_ID_SUB] = 26;
if (gSaveContext.healthCapacity > 0xA0) {
gSaveContext.timerY[1] = 54;
gSaveContext.timerY[TIMER_ID_SUB] = 54; // two rows of hearts
} else {
gSaveContext.timerY[1] = 46;
gSaveContext.timerY[TIMER_ID_SUB] = 46; // one row of hearts
}
if (gSaveContext.timer2State == 3) {
gSaveContext.timer2State = 4;
if (gSaveContext.subTimerState == SUBTIMER_STATE_DOWN_MOVE) {
gSaveContext.subTimerState = SUBTIMER_STATE_DOWN_TICK;
} else {
gSaveContext.timer2State = 10;
gSaveContext.subTimerState = SUBTIMER_STATE_UP_TICK;
}
}
FALLTHROUGH;
case 4:
case 10:
if ((gSaveContext.timer2State == 4) || (gSaveContext.timer2State == 10)) {
case SUBTIMER_STATE_DOWN_TICK:
case SUBTIMER_STATE_UP_TICK:
if ((gSaveContext.subTimerState == SUBTIMER_STATE_DOWN_TICK) ||
(gSaveContext.subTimerState == SUBTIMER_STATE_UP_TICK)) {
if (gSaveContext.healthCapacity > 0xA0) {
gSaveContext.timerY[1] = 54;
gSaveContext.timerY[TIMER_ID_SUB] = 54; // two rows of hearts
} else {
gSaveContext.timerY[1] = 46;
gSaveContext.timerY[TIMER_ID_SUB] = 46; // one row of hearts
}
}
if (gSaveContext.timer2State >= 3) {
D_8015FFE4--;
if (D_8015FFE4 == 0) {
D_8015FFE4 = 20;
if (gSaveContext.timer2State == 4) {
gSaveContext.timer2Value--;
osSyncPrintf("TOTAL_EVENT_TM=%d\n", gSaveContext.timer2Value);
if (gSaveContext.subTimerState >= SUBTIMER_STATE_DOWN_MOVE) {
sSubTimerNextSecondTimer--;
if (sSubTimerNextSecondTimer == 0) {
sSubTimerNextSecondTimer = 20;
if (gSaveContext.subTimerState == SUBTIMER_STATE_DOWN_TICK) {
gSaveContext.subTimerSeconds--;
osSyncPrintf("TOTAL_EVENT_TM=%d\n", gSaveContext.subTimerSeconds);
if (gSaveContext.timer2Value <= 0) {
if (gSaveContext.subTimerSeconds <= 0) {
// Out of time
if (!Flags_GetSwitch(play, 0x37) ||
((play->sceneId != SCENE_GANON_DEMO) &&
(play->sceneId != SCENE_GANON_FINAL) &&
(play->sceneId != SCENE_GANON_SONOGO) &&
(play->sceneId != SCENE_GANONTIKA_SONOGO))) {
D_8015FFE6 = 40;
gSaveContext.timer2State = 5;
sSubTimerStateTimer = 40;
gSaveContext.subTimerState = SUBTIMER_STATE_RESPAWN;
gSaveContext.cutsceneIndex = 0;
Message_StartTextbox(play, 0x71B0, NULL);
func_8002DF54(play, NULL, 8);
} else {
D_8015FFE6 = 40;
gSaveContext.timer2State = 6;
sSubTimerStateTimer = 40;
gSaveContext.subTimerState = SUBTIMER_STATE_STOP;
}
} else if (gSaveContext.timer2Value > 60) {
if (timerDigits[4] == 1) {
} else if (gSaveContext.subTimerSeconds > 60) {
// Beep at "xx:x1" (every 10 seconds)
if (sTimerDigits[4] == 1) {
Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_WOMAN, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}
} else if (gSaveContext.timer2Value > 10) {
if (timerDigits[4] & 1) {
} else if (gSaveContext.subTimerSeconds > 10) {
// Beep on alternating seconds
if ((sTimerDigits[4] % 2) != 0) {
Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}
} else {
// Beep every second
Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_E, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}
} else {
gSaveContext.timer2Value++;
if (GET_EVENTINF(EVENTINF_10)) {
if (gSaveContext.timer2Value == 240) {
Message_StartTextbox(play, 0x6083, NULL);
CLEAR_EVENTINF(EVENTINF_10);
gSaveContext.timer2State = 0;
}
} else { // SUBTIMER_STATE_UP_TICK
gSaveContext.subTimerSeconds++;
// Special case for the running-man race
if (GET_EVENTINF(EVENTINF_MARATHON_ACTIVE) &&
(gSaveContext.subTimerSeconds == MARATHON_TIME_LIMIT)) {
// After 4 minutes, cancel the timer
Message_StartTextbox(play, 0x6083, NULL);
CLEAR_EVENTINF(EVENTINF_MARATHON_ACTIVE);
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
}
}
if ((gSaveContext.timer2Value % 60) == 0) {
// Beep at the minute mark
if ((gSaveContext.subTimerSeconds % 60) == 0) {
Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
@ -3782,39 +3824,40 @@ void Interface_Draw(PlayState* play) {
}
}
break;
case 6:
D_8015FFE6--;
if (D_8015FFE6 == 0) {
gSaveContext.timer2State = 0;
case SUBTIMER_STATE_STOP:
sSubTimerStateTimer--;
if (sSubTimerStateTimer == 0) {
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
}
break;
}
break;
}
if (((gSaveContext.timer1State != 0) && (gSaveContext.timer1State != 10)) ||
(gSaveContext.timer2State != 0)) {
timerDigits[0] = timerDigits[1] = timerDigits[3] = 0;
timerDigits[2] = 10; // digit 10 is used as ':' (colon)
if (((gSaveContext.timerState != TIMER_STATE_OFF) && (gSaveContext.timerState != TIMER_STATE_STOP)) ||
(gSaveContext.subTimerState != SUBTIMER_STATE_OFF)) {
sTimerDigits[0] = sTimerDigits[1] = sTimerDigits[3] = 0;
sTimerDigits[2] = 10; // digit 10 is used as ':' (colon)
if (gSaveContext.timer1State != 0) {
timerDigits[4] = gSaveContext.timer1Value;
if (gSaveContext.timerState != TIMER_STATE_OFF) {
sTimerDigits[4] = gSaveContext.timerSeconds;
} else {
timerDigits[4] = gSaveContext.timer2Value;
sTimerDigits[4] = gSaveContext.subTimerSeconds;
}
while (timerDigits[4] >= 60) {
timerDigits[1]++;
if (timerDigits[1] >= 10) {
timerDigits[0]++;
timerDigits[1] -= 10;
while (sTimerDigits[4] >= 60) {
sTimerDigits[1]++;
if (sTimerDigits[1] >= 10) {
sTimerDigits[0]++;
sTimerDigits[1] -= 10;
}
timerDigits[4] -= 60;
sTimerDigits[4] -= 60;
}
while (timerDigits[4] >= 10) {
timerDigits[3]++;
timerDigits[4] -= 10;
while (sTimerDigits[4] >= 10) {
sTimerDigits[3]++;
sTimerDigits[4] -= 10;
}
// Clock Icon
@ -3822,34 +3865,36 @@ void Interface_Draw(PlayState* play) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255);
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0);
OVERLAY_DISP =
Gfx_TextureIA8(OVERLAY_DISP, gClockIconTex, 16, 16, ((void)0, gSaveContext.timerX[svar6]),
((void)0, gSaveContext.timerY[svar6]) + 2, 16, 16, 1 << 10, 1 << 10);
Gfx_TextureIA8(OVERLAY_DISP, gClockIconTex, 16, 16, ((void)0, gSaveContext.timerX[timerId]),
((void)0, gSaveContext.timerY[timerId]) + 2, 16, 16, 1 << 10, 1 << 10);
// Timer Counter
gDPPipeSync(OVERLAY_DISP++);
gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE,
TEXEL0, 0, PRIMITIVE, 0);
if (gSaveContext.timer1State != 0) {
if ((gSaveContext.timer1Value < 10) && (gSaveContext.timer1State < 11)) {
if (gSaveContext.timerState != TIMER_STATE_OFF) {
// TIMER_ID_MAIN
if ((gSaveContext.timerSeconds < 10) && (gSaveContext.timerState <= TIMER_STATE_STOP)) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 50, 0, 255);
} else {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255);
}
} else {
if ((gSaveContext.timer2Value < 10) && (gSaveContext.timer2State < 6)) {
// TIMER_ID_SUB
if ((gSaveContext.subTimerSeconds < 10) && (gSaveContext.subTimerState <= SUBTIMER_STATE_RESPAWN)) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 50, 0, 255);
} else {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 0, 255);
}
}
for (svar1 = 0; svar1 < 5; svar1++) {
for (svar1 = 0; svar1 < ARRAY_COUNT(sTimerDigits); svar1++) {
OVERLAY_DISP =
Gfx_TextureI8(OVERLAY_DISP, ((u8*)gCounterDigit0Tex + (8 * 16 * timerDigits[svar1])), 8, 16,
((void)0, gSaveContext.timerX[svar6]) + timerDigitLeftPos[svar1],
((void)0, gSaveContext.timerY[svar6]), digitWidth[svar1], VREG(42), VREG(43) << 1,
VREG(43) << 1);
Gfx_TextureI8(OVERLAY_DISP, ((u8*)gCounterDigit0Tex + (8 * 16 * sTimerDigits[svar1])), 8, 16,
((void)0, gSaveContext.timerX[timerId]) + timerDigitLeftPos[svar1],
((void)0, gSaveContext.timerY[timerId]), sDigitWidths[svar1], VREG(42),
VREG(43) << 1, VREG(43) << 1);
}
}
}
@ -4021,24 +4066,25 @@ void Interface_Update(PlayState* play) {
}
Health_UpdateBeatingHeart(play);
D_80125A58 = func_8008F2F8(play);
sEnvHazard = Player_GetEnvironmentalHazard(play);
if (D_80125A58 == 1) {
if (sEnvHazard == PLAYER_ENV_HAZARD_HOTROOM) {
if (CUR_EQUIP_VALUE(EQUIP_TYPE_TUNIC) == EQUIP_VALUE_TUNIC_GORON) {
D_80125A58 = 0;
sEnvHazard = PLAYER_ENV_HAZARD_NONE;
}
} else if ((func_8008F2F8(play) >= 2) && (func_8008F2F8(play) < 5)) {
} else if ((Player_GetEnvironmentalHazard(play) >= PLAYER_ENV_HAZARD_UNDERWATER_FLOOR) &&
(Player_GetEnvironmentalHazard(play) <= PLAYER_ENV_HAZARD_UNDERWATER_FREE)) {
if (CUR_EQUIP_VALUE(EQUIP_TYPE_TUNIC) == EQUIP_VALUE_TUNIC_ZORA) {
D_80125A58 = 0;
sEnvHazard = PLAYER_ENV_HAZARD_NONE;
}
}
Health_UpdateMeter(play);
if ((gSaveContext.timer1State >= 3) && (play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0) &&
(msgCtx->msgMode == MSGMODE_NONE) && !(player->stateFlags2 & PLAYER_STATE2_24) &&
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF) &&
!Play_InCsMode(play)) {}
if ((gSaveContext.timerState >= TIMER_STATE_ENV_HAZARD_MOVE) && (play->pauseCtx.state == 0) &&
(play->pauseCtx.debugState == 0) && (msgCtx->msgMode == MSGMODE_NONE) &&
!(player->stateFlags2 & PLAYER_STATE2_24) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
(play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play)) {}
if (gSaveContext.rupeeAccumulator != 0) {
if (gSaveContext.rupeeAccumulator > 0) {
@ -4140,16 +4186,19 @@ void Interface_Update(PlayState* play) {
Magic_Update(play);
}
if (gSaveContext.timer1State == 0) {
if (((D_80125A58 == 1) || (D_80125A58 == 2) || (D_80125A58 == 4)) && ((gSaveContext.health >> 1) != 0)) {
gSaveContext.timer1State = 1;
gSaveContext.timerX[0] = 140;
gSaveContext.timerY[0] = 80;
D_80125A5C = true;
if (gSaveContext.timerState == TIMER_STATE_OFF) {
if (((sEnvHazard == PLAYER_ENV_HAZARD_HOTROOM) || (sEnvHazard == PLAYER_ENV_HAZARD_UNDERWATER_FLOOR) ||
(sEnvHazard == PLAYER_ENV_HAZARD_UNDERWATER_FREE)) &&
((gSaveContext.health >> 1) != 0)) {
gSaveContext.timerState = TIMER_STATE_ENV_HAZARD_INIT;
gSaveContext.timerX[TIMER_ID_MAIN] = 140;
gSaveContext.timerY[TIMER_ID_MAIN] = 80;
sEnvHazardActive = true;
}
} else {
if (((D_80125A58 == 0) || (D_80125A58 == 3)) && (gSaveContext.timer1State < 5)) {
gSaveContext.timer1State = 0;
if (((sEnvHazard == PLAYER_ENV_HAZARD_NONE) || (sEnvHazard == PLAYER_ENV_HAZARD_SWIMMING)) &&
(gSaveContext.timerState <= TIMER_STATE_ENV_HAZARD_TICK)) {
gSaveContext.timerState = TIMER_STATE_OFF;
}
}

View file

@ -3,11 +3,6 @@
#include "assets/objects/object_link_boy/object_link_boy.h"
#include "assets/objects/object_link_child/object_link_child.h"
typedef struct {
/* 0x00 */ u8 flag;
/* 0x02 */ u16 textId;
} TextTriggerEntry; // size = 0x04
typedef struct {
/* 0x00 */ Gfx* dList;
/* 0x04 */ Vec3f pos;
@ -95,11 +90,16 @@ u8 sActionModelGroups[PLAYER_IA_MAX] = {
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_LENS_OF_TRUTH
};
TextTriggerEntry sTextTriggers[] = {
{ 1, 0x3040 },
{ 2, 0x401D },
{ 0, 0x0000 },
{ 2, 0x401D },
typedef struct {
/* 0x0 */ u8 flag;
/* 0x2 */ u16 textId;
} EnvHazardTextTriggerEntry; // size = 0x4
EnvHazardTextTriggerEntry sEnvHazardTextTriggers[] = {
{ ENV_HAZARD_TEXT_TRIGGER_HOTROOM, 0x3040 }, // PLAYER_ENV_HAZARD_HOTROOM - 1
{ ENV_HAZARD_TEXT_TRIGGER_UNDERWATER, 0x401D }, // PLAYER_ENV_HAZARD_UNDERWATER_FLOOR - 1
{ 0, 0x0000 }, // PLAYER_ENV_HAZARD_SWIMMING - 1
{ ENV_HAZARD_TEXT_TRIGGER_UNDERWATER, 0x401D }, // PLAYER_ENV_HAZARD_UNDERWATER_FREE - 1
};
// Used to map model groups to model types for [animation, left hand, right hand, sheath, waist]
@ -778,35 +778,37 @@ return_neg:
return -1;
}
s32 func_8008F2F8(PlayState* play) {
s32 Player_GetEnvironmentalHazard(PlayState* play) {
Player* this = GET_PLAYER(play);
TextTriggerEntry* triggerEntry;
s32 var;
EnvHazardTextTriggerEntry* triggerEntry;
s32 envHazard;
if (play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) { // Room is hot
var = 0;
} else if ((this->unk_840 > 80) &&
((this->currentBoots == PLAYER_BOOTS_IRON) || (this->unk_840 >= 300))) { // Deep underwater
var = ((this->currentBoots == PLAYER_BOOTS_IRON) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) ? 1 : 3;
envHazard = PLAYER_ENV_HAZARD_HOTROOM - 1;
} else if ((this->underwaterTimer > 80) &&
((this->currentBoots == PLAYER_BOOTS_IRON) || (this->underwaterTimer >= 300))) {
envHazard = ((this->currentBoots == PLAYER_BOOTS_IRON) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND))
? (PLAYER_ENV_HAZARD_UNDERWATER_FLOOR - 1)
: (PLAYER_ENV_HAZARD_UNDERWATER_FREE - 1);
} else if (this->stateFlags1 & PLAYER_STATE1_27) { // Swimming
var = 2;
envHazard = PLAYER_ENV_HAZARD_SWIMMING - 1;
} else {
return 0;
return PLAYER_ENV_HAZARD_NONE;
}
// Trigger general textboxes under certain conditions, like "It's so hot in here!"
triggerEntry = &sTextTriggers[var];
triggerEntry = &sEnvHazardTextTriggers[envHazard];
if (!Player_InCsMode(play)) {
if ((triggerEntry->flag != 0) && !(gSaveContext.textTriggerFlags & triggerEntry->flag) &&
(((var == 0) && (this->currentTunic != PLAYER_TUNIC_GORON)) ||
(((var == 1) || (var == 3)) && (this->currentBoots == PLAYER_BOOTS_IRON) &&
(this->currentTunic != PLAYER_TUNIC_ZORA)))) {
if ((triggerEntry->flag != 0) && !(gSaveContext.envHazardTextTriggerFlags & triggerEntry->flag) &&
(((envHazard == (PLAYER_ENV_HAZARD_HOTROOM - 1)) && (this->currentTunic != PLAYER_TUNIC_GORON)) ||
(((envHazard == (PLAYER_ENV_HAZARD_UNDERWATER_FLOOR - 1)) ||
(envHazard == (PLAYER_ENV_HAZARD_UNDERWATER_FREE - 1))) &&
(this->currentBoots == PLAYER_BOOTS_IRON) && (this->currentTunic != PLAYER_TUNIC_ZORA)))) {
Message_StartTextbox(play, triggerEntry->textId, NULL);
gSaveContext.textTriggerFlags |= triggerEntry->flag;
gSaveContext.envHazardTextTriggerFlags |= triggerEntry->flag;
}
}
return var + 1;
return envHazard + 1;
}
u8 sEyeMouthIndices[][2] = {

View file

@ -226,8 +226,8 @@ void BgPoEvent_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyTris(play, &this->collider);
} else {
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
if ((this->type == 1) && (gSaveContext.timer1Value > 0)) {
gSaveContext.timer1State = 0xA;
if ((this->type == 1) && (gSaveContext.timerSeconds > 0)) {
gSaveContext.timerState = TIMER_STATE_STOP;
}
}
}
@ -316,7 +316,7 @@ void BgPoEvent_BlockFall(BgPoEvent* this, PlayState* play) {
} else {
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
Actor_RequestQuakeAndRumble(&this->dyna.actor, play, 5, 5);
func_80088B34(this->timer);
Interface_SetTimer(this->timer);
if (firstFall == 0) {
firstFall = 1;
} else {
@ -342,10 +342,10 @@ void BgPoEvent_BlockIdle(BgPoEvent* this, PlayState* play) {
OnePointCutscene_Init(play, 3170, 30, amy, CAM_ID_MAIN);
}
func_80078884(NA_SE_SY_CORRECT_CHIME);
gSaveContext.timer1State = 0xA;
gSaveContext.timerState = TIMER_STATE_STOP;
}
} else {
if ((gSaveContext.timer1Value == 0) && (sBlocksAtRest == 5)) {
if ((gSaveContext.timerSeconds == 0) && (sBlocksAtRest == 5)) {
player->stateFlags2 &= ~PLAYER_STATE2_4;
sPuzzleState = 0x10;
sBlocksAtRest = 0;

View file

@ -156,7 +156,7 @@ void func_808A9234(BgRelayObjects* this, PlayState* play) {
Flags_UnsetSwitch(play, this->switchFlag);
this->dyna.actor.flags &= ~ACTOR_FLAG_4;
if (play->roomCtx.curRoom.num == 4) {
gSaveContext.timer1State = 0xF;
gSaveContext.timerState = TIMER_STATE_UP_FREEZE;
}
this->actionFunc = BgRelayObjects_DoNothing;
}

View file

@ -823,7 +823,7 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) {
this->unk_150[i].unk_22++;
}
} else if (i + 1 == this->sparkleCounter && play->csCtx.state == CS_STATE_IDLE) {
func_80088AF0(play);
Interface_SetSubTimerToFinalSecond(play);
Actor_Kill(&this->actor);
}
break;

View file

@ -103,7 +103,7 @@ void EnDivingGame_Destroy(Actor* thisx, PlayState* play) {
EnDivingGame* this = (EnDivingGame*)thisx;
if (this->unk_31F == 0) {
gSaveContext.timer1State = 0;
gSaveContext.timerState = TIMER_STATE_OFF;
}
Collider_DestroyCylinder(play, &this->collider);
}
@ -125,9 +125,9 @@ void EnDivingGame_SpawnRuppy(EnDivingGame* this, PlayState* play) {
}
s32 EnDivingGame_HasMinigameFinished(EnDivingGame* this, PlayState* play) {
if (gSaveContext.timer1State == 10 && !Play_InCsMode(play)) {
if ((gSaveContext.timerState == TIMER_STATE_STOP) && !Play_InCsMode(play)) {
// Failed.
gSaveContext.timer1State = 0;
gSaveContext.timerState = TIMER_STATE_OFF;
func_800F5B58();
func_80078884(NA_SE_SY_FOUND);
this->actor.textId = 0x71AD;
@ -145,7 +145,7 @@ s32 EnDivingGame_HasMinigameFinished(EnDivingGame* this, PlayState* play) {
}
if (this->grabbedRupeesCounter >= rupeesNeeded) {
// Won.
gSaveContext.timer1State = 0;
gSaveContext.timerState = TIMER_STATE_OFF;
this->allRupeesThrown = this->state = this->phase = this->unk_2A2 = this->grabbedRupeesCounter = 0;
if (!GET_EVENTCHKINF(EVENTCHKINF_38)) {
this->actor.textId = 0x4055;
@ -418,9 +418,9 @@ void func_809EE800(EnDivingGame* this, PlayState* play) {
if (this->unk_292 == Message_GetState(&play->msgCtx) && Message_ShouldAdvance(play)) {
Message_CloseTextbox(play);
if (!GET_EVENTCHKINF(EVENTCHKINF_38)) {
func_80088B34(BREG(2) + 50);
Interface_SetTimer(50 + BREG(2));
} else {
func_80088B34(BREG(2) + 50);
Interface_SetTimer(50 + BREG(2));
}
func_800F5ACC(NA_BGM_TIMED_MINI_GAME);
func_8002DF54(play, NULL, 7);
@ -506,9 +506,10 @@ void EnDivingGame_Update(Actor* thisx, PlayState* play2) {
if (1) {}
if (gSaveContext.timer1Value == 10) {
if (gSaveContext.timerSeconds == 10) {
Audio_SetFastTempoForTimedMinigame();
}
if (this->eyeTimer == 0) {
this->eyeTimer = 2;
this->eyeTexIndex++;

View file

@ -88,7 +88,7 @@ void EnDs_GiveOddPotion(EnDs* this, PlayState* play) {
if (Actor_HasParent(&this->actor, play)) {
this->actor.parent = NULL;
this->actionFunc = EnDs_DisplayOddPotionText;
gSaveContext.timer2State = 0;
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
} else {
func_8002F434(&this->actor, play, GI_ODD_POTION, 10000.0f, 50.0f);
}

View file

@ -48,7 +48,7 @@ void EnEg_Init(Actor* thisx, PlayState* play) {
}
void func_809FFDC8(EnEg* this, PlayState* play) {
if (!sVoided && (gSaveContext.timer2Value < 1) && Flags_GetSwitch(play, 0x36) && (kREG(0) == 0)) {
if (!sVoided && (gSaveContext.subTimerSeconds <= 0) && Flags_GetSwitch(play, 0x36) && (kREG(0) == 0)) {
// Void the player out
Play_TriggerRespawn(play);
gSaveContext.respawnFlag = -2;

View file

@ -865,7 +865,7 @@ void EnGo_BiggoronActionFunc(EnGo* this, PlayState* play) {
this->unk_1E0.unk_00 = 0;
EnGo_SetupAction(this, EnGo_Eyedrops);
play->msgCtx.msgMode = MSGMODE_PAUSED;
gSaveContext.timer2State = 0;
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
OnePointCutscene_Init(play, 4190, -99, &this->actor, CAM_ID_MAIN);
} else {
this->unk_1E0.unk_00 = 0;

View file

@ -1062,7 +1062,7 @@ void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) {
this->actor.textId = 0x3058;
}
if (this->actor.textId == 0x3059) {
gSaveContext.timer2State = 0;
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
}
player->actor.textId = this->actor.textId;

View file

@ -128,7 +128,7 @@ void EnHorseGameCheck_FinishIngoRace(EnHorseGameCheckIngoRace* this, PlayState*
}
DREG(25) = 0;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.timer1State = 0;
gSaveContext.timerState = TIMER_STATE_OFF;
}
s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play) {
@ -140,7 +140,7 @@ s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play)
if ((this->startTimer > 50) && !(this->startFlags & INGORACE_SET_TIMER)) {
this->startFlags |= INGORACE_SET_TIMER;
func_80088B34(0);
Interface_SetTimer(0);
} else if ((this->startTimer > 80) && (player->rideActor != NULL) && !(this->startFlags & INGORACE_PLAYER_MOVE)) {
this->startFlags |= INGORACE_PLAYER_MOVE;
horse = (EnHorse*)player->rideActor;
@ -211,7 +211,7 @@ s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play)
this->result = INGORACE_INGO_WIN;
this->finishTimer = 20;
}
if ((gSaveContext.timer1Value >= 180) && (this->startFlags & 2)) {
if ((gSaveContext.timerSeconds >= 180) && (this->startFlags & 2)) {
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_HORSE_GOAL);
this->result = INGORACE_TIME_UP;
this->finishTimer = 20;
@ -298,8 +298,8 @@ void EnHorseGameCheck_FinishMalonRace(EnHorseGameCheckMalonRace* this, PlayState
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
play->transitionTrigger = TRANS_TRIGGER_START;
} else if (this->result == MALONRACE_FAILURE) {
gSaveContext.timer1Value = 240;
gSaveContext.timer1State = 0xF;
gSaveContext.timerSeconds = 240;
gSaveContext.timerState = TIMER_STATE_UP_FREEZE;
gSaveContext.cutsceneIndex = 0;
play->nextEntranceIndex = ENTR_SPOT20_7;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
@ -328,7 +328,7 @@ s32 EnHorseGameCheck_UpdateMalonRace(EnHorseGameCheckBase* base, PlayState* play
}
if ((this->startTimer > 50) && !(this->raceFlags & MALONRACE_SET_TIMER)) {
this->raceFlags |= MALONRACE_SET_TIMER;
func_80088B34(0);
Interface_SetTimer(0);
} else if ((this->startTimer > 80) && (player->rideActor != NULL) && !(this->raceFlags & MALONRACE_PLAYER_MOVE)) {
this->raceFlags |= MALONRACE_PLAYER_MOVE;
horse = (EnHorse*)player->rideActor;
@ -383,7 +383,7 @@ s32 EnHorseGameCheck_UpdateMalonRace(EnHorseGameCheckBase* base, PlayState* play
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
this->result = MALONRACE_SUCCESS;
this->finishTimer = 70;
gSaveContext.timer1State = 0xF;
gSaveContext.timerState = TIMER_STATE_UP_FREEZE;
} else if ((this->fenceCheck[7] == 1) && !(this->raceFlags & MALONRACE_SECOND_LAP)) {
this->lapCount = 1;
this->raceFlags |= MALONRACE_SECOND_LAP;
@ -400,11 +400,11 @@ s32 EnHorseGameCheck_UpdateMalonRace(EnHorseGameCheckBase* base, PlayState* play
this->finishTimer = 30;
}
}
if ((gSaveContext.timer1Value >= 180) && (this->raceFlags & MALONRACE_SET_TIMER)) {
gSaveContext.timer1Value = 240;
if ((gSaveContext.timerSeconds >= 180) && (this->raceFlags & MALONRACE_SET_TIMER)) {
gSaveContext.timerSeconds = 240;
this->result = MALONRACE_TIME_UP;
this->finishTimer = 30;
gSaveContext.timer1State = 0;
gSaveContext.timerState = TIMER_STATE_OFF;
}
} else {
if (this->finishTimer > 0) {

View file

@ -89,11 +89,11 @@ typedef struct {
// these seem to be valid coords on Hyrule field, along with target speeds
static HorsePosSpeed sHorseFieldPositions[] = {
{ {-1682, -500, 12578}, 7 }, { {-3288, -500, 13013}, 7 }, { {-5142, -417, 11630}, 7 },
{ {-5794, -473, 9573}, 7 }, { {-6765, -500, 8364}, 7 }, { {-6619, -393, 6919}, 7 },
{ {-5193, 124, 5433}, 7 }, { {-2970, 2, 4537}, 7 }, { {-2949, -35, 4527}, 7 },
{ {-1907, -47, 2978}, 7 }, { {2488, 294, 3628}, 7 }, { {3089, 378, 4713}, 7 },
{ {1614, -261, 7596}, 7 }, { {754, -187, 9295}, 7 },
{ { -1682, -500, 12578 }, 7 }, { { -3288, -500, 13013 }, 7 }, { { -5142, -417, 11630 }, 7 },
{ { -5794, -473, 9573 }, 7 }, { { -6765, -500, 8364 }, 7 }, { { -6619, -393, 6919 }, 7 },
{ { -5193, 124, 5433 }, 7 }, { { -2970, 2, 4537 }, 7 }, { { -2949, -35, 4527 }, 7 },
{ { -1907, -47, 2978 }, 7 }, { { 2488, 294, 3628 }, 7 }, { { 3089, 378, 4713 }, 7 },
{ { 1614, -261, 7596 }, 7 }, { { 754, -187, 9295 }, 7 },
};
static InitChainEntry sInitChain[] = {

View file

@ -126,9 +126,9 @@ void func_80A6E5EC(EnHs* this, PlayState* play) {
void func_80A6E630(EnHs* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) {
func_80088AA0(180);
Interface_SetSubTimer(180);
func_80A6E3A0(this, func_80A6E6B0);
CLEAR_EVENTINF(EVENTINF_10);
CLEAR_EVENTINF(EVENTINF_MARATHON_ACTIVE);
}
this->unk_2A8 |= 1;

View file

@ -437,7 +437,7 @@ void func_80A79BAC(EnIn* this, PlayState* play, s32 index, u32 transitionType) {
if (index == 0) {
AREG(6) = 0;
}
gSaveContext.timer1State = 0;
gSaveContext.timerState = TIMER_STATE_OFF;
}
void func_80A79C78(EnIn* this, PlayState* play) {
@ -580,7 +580,7 @@ void func_80A79FB0(EnIn* this, PlayState* play) {
this->actor.targetMode = 3;
EnIn_ChangeAnim(this, ENIN_ANIM_2);
this->actionFunc = func_80A7A568;
func_80088B34(0x3C);
Interface_SetTimer(60);
break;
case EVENTINF_HORSES_STATE_3:
EnIn_ChangeAnim(this, ENIN_ANIM_4);
@ -657,12 +657,12 @@ void func_80A7A568(EnIn* this, PlayState* play) {
if (!GET_EVENTCHKINF(EVENTCHKINF_1B) && (player->stateFlags1 & PLAYER_STATE1_23)) {
SET_INFTABLE(INFTABLE_AB);
}
if (gSaveContext.timer1State == 10) {
if (gSaveContext.timerState == TIMER_STATE_STOP) {
Audio_PlaySfxGeneral(NA_SE_SY_FOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
func_80A79C78(this, play);
this->actionFunc = func_80A7B024;
gSaveContext.timer1State = 0;
gSaveContext.timerState = TIMER_STATE_OFF;
} else if (this->unk_308.unk_00 == 2) {
if (play->msgCtx.choiceIndex == 0) {
if (gSaveContext.rupees < 50) {
@ -929,7 +929,8 @@ void EnIn_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
if (this->actionFunc != func_80A7A304) {
func_80A79AB4(this, play);
if (gSaveContext.timer2Value < 6 && gSaveContext.timer2State != 0 && this->unk_308.unk_00 == 0) {
if ((gSaveContext.subTimerSeconds < 6) && (gSaveContext.subTimerState != SUBTIMER_STATE_OFF) &&
(this->unk_308.unk_00 == 0)) {
if (Actor_ProcessTalkRequest(&this->actor, play)) {}
} else {
func_800343CC(play, &this->actor, &this->unk_308.unk_00,

View file

@ -441,8 +441,8 @@ void EnKz_SetupGetItem(EnKz* this, PlayState* play) {
void EnKz_StartTimer(EnKz* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) {
if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_EYEBALL_FROG) {
func_80088AA0(180); // start timer2 with 3 minutes
CLEAR_EVENTINF(EVENTINF_10);
Interface_SetSubTimer(180);
CLEAR_EVENTINF(EVENTINF_MARATHON_ACTIVE);
}
this->unk_1E0.unk_00 = 0;
this->actionFunc = EnKz_Wait;

View file

@ -73,39 +73,44 @@ static AnimationFrameCountInfo sAnimationInfo[] = {
u16 func_80AA2AA0(PlayState* play, Actor* thisx) {
Player* player = GET_PLAYER(play);
s16* timer1ValuePtr; // weirdness with this necessary to match
if (!GET_INFTABLE(INFTABLE_B8)) {
return 0x2000;
}
timer1ValuePtr = &gSaveContext.timer1Value;
if (GET_EVENTINF(EVENTINF_HORSES_0A)) {
gSaveContext.timer1Value = gSaveContext.timer1Value;
gSaveContext.timerSeconds = gSaveContext.timerSeconds;
thisx->flags |= ACTOR_FLAG_16;
if (gSaveContext.timer1Value >= 0xD3) {
if (((void)0, gSaveContext.timerSeconds) > 210) {
return 0x208E;
}
if ((HIGH_SCORE(HS_HORSE_RACE) == 0) || (HIGH_SCORE(HS_HORSE_RACE) >= 0xB4)) {
HIGH_SCORE(HS_HORSE_RACE) = 0xB4;
gSaveContext.timer1Value = *timer1ValuePtr;
if ((HIGH_SCORE(HS_HORSE_RACE) == 0) || (HIGH_SCORE(HS_HORSE_RACE) >= 180)) {
HIGH_SCORE(HS_HORSE_RACE) = 180;
}
if (!GET_EVENTCHKINF(EVENTCHKINF_1E) && (gSaveContext.timer1Value < 0x32)) {
if (!GET_EVENTCHKINF(EVENTCHKINF_1E) && (((void)0, gSaveContext.timerSeconds) < 50)) {
return 0x208F;
} else if (gSaveContext.timer1Value < HIGH_SCORE(HS_HORSE_RACE)) {
return 0x2012;
} else {
return 0x2004;
}
if (HIGH_SCORE(HS_HORSE_RACE) > ((void)0, gSaveContext.timerSeconds)) {
return 0x2012;
}
return 0x2004;
}
if (!(player->stateFlags1 & PLAYER_STATE1_23) &&
(Actor_FindNearby(play, thisx, ACTOR_EN_HORSE, 1, 1200.0f) == NULL)) {
return 0x2001;
}
if (!GET_INFTABLE(INFTABLE_B9)) {
return 0x2002;
} else {
return 0x2003;
}
return 0x2003;
}
s16 func_80AA2BD4(PlayState* play, Actor* thisx) {
@ -119,7 +124,7 @@ s16 func_80AA2BD4(PlayState* play, Actor* thisx) {
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST);
play->transitionTrigger = TRANS_TRIGGER_START;
SET_EVENTINF(EVENTINF_HORSES_0A);
gSaveContext.timer1State = 0xF;
gSaveContext.timerState = TIMER_STATE_UP_FREEZE;
}
break;
case TEXT_STATE_CHOICE:
@ -147,15 +152,15 @@ s16 func_80AA2BD4(PlayState* play, Actor* thisx) {
FALLTHROUGH;
case 0x2004:
case 0x2012:
if (HIGH_SCORE(HS_HORSE_RACE) > gSaveContext.timer1Value) {
HIGH_SCORE(HS_HORSE_RACE) = gSaveContext.timer1Value;
if (HIGH_SCORE(HS_HORSE_RACE) > gSaveContext.timerSeconds) {
HIGH_SCORE(HS_HORSE_RACE) = gSaveContext.timerSeconds;
}
FALLTHROUGH;
case 0x208E:
CLEAR_EVENTINF(EVENTINF_HORSES_0A);
thisx->flags &= ~ACTOR_FLAG_16;
ret = 0;
gSaveContext.timer1State = 0xA;
gSaveContext.timerState = TIMER_STATE_STOP;
break;
case 0x2002:
SET_INFTABLE(INFTABLE_B9);

View file

@ -92,8 +92,8 @@ void func_80AACA94(EnMk* this, PlayState* play) {
if (Actor_HasParent(&this->actor, play) != 0) {
this->actor.parent = NULL;
this->actionFunc = func_80AACA40;
func_80088AA0(240);
CLEAR_EVENTINF(EVENTINF_10);
Interface_SetSubTimer(240);
CLEAR_EVENTINF(EVENTINF_MARATHON_ACTIVE);
} else {
func_8002F434(&this->actor, play, GI_EYE_DROPS, 10000.0f, 50.0f);
}
@ -253,7 +253,7 @@ void EnMk_Wait(EnMk* this, PlayState* play) {
Animation_Change(&this->skelAnime, &object_mk_Anim_000368, 1.0f, 0.0f,
Animation_GetLastFrame(&object_mk_Anim_000368), ANIMMODE_ONCE, -4.0f);
this->flags &= ~2;
gSaveContext.timer2State = 0;
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
func_80078884(NA_SE_SY_TRE_BOX_APPEAR);
break;
default:

View file

@ -103,20 +103,20 @@ void func_80AAEF70(EnMm2* this, PlayState* play) {
if (!GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) {
this->actor.textId = 0x6086;
} else if (GET_INFTABLE(INFTABLE_17F)) {
if (GET_EVENTINF(EVENTINF_10)) {
if (GET_EVENTINF(EVENTINF_MARATHON_ACTIVE)) {
this->actor.textId = 0x6082;
} else if (gSaveContext.timer2State != 0) {
} else if (gSaveContext.subTimerState != SUBTIMER_STATE_OFF) {
this->actor.textId = 0x6076;
} else if (HIGH_SCORE(HS_MARATHON) == 158) {
this->actor.textId = 0x607E;
} else {
this->actor.textId = 0x6081;
}
} else if (gSaveContext.timer2State) {
} else if (gSaveContext.subTimerState != SUBTIMER_STATE_OFF) {
this->actor.textId = 0x6076;
} else {
this->actor.textId = 0x607D;
CLEAR_EVENTINF(EVENTINF_10);
CLEAR_EVENTINF(EVENTINF_MARATHON_ACTIVE);
HIGH_SCORE(HS_MARATHON) = 158;
}
}
@ -149,7 +149,7 @@ void EnMm2_Init(Actor* thisx, PlayState* play2) {
Actor_Kill(&this->actor);
}
if (this->actor.params == 1) {
if (!GET_INFTABLE(INFTABLE_17F) || !GET_EVENTINF(EVENTINF_10)) {
if (!GET_INFTABLE(INFTABLE_17F) || !GET_EVENTINF(EVENTINF_MARATHON_ACTIVE)) {
osSyncPrintf(VT_FGCOL(CYAN) " マラソン 開始されていない \n" VT_RST "\n");
Actor_Kill(&this->actor);
}
@ -193,8 +193,8 @@ void func_80AAF330(EnMm2* this, PlayState* play) {
if (!(this->unk_1F4 & 2)) {
Message_CloseTextbox(play);
}
gSaveContext.timer2State = 0;
CLEAR_EVENTINF(EVENTINF_10);
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
CLEAR_EVENTINF(EVENTINF_MARATHON_ACTIVE);
}
}
@ -209,7 +209,7 @@ void func_80AAF3C0(EnMm2* this, PlayState* play) {
case 0:
Message_ContinueTextbox(play, 0x607F);
this->actor.textId = 0x607F;
SET_EVENTINF(EVENTINF_10);
SET_EVENTINF(EVENTINF_MARATHON_ACTIVE);
break;
case 1:
Message_ContinueTextbox(play, 0x6080);
@ -219,14 +219,14 @@ void func_80AAF3C0(EnMm2* this, PlayState* play) {
if (this->unk_1F4 & 4) {
if (1) {}
this->unk_1F4 &= ~4;
HIGH_SCORE(HS_MARATHON) += 1;
HIGH_SCORE(HS_MARATHON)++;
}
}
return;
case 0x6081:
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
this->unk_1F4 |= 4;
HIGH_SCORE(HS_MARATHON) -= 1;
HIGH_SCORE(HS_MARATHON)--;
Message_ContinueTextbox(play, 0x607E);
this->actor.textId = 0x607E;
}
@ -235,7 +235,7 @@ void func_80AAF3C0(EnMm2* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
if (this->actor.textId == 0x607F) {
func_80088AA0(0);
Interface_SetSubTimer(0);
this->actionFunc = func_80AAF57C;
} else {
this->actionFunc = func_80AAF57C;
@ -266,19 +266,20 @@ void func_80AAF668(EnMm2* this, PlayState* play) {
this->actor.world.rot.y = -0x3E80;
this->actor.shape.rot.y = this->actor.world.rot.y;
SkelAnime_Update(&this->skelAnime);
if (((void)0, gSaveContext.timer2Value) < HIGH_SCORE(HS_MARATHON)) {
if (((void)0, gSaveContext.subTimerSeconds) < HIGH_SCORE(HS_MARATHON)) {
this->actor.textId = 0x6085;
} else {
this->actor.textId = 0x6084;
}
if (func_80AAF224(this, play, func_80AAF5EC)) {
this->unk_1F6 = 0;
if (((void)0, gSaveContext.timer2Value) < HIGH_SCORE(HS_MARATHON)) {
HIGH_SCORE(HS_MARATHON) = gSaveContext.timer2Value;
if (((void)0, gSaveContext.subTimerSeconds) < HIGH_SCORE(HS_MARATHON)) {
HIGH_SCORE(HS_MARATHON) = gSaveContext.subTimerSeconds;
}
} else {
LOG_HEX("((z_common_data.event_inf[1]) & (0x0001))", GET_EVENTINF(EVENTINF_10), "../z_en_mm2.c", 541);
if (!GET_EVENTINF(EVENTINF_10)) {
LOG_HEX("((z_common_data.event_inf[1]) & (0x0001))", GET_EVENTINF(EVENTINF_MARATHON_ACTIVE), "../z_en_mm2.c",
541);
if (!GET_EVENTINF(EVENTINF_MARATHON_ACTIVE)) {
this->unk_1F4 |= 2;
this->unk_1F4 &= ~1;
EnMm2_ChangeAnim(this, RM2_ANIM_STAND, &this->previousAnimation);

View file

@ -137,7 +137,7 @@ void EnPoRelay_SetupRace(EnPoRelay* this) {
EnPoRelay_Vec3sToVec3f(&vec, &D_80AD8C30[this->pathIndex]);
this->actionTimer = ((s16)(this->actor.shape.rot.y - this->actor.world.rot.y - 0x8000) >> 0xB) % 32U;
func_80088B34(0);
Interface_SetTimer(0);
this->hookshotSlotFull = INV_CONTENT(ITEM_HOOKSHOT) != ITEM_NONE;
this->unk_19A = Actor_WorldYawTowardPoint(&this->actor, &vec);
this->actor.flags |= ACTOR_FLAG_27;
@ -258,7 +258,7 @@ void EnPoRelay_EndRace(EnPoRelay* this, PlayState* play) {
this->actionFunc = EnPoRelay_Talk2;
} else if (play->roomCtx.curRoom.num == 5) {
Actor_Kill(&this->actor);
gSaveContext.timer1State = 0;
gSaveContext.timerState = TIMER_STATE_OFF;
} else if (Actor_IsFacingAndNearPlayer(&this->actor, 150.0f, 0x3000)) {
this->actor.textId = this->textId;
func_8002F2CC(&this->actor, play, 250.0f);
@ -279,7 +279,7 @@ void EnPoRelay_Talk2(EnPoRelay* this, PlayState* play) {
Message_ContinueTextbox(play, this->actor.textId);
}
} else if (Actor_TextboxIsClosing(&this->actor, play)) {
gSaveContext.timer1State = 0;
gSaveContext.timerState = TIMER_STATE_OFF;
this->actionTimer = 0;
this->actionFunc = EnPoRelay_DisappearAndReward;
}
@ -326,17 +326,17 @@ void EnPoRelay_DisappearAndReward(EnPoRelay* this, PlayState* play) {
sp60.x = this->actor.world.pos.x;
sp60.y = this->actor.floorHeight;
sp60.z = this->actor.world.pos.z;
if (gSaveContext.timer1Value < HIGH_SCORE(HS_DAMPE_RACE)) {
HIGH_SCORE(HS_DAMPE_RACE) = gSaveContext.timer1Value;
if (gSaveContext.timerSeconds < HIGH_SCORE(HS_DAMPE_RACE)) {
HIGH_SCORE(HS_DAMPE_RACE) = gSaveContext.timerSeconds;
}
if (Flags_GetCollectible(play, this->actor.params) == 0 && gSaveContext.timer1Value <= 60) {
if (!Flags_GetCollectible(play, this->actor.params) && (gSaveContext.timerSeconds <= 60)) {
Item_DropCollectible2(play, &sp60, (this->actor.params << 8) + (0x4000 | ITEM00_HEART_PIECE));
} else {
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ITEM00, sp60.x, sp60.y, sp60.z, 0, 0, 0, 2);
}
} else {
Flags_SetTempClear(play, 4);
HIGH_SCORE(HS_DAMPE_RACE) = gSaveContext.timer1Value;
HIGH_SCORE(HS_DAMPE_RACE) = gSaveContext.timerSeconds;
}
Actor_Kill(&this->actor);
}

View file

@ -489,7 +489,7 @@ void func_80B12460(EnSyatekiNiw* this, PlayState* play) {
void func_80B128D8(EnSyatekiNiw* this, PlayState* play) {
if (this->unk_25E == 1) {
gSaveContext.timer1State = 0;
gSaveContext.timerState = TIMER_STATE_OFF;
}
}

View file

@ -278,7 +278,7 @@ void EnTa_Destroy(Actor* thisx, PlayState* play) {
if (this->actor.params != ENTA_IN_KAKARIKO && this->actor.params != ENTA_RETURNED_FROM_KAKARIKO &&
play->sceneId == SCENE_SOUKO) {
gSaveContext.timer1State = 0;
gSaveContext.timerState = TIMER_STATE_OFF;
}
if (this->stateFlags & TALON_STATE_FLAG_RESTORE_BGM_ON_DESTROY) {
@ -756,7 +756,7 @@ void EnTa_RunCuccoGame(EnTa* this, PlayState* play) {
switch (EnTa_GetSuperCuccosCount(this, play)) {
case 1:
// Last cucco found, end the game
gSaveContext.timer1State = 0;
gSaveContext.timerState = TIMER_STATE_OFF;
func_8002DF54(play, &this->actor, 1);
Message_StartTextbox(play, 0x2084, &this->actor);
@ -796,15 +796,15 @@ void EnTa_RunCuccoGame(EnTa* this, PlayState* play) {
}
}
if (gSaveContext.timer1Value == 10) {
if (gSaveContext.timerSeconds == 10) {
Audio_SetFastTempoForTimedMinigame();
}
if (gSaveContext.timer1Value == 0 && !Play_InCsMode(play)) {
if ((gSaveContext.timerSeconds == 0) && !Play_InCsMode(play)) {
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0);
this->stateFlags &= ~TALON_STATE_FLAG_RESTORE_BGM_ON_DESTROY;
func_80078884(NA_SE_SY_FOUND);
gSaveContext.timer1State = 0;
gSaveContext.timerState = TIMER_STATE_OFF;
func_8002DF54(play, &this->actor, 1);
// Time's up text
@ -881,7 +881,7 @@ void EnTa_StartingCuccoGame3(EnTa* this, PlayState* play) {
Animation_GetLastFrame(&gTalonSitHandsUpAnim), ANIMMODE_ONCE, 0.0f);
this->timer = 50;
func_80088B34(30);
Interface_SetTimer(30);
func_800F5ACC(NA_BGM_TIMED_MINI_GAME);
this->stateFlags |= TALON_STATE_FLAG_RESTORE_BGM_ON_DESTROY;
Message_CloseTextbox(play);

View file

@ -1607,7 +1607,7 @@ void EnZl2_Init(Actor* thisx, PlayState* play) {
Audio_SetSfxBanksMute(0x6F);
break;
case 4:
gSaveContext.timer2State = 0;
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
break;
}
}

View file

@ -2482,7 +2482,7 @@ s32 func_80B59698(EnZl3* this, PlayState* play) {
u8 spawn = play->spawn;
if ((func_80B54DB4(this) == 0x20) && (spawn == 0) &&
((gSaveContext.timer2Value <= 0) || (gSaveContext.timer2State == 0))) {
((gSaveContext.subTimerSeconds <= 0) || (gSaveContext.subTimerState == SUBTIMER_STATE_OFF))) {
return 1;
}
}
@ -2497,7 +2497,7 @@ s32 func_80B59768(EnZl3* this, PlayState* play) {
if (cond) {
u8 spawn = play->spawn;
if ((func_80B54DB4(this) == 0x20) && (spawn == 0) && (gSaveContext.timer2Value <= 0)) {
if ((func_80B54DB4(this) == 0x20) && (spawn == 0) && (gSaveContext.subTimerSeconds <= 0)) {
return 1;
}
}
@ -2524,7 +2524,7 @@ void func_80B59828(EnZl3* this, PlayState* play) {
}
if (func_80B59698(this, play) != 0) {
func_80088AA0(180);
Interface_SetSubTimer(180);
func_80B53468();
gSaveContext.healthAccumulator = 320;
Magic_Fill(play);
@ -2569,7 +2569,7 @@ void func_80B59AD0(EnZl3* this, PlayState* play) {
Actor* thisx = &this->actor; // unused, necessary to use 'this' first to fix regalloc
Flags_SetSwitch(play, 0x36);
func_80088AA0(180);
Interface_SetSubTimer(180);
func_80B54EA4(this, play);
func_80B53614(this, play);
CLEAR_EVENTCHKINF(EVENTCHKINF_C7);
@ -2657,7 +2657,7 @@ void EnZl3_Init(Actor* thisx, PlayState* play) {
switch (func_80B54DD4(this)) {
case 1:
gSaveContext.timer2State = 0;
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
break;
case 3:
func_80B59A80(this, play);

View file

@ -49,14 +49,14 @@ void ObjRoomtimer_Init(Actor* thisx, PlayState* play) {
void ObjRoomtimer_Destroy(Actor* thisx, PlayState* play) {
ObjRoomtimer* this = (ObjRoomtimer*)thisx;
if ((this->actor.params != 0x3FF) && (gSaveContext.timer1Value > 0)) {
gSaveContext.timer1State = 10;
if ((this->actor.params != 0x3FF) && (gSaveContext.timerSeconds > 0)) {
gSaveContext.timerState = TIMER_STATE_STOP;
}
}
void func_80B9D054(ObjRoomtimer* this, PlayState* play) {
if (this->actor.params != 0x3FF) {
func_80088B34(this->actor.params);
Interface_SetTimer(this->actor.params);
}
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
@ -66,19 +66,20 @@ void func_80B9D054(ObjRoomtimer* this, PlayState* play) {
void func_80B9D0B0(ObjRoomtimer* this, PlayState* play) {
if (Flags_GetTempClear(play, this->actor.room)) {
if (this->actor.params != 0x3FF) {
gSaveContext.timer1State = 10;
gSaveContext.timerState = TIMER_STATE_STOP;
}
Flags_SetClear(play, this->actor.room);
Flags_SetSwitch(play, this->switchFlag);
func_80078884(NA_SE_SY_CORRECT_CHIME);
Actor_Kill(&this->actor);
} else {
if ((this->actor.params != 0x3FF) && (gSaveContext.timer1Value == 0)) {
Audio_PlaySfxGeneral(NA_SE_OC_ABYSS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
Play_TriggerVoidOut(play);
Actor_Kill(&this->actor);
}
return;
}
if ((this->actor.params != 0x3FF) && (gSaveContext.timerSeconds == 0)) {
Audio_PlaySfxGeneral(NA_SE_OC_ABYSS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
Play_TriggerVoidOut(play);
Actor_Kill(&this->actor);
}
}

View file

@ -2411,7 +2411,7 @@ void func_80834298(Player* this, PlayState* play) {
((this->heldItemAction == this->itemAction) || (this->stateFlags1 & PLAYER_STATE1_22)) &&
(gSaveContext.health != 0) && (play->csCtx.state == CS_STATE_IDLE) && (this->csMode == 0) &&
(play->shootingGalleryStatus == 0) && (play->activeCamId == CAM_ID_MAIN) &&
(play->transitionTrigger != TRANS_TRIGGER_START) && (gSaveContext.timer1State != 10)) {
(play->transitionTrigger != TRANS_TRIGGER_START) && (gSaveContext.timerState != TIMER_STATE_STOP)) {
func_80833DF8(this, play);
}
@ -6056,11 +6056,11 @@ void func_8083D36C(PlayState* play, Player* this) {
void func_8083D53C(PlayState* play, Player* this) {
if (this->actor.yDistToWater < this->ageProperties->unk_2C) {
Audio_SetBaseFilter(0);
this->unk_840 = 0;
this->underwaterTimer = 0;
} else {
Audio_SetBaseFilter(0x20);
if (this->unk_840 < 300) {
this->unk_840++;
if (this->underwaterTimer < 300) {
this->underwaterTimer++;
}
}
@ -13394,7 +13394,7 @@ void func_8085063C(Player* this, PlayState* play) {
play->transitionTrigger = TRANS_TRIGGER_START;
play->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_TOP].entranceIndex;
play->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
func_80088AF0(play);
Interface_SetSubTimerToFinalSecond(play);
return;
}

View file

@ -1463,8 +1463,8 @@ void FileSelect_LoadGame(GameState* thisx) {
gSaveContext.natureAmbienceId = 0xFF;
gSaveContext.showTitleCard = true;
gSaveContext.dogParams = 0;
gSaveContext.timer1State = 0;
gSaveContext.timer2State = 0;
gSaveContext.timerState = TIMER_STATE_OFF;
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
gSaveContext.eventInf[0] = 0;
gSaveContext.eventInf[1] = 0;
gSaveContext.eventInf[2] = 0;