Begin timer docs

This commit is contained in:
engineer124
2022-07-14 13:12:03 +10:00
parent 74de44b357
commit a3f2655594
24 changed files with 399 additions and 358 deletions
+3 -3
View File
@@ -1866,8 +1866,8 @@ void OLib_DbCameraVec3fSum(PosRot* a, Vec3f* b, Vec3f* dest, s16 mode);
// void func_8010DC58(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5);
// void func_8010DE38(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6);
// void Interface_InitVertices(void);
// void func_8010E968(void);
void func_8010E9F0(s16 arg0, s16 arg1);
// void Interface_TimerCallback(void);
void func_8010E9F0(s16 timerId, s16 timeLimit);
void func_8010EA9C(s16 timeLimit, s16 arg1);
// void func_8010EB50(void);
// void func_8010EBA0(void);
@@ -1929,7 +1929,7 @@ void func_8011C808(PlayState* play);
// void func_80121000(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE1 param_8, UNK_TYPE1 param_9, UNK_TYPE1 param_10, UNK_TYPE4 param_11, UNK_TYPE4 param_12, UNK_TYPE4 param_13, UNK_TYPE4 param_14);
// void Interface_AllocStory(void);
// void Interface_Update(void);
// void func_80121F94(void);
// void Interface_Destroy(void);
void Interface_Init(PlayState* play);
Path* Path_GetByIndex(PlayState* play, s16 index, s16 max);
f32 Path_OrientAndGetDistSq(Actor* actor, Path* path, s16 waypoint, s16* yaw);
+1 -1
View File
@@ -1048,7 +1048,7 @@ extern UNK_PTR D_801BF5C0;
// extern UNK_TYPE1 D_801BF96A;
// extern UNK_TYPE1 D_801BF96C;
// extern UNK_TYPE1 D_801BF96E;
// extern UNK_TYPE2 D_801BF970;
// extern UNK_TYPE2 sTimerId;
// extern UNK_TYPE1 D_801BF972;
// extern UNK_TYPE2 D_801BF974;
// extern UNK_TYPE2 D_801BF978;
+44 -12
View File
@@ -54,6 +54,38 @@ typedef enum {
#define MAGIC_NORMAL_METER 0x30
#define MAGIC_DOUBLE_METER (2 * MAGIC_NORMAL_METER)
typedef enum {
/* 0 */ TIMER_STATE_OFF,
/* 1 */ TIMER_STATE_1,
/* 2 */ TIMER_STATE_2,
/* 3 */ TIMER_STATE_3,
/* 4 */ TIMER_STATE_4,
/* 5 */ TIMER_STATE_5,
/* 6 */ TIMER_STATE_6,
/* 7 */ TIMER_STATE_7,
/* 8 */ TIMER_STATE_8,
/* 9 */ TIMER_STATE_9,
/* 10 */ TIMER_STATE_10,
/* 11 */ TIMER_STATE_11,
/* 12 */ TIMER_STATE_12,
/* 13 */ TIMER_STATE_13,
/* 14 */ TIMER_STATE_14,
/* 15 */ TIMER_STATE_15,
/* 16 */ TIMER_STATE_16
} TimerState;
typedef enum {
/* 0 */ TIMER_ID_0,
/* 1 */ TIMER_ID_1,
/* 2 */ TIMER_ID_2,
/* 3 */ TIMER_ID_3, // countdown until mooncrash
/* 4 */ TIMER_ID_4,
/* 5 */ TIMER_ID_5,
/* 6 */ TIMER_ID_6,
/* 7 */ TIMER_ID_MAX,
/* 99 */ TIMER_ID_NONE = 99,
} TimerId;
typedef struct SramContext {
/* 0x00 */ u8* readBuff;
/* 0x04 */ u8 *saveBuf;
@@ -214,11 +246,11 @@ typedef struct SaveContext {
/* 0x1015 */ u8 unk_1015;
/* 0x1016 */ u16 jinxTimer;
/* 0x1018 */ s16 rupeeAccumulator; // "lupy_udct"
/* 0x101A */ u8 unk_101A[6]; // "bottle_status", one entry for each bottle
/* 0x1020 */ OSTime unk_1020[6]; // "bottle_ostime", one entry for each bottle
/* 0x1050 */ OSTime unk_1050[6]; // "bottle_sub", one entry for each bottle
/* 0x1080 */ OSTime unk_1080[6]; // "bottle_time", one entry for each bottle
/* 0x10B0 */ OSTime unk_10B0[6]; // "bottle_stop_time", one entry for each bottle
/* 0x101A */ u8 bottleStatus[6]; // "bottle_status", one entry for each bottle
/* 0x1020 */ OSTime bottleTimer1Value[6]; // "bottle_ostime", one entry for each bottle
/* 0x1050 */ OSTime bottleTimer2Value[6]; // "bottle_sub", one entry for each bottle
/* 0x1080 */ OSTime bottleTimer3Value[6]; // "bottle_time", one entry for each bottle
/* 0x10B0 */ OSTime bottleTimer4Value[6]; // "bottle_stop_time", one entry for each bottle
/* 0x10E0 */ u64 pictoPhoto[1400]; // buffer containing the pictograph photo
/* 0x3CA0 */ s32 fileNum; // "file_no"
/* 0x3CA4 */ s16 powderKegTimer; // "big_bom_timer"
@@ -237,14 +269,14 @@ typedef struct SaveContext {
/* 0x3DBF */ u8 showTitleCard; // "name_display"
/* 0x3DC0 */ s16 unk_3DC0; // "shield_magic_timer"
/* 0x3DC2 */ u8 unk_3DC2; // "pad1"
/* 0x3DC8 */ OSTime unk_3DC8; // "get_time"
/* 0x3DD0 */ u8 unk_3DD0[7]; // "event_fg"
/* 0x3DC8 */ OSTime timerOsTime; // "get_time"
/* 0x3DD0 */ u8 timerState[7]; // "event_fg"
/* 0x3DD7 */ u8 timersNoTimeLimit[7]; // "calc_flag"
/* 0x3DE0 */ OSTime unk_3DE0[7]; // "event_ostime"
/* 0x3E18 */ OSTime unk_3E18[7]; // "event_sub"
/* 0x3E50 */ OSTime unk_3E50[7]; // "func_time"
/* 0x3E88 */ OSTime unk_3E88[7]; // "func_end_time"
/* 0x3EC0 */ OSTime unk_3EC0[7]; // "func_stop_time"
/* 0x3DE0 */ OSTime eventTimer1Value[7]; // "event_ostime"
/* 0x3E18 */ OSTime eventTimer2Value[7]; // "event_sub"
/* 0x3E50 */ OSTime funcTimer1Value[7]; // "func_time"
/* 0x3E88 */ OSTime funcTimer2Value[7]; // "func_end_time"
/* 0x3EC0 */ OSTime funcTimer3Value[7]; // "func_stop_time"
/* 0x3EF8 */ s16 timerX[7]; // "event_xp"
/* 0x3F06 */ s16 timerY[7]; // "event_yp"
/* 0x3F14 */ s16 unk_3F14; // "character_change"
+1 -1
View File
@@ -688,7 +688,7 @@ void Inventory_SetMapVisibility(s16 tingleIndex) {
void Inventory_SaveDekuPlaygroundHighScore(s16 timerId) {
s16 i;
gSaveContext.save.dekuPlaygroundHighScores[CURRENT_DAY - 1] = gSaveContext.unk_3DE0[timerId];
gSaveContext.save.dekuPlaygroundHighScores[CURRENT_DAY - 1] = gSaveContext.eventTimer1Value[timerId];
for (i = 0; i < 8; i++) {
gSaveContext.save.inventory.dekuPlaygroundPlayerName[CURRENT_DAY - 1][i] =
+3 -3
View File
@@ -18,14 +18,14 @@ static s16 sGameOverTimer = 0;
void GameOver_Update(PlayState* play) {
GameOverContext* gameOverCtx = &play->gameOverCtx;
s16 i;
s16 timerId;
switch (gameOverCtx->state) {
case GAMEOVER_DEATH_START:
func_801477B4(play);
for (i = 0; i < ARRAY_COUNT(gSaveContext.unk_3DD0); i++) {
gSaveContext.unk_3DD0[i] = 0;
for (timerId = 0; timerId < TIMER_ID_MAX; timerId++) {
gSaveContext.timerState[timerId] = TIMER_STATE_OFF;
}
gSaveContext.eventInf[1] &= ~1;
+229 -221
View File
File diff suppressed because it is too large Load Diff
+14 -14
View File
@@ -873,13 +873,13 @@ void func_80144A94(SramContext* sramCtx) {
gSaveContext.cycleSceneFlags[i].collectible = gSaveContext.save.permanentSceneFlags[i].collectible;
}
for (i = 0; i < ARRAY_COUNT(gSaveContext.unk_3DD0); i++) {
gSaveContext.unk_3DD0[i] = 0;
gSaveContext.unk_3DE0[i] = 0;
gSaveContext.unk_3E18[i] = 0;
gSaveContext.unk_3E50[i] = 0;
gSaveContext.unk_3E88[i] = 0;
gSaveContext.unk_3EC0[i] = 0;
for (i = 0; i < ARRAY_COUNT(gSaveContext.timerState); i++) {
gSaveContext.timerState[i] = TIMER_STATE_OFF;
gSaveContext.eventTimer1Value[i] = 0;
gSaveContext.eventTimer2Value[i] = 0;
gSaveContext.funcTimer1Value[i] = 0;
gSaveContext.funcTimer2Value[i] = 0;
gSaveContext.funcTimer3Value[i] = 0;
}
D_801BDAA0 = 1;
@@ -944,13 +944,13 @@ void Sram_OpenSave(FileChooseContext* fileChooseCtx, SramContext* sramCtx) {
gSaveContext.cycleSceneFlags[i].collectible = gSaveContext.save.permanentSceneFlags[i].collectible;
}
for (i = 0; i < ARRAY_COUNT(gSaveContext.unk_3DD0); i++) {
gSaveContext.unk_3DD0[i] = 0;
gSaveContext.unk_3DE0[i] = 0;
gSaveContext.unk_3E18[i] = 0;
gSaveContext.unk_3E50[i] = 0;
gSaveContext.unk_3E88[i] = 0;
gSaveContext.unk_3EC0[i] = 0;
for (i = 0; i < ARRAY_COUNT(gSaveContext.timerState); i++) {
gSaveContext.timerState[i] = TIMER_STATE_OFF;
gSaveContext.eventTimer1Value[i] = 0;
gSaveContext.eventTimer2Value[i] = 0;
gSaveContext.funcTimer1Value[i] = 0;
gSaveContext.funcTimer2Value[i] = 0;
gSaveContext.funcTimer3Value[i] = 0;
}
if (gSaveContext.save.isFirstCycle) {
+4 -4
View File
@@ -1046,9 +1046,9 @@ void DmStk_Init(Actor* thisx, PlayState* play) {
if (gSaveContext.save.entranceIndex == 0x2C00) {
if (gSaveContext.sceneSetupIndex == 0) {
if (gSaveContext.unk_3DD0[3] == 0) {
if (gSaveContext.timerState[TIMER_ID_3] == TIMER_STATE_OFF) {
// Starts a 5 minute (300 second) timer until the moon falls.
func_8010E9F0(3, 300);
func_8010E9F0(TIMER_ID_3, 300);
XREG(80) = 200;
XREG(81) = 115;
}
@@ -1063,10 +1063,10 @@ void DmStk_Init(Actor* thisx, PlayState* play) {
} else if (gSaveContext.sceneSetupIndex == 3) {
this->animationId = SK_ANIMATION_FLOATING_ARMS_CROSSED;
if (gSaveContext.unk_3DD0[3] == 0) {
if (gSaveContext.timerState[TIMER_ID_3] == TIMER_STATE_OFF) {
// This code is called when the Giants fail to stop the moon.
// Starts a 1 minute (60 second) timer until the moon falls.
func_8010E9F0(3, 60);
func_8010E9F0(TIMER_ID_3, 60);
XREG(80) = 200;
XREG(81) = 115;
}
+2 -2
View File
@@ -216,7 +216,7 @@ void EnDno_Init(Actor* thisx, PlayState* play) {
} else {
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 14, &this->unk_32C);
thisx->room = -1;
gSaveContext.unk_3DD0[1] = 5;
gSaveContext.timerState[TIMER_ID_1] = TIMER_STATE_5;
this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo);
this->unk_3B0 |= 1;
this->actionFunc = func_80A72438;
@@ -817,7 +817,7 @@ void func_80A73244(EnDno* this, PlayState* play) {
this->unk_328 = 2;
this->actor.speedXZ = 0.0f;
Flags_UnsetSwitch(play, ENDNO_GET_3F80(&this->actor));
gSaveContext.unk_3DD0[1] = 5;
gSaveContext.timerState[TIMER_ID_1] = TIMER_STATE_5;
this->unk_44E = 0;
this->actionFunc = func_80A732C8;
}
+12 -12
View File
@@ -401,7 +401,7 @@ void func_80962340(EnFu* this, PlayState* play) {
Message_StartTextbox(play, 0x287E, &this->actor);
this->unk_552 = 0x287E;
}
} else if ((gSaveContext.unk_3DE0[4] == 0) && (this->unk_552 != 0x2888)) {
} else if ((gSaveContext.eventTimer1Value[TIMER_ID_4] == 0) && (this->unk_552 != 0x2888)) {
Message_StartTextbox(play, 0x2886, &this->actor);
this->unk_552 = 0x2886;
} else {
@@ -644,7 +644,7 @@ void func_80962A10(EnFu* this, PlayState* play) {
play_sound(NA_SE_SY_FOUND);
player->stateFlags1 &= ~0x20;
func_8010E9F0(4, 60);
func_8010E9F0(TIMER_ID_4, 60);
if (this->unk_546 == 1) {
func_809616E0(this, play);
} else {
@@ -682,7 +682,7 @@ void func_80962BCC(EnFu* this, PlayState* play) {
play_sound(NA_SE_SY_FOUND);
player->stateFlags1 &= ~0x20;
player->stateFlags3 |= 0x400000;
func_8010E9F0(4, 60);
func_8010E9F0(TIMER_ID_4, 60);
if (this->unk_546 == 1) {
func_809616E0(this, play);
@@ -713,7 +713,7 @@ void func_80962D60(EnFu* this, PlayState* play) {
play_sound(NA_SE_SY_FOUND);
player->stateFlags1 &= ~0x20;
player->stateFlags3 |= 0x400000;
func_8010E9F0(4, 60);
func_8010E9F0(TIMER_ID_4, 60);
if (this->unk_546 == 1) {
func_809616E0(this, play);
@@ -761,11 +761,11 @@ void func_80962F4C(EnFu* this, PlayState* play) {
break;
}
if (gSaveContext.unk_3DE0[4] < 2000) {
if (gSaveContext.eventTimer1Value[TIMER_ID_4] < 2000) {
s16 val = D_80964B00[this->unk_542] + 200;
Math_SmoothStepToS(&fuKaiten->rotationSpeed, val, 10, 5, 5);
} else if (gSaveContext.unk_3DE0[4] < 4000) {
} else if (gSaveContext.eventTimer1Value[TIMER_ID_4] < 4000) {
s16 val = D_80964B00[this->unk_542] + 100;
Math_SmoothStepToS(&fuKaiten->rotationSpeed, val, 10, 5, 5);
@@ -777,12 +777,12 @@ void func_80962F4C(EnFu* this, PlayState* play) {
if ((!DynaPolyActor_IsInRidingRotatingState((DynaPolyActor*)this->actor.child) &&
(player->actor.bgCheckFlags & 1)) ||
(gSaveContext.unk_3DE0[4] < 1) || (this->unk_548 == this->unk_54C)) {
(gSaveContext.eventTimer1Value[TIMER_ID_4] < 1) || (this->unk_548 == this->unk_54C)) {
player->stateFlags3 &= ~0x400000;
func_80961E88(play);
player->stateFlags1 |= 0x20;
if (this->unk_548 < this->unk_54C) {
if (gSaveContext.unk_3DE0[4] == 0) {
if (gSaveContext.eventTimer1Value[TIMER_ID_4] == 0) {
Message_StartTextbox(play, 0x2885, &this->actor);
this->unk_552 = 0x2885;
} else {
@@ -790,15 +790,15 @@ void func_80962F4C(EnFu* this, PlayState* play) {
this->unk_552 = 0x2888;
}
func_801A2C20();
gSaveContext.unk_3DE0[4] = 0;
gSaveContext.unk_3DD0[4] = 5;
gSaveContext.eventTimer1Value[TIMER_ID_4] = 0;
gSaveContext.timerState[TIMER_ID_4] = TIMER_STATE_5;
this->unk_548 = 0;
func_809632D0(this);
} else {
this->unk_548 = 0;
func_801A2C20();
gSaveContext.unk_3DE0[4] = 0;
gSaveContext.unk_3DD0[4] = 5;
gSaveContext.eventTimer1Value[TIMER_ID_4] = 0;
gSaveContext.timerState[TIMER_ID_4] = TIMER_STATE_5;
func_801A3098(NA_BGM_GET_ITEM | 0x900);
Interface_SetPerfectMinigame(play, 1);
this->unk_54A = 3;
+5 -5
View File
@@ -459,7 +459,7 @@ void func_80B10240(EnGb2* this, PlayState* play) {
D_80B119B0[this->unk_280].unk_04.y, D_80B119B0[this->unk_280].unk_04.z, 0, 0, 0,
this->unk_27E);
if (this->unk_280 == 0) {
func_8010E9F0(1, 180);
func_8010E9F0(TIMER_ID_1, 180);
}
this->actionFunc = func_80B10344;
} else {
@@ -487,7 +487,7 @@ void func_80B10344(EnGb2* this, PlayState* play) {
if (this->unk_26C & 0x200) {
if (this->unk_280 == 3) {
this->unk_26C &= ~0x200;
gSaveContext.unk_3DD0[1] = 5;
gSaveContext.timerState[TIMER_ID_1] = TIMER_STATE_5;
func_800FE498();
gSaveContext.eventInf[4] |= 0x40;
func_80B0FE7C(play);
@@ -506,7 +506,7 @@ void func_80B10344(EnGb2* this, PlayState* play) {
}
if (gSaveContext.save.playerData.health < 49) {
gSaveContext.unk_3DD0[1] = 5;
gSaveContext.timerState[TIMER_ID_1] = TIMER_STATE_5;
gSaveContext.eventInf[4] |= 0x40;
gSaveContext.eventInf[4] |= 0x20;
@@ -519,8 +519,8 @@ void func_80B10344(EnGb2* this, PlayState* play) {
}
func_80B0FE7C(play);
} else if (gSaveContext.unk_3DE0[1] == 0) {
gSaveContext.unk_3DD0[1] = 5;
} else if (gSaveContext.eventTimer1Value[TIMER_ID_1] == 0) {
gSaveContext.timerState[TIMER_ID_1] = TIMER_STATE_5;
gSaveContext.eventInf[4] |= 0x40;
gSaveContext.eventInf[4] |= 0x10;
@@ -121,7 +121,7 @@ s32 func_808F8CCC(EnHorseGameCheck* this, PlayState* play2) {
return false;
}
func_8010E9F0(4, 0);
func_8010E9F0(TIMER_ID_4, 0);
play->interfaceCtx.unk_280 = 1;
this->horse1 =
@@ -145,7 +145,7 @@ s32 func_808F8CCC(EnHorseGameCheck* this, PlayState* play2) {
}
s32 func_808F8E94(EnHorseGameCheck* this, PlayState* play) {
gSaveContext.unk_3DD0[4] = 0;
gSaveContext.timerState[TIMER_ID_4] = TIMER_STATE_OFF;
return true;
}
@@ -247,11 +247,11 @@ s32 func_808F8FAC(EnHorseGameCheck* this, PlayState* play) {
return true;
}
if (gSaveContext.unk_3DE0[4] >= 0x4650) {
if (gSaveContext.eventTimer1Value[TIMER_ID_4] >= 0x4650) {
Audio_QueueSeqCmd(0x8041);
play_sound(NA_SE_SY_START_SHOT);
this->unk_164 |= 0x40000;
gSaveContext.unk_3DD0[4] = 6;
gSaveContext.timerState[TIMER_ID_4] = TIMER_STATE_6;
SET_RACE_FLAGS(RACE_FLAG_4);
this->unk_174 = 60;
}
@@ -284,7 +284,7 @@ s32 func_808F8FAC(EnHorseGameCheck* this, PlayState* play) {
Audio_QueueSeqCmd(0x8041);
play_sound(NA_SE_SY_START_SHOT);
this->unk_164 |= 0x40000;
gSaveContext.unk_3DD0[4] = 6;
gSaveContext.timerState[TIMER_ID_4] = TIMER_STATE_6;
SET_RACE_FLAGS(RACE_FLAG_3);
this->unk_174 = 60;
}
@@ -317,7 +317,7 @@ s32 func_808F8FAC(EnHorseGameCheck* this, PlayState* play) {
Audio_QueueSeqCmd(0x8041);
play_sound(NA_SE_SY_START_SHOT);
this->unk_164 |= 0x02000000;
gSaveContext.unk_3DD0[4] = 6;
gSaveContext.timerState[TIMER_ID_4] = TIMER_STATE_6;
SET_RACE_FLAGS(RACE_FLAG_3);
this->unk_174 = 60;
}
@@ -346,7 +346,7 @@ s32 func_808F8FAC(EnHorseGameCheck* this, PlayState* play) {
Audio_QueueSeqCmd(0x8041);
play_sound(NA_SE_SY_START_SHOT);
this->unk_164 |= 0x800;
gSaveContext.unk_3DD0[4] = 6;
gSaveContext.timerState[TIMER_ID_4] = TIMER_STATE_6;
SET_RACE_FLAGS(RACE_FLAG_2);
this->unk_174 = 60;
}
@@ -155,7 +155,7 @@ void func_80C13BB8(EnJgameTsn* this, PlayState* play) {
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
if (this->actor.flags & ACTOR_FLAG_10000) {
this->actor.flags &= ~ACTOR_FLAG_10000;
if (gSaveContext.unk_3DE0[4] > 0) {
if (gSaveContext.eventTimer1Value[TIMER_ID_4] > 0) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
Message_StartTextbox(play, 0x10A2, &this->actor);
this->unk_300 = 0x10A2;
@@ -287,7 +287,7 @@ void func_80C1410C(EnJgameTsn* this, PlayState* play) {
play->interfaceCtx.unk_280 = 1;
Interface_InitMinigame(play);
gSaveContext.save.weekEventReg[90] |= 0x20;
func_8010E9F0(4, 0x78);
func_8010E9F0(TIMER_ID_4, 120);
this->actionFunc = func_80C1418C;
}
@@ -352,7 +352,7 @@ void func_80C14230(EnJgameTsn* this, PlayState* play) {
func_80C14030(this);
}
if (gSaveContext.unk_3DE0[4] == 0) {
if (gSaveContext.eventTimer1Value[TIMER_ID_4] == 0) {
Message_StartTextbox(play, 0x10A1, &this->actor);
this->unk_300 = 0x10A1;
player->stateFlags1 |= 0x20;
@@ -479,7 +479,7 @@ void func_80C147B4(EnJgameTsn* this, PlayState* play) {
case 0x10A1:
func_801477B4(play);
gSaveContext.minigameState = 3;
gSaveContext.unk_3DD0[4] = 5;
gSaveContext.timerState[TIMER_ID_4] = TIMER_STATE_5;
gSaveContext.save.weekEventReg[90] &= (u8)~0x20;
func_80C144E4(this);
break;
+10 -10
View File
@@ -678,7 +678,7 @@ void EnMa4_HorsebackGameCheckPlayerInteractions(EnMa4* this, PlayState* play) {
// "You're feeling confident"
Message_StartTextbox(play, 0x336E, &this->actor);
this->actionFunc = EnMa4_HorsebackGameTalking;
} else if ((gSaveContext.unk_3DE0[4] < 115 * 100)) { // timer < 115 seconds
} else if ((gSaveContext.eventTimer1Value[TIMER_ID_4] < 115 * 100)) { // timer < 115 seconds
func_800B8614(&this->actor, play, 100.0f);
}
}
@@ -693,7 +693,7 @@ void EnMa4_InitHorsebackGame(EnMa4* this, PlayState* play) {
Player* player = GET_PLAYER(play);
play->interfaceCtx.unk_280 = 1;
func_8010E9F0(4, 0);
func_8010E9F0(TIMER_ID_4, 0);
gSaveContext.save.weekEventReg[8] |= 1;
Interface_InitMinigame(play);
player->stateFlags1 |= 0x20;
@@ -721,9 +721,9 @@ void EnMa4_HorsebackGameWait(EnMa4* this, PlayState* play) {
play->interfaceCtx.unk_25C = 1;
}
if ((gSaveContext.unk_3DE0[4] >= 2 * 60 * 100) // timer >= 2 minutes
if ((gSaveContext.eventTimer1Value[TIMER_ID_4] >= 2 * 60 * 100) // timer >= 2 minutes
|| (this->poppedBalloonCounter == 10)) {
gSaveContext.unk_3DD0[4] = 6;
gSaveContext.timerState[TIMER_ID_4] = TIMER_STATE_6;
EnMa4_SetupHorsebackGameEnd(this, play);
D_80AC0258 = 0;
}
@@ -902,13 +902,13 @@ void EnMa4_StartDialogue(EnMa4* this, PlayState* play) {
gSaveContext.save.weekEventReg[21] |= 0x40;
}
} else if (this->state == MA4_STATE_AFTERHORSEBACKGAME) {
if (gSaveContext.unk_3DE0[4] >= 2 * 60 * 100) {
if (gSaveContext.eventTimer1Value[TIMER_ID_4] >= 2 * 60 * 100) {
// "Too bad Grasshopper"
EnMa4_SetFaceExpression(this, 0, 0);
Message_StartTextbox(play, 0x336D, &this->actor);
this->textId = 0x336D;
} else {
time = gSaveContext.unk_3DE0[4];
time = gSaveContext.eventTimer1Value[TIMER_ID_4];
if ((s32)time < (s32)gSaveContext.save.horseBackBalloonHighScore) {
// [Score] New record!
gSaveContext.save.horseBackBalloonHighScore = time;
@@ -947,12 +947,12 @@ void EnMa4_StartDialogue(EnMa4* this, PlayState* play) {
Message_StartTextbox(play, 0x3354, &this->actor);
this->textId = 0x3354;
} else if (this->state == MA4_STATE_AFTERHORSEBACKGAME) {
if (gSaveContext.unk_3DE0[4] >= 2 * 60 * 100) {
if (gSaveContext.eventTimer1Value[TIMER_ID_4] >= 2 * 60 * 100) {
// "Try again?"
Message_StartTextbox(play, 0x3356, &this->actor);
this->textId = 0x3356;
} else {
time = gSaveContext.unk_3DE0[4];
time = gSaveContext.eventTimer1Value[TIMER_ID_4];
if ((s32)time < (s32)gSaveContext.save.horseBackBalloonHighScore) {
gSaveContext.save.horseBackBalloonHighScore = time;
EnMa4_SetFaceExpression(this, 0, 3);
@@ -974,12 +974,12 @@ void EnMa4_StartDialogue(EnMa4* this, PlayState* play) {
Message_StartTextbox(play, 0x3358, &this->actor);
this->textId = 0x3358;
} else if (this->state == MA4_STATE_AFTERHORSEBACKGAME) {
if (gSaveContext.unk_3DE0[4] >= 2 * 60 * 100) {
if (gSaveContext.eventTimer1Value[TIMER_ID_4] >= 2 * 60 * 100) {
// "Try again?"
Message_StartTextbox(play, 0x3356, &this->actor);
this->textId = 0x3356;
} else {
time = gSaveContext.unk_3DE0[4];
time = gSaveContext.eventTimer1Value[TIMER_ID_4];
if ((s32)time < (s32)gSaveContext.save.horseBackBalloonHighScore) {
// New record
gSaveContext.save.horseBackBalloonHighScore = time;
+15 -14
View File
@@ -245,13 +245,14 @@ void func_80A6F5E4(EnMm3* this, PlayState* play) {
break;
case 0x2791:
if (gSaveContext.unk_3DE0[0] == 1000) {
if (gSaveContext.eventTimer1Value[TIMER_ID_0] == 1000) {
Message_StartTextbox(play, 0x2792, &this->actor);
this->unk_2B4 = 0x2792;
} else if ((gSaveContext.unk_3DE0[0] >= 1500)) {
} else if ((gSaveContext.eventTimer1Value[TIMER_ID_0] >= 1500)) {
Message_StartTextbox(play, 0x2797, &this->actor);
this->unk_2B4 = 0x2797;
} else if ((gSaveContext.unk_3DE0[0] <= 1050) && (gSaveContext.unk_3DE0[0] >= 950)) {
} else if ((gSaveContext.eventTimer1Value[TIMER_ID_0] <= 1050) &&
(gSaveContext.eventTimer1Value[TIMER_ID_0] >= 950)) {
Message_StartTextbox(play, 0x2795, &this->actor);
this->unk_2B4 = 0x2795;
} else {
@@ -297,7 +298,7 @@ void func_80A6F5E4(EnMm3* this, PlayState* play) {
} else if ((this->unk_2AC > 0) && (this->unk_2B4 == 0x2791)) {
this->unk_2AC--;
if (this->unk_2AC == 0) {
if (gSaveContext.unk_3DE0[0] == 1000) {
if (gSaveContext.eventTimer1Value[TIMER_ID_0] == 1000) {
func_801A3098(0x922);
} else {
play_sound(NA_SE_SY_ERROR);
@@ -376,18 +377,18 @@ void func_80A6FBA0(EnMm3* this) {
void func_80A6FBFC(EnMm3* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (gSaveContext.unk_3DD0[0] == 0x10) {
if (gSaveContext.timerState[TIMER_ID_0] == TIMER_STATE_16) {
player->stateFlags1 &= ~0x20;
this->actor.flags |= ACTOR_FLAG_10000;
if (gSaveContext.unk_3DE0[0] > 1500) {
gSaveContext.unk_3DE0[0] = 1500;
} else if ((((void)0, gSaveContext.unk_3DE0[0]) >= (OSTime)(995 - XREG(16))) &&
(((void)0, gSaveContext.unk_3DE0[0]) <= (OSTime)(1005 + XREG(17)))) {
gSaveContext.unk_3DE0[0] = 1000;
if (gSaveContext.eventTimer1Value[TIMER_ID_0] > 1500) {
gSaveContext.eventTimer1Value[TIMER_ID_0] = 1500;
} else if ((((void)0, gSaveContext.eventTimer1Value[TIMER_ID_0]) >= (OSTime)(995 - XREG(16))) &&
(((void)0, gSaveContext.eventTimer1Value[TIMER_ID_0]) <= (OSTime)(1005 + XREG(17)))) {
gSaveContext.eventTimer1Value[TIMER_ID_0] = 1000;
}
} else if (gSaveContext.unk_3DE0[0] > 1500) {
gSaveContext.unk_3DD0[0] = 15;
gSaveContext.unk_3DC8 = osGetTime();
} else if (gSaveContext.eventTimer1Value[TIMER_ID_0] > 1500) {
gSaveContext.timerState[TIMER_ID_0] = TIMER_STATE_15;
gSaveContext.timerOsTime = osGetTime();
}
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
@@ -396,7 +397,7 @@ void func_80A6FBFC(EnMm3* this, PlayState* play) {
Message_StartTextbox(play, 0x2791, &this->actor);
this->unk_2B4 = 0x2791;
this->unk_2AC = 7;
gSaveContext.unk_3DD0[0] = 0;
gSaveContext.timerState[TIMER_ID_0] = TIMER_STATE_OFF;
this->actor.flags &= ~ACTOR_FLAG_10000;
play_sound(NA_SE_SY_START_SHOT);
func_80A6F9C8(this);
@@ -253,7 +253,7 @@ s32 EnMttag_ExitRace(PlayState* play, s32 arg1, s32 nextTransition) {
* Displays the text which says that the player has made a false start.
*/
void EnMttag_ShowFalseStartMessage(EnMttag* this, PlayState* play) {
gSaveContext.unk_3DD0[4] = 0;
gSaveContext.timerState[TIMER_ID_4] = TIMER_STATE_OFF;
Message_StartTextbox(play, 0xE95, NULL); // An entrant made a false start
func_800B7298(play, &this->actor, 7);
Audio_QueueSeqCmd(0x101400FF);
@@ -314,7 +314,7 @@ void EnMttag_RaceStart(EnMttag* this, PlayState* play) {
gSaveContext.eventInf[1] |= 8;
} else {
if (DECR(this->timer) == 60) {
func_8010E9F0(4, 0);
func_8010E9F0(TIMER_ID_4, 0);
play->interfaceCtx.unk_280 = 1;
Audio_QueueSeqCmd(NA_BGM_GORON_RACE | 0x8000);
play->envCtx.unk_E4 = 0xFE;
@@ -359,14 +359,14 @@ void EnMttag_Race(EnMttag* this, PlayState* play) {
s32 playerCheatStatus;
if (EnMttag_IsInFinishLine(playerPos)) {
gSaveContext.unk_3DD0[4] = 6;
gSaveContext.timerState[TIMER_ID_4] = TIMER_STATE_6;
play_sound(NA_SE_SY_START_SHOT);
Audio_QueueSeqCmd(NA_BGM_GORON_GOAL | 0x8000);
this->timer = 55;
gSaveContext.eventInf[1] |= 2;
this->actionFunc = EnMttag_RaceFinish;
} else if (EnMttag_IsAnyRaceGoronOverFinishLine(this)) {
gSaveContext.unk_3DD0[4] = 6;
gSaveContext.timerState[TIMER_ID_4] = TIMER_STATE_6;
play_sound(NA_SE_SY_START_SHOT);
Audio_QueueSeqCmd(NA_BGM_GORON_GOAL | 0x8000);
this->timer = 55;
@@ -457,7 +457,7 @@ void EnMttag_HandleCantWinChoice(EnMttag* this, PlayState* play) {
if (play->msgCtx.choiceIndex != 0) {
// Exit the race
func_8019F230();
gSaveContext.unk_3DD0[4] = 0;
gSaveContext.timerState[TIMER_ID_4] = TIMER_STATE_OFF;
EnMttag_ExitRace(play, 2, 2);
gSaveContext.eventInf[1] &= (u8)~8;
gSaveContext.eventInf[1] |= 4;
@@ -503,8 +503,8 @@ void EnMttag_Init(Actor* thisx, PlayState* play) {
void EnMttag_Destroy(Actor* thisx, PlayState* play) {
EnMttag* this = THIS;
if (gSaveContext.unk_3DD0[4] != 6) {
gSaveContext.unk_3DD0[4] = 5;
if (gSaveContext.timerState[TIMER_ID_4] != TIMER_STATE_6) {
gSaveContext.timerState[TIMER_ID_4] = TIMER_STATE_5;
}
}
@@ -270,7 +270,7 @@ void func_80A2C2E0(EnSyatekiDekunuts* this, PlayState* play) {
void func_80A2C33C(EnSyatekiDekunuts* this, PlayState* play) {
EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent;
if ((gSaveContext.unk_3DE0[1] <= 0) || (syatekiMan->unk_26A != 1)) {
if ((gSaveContext.eventTimer1Value[TIMER_ID_1] <= 0) || (syatekiMan->unk_26A != 1)) {
func_80A2C3AC(this);
}
@@ -894,7 +894,7 @@ void func_809C80C0(EnSyatekiMan* this, PlayState* play) {
this->unk_27A = 0;
this->unk_27C = 0;
this->unk_26E = 0;
func_8010E9F0(1, 100);
func_8010E9F0(TIMER_ID_1, 100);
this->actor.draw = NULL;
this->actionFunc = func_809C81D0;
}
@@ -937,9 +937,9 @@ void func_809C81D0(EnSyatekiMan* this, PlayState* play) {
}
this->unk_26C++;
if (gSaveContext.unk_3DE0[1] == 0) {
gSaveContext.unk_3DE0[1] = 0;
gSaveContext.unk_3DD0[1] = 5;
if (gSaveContext.eventTimer1Value[TIMER_ID_1] == 0) {
gSaveContext.eventTimer1Value[TIMER_ID_1] = 0;
gSaveContext.timerState[TIMER_ID_1] = TIMER_STATE_5;
this->actor.draw = EnSyatekiMan_Draw;
this->unk_27E = 0;
this->unk_27C = 0;
@@ -957,10 +957,10 @@ void func_809C81D0(EnSyatekiMan* this, PlayState* play) {
this->unk_26A = 5;
if (this->unk_280 == 0x848) {
Interface_SetPerfectMinigame(play, 2);
gSaveContext.unk_3DD0[1] = 6;
gSaveContext.timerState[TIMER_ID_1] = TIMER_STATE_6;
this->actionFunc = func_809C8610;
} else {
gSaveContext.unk_3DD0[1] = 5;
gSaveContext.timerState[TIMER_ID_1] = TIMER_STATE_5;
this->actionFunc = func_809C8488;
}
}
@@ -1016,15 +1016,15 @@ void func_809C8610(EnSyatekiMan* this, PlayState* play) {
player->stateFlags1 |= 0x20;
if (!play->interfaceCtx.isMinigamePerfect) {
if (gSaveContext.unk_3DE0[1] == 0) {
gSaveContext.unk_3DE0[1] = 0;
gSaveContext.unk_3DD0[1] = 5;
if (gSaveContext.eventTimer1Value[TIMER_ID_1] == 0) {
gSaveContext.eventTimer1Value[TIMER_ID_1] = 0;
gSaveContext.timerState[TIMER_ID_1] = TIMER_STATE_5;
this->unk_27E = 0;
this->unk_27C = 0;
this->actionFunc = func_809C8488;
D_809C94A0 = 0;
} else if (D_809C94A0 > 10) {
gSaveContext.unk_3E88[1] += 100;
gSaveContext.funcTimer2Value[TIMER_ID_1] += 100;
play->interfaceCtx.unk_25C += 10;
this->unk_280 += 10;
Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR);
@@ -1084,7 +1084,7 @@ void func_809C8808(EnSyatekiMan* this, PlayState* play) {
this->unk_26C = 70;
this->unk_26E = 0;
D_809C94A4 = 30;
func_8010E9F0(1, 75);
func_8010E9F0(TIMER_ID_1, 75);
this->actor.draw = NULL;
this->actionFunc = func_809C898C;
}
@@ -1097,15 +1097,15 @@ void func_809C898C(EnSyatekiMan* this, PlayState* play) {
};
static s32 D_809C94A8 = 0;
Player* player = GET_PLAYER(play);
s32 sp30 = (((void)0, gSaveContext.unk_3DE0[1]) * 0.1f) + 1.0f;
s32 sp30 = (((void)0, gSaveContext.eventTimer1Value[TIMER_ID_1]) * 0.1f) + 1.0f;
if (sp30 < 0x2EF) {
s32 temp;
if (D_809C94A8 == 0) {
temp = ((void)0, gSaveContext.unk_3DE0[1]) % 500;
temp = ((void)0, gSaveContext.eventTimer1Value[TIMER_ID_1]) % 500;
} else {
temp = (((void)0, gSaveContext.unk_3DE0[1]) + 250) % 500;
temp = (((void)0, gSaveContext.eventTimer1Value[TIMER_ID_1]) + 250) % 500;
}
if (temp < 100) {
@@ -1114,7 +1114,7 @@ void func_809C898C(EnSyatekiMan* this, PlayState* play) {
if (this->unk_26E != 0) {
if (this->unk_26E == 2) {
gSaveContext.unk_3E18[1] -= 250;
gSaveContext.eventTimer2Value[TIMER_ID_1] -= 250;
D_809C94A8 = (D_809C94A8 + 25) % 50;
}
this->unk_26E = 0;
@@ -1132,11 +1132,11 @@ void func_809C898C(EnSyatekiMan* this, PlayState* play) {
}
}
if (gSaveContext.unk_3DE0[1] == 0) {
if (gSaveContext.eventTimer1Value[TIMER_ID_1] == 0) {
this->unk_27E = 0;
this->unk_26C = 80;
gSaveContext.unk_3DE0[1] = 0;
gSaveContext.unk_3DD0[1] = 5;
gSaveContext.eventTimer1Value[TIMER_ID_1] = 0;
gSaveContext.timerState[TIMER_ID_1] = TIMER_STATE_5;
player->stateFlags1 |= 0x20;
D_809C94A8 = 0;
this->actor.draw = EnSyatekiMan_Draw;
@@ -90,7 +90,7 @@ void func_80AC9FE4(EnTimeTag* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor);
this->actionFunc = func_80AC9FD4;
gSaveContext.unk_3DD0[3] = 0;
gSaveContext.timerState[TIMER_ID_3] = TIMER_STATE_OFF;
if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOWLA) && CHECK_QUEST_ITEM(QUEST_REMAINS_GOHT) &&
CHECK_QUEST_ITEM(QUEST_REMAINS_GYORG) && CHECK_QUEST_ITEM(QUEST_REMAINS_TWINMOLD)) {
gSaveContext.save.weekEventReg[25] |= 2;
@@ -107,7 +107,7 @@ void func_80ACA0A8(EnTimeTag* this, PlayState* play) {
if (this->actor.cutscene != -1) {
this->actionFunc = func_80AC9FE4;
ActorCutscene_SetIntentToPlay(this2->actor.cutscene);
gSaveContext.unk_3DD0[3] = 0;
gSaveContext.timerState[TIMER_ID_3] = TIMER_STATE_OFF;
}
play->msgCtx.ocarinaMode = 4;
}
@@ -45,14 +45,14 @@ void ObjRoomtimer_Init(Actor* thisx, PlayState* play) {
void ObjRoomtimer_Destroy(Actor* thisx, PlayState* play) {
ObjRoomtimer* this = THIS;
if (this->actor.params != 0x1FF && gSaveContext.unk_3DD0[4] > 0) {
gSaveContext.unk_3DD0[4] = 5;
if (this->actor.params != 0x1FF && gSaveContext.timerState[TIMER_ID_4] >= TIMER_STATE_1) {
gSaveContext.timerState[TIMER_ID_4] = TIMER_STATE_5;
}
}
void func_80973CD8(ObjRoomtimer* this, PlayState* play) {
if (this->actor.params != 0x1FF) {
func_8010E9F0(4, this->actor.params);
func_8010E9F0(TIMER_ID_4, this->actor.params);
}
func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
@@ -62,11 +62,11 @@ void func_80973CD8(ObjRoomtimer* this, PlayState* play) {
void func_80973D3C(ObjRoomtimer* this, PlayState* play) {
if (Flags_GetClearTemp(play, this->actor.room)) {
if (this->actor.params != 0x1FF) {
gSaveContext.unk_3DD0[4] = 5;
gSaveContext.timerState[TIMER_ID_4] = TIMER_STATE_5;
}
ActorCutscene_SetIntentToPlay(this->actor.cutscene);
this->actionFunc = func_80973DE0;
} else if (this->actor.params != 0x1FF && gSaveContext.unk_3DD0[4] == 0) {
} else if (this->actor.params != 0x1FF && gSaveContext.timerState[TIMER_ID_4] == TIMER_STATE_OFF) {
play_sound(NA_SE_OC_ABYSS);
func_80169EFC(&play->state);
Actor_MarkForDeath(&this->actor);

Some files were not shown because too many files have changed in this diff Show More