mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-03 16:52:07 -04:00
z_parameter: Time (1 non-matching) (#1144)
* import time docs * cleanup * fix display list * missed one * three-day events * PR Suggestions and cleanup * adjust comment * more macros * PR Suggestions * move InterfaceContext
This commit is contained in:
+5
-5
@@ -252,9 +252,9 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c
|
||||
break;
|
||||
case 0x12:
|
||||
if (!gSaveContext.save.isNight) {
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) - (u16)REG(15);
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) - (u16)R_TIME_SPEED;
|
||||
} else {
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) - (u16)(2 * REG(15));
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) - (u16)(2 * R_TIME_SPEED);
|
||||
}
|
||||
break;
|
||||
case 0x13:
|
||||
@@ -326,10 +326,10 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c
|
||||
if (csCtx->frames != D_801BB15C) {
|
||||
D_801BB15C = csCtx->frames;
|
||||
|
||||
if (REG(15) != 0) {
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)REG(15);
|
||||
if (R_TIME_SPEED != 0) {
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)R_TIME_SPEED;
|
||||
gSaveContext.save.time =
|
||||
((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.daySpeed);
|
||||
((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.timeSpeedOffset);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
+3
-3
@@ -124,11 +124,11 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800FE3E0.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800FE484.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/Environment_StopTime.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800FE498.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/Environment_StartTime.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800FE4A8.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/Environment_IsTimeStopped.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800FE4B8.s")
|
||||
|
||||
|
||||
@@ -212,13 +212,9 @@ void Message_LoadTimeNES(PlayState* play, u8 arg1, s32* offset, f32* arg3, s16*
|
||||
s16 i;
|
||||
|
||||
if (arg1 == 0xCF) {
|
||||
// Calculates the time left before the moon crashes.
|
||||
// The day begins at CLOCK_TIME(6, 0) so it must be offset.
|
||||
timeLeft = (4 - CURRENT_DAY) * DAY_LENGTH - (u16)(((void)0, gSaveContext.save.time) - CLOCK_TIME(6, 0));
|
||||
timeLeft = TIME_UNTIL_MOON_CRASH;
|
||||
} else {
|
||||
// Calculates the time left before a new day.
|
||||
// The day begins at CLOCK_TIME(6, 0) so it must be offset.
|
||||
timeLeft = DAY_LENGTH - (u16)(((void)0, gSaveContext.save.time) - CLOCK_TIME(6, 0));
|
||||
timeLeft = TIME_UNTIL_NEW_DAY;
|
||||
}
|
||||
|
||||
timeLeftInMinutes = TIME_TO_MINUTES_F(timeLeft);
|
||||
|
||||
+562
-7
@@ -932,7 +932,28 @@ u32 Interface_GetCompressedTimerDigits(s16 timerId) {
|
||||
(timerArr[4] << 4) | timerArr[5];
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8010EE74.s")
|
||||
void Interface_NewDay(PlayState* play, s32 day) {
|
||||
s32 pad;
|
||||
s16 i = day - 1;
|
||||
|
||||
// i is used to store dayMinusOne
|
||||
if ((i < 0) || (i >= 3)) {
|
||||
i = 0;
|
||||
}
|
||||
|
||||
// Loads day number from week_static for the three-day clock
|
||||
DmaMgr_SendRequest0((u32)play->interfaceCtx.doActionSegment + 0x780,
|
||||
(u32)SEGMENT_ROM_START(week_static) + i * 0x510, 0x510);
|
||||
|
||||
// i is used to store sceneId
|
||||
for (i = 0; i < ARRAY_COUNT(gSaveContext.save.permanentSceneFlags); i++) {
|
||||
gSaveContext.save.permanentSceneFlags[i].chest = gSaveContext.cycleSceneFlags[i].chest;
|
||||
gSaveContext.save.permanentSceneFlags[i].switch0 = gSaveContext.cycleSceneFlags[i].switch0;
|
||||
gSaveContext.save.permanentSceneFlags[i].switch1 = gSaveContext.cycleSceneFlags[i].switch1;
|
||||
gSaveContext.save.permanentSceneFlags[i].clearedRoom = gSaveContext.cycleSceneFlags[i].clearedRoom;
|
||||
gSaveContext.save.permanentSceneFlags[i].collectible = gSaveContext.cycleSceneFlags[i].collectible;
|
||||
}
|
||||
}
|
||||
|
||||
void Interface_SetHudVisibility(u16 hudVisibility) {
|
||||
if (gSaveContext.hudVisibility != hudVisibility) {
|
||||
@@ -3088,17 +3109,550 @@ s16 D_801BFB24[] = { 0, 255, 100, 0 }; // magicArrowEffectsB
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80119030.s")
|
||||
|
||||
s16 D_801BFB2C = 255;
|
||||
/**
|
||||
* Draws either the analog three-day clock or the digital final-hours clock
|
||||
*/
|
||||
#ifdef NON_MATCHING
|
||||
void Interface_DrawClock(PlayState* play) {
|
||||
static s16 sThreeDayClockAlpha = 255;
|
||||
static s16 D_801BFB30 = 0; // sClockAlphaTimer1
|
||||
static s16 D_801BFB34 = 0; // sClockAlphaTimer2
|
||||
static u16 sThreeDayClockHours[] = {
|
||||
CLOCK_TIME(0, 0), CLOCK_TIME(1, 0), CLOCK_TIME(2, 0), CLOCK_TIME(3, 0), CLOCK_TIME(4, 0),
|
||||
CLOCK_TIME(5, 0), CLOCK_TIME(6, 0), CLOCK_TIME(7, 0), CLOCK_TIME(8, 0), CLOCK_TIME(9, 0),
|
||||
CLOCK_TIME(10, 0), CLOCK_TIME(11, 0), CLOCK_TIME(12, 0), CLOCK_TIME(13, 0), CLOCK_TIME(14, 0),
|
||||
CLOCK_TIME(15, 0), CLOCK_TIME(16, 0), CLOCK_TIME(17, 0), CLOCK_TIME(18, 0), CLOCK_TIME(19, 0),
|
||||
CLOCK_TIME(20, 0), CLOCK_TIME(21, 0), CLOCK_TIME(22, 0), CLOCK_TIME(23, 0), CLOCK_TIME(24, 0) - 1,
|
||||
};
|
||||
static TexturePtr sThreeDayClockHourTextures[] = {
|
||||
gThreeDayClockHour12Tex, gThreeDayClockHour1Tex, gThreeDayClockHour2Tex, gThreeDayClockHour3Tex,
|
||||
gThreeDayClockHour4Tex, gThreeDayClockHour5Tex, gThreeDayClockHour6Tex, gThreeDayClockHour7Tex,
|
||||
gThreeDayClockHour8Tex, gThreeDayClockHour9Tex, gThreeDayClockHour10Tex, gThreeDayClockHour11Tex,
|
||||
gThreeDayClockHour12Tex, gThreeDayClockHour1Tex, gThreeDayClockHour2Tex, gThreeDayClockHour3Tex,
|
||||
gThreeDayClockHour4Tex, gThreeDayClockHour5Tex, gThreeDayClockHour6Tex, gThreeDayClockHour7Tex,
|
||||
gThreeDayClockHour8Tex, gThreeDayClockHour9Tex, gThreeDayClockHour10Tex, gThreeDayClockHour11Tex,
|
||||
};
|
||||
static s16 D_801BFBCC = 0; // sClockInvDiamondPrimRed
|
||||
static s16 D_801BFBD0 = 0; // sClockInvDiamondPrimGreen
|
||||
static s16 D_801BFBD4 = 255; // sClockInvDiamondPrimBlue
|
||||
static s16 D_801BFBD8 = 0; // sClockInvDiamondEnvRed
|
||||
static s16 D_801BFBDC = 0; // sClockInvDiamondEnvGreen
|
||||
static s16 D_801BFBE0 = 0; // sClockInvDiamondEnvBlue
|
||||
static s16 D_801BFBE4 = 15; // sClockInvDiamondTimer
|
||||
static s16 D_801BFBE8 = 0; // sClockInvDiamondTargetIndex
|
||||
static s16 D_801BFBEC[] = { 100, 0 }; // sClockInvDiamondPrimRedTargets
|
||||
static s16 D_801BFBF0[] = { 205, 155 }; // sClockInvDiamondPrimGreenTargets
|
||||
static s16 D_801BFBF4[] = { 255, 255 }; // sClockInvDiamondPrimBlueTargets
|
||||
static s16 D_801BFBF8[] = { 30, 0 }; // sClockInvDiamondEnvRedTargets
|
||||
static s16 D_801BFBFC[] = { 30, 0 }; // sClockInvDiamondEnvGreenTargets
|
||||
static s16 D_801BFC00[] = { 100, 0 }; // sClockInvDiamondEnvBlueTargets
|
||||
static s16 D_801BFC04[] = { 255, 0 }; // sFinalHoursClockDigitsRed
|
||||
static s16 D_801BFC08[] = { 100, 0 }; // sFinalHoursClockFrameEnvRedTargets
|
||||
static s16 D_801BFC0C[] = { 30, 0 }; // sFinalHoursClockFrameEnvGreenTargets
|
||||
static s16 D_801BFC10[] = { 100, 0 }; // sFinalHoursClockFrameEnvBlueTargets
|
||||
static TexturePtr sFinalHoursDigitTextures[] = {
|
||||
gFinalHoursClockDigit0Tex, gFinalHoursClockDigit1Tex, gFinalHoursClockDigit2Tex, gFinalHoursClockDigit3Tex,
|
||||
gFinalHoursClockDigit4Tex, gFinalHoursClockDigit5Tex, gFinalHoursClockDigit6Tex, gFinalHoursClockDigit7Tex,
|
||||
gFinalHoursClockDigit8Tex, gFinalHoursClockDigit9Tex, gFinalHoursClockColonTex,
|
||||
};
|
||||
// sFinalHoursDigitSlotPosXOffset
|
||||
static s16 D_801BFC40[] = {
|
||||
127, 136, 144, 151, 160, 168, 175, 184,
|
||||
};
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
MessageContext* msgCtx = &play->msgCtx;
|
||||
s16 sp1E6;
|
||||
f32 temp_f14;
|
||||
u32 timeUntilMoonCrash;
|
||||
f32 sp1D8;
|
||||
f32 timeInMinutes;
|
||||
f32 timeInSeconds;
|
||||
f32 sp1CC;
|
||||
s32 new_var;
|
||||
s16 sp1C6;
|
||||
s16 currentHour;
|
||||
u16 time;
|
||||
s16 temp;
|
||||
s16 colorStep;
|
||||
s16 finalHoursClockSlots[8]; // sp1AC
|
||||
s16 index;
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
if (R_TIME_SPEED != 0) {
|
||||
if ((msgCtx->msgMode == 0) || ((play->actorCtx.flags & ACTORCTX_FLAG_1) && !Play_InCsMode(play)) ||
|
||||
(msgCtx->msgMode == 0) || ((msgCtx->currentTextId >= 0x100) && (msgCtx->currentTextId <= 0x200)) ||
|
||||
(gSaveContext.gameMode == 3)) {
|
||||
if (!FrameAdvance_IsEnabled(&play->state) && !Environment_IsTimeStopped() && (gSaveContext.save.day < 4)) {
|
||||
/**
|
||||
* Changes Clock's transparancy depending if Player is moving or not and possibly other things
|
||||
*/
|
||||
if (gSaveContext.hudVisibility == HUD_VISIBILITY_ALL) {
|
||||
if (func_801234D4(play)) {
|
||||
sThreeDayClockAlpha = 80;
|
||||
D_801BFB30 = 5;
|
||||
D_801BFB34 = 20;
|
||||
} else if (D_801BFB34 != 0) {
|
||||
D_801BFB34--;
|
||||
} else if (D_801BFB30 != 0) {
|
||||
colorStep = ABS_ALT(sThreeDayClockAlpha - 255) / D_801BFB30;
|
||||
sThreeDayClockAlpha += colorStep;
|
||||
|
||||
if (sThreeDayClockAlpha >= 255) {
|
||||
sThreeDayClockAlpha = 255;
|
||||
D_801BFB30 = 0;
|
||||
}
|
||||
} else {
|
||||
if (play->actorCtx.flags & ACTORCTX_FLAG_1) {
|
||||
sThreeDayClockAlpha = 255;
|
||||
} else {
|
||||
sThreeDayClockAlpha = interfaceCtx->bAlpha;
|
||||
}
|
||||
D_801BFB34 = 0;
|
||||
D_801BFB30 = 0;
|
||||
}
|
||||
} else {
|
||||
if (play->actorCtx.flags & ACTORCTX_FLAG_1) {
|
||||
sThreeDayClockAlpha = 255;
|
||||
} else {
|
||||
sThreeDayClockAlpha = interfaceCtx->bAlpha;
|
||||
}
|
||||
D_801BFB34 = 0;
|
||||
D_801BFB30 = 0;
|
||||
}
|
||||
|
||||
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE)) {
|
||||
|
||||
func_8012C654(play->state.gfxCtx);
|
||||
|
||||
/**
|
||||
* Draw Clock's Hour Lines
|
||||
*/
|
||||
gDPSetAlphaCompare(OVERLAY_DISP++, G_AC_THRESHOLD);
|
||||
gDPSetRenderMode(OVERLAY_DISP++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 130, 130, 130, sThreeDayClockAlpha);
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE,
|
||||
TEXEL0, 0, PRIMITIVE, 0);
|
||||
|
||||
OVERLAY_DISP = Gfx_DrawTexRect4b(OVERLAY_DISP, gThreeDayClockHourLinesTex, 4, 64, 35, 96, 180, 128,
|
||||
35, 1, 6, 0, 1 << 10, 1 << 10);
|
||||
|
||||
/**
|
||||
* Draw Clock's Border
|
||||
*/
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, sThreeDayClockAlpha);
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE,
|
||||
TEXEL0, 0, PRIMITIVE, 0);
|
||||
|
||||
//! @bug A texture height of 50 is given below. The texture is only 48 units height
|
||||
//! resulting in this reading into the next texture. This results in a white
|
||||
//! dot in the bottom center of the clock. For the three-day clock, this is
|
||||
//! covered by the diamond. However, it can be seen by the final-hours clock.
|
||||
OVERLAY_DISP = Gfx_DrawTexRect4b(OVERLAY_DISP, gThreeDayClockBorderTex, 4, 64, 50, 96, 168, 128, 50,
|
||||
1, 6, 0, 1 << 10, 1 << 10);
|
||||
|
||||
if (((CURRENT_DAY >= 4) || ((CURRENT_DAY == 3) && (((void)0, gSaveContext.save.time) >= 5) &&
|
||||
(((void)0, gSaveContext.save.time) < CLOCK_TIME(6, 0))))) {
|
||||
func_8012C8D4(play->state.gfxCtx);
|
||||
gSPMatrix(OVERLAY_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
} else {
|
||||
/**
|
||||
* Draw Three-Day Clock's Diamond
|
||||
*/
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
|
||||
// Time is slowed down to half speed with inverted song of time
|
||||
if (gSaveContext.save.timeSpeedOffset == -2) {
|
||||
// Clock diamond is blue and flashes white
|
||||
colorStep = ABS_ALT(D_801BFBCC - D_801BFBEC[D_801BFBE8]) / D_801BFBE4;
|
||||
if (D_801BFBCC >= D_801BFBEC[D_801BFBE8]) {
|
||||
D_801BFBCC -= colorStep;
|
||||
} else {
|
||||
D_801BFBCC += colorStep;
|
||||
}
|
||||
|
||||
colorStep = ABS_ALT(D_801BFBD0 - D_801BFBF0[D_801BFBE8]) / D_801BFBE4;
|
||||
if (D_801BFBD0 >= D_801BFBF0[D_801BFBE8]) {
|
||||
D_801BFBD0 -= colorStep;
|
||||
} else {
|
||||
D_801BFBD0 += colorStep;
|
||||
}
|
||||
|
||||
colorStep = ABS_ALT(D_801BFBD4 - D_801BFBF4[D_801BFBE8]) / D_801BFBE4;
|
||||
if (D_801BFBD4 >= D_801BFBF4[D_801BFBE8]) {
|
||||
D_801BFBD4 -= colorStep;
|
||||
} else {
|
||||
D_801BFBD4 += colorStep;
|
||||
}
|
||||
|
||||
colorStep = ABS_ALT(D_801BFBD8 - D_801BFBF8[D_801BFBE8]) / D_801BFBE4;
|
||||
if (D_801BFBD8 >= D_801BFBF8[D_801BFBE8]) {
|
||||
D_801BFBD8 -= colorStep;
|
||||
} else {
|
||||
D_801BFBD8 += colorStep;
|
||||
}
|
||||
|
||||
colorStep = ABS_ALT(D_801BFBDC - D_801BFBFC[D_801BFBE8]) / D_801BFBE4;
|
||||
if (D_801BFBDC >= D_801BFBFC[D_801BFBE8]) {
|
||||
D_801BFBDC -= colorStep;
|
||||
} else {
|
||||
D_801BFBDC += colorStep;
|
||||
}
|
||||
|
||||
colorStep = ABS_ALT(D_801BFBE0 - D_801BFC00[D_801BFBE8]) / D_801BFBE4;
|
||||
if (D_801BFBE0 >= D_801BFC00[D_801BFBE8]) {
|
||||
D_801BFBE0 -= colorStep;
|
||||
} else {
|
||||
D_801BFBE0 += colorStep;
|
||||
}
|
||||
|
||||
D_801BFBE4--;
|
||||
|
||||
if (D_801BFBE4 == 0) {
|
||||
D_801BFBCC = D_801BFBEC[D_801BFBE8];
|
||||
D_801BFBD0 = D_801BFBF0[D_801BFBE8];
|
||||
D_801BFBD4 = D_801BFBF4[D_801BFBE8];
|
||||
D_801BFBD8 = D_801BFBF8[D_801BFBE8];
|
||||
D_801BFBDC = D_801BFBFC[D_801BFBE8];
|
||||
D_801BFBE0 = D_801BFC00[D_801BFBE8];
|
||||
D_801BFBE4 = 15;
|
||||
D_801BFBE8 ^= 1;
|
||||
}
|
||||
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0,
|
||||
PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0,
|
||||
PRIMITIVE, 0);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, D_801BFBCC, D_801BFBD0, 255, sThreeDayClockAlpha);
|
||||
gDPSetEnvColor(OVERLAY_DISP++, D_801BFBD8, D_801BFBDC, D_801BFBE0, 0);
|
||||
} else {
|
||||
// Clock diamond is green for regular timeSpeedOffset
|
||||
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 170, 100, sThreeDayClockAlpha);
|
||||
}
|
||||
|
||||
OVERLAY_DISP = Gfx_DrawTexRectIA8(OVERLAY_DISP, gThreeDayClockDiamondTex, 40, 32, 140, 190, 40,
|
||||
32, 1 << 10, 1 << 10);
|
||||
|
||||
/**
|
||||
* Draw Three-Day Clock's Day-Number over Diamond
|
||||
*/
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 155, sThreeDayClockAlpha);
|
||||
|
||||
OVERLAY_DISP = Gfx_DrawTexRectIA8(OVERLAY_DISP, interfaceCtx->doActionSegment + 0x780, 48, 27,
|
||||
137, 192, 48, 27, 1 << 10, 1 << 10);
|
||||
|
||||
/**
|
||||
* Draw Three-Day Clock's Star (for the Minute Tracker)
|
||||
*/
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
|
||||
if (D_801BF974 != 0) {
|
||||
D_801BF980 += 0.02f;
|
||||
D_801BF97C += 11;
|
||||
} else {
|
||||
D_801BF980 -= 0.02f;
|
||||
D_801BF97C -= 11;
|
||||
}
|
||||
|
||||
D_801BF978--;
|
||||
if (D_801BF978 == 0) {
|
||||
D_801BF978 = 10;
|
||||
D_801BF974 ^= 1;
|
||||
}
|
||||
|
||||
timeInSeconds = TIME_TO_SECONDS_F(gSaveContext.save.time);
|
||||
timeInSeconds -= ((s16)(timeInSeconds / 3600.0f)) * 3600.0f;
|
||||
|
||||
func_8012C8D4(play->state.gfxCtx);
|
||||
|
||||
gSPMatrix(OVERLAY_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
if (sThreeDayClockAlpha != 255) {
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 110, sThreeDayClockAlpha);
|
||||
} else {
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 110, D_801BF97C);
|
||||
}
|
||||
|
||||
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
||||
gDPSetAlphaCompare(OVERLAY_DISP++, G_AC_THRESHOLD);
|
||||
gDPSetRenderMode(OVERLAY_DISP++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
|
||||
|
||||
Matrix_Translate(0.0f, -86.0f, 0.0f, MTXMODE_NEW);
|
||||
Matrix_Scale(1.0f, 1.0f, D_801BF980, MTXMODE_APPLY);
|
||||
Matrix_RotateZF(-(timeInSeconds * 0.0175f) / 10.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[12], 4, 0);
|
||||
gDPLoadTextureBlock_4b(OVERLAY_DISP++, gThreeDayClockStarMinuteTex, G_IM_FMT_I, 16, 16, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
gSP1Quadrangle(OVERLAY_DISP++, 0, 2, 3, 1, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cuts off Three-Day Clock's Sun and Moon when they dip below the clock
|
||||
*/
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetScissorFrac(OVERLAY_DISP++, G_SC_NON_INTERLACE, 400, 620, 880,
|
||||
R_THREE_DAY_CLOCK_SUN_MOON_CUTOFF * 4.0f);
|
||||
|
||||
// determines the current hour
|
||||
for (sp1C6 = 0; sp1C6 <= 24; sp1C6++) {
|
||||
if (((void)0, gSaveContext.save.time) < sThreeDayClockHours[sp1C6 + 1]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw Three-Day Clock's Sun (for the Day-Time Hours Tracker)
|
||||
*/
|
||||
time = gSaveContext.save.time;
|
||||
sp1D8 = Math_SinS(time) * -40.0f;
|
||||
temp_f14 = Math_CosS(time) * -34.0f;
|
||||
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 100, 110, sThreeDayClockAlpha);
|
||||
|
||||
Matrix_Translate(sp1D8, temp_f14, 0.0f, MTXMODE_NEW);
|
||||
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[16], 4, 0);
|
||||
|
||||
OVERLAY_DISP = Gfx_DrawTexQuadIA8(OVERLAY_DISP, gThreeDayClockSunHourTex, 24, 24, 0);
|
||||
|
||||
/**
|
||||
* Draw Three-Day Clock's Moon (for the Night-Time Hours Tracker)
|
||||
*/
|
||||
sp1D8 = Math_SinS(time) * 40.0f;
|
||||
temp_f14 = Math_CosS(time) * 34.0f;
|
||||
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 55, sThreeDayClockAlpha);
|
||||
|
||||
Matrix_Translate(sp1D8, temp_f14, 0.0f, MTXMODE_NEW);
|
||||
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[20], 4, 0);
|
||||
|
||||
OVERLAY_DISP = Gfx_DrawTexQuadIA8(OVERLAY_DISP, gThreeDayClockMoonHourTex, 24, 24, 0);
|
||||
|
||||
/**
|
||||
* Cuts off Three-Day Clock's Hour Digits when they dip below the clock
|
||||
*/
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetScissorFrac(OVERLAY_DISP++, G_SC_NON_INTERLACE, 400, 620, 880,
|
||||
R_THREE_DAY_CLOCK_HOUR_DIGIT_CUTOFF * 4.0f);
|
||||
|
||||
/**
|
||||
* Draws Three-Day Clock's Hour Digit Above the Sun
|
||||
*/
|
||||
sp1CC = gSaveContext.save.time * 0.000096131f;
|
||||
|
||||
// Rotates Three-Day Clock's Hour Digit To Above the Sun
|
||||
Matrix_Translate(0.0f, R_THREE_DAY_CLOCK_Y_POS / 10.0f, 0.0f, MTXMODE_NEW);
|
||||
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateZF(-(sp1CC - 3.15f), MTXMODE_APPLY);
|
||||
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
// Draws Three-Day Clock's Hour Digit Above the Sun
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE,
|
||||
TEXEL0, 0, PRIMITIVE, 0);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, sThreeDayClockAlpha);
|
||||
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[24], 8, 0);
|
||||
|
||||
OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTextures[sp1C6], 4, 16, 11, 0);
|
||||
|
||||
// Colours the Three-Day Clocks's Hour Digit Above the Sun
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 155, sThreeDayClockAlpha);
|
||||
gSP1Quadrangle(OVERLAY_DISP++, 4, 6, 7, 5, 0);
|
||||
|
||||
/**
|
||||
* Draws Three-Day Clock's Hour Digit Above the Moon
|
||||
*/
|
||||
// Rotates Three-Day Clock's Hour Digit To Above the Moon
|
||||
Matrix_Translate(0.0f, R_THREE_DAY_CLOCK_Y_POS / 10.0f, 0.0f, MTXMODE_NEW);
|
||||
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateZF(-sp1CC, MTXMODE_APPLY);
|
||||
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
// Draws Three-Day Clock's Hour Digit Above the Moon
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE,
|
||||
TEXEL0, 0, PRIMITIVE, 0);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, sThreeDayClockAlpha);
|
||||
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[32], 8, 0);
|
||||
|
||||
OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTextures[sp1C6], 4, 16, 11, 0);
|
||||
|
||||
// Colours the Three-Day Clocks's Hour Digit Above the Moon
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 155, sThreeDayClockAlpha);
|
||||
gSP1Quadrangle(OVERLAY_DISP++, 4, 6, 7, 5, 0);
|
||||
|
||||
gSPDisplayList(OVERLAY_DISP++, D_0E000000.setScissor);
|
||||
|
||||
// Final Hours
|
||||
if ((CURRENT_DAY >= 4) || ((CURRENT_DAY == 3) && (((void)0, gSaveContext.save.time) >= 5) &&
|
||||
(((void)0, gSaveContext.save.time) < CLOCK_TIME(6, 0)))) {
|
||||
if (((void)0, gSaveContext.save.time) >= CLOCK_TIME(5, 0)) {
|
||||
// The Final Hours clock will flash red
|
||||
|
||||
colorStep =
|
||||
ABS_ALT(sFinalHoursClockDigitsRed - D_801BFC04[sFinalHoursClockColorTargetIndex]) /
|
||||
sFinalHoursClockColorTimer;
|
||||
if (sFinalHoursClockDigitsRed >= D_801BFC04[sFinalHoursClockColorTargetIndex]) {
|
||||
sFinalHoursClockDigitsRed -= colorStep;
|
||||
} else {
|
||||
sFinalHoursClockDigitsRed += colorStep;
|
||||
}
|
||||
|
||||
colorStep =
|
||||
ABS_ALT(sFinalHoursClockFrameEnvRed - D_801BFC08[sFinalHoursClockColorTargetIndex]) /
|
||||
sFinalHoursClockColorTimer;
|
||||
if (sFinalHoursClockFrameEnvRed >= D_801BFC08[sFinalHoursClockColorTargetIndex]) {
|
||||
sFinalHoursClockFrameEnvRed -= colorStep;
|
||||
} else {
|
||||
sFinalHoursClockFrameEnvRed += colorStep;
|
||||
}
|
||||
|
||||
colorStep =
|
||||
ABS_ALT(sFinalHoursClockFrameEnvGreen - D_801BFC0C[sFinalHoursClockColorTargetIndex]) /
|
||||
sFinalHoursClockColorTimer;
|
||||
if (sFinalHoursClockFrameEnvGreen >= D_801BFC0C[sFinalHoursClockColorTargetIndex]) {
|
||||
sFinalHoursClockFrameEnvGreen -= colorStep;
|
||||
} else {
|
||||
sFinalHoursClockFrameEnvGreen += colorStep;
|
||||
}
|
||||
|
||||
colorStep =
|
||||
ABS_ALT(sFinalHoursClockFrameEnvBlue - D_801BFC10[sFinalHoursClockColorTargetIndex]) /
|
||||
sFinalHoursClockColorTimer;
|
||||
if (sFinalHoursClockFrameEnvBlue >= D_801BFC10[sFinalHoursClockColorTargetIndex]) {
|
||||
sFinalHoursClockFrameEnvBlue -= colorStep;
|
||||
} else {
|
||||
sFinalHoursClockFrameEnvBlue += colorStep;
|
||||
}
|
||||
|
||||
sFinalHoursClockColorTimer--;
|
||||
|
||||
if (sFinalHoursClockColorTimer == 0) {
|
||||
sFinalHoursClockDigitsRed = D_801BFC04[sFinalHoursClockColorTargetIndex];
|
||||
sFinalHoursClockFrameEnvRed = D_801BFC08[sFinalHoursClockColorTargetIndex];
|
||||
sFinalHoursClockFrameEnvGreen = D_801BFC0C[sFinalHoursClockColorTargetIndex];
|
||||
sFinalHoursClockFrameEnvBlue = D_801BFC10[sFinalHoursClockColorTargetIndex];
|
||||
sFinalHoursClockColorTimer = 6;
|
||||
sFinalHoursClockColorTargetIndex ^= 1;
|
||||
}
|
||||
}
|
||||
|
||||
sp1E6 = sThreeDayClockAlpha;
|
||||
if (sp1E6 != 0) {
|
||||
sp1E6 = 255;
|
||||
}
|
||||
|
||||
func_8012C654(play->state.gfxCtx);
|
||||
|
||||
/**
|
||||
* Draws Final-Hours Clock's Frame
|
||||
*/
|
||||
gSPMatrix(OVERLAY_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gDPSetAlphaCompare(OVERLAY_DISP++, G_AC_THRESHOLD);
|
||||
gDPSetRenderMode(OVERLAY_DISP++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0,
|
||||
PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0,
|
||||
PRIMITIVE, 0);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 195, sp1E6);
|
||||
gDPSetEnvColor(OVERLAY_DISP++, sFinalHoursClockFrameEnvRed, sFinalHoursClockFrameEnvGreen,
|
||||
sFinalHoursClockFrameEnvBlue, 0);
|
||||
|
||||
OVERLAY_DISP = Gfx_DrawTexRect4b(OVERLAY_DISP, gFinalHoursClockFrameTex, 3, 80, 13, 119, 202,
|
||||
80, 13, 0, 0, 0, 1 << 10, 1 << 10);
|
||||
|
||||
finalHoursClockSlots[0] = 0;
|
||||
|
||||
timeUntilMoonCrash = TIME_UNTIL_MOON_CRASH;
|
||||
|
||||
timeInMinutes = TIME_TO_MINUTES_F(timeUntilMoonCrash);
|
||||
|
||||
// digits for hours
|
||||
finalHoursClockSlots[1] = timeInMinutes / 60.0f;
|
||||
finalHoursClockSlots[2] = timeInMinutes / 60.0f;
|
||||
|
||||
temp = (s32)timeInMinutes % 60;
|
||||
|
||||
while (finalHoursClockSlots[1] >= 10) {
|
||||
finalHoursClockSlots[0]++;
|
||||
finalHoursClockSlots[1] -= 10;
|
||||
}
|
||||
|
||||
// digits for minutes
|
||||
finalHoursClockSlots[3] = 0;
|
||||
finalHoursClockSlots[4] = temp;
|
||||
|
||||
while (finalHoursClockSlots[4] >= 10) {
|
||||
finalHoursClockSlots[3]++;
|
||||
finalHoursClockSlots[4] -= 10;
|
||||
}
|
||||
|
||||
// digits for seconds
|
||||
finalHoursClockSlots[6] = 0;
|
||||
finalHoursClockSlots[7] =
|
||||
timeUntilMoonCrash - (u32)((finalHoursClockSlots[2] * ((f32)0x10000 / 24)) +
|
||||
(((void)0, temp) * ((f32)0x10000 / (24 * 60))));
|
||||
|
||||
while (finalHoursClockSlots[7] >= 10) {
|
||||
finalHoursClockSlots[6]++;
|
||||
finalHoursClockSlots[7] -= 10;
|
||||
}
|
||||
|
||||
// Colon separating hours from minutes and minutes from seconds
|
||||
finalHoursClockSlots[2] = finalHoursClockSlots[5] = 10;
|
||||
|
||||
/**
|
||||
* Draws Final-Hours Clock's Digits
|
||||
*/
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, sFinalHoursClockDigitsRed, 0, 0, sp1E6);
|
||||
gDPSetEnvColor(OVERLAY_DISP++, sFinalHoursClockDigitsRed, 0, 0, 0);
|
||||
|
||||
for (sp1C6 = 0; sp1C6 < 8; sp1C6++) {
|
||||
index = D_801BFC40[sp1C6];
|
||||
|
||||
OVERLAY_DISP =
|
||||
Gfx_DrawTexRectI8(OVERLAY_DISP, sFinalHoursDigitTextures[finalHoursClockSlots[sp1C6]],
|
||||
8, 8, index, 205, 8, 8, 1 << 10, 1 << 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
#else
|
||||
s16 sThreeDayClockAlpha = 255;
|
||||
s16 D_801BFB30 = 0;
|
||||
s16 D_801BFB34 = 0;
|
||||
u16 D_801BFB38[] = {
|
||||
u16 sThreeDayClockHours[] = {
|
||||
CLOCK_TIME(0, 0), CLOCK_TIME(1, 0), CLOCK_TIME(2, 0), CLOCK_TIME(3, 0), CLOCK_TIME(4, 0),
|
||||
CLOCK_TIME(5, 0), CLOCK_TIME(6, 0), CLOCK_TIME(7, 0), CLOCK_TIME(8, 0), CLOCK_TIME(9, 0),
|
||||
CLOCK_TIME(10, 0), CLOCK_TIME(11, 0), CLOCK_TIME(12, 0), CLOCK_TIME(13, 0), CLOCK_TIME(14, 0),
|
||||
CLOCK_TIME(15, 0), CLOCK_TIME(16, 0), CLOCK_TIME(17, 0), CLOCK_TIME(18, 0), CLOCK_TIME(19, 0),
|
||||
CLOCK_TIME(20, 0), CLOCK_TIME(21, 0), CLOCK_TIME(22, 0), CLOCK_TIME(23, 0), CLOCK_TIME(24, 0) - 1,
|
||||
};
|
||||
TexturePtr D_801BFB6C[] = {
|
||||
TexturePtr sThreeDayClockHourTextures[] = {
|
||||
gThreeDayClockHour12Tex, gThreeDayClockHour1Tex, gThreeDayClockHour2Tex, gThreeDayClockHour3Tex,
|
||||
gThreeDayClockHour4Tex, gThreeDayClockHour5Tex, gThreeDayClockHour6Tex, gThreeDayClockHour7Tex,
|
||||
gThreeDayClockHour8Tex, gThreeDayClockHour9Tex, gThreeDayClockHour10Tex, gThreeDayClockHour11Tex,
|
||||
@@ -3124,7 +3678,7 @@ s16 D_801BFC04[] = { 255, 0 };
|
||||
s16 D_801BFC08[] = { 100, 0 };
|
||||
s16 D_801BFC0C[] = { 30, 0 };
|
||||
s16 D_801BFC10[] = { 100, 0 };
|
||||
TexturePtr D_801BFC14[] = {
|
||||
TexturePtr sFinalHoursDigitTextures[] = {
|
||||
gFinalHoursClockDigit0Tex, gFinalHoursClockDigit1Tex, gFinalHoursClockDigit2Tex, gFinalHoursClockDigit3Tex,
|
||||
gFinalHoursClockDigit4Tex, gFinalHoursClockDigit5Tex, gFinalHoursClockDigit6Tex, gFinalHoursClockDigit7Tex,
|
||||
gFinalHoursClockDigit8Tex, gFinalHoursClockDigit9Tex, gFinalHoursClockColonTex,
|
||||
@@ -3132,8 +3686,9 @@ TexturePtr D_801BFC14[] = {
|
||||
s16 D_801BFC40[] = {
|
||||
127, 136, 144, 151, 160, 168, 175, 184,
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80119610.s")
|
||||
void Interface_DrawClock(PlayState* play);
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Interface_DrawClock.s")
|
||||
#endif
|
||||
|
||||
void Interface_SetPerfectLetters(PlayState* play, s16 perfectLettersType) {
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
+13
-12
@@ -378,30 +378,31 @@ void Scene_HeaderCmdSkyboxDisables(PlayState* play, SceneCmd* cmd) {
|
||||
|
||||
// SceneTableEntry Header Command 0x10: Time Settings
|
||||
void Scene_HeaderCmdTimeSettings(PlayState* play, SceneCmd* cmd) {
|
||||
if (cmd->timeSettings.hour != 0xFF && cmd->timeSettings.min != 0xFF) {
|
||||
if ((cmd->timeSettings.hour != 0xFF) && (cmd->timeSettings.min != 0xFF)) {
|
||||
gSaveContext.skyboxTime = gSaveContext.save.time =
|
||||
(u16)(((cmd->timeSettings.hour + (cmd->timeSettings.min / 60.0f)) * 60.0f) / 0.021972656f);
|
||||
CLOCK_TIME_ALT2_F(cmd->timeSettings.hour, cmd->timeSettings.min);
|
||||
}
|
||||
|
||||
if (cmd->timeSettings.unk6 != 0xFF) {
|
||||
play->envCtx.timeIncrement = cmd->timeSettings.unk6;
|
||||
if (cmd->timeSettings.timeSpeed != 0xFF) {
|
||||
play->envCtx.sceneTimeSpeed = cmd->timeSettings.timeSpeed;
|
||||
} else {
|
||||
play->envCtx.timeIncrement = 0;
|
||||
play->envCtx.sceneTimeSpeed = 0;
|
||||
}
|
||||
|
||||
if ((gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) && (play->envCtx.timeIncrement != 0)) {
|
||||
play->envCtx.timeIncrement = 5;
|
||||
// Increase time speed during first cycle
|
||||
if ((gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) && (play->envCtx.sceneTimeSpeed != 0)) {
|
||||
play->envCtx.sceneTimeSpeed = 5;
|
||||
}
|
||||
|
||||
if (gSaveContext.sunsSongState == SUNSSONG_INACTIVE) {
|
||||
REG(15) = play->envCtx.timeIncrement;
|
||||
R_TIME_SPEED = play->envCtx.sceneTimeSpeed;
|
||||
}
|
||||
|
||||
play->envCtx.unk_4 = -(Math_SinS(((void)0, gSaveContext.save.time) - 0x8000) * 120.0f) * 25.0f;
|
||||
play->envCtx.unk_8 = (Math_CosS(((void)0, gSaveContext.save.time) - 0x8000) * 120.0f) * 25.0f;
|
||||
play->envCtx.unk_C = (Math_CosS(((void)0, gSaveContext.save.time) - 0x8000) * 20.0f) * 25.0f;
|
||||
play->envCtx.sunPos.x = -(Math_SinS(((void)0, gSaveContext.save.time) - CLOCK_TIME(12, 0)) * 120.0f) * 25.0f;
|
||||
play->envCtx.sunPos.y = (Math_CosS(((void)0, gSaveContext.save.time) - CLOCK_TIME(12, 0)) * 120.0f) * 25.0f;
|
||||
play->envCtx.sunPos.z = (Math_CosS(((void)0, gSaveContext.save.time) - CLOCK_TIME(12, 0)) * 20.0f) * 25.0f;
|
||||
|
||||
if ((play->envCtx.timeIncrement == 0) && (gSaveContext.save.cutscene < 0xFFF0)) {
|
||||
if ((play->envCtx.sceneTimeSpeed == 0) && (gSaveContext.save.cutscene < 0xFFF0)) {
|
||||
gSaveContext.skyboxTime = gSaveContext.save.time;
|
||||
|
||||
if ((gSaveContext.skyboxTime >= CLOCK_TIME(4, 0)) && (gSaveContext.skyboxTime < CLOCK_TIME(6, 30))) {
|
||||
|
||||
@@ -342,7 +342,7 @@ void Sram_SaveEndOfCycle(PlayState* play) {
|
||||
u8 slot;
|
||||
u8 item;
|
||||
|
||||
gSaveContext.save.daySpeed = 0;
|
||||
gSaveContext.save.timeSpeedOffset = 0;
|
||||
gSaveContext.save.daysElapsed = 0;
|
||||
gSaveContext.save.day = 0;
|
||||
gSaveContext.save.time = CLOCK_TIME(6, 0) - 1;
|
||||
@@ -593,7 +593,7 @@ void Sram_ResetSave(void) {
|
||||
gSaveContext.save.unk_06 = 0;
|
||||
gSaveContext.save.linkAge = 0;
|
||||
gSaveContext.save.isNight = false;
|
||||
gSaveContext.save.daySpeed = 0;
|
||||
gSaveContext.save.timeSpeedOffset = 0;
|
||||
gSaveContext.save.snowheadCleared = 0;
|
||||
gSaveContext.save.hasTatl = false;
|
||||
gSaveContext.save.isOwlSave = false;
|
||||
|
||||
@@ -255,7 +255,7 @@ void func_809542A0(BgIngate* this, PlayState* play) {
|
||||
gSaveContext.nextTransitionType = TRANS_TYPE_03;
|
||||
this->actionFunc = func_80953F8C;
|
||||
CLEAR_WEEKEVENTREG(WEEKEVENTREG_90_40);
|
||||
func_800FE498();
|
||||
Environment_StartTime();
|
||||
}
|
||||
|
||||
void func_80954340(BgIngate* this, PlayState* play) {
|
||||
@@ -264,7 +264,7 @@ void func_80954340(BgIngate* this, PlayState* play) {
|
||||
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_6);
|
||||
this->timePath = &play->setupPathList[this->timePath->unk1];
|
||||
func_80953F14(this, play);
|
||||
func_800FE484();
|
||||
Environment_StopTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -283,7 +283,7 @@ void func_809543D4(BgIngate* this, PlayState* play) {
|
||||
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_6);
|
||||
this->unk160 &= ~0x4;
|
||||
this->actionFunc = func_809541B8;
|
||||
func_800FE498();
|
||||
Environment_StartTime();
|
||||
func_8019F208();
|
||||
} else {
|
||||
if (this->timePath != NULL) {
|
||||
@@ -304,7 +304,7 @@ void func_809543D4(BgIngate* this, PlayState* play) {
|
||||
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_6);
|
||||
this->unk160 &= ~0x4;
|
||||
this->actionFunc = func_809541B8;
|
||||
func_800FE498();
|
||||
Environment_StartTime();
|
||||
func_8019F230();
|
||||
}
|
||||
func_801477B4(play);
|
||||
|
||||
@@ -1154,7 +1154,7 @@ void DmStk_WaitForTelescope(DmStk* this, PlayState* play) {
|
||||
if (play->view.fovy < 25.0f) {
|
||||
if ((screenPos.x >= 70.0f) && (screenPos.x < (SCREEN_WIDTH - 70.0f)) && (screenPos.y >= 30.0f) &&
|
||||
(screenPos.y < (SCREEN_HEIGHT - 30.0f))) {
|
||||
func_800FE484();
|
||||
Environment_StopTime();
|
||||
this->actionFunc = DmStk_StartTelescopeCutscene;
|
||||
}
|
||||
}
|
||||
@@ -1181,7 +1181,7 @@ void DmStk_StartTelescopeCutscene(DmStk* this, PlayState* play) {
|
||||
|
||||
if (ActorCutscene_GetCanPlayNext(cutscene)) {
|
||||
ActorCutscene_Start(cutscene, &this->actor);
|
||||
func_800FE498();
|
||||
Environment_StartTime();
|
||||
this->actionFunc = DmStk_DoNothing;
|
||||
} else {
|
||||
ActorCutscene_SetIntentToPlay(cutscene);
|
||||
@@ -1816,9 +1816,10 @@ void DmStk_Update(Actor* thisx, PlayState* play) {
|
||||
(play->msgCtx.currentTextId == 0x5E6) && !FrameAdvance_IsEnabled(&play->state) &&
|
||||
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (ActorCutscene_GetCurrentIndex() == -1) &&
|
||||
(play->csCtx.state == 0)) {
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)REG(15);
|
||||
if (REG(15) != 0) {
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.daySpeed);
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)R_TIME_SPEED;
|
||||
if (R_TIME_SPEED != 0) {
|
||||
gSaveContext.save.time =
|
||||
((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.timeSpeedOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ void DoorWarp1_Init(Actor* thisx, PlayState* play) {
|
||||
|
||||
if ((play->sceneId == SCENE_MITURIN_BS) || (play->sceneId == SCENE_HAKUGIN_BS) ||
|
||||
(play->sceneId == SCENE_INISIE_BS) || (play->sceneId == SCENE_SEA_BS)) {
|
||||
func_800FE484();
|
||||
Environment_StopTime();
|
||||
play->interfaceCtx.restrictions.unk_312 = 1;
|
||||
play->interfaceCtx.restrictions.songOfSoaring = 1;
|
||||
}
|
||||
|
||||
@@ -748,7 +748,7 @@ void func_80BDF578(EnAl* this, PlayState* play) {
|
||||
void func_80BDF5E8(EnAl* this, PlayState* play) {
|
||||
ScheduleOutput sp20;
|
||||
|
||||
this->unk_4E0 = REG(15) + ((void)0, gSaveContext.save.daySpeed);
|
||||
this->unk_4E0 = R_TIME_SPEED + ((void)0, gSaveContext.save.timeSpeedOffset);
|
||||
if (!Schedule_RunScript(play, D_80BDFC70, &sp20) ||
|
||||
((this->unk_35C != sp20.result) && !func_80BDF390(this, play, &sp20))) {
|
||||
this->actor.shape.shadowDraw = NULL;
|
||||
|
||||
@@ -102,8 +102,8 @@ void func_809C10B0(EnAob01* this, s32 arg1) {
|
||||
}
|
||||
|
||||
void func_809C1124(void) {
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)REG(15);
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.daySpeed);
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)R_TIME_SPEED;
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.timeSpeedOffset);
|
||||
}
|
||||
|
||||
void func_809C1158(EnAob01* this, PlayState* play) {
|
||||
|
||||
@@ -654,7 +654,7 @@ void EnBaba_GaveBlastMask(EnBaba* this, PlayState* play) {
|
||||
void EnBaba_FollowSchedule(EnBaba* this, PlayState* play) {
|
||||
ScheduleOutput scheduleOutput;
|
||||
|
||||
this->timePathTimeSpeed = REG(15) + ((void)0, gSaveContext.save.daySpeed);
|
||||
this->timePathTimeSpeed = R_TIME_SPEED + ((void)0, gSaveContext.save.timeSpeedOffset);
|
||||
|
||||
if (!Schedule_RunScript(play, sSchedule, &scheduleOutput) ||
|
||||
((this->scheduleResult != scheduleOutput.result) &&
|
||||
|
||||
@@ -114,7 +114,7 @@ void func_809CCEE8(EnBji01* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_809CD028(EnBji01* this, PlayState* play) {
|
||||
f32 timeBeforeMoonCrash;
|
||||
f32 timeUntilMoonCrash;
|
||||
|
||||
switch (this->actor.params) {
|
||||
case SHIKASHI_TYPE_DEFAULT:
|
||||
@@ -177,11 +177,8 @@ void func_809CD028(EnBji01* this, PlayState* play) {
|
||||
this->textId = 0x5EA;
|
||||
break;
|
||||
case 3:
|
||||
// Calculates the time left before the moon crashes.
|
||||
// The day begins at CLOCK_TIME(6, 0) so it must be offset.
|
||||
timeBeforeMoonCrash = (4 - CURRENT_DAY) * DAY_LENGTH -
|
||||
(u16)(((void)0, gSaveContext.save.time) - CLOCK_TIME(6, 0));
|
||||
if (timeBeforeMoonCrash < CLOCK_TIME_F(1, 0)) {
|
||||
timeUntilMoonCrash = TIME_UNTIL_MOON_CRASH;
|
||||
if (timeUntilMoonCrash < CLOCK_TIME_F(1, 0)) {
|
||||
this->textId = 0x5E8;
|
||||
} else {
|
||||
this->textId = 0x5EB;
|
||||
|
||||
@@ -846,7 +846,7 @@ void EnFishing_Init(Actor* thisx, PlayState* play2) {
|
||||
|
||||
D_8090CD04 = 20;
|
||||
play->specialEffects = sFishingEffects;
|
||||
REG(15) = 1; // gTimeIncrement in OoT
|
||||
R_TIME_SPEED = 1;
|
||||
D_809171FC = 0;
|
||||
D_809171F6 = 10;
|
||||
|
||||
|
||||
@@ -488,7 +488,7 @@ void func_80B10344(EnGb2* this, PlayState* play) {
|
||||
if (this->unk_280 == 3) {
|
||||
this->unk_26C &= ~0x200;
|
||||
gSaveContext.timerStates[TIMER_ID_MINIGAME_1] = TIMER_STATE_STOP;
|
||||
func_800FE498();
|
||||
Environment_StartTime();
|
||||
SET_EVENTINF(EVENTINF_46);
|
||||
func_80B0FE7C(play);
|
||||
} else if (this->unk_280 == 2) {
|
||||
@@ -892,7 +892,7 @@ void EnGb2_Init(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
if (gSaveContext.save.entrance == ENTRANCE(GHOST_HUT, 1)) {
|
||||
func_800FE484();
|
||||
Environment_StopTime();
|
||||
this->actionFunc = func_80B10240;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1582,7 +1582,7 @@ void func_80950C24(EnGm* this, PlayState* play) {
|
||||
void func_80950CDC(EnGm* this, PlayState* play) {
|
||||
ScheduleOutput sp20;
|
||||
|
||||
this->timePathTimeSpeed = REG(15) + ((void)0, gSaveContext.save.daySpeed);
|
||||
this->timePathTimeSpeed = R_TIME_SPEED + ((void)0, gSaveContext.save.timeSpeedOffset);
|
||||
|
||||
if (!Schedule_RunScript(play, D_80951820, &sp20) ||
|
||||
((this->unk_258 != sp20.result) && !func_80950280(this, play, &sp20))) {
|
||||
|
||||
@@ -140,7 +140,7 @@ s32 func_808F8CCC(EnHorseGameCheck* this, PlayState* play2) {
|
||||
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_FREE0);
|
||||
Play_SetCameraAtEye(play, CAM_ID_MAIN, &mainCamAt, &mainCamEye);
|
||||
Play_SetCameraFov(play, CAM_ID_MAIN, 45.0f);
|
||||
func_800FE484();
|
||||
Environment_StopTime();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -876,7 +876,7 @@ void func_80BF2A50(EnIg* this, PlayState* play) {
|
||||
void func_80BF2AF8(EnIg* this, PlayState* play) {
|
||||
ScheduleOutput sp20;
|
||||
|
||||
this->timePathTimeSpeed = REG(15) + ((void)0, gSaveContext.save.daySpeed);
|
||||
this->timePathTimeSpeed = R_TIME_SPEED + ((void)0, gSaveContext.save.timeSpeedOffset);
|
||||
|
||||
if (!Schedule_RunScript(play, D_80BF3260, &sp20) ||
|
||||
((this->scheduleResult != sp20.result) && !func_80BF2368(this, play, &sp20))) {
|
||||
|
||||
@@ -3016,7 +3016,7 @@ void func_80B49C38(EnInvadepoh* this, PlayState* play) {
|
||||
if (this->unk378 == 0) {
|
||||
temp_v0_2 = func_800FE620(play);
|
||||
if (temp_v0_2 > 0) {
|
||||
temp_v0_2 = (REG(15) * -16.0f / temp_v0_2) - 0.5f;
|
||||
temp_v0_2 = (R_TIME_SPEED * -16.0f / temp_v0_2) - 0.5f;
|
||||
this->unk378 = func_80B45550(this, play, SQ(80.0f), temp_v0_2);
|
||||
}
|
||||
}
|
||||
@@ -3968,7 +3968,7 @@ void func_80B4C730(EnInvadepoh* this, PlayState* play) {
|
||||
if (this->unk378 == 0) {
|
||||
temp_v0_2 = func_800FE620(play);
|
||||
if (temp_v0_2 > 0) {
|
||||
temp_v0_2 = (REG(15) * -23.0f / temp_v0_2) - 0.5f;
|
||||
temp_v0_2 = (R_TIME_SPEED * -23.0f / temp_v0_2) - 0.5f;
|
||||
this->unk378 = func_80B45550(this, play, SQ(80.0f), temp_v0_2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ void func_80BC2150(EnJa* this, PlayState* play) {
|
||||
void func_80BC21A8(EnJa* this, PlayState* play) {
|
||||
ScheduleOutput sp18;
|
||||
|
||||
this->unk_35C = REG(15) + ((void)0, gSaveContext.save.daySpeed);
|
||||
this->unk_35C = R_TIME_SPEED + ((void)0, gSaveContext.save.timeSpeedOffset);
|
||||
if (!Schedule_RunScript(play, D_80BC35F0, &sp18) ||
|
||||
((this->unk_1D8.unk_00 != sp18.result) && !func_80BC20D0(this, play, &sp18))) {
|
||||
this->actor.shape.shadowDraw = NULL;
|
||||
|
||||
@@ -638,7 +638,7 @@ void EnNb_HandleSchedule(EnNb* this, PlayState* play) {
|
||||
void EnNb_FollowSchedule(EnNb* this, PlayState* play) {
|
||||
ScheduleOutput scheduleOutput;
|
||||
|
||||
this->timePathTimeSpeed = REG(15) + ((void)0, gSaveContext.save.daySpeed);
|
||||
this->timePathTimeSpeed = R_TIME_SPEED + ((void)0, gSaveContext.save.timeSpeedOffset);
|
||||
|
||||
if (gSaveContext.eventInf[4] & 8) {
|
||||
scheduleOutput.result = EN_NB_SCH_1;
|
||||
|
||||
@@ -1987,7 +1987,7 @@ void func_80AFA4D0(EnPm* this, PlayState* play) {
|
||||
u16 sp3C = 0;
|
||||
ScheduleOutput sp2C;
|
||||
|
||||
this->timePathTimeSpeed = REG(15) + ((void)0, gSaveContext.save.daySpeed);
|
||||
this->timePathTimeSpeed = R_TIME_SPEED + ((void)0, gSaveContext.save.timeSpeedOffset);
|
||||
if (this->unk_38C != 0) {
|
||||
time = gSaveContext.save.time - D_801F4E78;
|
||||
sp3C = gSaveContext.save.time;
|
||||
|
||||
@@ -231,8 +231,8 @@ void EnSuttari_TriggerTransition(PlayState* play, u16 entrance) {
|
||||
}
|
||||
|
||||
void EnSuttari_UpdateTime(void) {
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)REG(15);
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.daySpeed);
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)R_TIME_SPEED;
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.timeSpeedOffset);
|
||||
}
|
||||
|
||||
s32 func_80BAA904(EnSuttari* this, PlayState* play) {
|
||||
@@ -1104,7 +1104,7 @@ void func_80BACE4C(EnSuttari* this, PlayState* play) {
|
||||
void func_80BACEE0(EnSuttari* this, PlayState* play) {
|
||||
ScheduleOutput scheduleOutput;
|
||||
|
||||
this->timePathTimeSpeed = REG(15) + ((void)0, gSaveContext.save.daySpeed);
|
||||
this->timePathTimeSpeed = R_TIME_SPEED + ((void)0, gSaveContext.save.timeSpeedOffset);
|
||||
if (!Schedule_RunScript(play, D_80BAE820, &scheduleOutput) ||
|
||||
((this->unk428 != scheduleOutput.result) && !func_80BABF64(this, play, &scheduleOutput))) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_1;
|
||||
@@ -1128,7 +1128,7 @@ void func_80BACEE0(EnSuttari* this, PlayState* play) {
|
||||
void func_80BAD004(EnSuttari* this, PlayState* play) {
|
||||
ScheduleOutput scheduleOutput;
|
||||
|
||||
this->timePathTimeSpeed = REG(15) + ((void)0, gSaveContext.save.daySpeed);
|
||||
this->timePathTimeSpeed = R_TIME_SPEED + ((void)0, gSaveContext.save.timeSpeedOffset);
|
||||
if (!Schedule_RunScript(play, D_80BAE820, &scheduleOutput) ||
|
||||
((this->unk428 != scheduleOutput.result) && !func_80BABF64(this, play, &scheduleOutput))) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_1;
|
||||
@@ -1255,7 +1255,7 @@ void func_80BAD5F8(EnSuttari* this, PlayState* play) {
|
||||
this->animIndex = 2;
|
||||
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex);
|
||||
}
|
||||
this->timePathTimeSpeed = REG(15) + ((void)0, gSaveContext.save.daySpeed);
|
||||
this->timePathTimeSpeed = R_TIME_SPEED + ((void)0, gSaveContext.save.timeSpeedOffset);
|
||||
if (!Schedule_RunScript(play, D_80BAE820, &scheduleOutput) ||
|
||||
((this->unk428 != scheduleOutput.result) && !func_80BABF64(this, play, &scheduleOutput))) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_1;
|
||||
@@ -1293,7 +1293,7 @@ void func_80BAD7F8(EnSuttari* this, PlayState* play) {
|
||||
this->animIndex = 2;
|
||||
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex);
|
||||
}
|
||||
this->timePathTimeSpeed = REG(15) + ((void)0, gSaveContext.save.daySpeed);
|
||||
this->timePathTimeSpeed = R_TIME_SPEED + ((void)0, gSaveContext.save.timeSpeedOffset);
|
||||
if (!Schedule_RunScript(play, D_80BAE820, &scheduleOutput) ||
|
||||
((this->unk428 != scheduleOutput.result) && !func_80BABF64(this, play, &scheduleOutput))) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_1;
|
||||
|
||||
@@ -473,7 +473,7 @@ void func_80BE1224(EnTab* this, PlayState* play) {
|
||||
void func_80BE127C(EnTab* this, PlayState* play) {
|
||||
ScheduleOutput sp18;
|
||||
|
||||
this->unk_31A = REG(15) + ((void)0, gSaveContext.save.daySpeed);
|
||||
this->unk_31A = R_TIME_SPEED + ((void)0, gSaveContext.save.timeSpeedOffset);
|
||||
|
||||
if (!Schedule_RunScript(play, D_80BE18D0, &sp18) ||
|
||||
((this->unk_1D8 != sp18.result) && !func_80BE1060(this, play, &sp18))) {
|
||||
|
||||
@@ -507,7 +507,7 @@ void EnTest3_Destroy(Actor* thisx, PlayState* play2) {
|
||||
Collider_DestroyQuad(play, &this->player.meleeWeaponQuads[1]);
|
||||
Collider_DestroyQuad(play, &this->player.shieldQuad);
|
||||
ZeldaArena_Free(this->player.maskObjectSegment);
|
||||
func_800FE498();
|
||||
Environment_StartTime();
|
||||
}
|
||||
|
||||
s32 func_80A3F080(EnTest3* this, PlayState* play, struct_80A41828* arg2, ScheduleOutput* scheduleOutput) {
|
||||
@@ -764,7 +764,7 @@ s32 func_80A3FBE8(EnTest3* this, PlayState* play) {
|
||||
if (this->unk_D8D >= 0) {
|
||||
if (func_80A3E9DC(this, play)) {
|
||||
this->unk_D8D = -1;
|
||||
func_800FE484();
|
||||
Environment_StopTime();
|
||||
}
|
||||
} else if ((play->actorCtx.flags & ACTORCTX_FLAG_6) || (play->actorCtx.flags & ACTORCTX_FLAG_5)) {
|
||||
this->unk_D8D = ActorCutscene_GetAdditionalCutscene(this->player.actor.cutscene);
|
||||
@@ -779,9 +779,9 @@ s32 func_80A3FBE8(EnTest3* this, PlayState* play) {
|
||||
}
|
||||
} else if ((D_80A41D20 == 2) && func_80A3E9DC(this, play)) {
|
||||
ActorCutscene_SetReturnCamera(CAM_ID_MAIN);
|
||||
func_800FE498();
|
||||
if (gSaveContext.save.time > CLOCK_TIME(6, 0)) {
|
||||
func_800FE658(TIME_TO_MINUTES_ALT_F(fabsf((s16)-gSaveContext.save.time)));
|
||||
Environment_StartTime();
|
||||
if (((void)0, gSaveContext.save.time) > CLOCK_TIME(6, 0)) {
|
||||
func_800FE658(TIME_TO_MINUTES_ALT_F(fabsf((s16) - ((void)0, gSaveContext.save.time))));
|
||||
}
|
||||
if (play->actorCtx.flags & ACTORCTX_FLAG_6) {
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_51_20);
|
||||
@@ -967,7 +967,7 @@ void func_80A40678(EnTest3* this, PlayState* play) {
|
||||
|
||||
this->unk_D80 = ((this->unk_D88 == 20) || (this->unk_D88 == 10) || (this->unk_D88 == 9)) ? 3
|
||||
: Play_InCsMode(play) ? 0
|
||||
: REG(15) + ((void)0, gSaveContext.save.daySpeed);
|
||||
: R_TIME_SPEED + ((void)0, gSaveContext.save.timeSpeedOffset);
|
||||
|
||||
if (Schedule_RunScript(play, sScheduleScript, &scheduleOutput)) {
|
||||
if (this->unk_D88 != scheduleOutput.result) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* File: z_en_test4.c
|
||||
* Overlay: ovl_En_Test4
|
||||
* Description: Three-Day Timer
|
||||
* Description: Three-Day Events
|
||||
*/
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
@@ -59,7 +59,7 @@ void func_80A41D70(EnTest4* this, PlayState* play) {
|
||||
this->unk_146 = gSaveContext.save.time += CLOCK_TIME_MINUTE;
|
||||
}
|
||||
|
||||
func_8010EE74(play, CURRENT_DAY);
|
||||
Interface_NewDay(play, CURRENT_DAY);
|
||||
D_801BDBC8 = 0xFE;
|
||||
func_800FB758(play);
|
||||
func_800FEAF4(&play->envCtx);
|
||||
@@ -95,7 +95,7 @@ void func_80A41FA4(EnTest4* this, PlayState* play) {
|
||||
} else if ((sCutscenes[this->unk_144] < 0) || (play->actorCtx.flags & ACTORCTX_FLAG_1)) {
|
||||
Sram_IncrementDay();
|
||||
gSaveContext.save.time = CLOCK_TIME(6, 0);
|
||||
func_8010EE74(play, CURRENT_DAY);
|
||||
Interface_NewDay(play, CURRENT_DAY);
|
||||
func_80151A68(play, sDayMessages2[CURRENT_DAY - 1]);
|
||||
D_801BDBC8 = 0xFE;
|
||||
func_800FB758(play);
|
||||
|
||||
@@ -323,8 +323,8 @@ void func_80AECB6C(EnTk* this, PlayState* play) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (REG(15) != 0.0f) {
|
||||
this->skelAnime.playSpeed = (f32)func_800FE620(play) / REG(15);
|
||||
if (R_TIME_SPEED != 0.0f) {
|
||||
this->skelAnime.playSpeed = (f32)func_800FE620(play) / R_TIME_SPEED;
|
||||
} else {
|
||||
this->skelAnime.playSpeed = 0.0f;
|
||||
}
|
||||
@@ -337,14 +337,14 @@ void func_80AECB6C(EnTk* this, PlayState* play) {
|
||||
func_80AEC658(&this->skelAnime, this->unk_320, 1.0f, &sp48, &sp44);
|
||||
}
|
||||
|
||||
temp2 = REG(15) * sp44;
|
||||
temp2 = R_TIME_SPEED * sp44;
|
||||
temp_f0 = temp2;
|
||||
|
||||
this->unk_2DC += (REG(15) * sp44) - temp2;
|
||||
this->unk_2DC += (R_TIME_SPEED * sp44) - temp2;
|
||||
temp3 = this->unk_2DC;
|
||||
this->timePathTimeSpeed = temp2 + temp3;
|
||||
this->unk_2DC -= temp3;
|
||||
this->unk_2E0 += REG(15);
|
||||
this->unk_2E0 += R_TIME_SPEED;
|
||||
|
||||
if (Schedule_RunScript(play, D_80AEF800, &sp34)) {
|
||||
if ((this->unk_3CC != sp34.result) && !func_80AED354(this, play, &sp34)) {
|
||||
|
||||
@@ -486,9 +486,10 @@ void EnWeatherTag_Update(Actor* thisx, PlayState* play) {
|
||||
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (ActorCutscene_GetCurrentIndex() == -1) &&
|
||||
(play->csCtx.state == 0)) {
|
||||
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)REG(15);
|
||||
if (REG(15) != 0) {
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.daySpeed);
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)R_TIME_SPEED;
|
||||
if (R_TIME_SPEED != 0) {
|
||||
gSaveContext.save.time =
|
||||
((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.timeSpeedOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -698,7 +698,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) {
|
||||
sp54 = false;
|
||||
this->flags |= OBJ_UM_FLAG_0100;
|
||||
ObjUm_SetupAction(this, func_80B7A144);
|
||||
func_800FE484();
|
||||
Environment_StopTime();
|
||||
} else {
|
||||
// Waiting for player
|
||||
|
||||
@@ -722,7 +722,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) {
|
||||
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_52_02)) {
|
||||
this->pathIndex = this->initialPathIndex;
|
||||
sp54 = false;
|
||||
func_800FE484();
|
||||
Environment_StopTime();
|
||||
ObjUm_SetupAction(this, ObjUm_PreMilkRunStartCs);
|
||||
this->unk_354 = 0;
|
||||
ObjUm_RotatePlayer(this, play, 0);
|
||||
@@ -735,7 +735,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) {
|
||||
|
||||
this->pathIndex = this->initialPathIndex;
|
||||
sp54 = false;
|
||||
func_800FE484();
|
||||
Environment_StopTime();
|
||||
ObjUm_SetupAction(this, ObjUm_StartCs);
|
||||
this->unk_354 = 0;
|
||||
ObjUm_RotatePlayer(this, play, 0);
|
||||
@@ -747,7 +747,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) {
|
||||
|
||||
this->pathIndex = this->initialPathIndex;
|
||||
sp54 = false;
|
||||
func_800FE484();
|
||||
Environment_StopTime();
|
||||
ObjUm_SetupAction(this, ObjUm_PostMilkRunStartCs);
|
||||
this->unk_354 = 0;
|
||||
ObjUm_RotatePlayer(this, play, 0);
|
||||
|
||||
@@ -80,7 +80,7 @@ void OceffSpot_End(OceffSpot* this, PlayState* play) {
|
||||
this->unk16C -= 0.05f;
|
||||
} else {
|
||||
Actor_Kill(&this->actor);
|
||||
if ((REG(15) != 0x190) && (play->msgCtx.unk12046 == 0)) {
|
||||
if ((R_TIME_SPEED != 400) && (play->msgCtx.unk12046 == 0)) {
|
||||
if ((play->msgCtx.ocarinaAction != 0x39) || (play->msgCtx.ocarinaMode != 0xA)) {
|
||||
gSaveContext.sunsSongState = SUNSSONG_START;
|
||||
}
|
||||
|
||||
@@ -170,10 +170,10 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, PlayState* play) {
|
||||
|
||||
if (!(this->actor.xzDistToPlayer > 120.0f)) {
|
||||
if ((gSaveContext.save.time >= CLOCK_TIME(6, 30)) && (gSaveContext.save.time < CLOCK_TIME(7, 30))) {
|
||||
cylinderPos.x = player->bodyPartsPos[PLAYER_BODYPART_HEAD].x + (play->envCtx.unk_4 * (1.0f / 6.0f));
|
||||
cylinderPos.x = player->bodyPartsPos[PLAYER_BODYPART_HEAD].x + (play->envCtx.sunPos.x * (1.0f / 6.0f));
|
||||
cylinderPos.y =
|
||||
(player->bodyPartsPos[PLAYER_BODYPART_HEAD].y - 30.0f) + (play->envCtx.unk_8 * (1.0f / 6.0f));
|
||||
cylinderPos.z = player->bodyPartsPos[PLAYER_BODYPART_HEAD].z + (play->envCtx.unk_C * (1.0f / 6.0f));
|
||||
(player->bodyPartsPos[PLAYER_BODYPART_HEAD].y - 30.0f) + (play->envCtx.sunPos.y * (1.0f / 6.0f));
|
||||
cylinderPos.z = player->bodyPartsPos[PLAYER_BODYPART_HEAD].z + (play->envCtx.sunPos.z * (1.0f / 6.0f));
|
||||
|
||||
this->hitboxPos = cylinderPos;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user