sync to PRs

This commit is contained in:
engineer124
2022-11-20 13:35:22 -05:00
parent c74e89857d
commit 10b0755676
34 changed files with 942 additions and 954 deletions
+7 -7
View File
@@ -119,13 +119,13 @@
<Texture Name="gMinigameCountdown3Tex" OutName="minigame_countdown_3" Format="ia8" Width="24" Height="32" Offset="0x7828"/>
<!-- The letters of "PERFECT!" -->
<Texture Name="gMinigameLetterPTex" OutName="minigame_letter_p" Format="i4" Width="32" Height="33" Offset="0x7B28"/>
<Texture Name="gMinigameLetterETex" OutName="minigame_letter_e" Format="i4" Width="32" Height="33" Offset="0x7D38"/>
<Texture Name="gMinigameLetterRTex" OutName="minigame_letter_r" Format="i4" Width="32" Height="33" Offset="0x7F48"/>
<Texture Name="gMinigameLetterFTex" OutName="minigame_letter_f" Format="i4" Width="32" Height="33" Offset="0x8158"/>
<Texture Name="gMinigameLetterCTex" OutName="minigame_letter_c" Format="i4" Width="32" Height="33" Offset="0x8368"/>
<Texture Name="gMinigameLetterTTex" OutName="minigame_letter_t" Format="i4" Width="32" Height="33" Offset="0x8578"/>
<Texture Name="gMinigameExclamationTex" OutName="minigame_exclamation" Format="i4" Width="32" Height="33" Offset="0x8788"/>
<Texture Name="gPerfectLetterPTex" OutName="letter_perfect_p" Format="i4" Width="32" Height="33" Offset="0x7B28"/>
<Texture Name="gPerfectLetterETex" OutName="letter_perfect_e" Format="i4" Width="32" Height="33" Offset="0x7D38"/>
<Texture Name="gPerfectLetterRTex" OutName="letter_perfect_r" Format="i4" Width="32" Height="33" Offset="0x7F48"/>
<Texture Name="gPerfectLetterFTex" OutName="letter_perfect_f" Format="i4" Width="32" Height="33" Offset="0x8158"/>
<Texture Name="gPerfectLetterCTex" OutName="letter_perfect_c" Format="i4" Width="32" Height="33" Offset="0x8368"/>
<Texture Name="gPerfectLetterTTex" OutName="letter_perfect_t" Format="i4" Width="32" Height="33" Offset="0x8578"/>
<Texture Name="gPerfectLetterExclamationTex" OutName="letter_perfect_exclamation" Format="i4" Width="32" Height="33" Offset="0x8788"/>
<!-- Similar to stray fairy icons in icon_item_dungeon_static, except with a turned head -->
<Texture Name="gStrayFairyWoodfallIconTex" OutName="stray_fairy_woodfall_icon" Format="rgba32" Width="32" Height="24" Offset="0x8998"/>
+4 -4
View File
@@ -1383,9 +1383,9 @@ void func_800FD928(s32 param_1);
// void func_800FDC94(void);
// void func_800FE390(void);
// void func_800FE3E0(void);
void func_800FE484(void);
void func_800FE498(void);
u8 func_800FE4A8(void);
void Environment_StopTime(void);
void Environment_StartTime(void);
u8 Environment_IsTimeStopped(void);
u32 func_800FE4B8(PlayState* play);
// void func_800FE590(void);
// void func_800FE5D0(void);
@@ -1737,7 +1737,7 @@ void Inventory_ChangeAmmo(s16 item, s16 ammoChange);
void Magic_Add(PlayState* play, s16 magicToAdd);
void Magic_Reset(PlayState* play);
s32 Magic_Consume(PlayState* play, s16 magicToConsume, s16 type);
void Interface_SetMinigamePerfect(PlayState* play, s16 minigamePerfectType);
void Interface_SetPerfectLetters(PlayState* play, s16 perfectLettersType);
void Interface_StartMoonCrash(PlayState* play);
void Interface_Draw(PlayState* play);
void Interface_Update(PlayState* play);
+5 -2
View File
@@ -48,10 +48,13 @@
#define DAY_LENGTH (CLOCK_TIME(24, 0))
#define TIME_TO_MINUTES_F(time) ((time) * ((24.0f * 60.0f) / 0x10000)) // 0.021972656f
#define CLOCK_TIME_F(hr, min) (((hr) * 60.0f + (min)) * (0x10000 / (24.0f * 60.0f)))
#define TIME_TO_MINUTES_ALT_F(time) ((time) / (0x10000 / (24.0f * 60.0f)))
#define TIME_TO_SECONDS_F(time) ((time) * ((24.0f * 60.0f * 60.0f) / 0x10000))
#define CLOCK_TIME_F(hr, min) (((hr) * 60.0f + (min)) * (0x10000 / (24.0f * 60.0f)))
#define CLOCK_TIME_ALT_F(hr, min) (((hr) * 60.0f + (min)) / (24.0f * 60.0f / 0x10000))
#define CLOCK_TIME_ALT2_F(hr, min) ((((hr) + (min) / 60.0f) * 60.0f) / (24.0f * 60.0f / 0x10000))
#define CAPACITY(upg, value) gUpgradeCapacities[upg][value]
#define CUR_CAPACITY(upg) CAPACITY(upg, CUR_UPG_VALUE(upg))
+9 -9
View File
@@ -737,17 +737,17 @@ extern UNK_PTR D_801BF5C0;
// extern UNK_TYPE1 D_801BFC10;
// extern UNK_TYPE1 sFinalHoursDigitTextures;
// extern UNK_TYPE1 D_801BFC40;
// extern UNK_TYPE2 sMinigamePerfectType1AngleOffScreenTargets;
// extern UNK_TYPE2 sMinigamePerfectType1PrimColorTargets;
// extern UNK_TYPE2 sPerfectLettersType1OffScreenAngles;
// extern UNK_TYPE2 sPerfectLettersType1PrimColorTargets;
// extern UNK_TYPE2 D_801BFC62;
// extern UNK_TYPE2 D_801BFC64;
// extern UNK_TYPE2 sMinigamePerfectType2LetterXOffsetSpellingTargets;
// extern UNK_TYPE2 sMinigamePerfectType2LetterXOffsetOffScreenTargets;
// extern UNK_TYPE1 sMinigamePerfectType2PrimColorTargets;
// extern UNK_TYPE2 sMinigamePerfectType3LetterXOffsetSpellingTargets;
// extern UNK_TYPE2 sMinigamePerfectType3AngleOffScreenTargets;
// extern UNK_TYPE1 sMinigamePerfectType3PrimColorTargets;
// extern UNK_TYPE4 sMinigamePerfectTextures;
// extern UNK_TYPE2 sPerfectLettersType2SpellingOffsetsX;
// extern UNK_TYPE2 sPerfectLettersType2OffScreenOffsetsX;
// extern UNK_TYPE1 sPerfectLettersType2PrimColorTargets;
// extern UNK_TYPE2 sPerfectLettersType3SpellingOffsetsX;
// extern UNK_TYPE2 sPerfectLettersType3OffScreenAngles;
// extern UNK_TYPE1 sPerfectLettersType3PrimColorTargets;
// extern UNK_TYPE4 sPerfectLettersTextures;
// extern UNK_TYPE2 sTimerStateTimer;
// extern UNK_TYPE2 sTimerDigits;
// extern UNK_TYPE2 D_801BFCEA;
+26 -26
View File
@@ -74,24 +74,24 @@ typedef enum {
} MinigameState;
typedef enum {
/* 0 */ MINIGAME_PERFECT_TYPE_OFF,
/* 1 */ MINIGAME_PERFECT_TYPE_1,
/* 2 */ MINIGAME_PERFECT_TYPE_2,
/* 3 */ MINIGAME_PERFECT_TYPE_3
/* 0 */ PERFECT_LETTERS_TYPE_OFF,
/* 1 */ PERFECT_LETTERS_TYPE_1,
/* 2 */ PERFECT_LETTERS_TYPE_2,
/* 3 */ PERFECT_LETTERS_TYPE_3
} MinigamePerfectType;
typedef enum {
/* 0 */ MINIGAME_PERFECT_STATE_OFF,
/* 1 */ MINIGAME_PERFECT_STATE_INIT,
/* 2 */ MINIGAME_PERFECT_STATE_ENTER,
/* 3 */ MINIGAME_PERFECT_STATE_STATIONARY, // Display for type 1
/* 4 */ MINIGAME_PERFECT_STATE_SPREAD, // Exit for type 1
/* 5 */ MINIGAME_PERFECT_STATE_DISPLAY,
/* 6 */ MINIGAME_PERFECT_STATE_EXIT
/* 0 */ PERFECT_LETTERS_STATE_OFF,
/* 1 */ PERFECT_LETTERS_STATE_INIT,
/* 2 */ PERFECT_LETTERS_STATE_ENTER,
/* 3 */ PERFECT_LETTERS_STATE_STATIONARY, // Display for type 1
/* 4 */ PERFECT_LETTERS_STATE_SPREAD, // Exit for type 1
/* 5 */ PERFECT_LETTERS_STATE_DISPLAY,
/* 6 */ PERFECT_LETTERS_STATE_EXIT
} MinigamePerfectState;
#define MINIGAME_PERFECT_NUM_LETTERS 8
#define MINIGAME_PERFECT_ANGLE_PER_LETTER (0x10000 / MINIGAME_PERFECT_NUM_LETTERS)
#define PERFECT_LETTERS_NUM_LETTERS 8
#define PERFECT_LETTERS_ANGLE_PER_LETTER (0x10000 / PERFECT_LETTERS_NUM_LETTERS)
typedef enum {
/* 0 */ STORY_DMA_IDLE,
@@ -177,19 +177,19 @@ typedef struct {
/* 0x280 */ u8 minigameState;
/* 0x282 */ s16 minigameCountdownAlpha;
/* 0x284 */ s16 minigameCountdownScale;
/* 0x286 */ s16 isMinigamePerfect;
/* 0x288 */ s16 minigamePerfectType;
/* 0x28A */ s16 minigamePerfectState[MINIGAME_PERFECT_NUM_LETTERS];
/* 0x29A */ u16 minigamePerfectLetterEllipseAngle[MINIGAME_PERFECT_NUM_LETTERS];
/* 0x2AA */ s16 minigamePerfectLetterXOffset[MINIGAME_PERFECT_NUM_LETTERS];
/* 0x2BC */ f32 minigamePerfectLetterEllipseRadiusX[MINIGAME_PERFECT_NUM_LETTERS];
/* 0x2DC */ f32 minigamePerfectLetterEllipseRadiusY[MINIGAME_PERFECT_NUM_LETTERS];
/* 0x2FC */ s16 minigamePerfectPrimColor[4];
/* 0x304 */ s16 minigamePerfectLetterCount;
/* 0x306 */ s16 minigamePerfectUnused;
/* 0x308 */ s16 minigamePerfectColorTargetIndex;
/* 0x30A */ s16 minigamePerfectColorTimer;
/* 0x30C */ s16 minigamePerfectTimer;
/* 0x286 */ s16 perfectLettersOn;
/* 0x288 */ s16 perfectLettersType;
/* 0x28A */ s16 perfectLettersState[PERFECT_LETTERS_NUM_LETTERS];
/* 0x29A */ u16 perfectLettersAngles[PERFECT_LETTERS_NUM_LETTERS]; // Angle that follows the projectory of an ellipse
/* 0x2AA */ s16 perfectLettersOffsetX[PERFECT_LETTERS_NUM_LETTERS];
/* 0x2BC */ f32 perfectLettersSemiAxisX[PERFECT_LETTERS_NUM_LETTERS];
/* 0x2DC */ f32 perfectLettersSemiAxisY[PERFECT_LETTERS_NUM_LETTERS];
/* 0x2FC */ s16 perfectLettersPrimColor[4];
/* 0x304 */ s16 perfectLettersCount;
/* 0x306 */ s16 perfectLettersUnused;
/* 0x308 */ s16 perfectLettersColorIndex;
/* 0x30A */ s16 perfectLettersColorTimer;
/* 0x30C */ s16 perfectLettersTimer;
struct {
/* 0x30E */ u8 hGauge;
/* 0x30F */ u8 bButton;
+6 -1
View File
@@ -258,7 +258,7 @@ typedef struct Save {
/* 0x000C */ u16 time; // "zelda_time"
/* 0x000E */ u16 owlSaveLocation;
/* 0x0010 */ s32 isNight; // "asahiru_fg"
/* 0x0014 */ s32 daySpeed; // "change_zelda_time"
/* 0x0014 */ s32 timeSpeedOffset; // "change_zelda_time"
/* 0x0018 */ s32 day; // "totalday"
/* 0x001C */ s32 daysElapsed; // "eventday"
/* 0x0020 */ u8 playerForm; // "player_character"
@@ -409,6 +409,11 @@ typedef enum SunsSongState {
#define CURRENT_DAY (((void)0, gSaveContext.save.day) % 5)
// The day begins at CLOCK_TIME(6, 0) so it must be offset.
#define TIME_UNTIL_MOON_CRASH \
((4 - CURRENT_DAY) * DAY_LENGTH - (u16)(((void)0, gSaveContext.save.time) - CLOCK_TIME(6, 0)));
#define TIME_UNTIL_NEW_DAY (DAY_LENGTH - (u16)(((void)0, gSaveContext.save.time) - CLOCK_TIME(6, 0)));
#define GET_PLAYER_FORM ((void)0, gSaveContext.save.playerForm)
#define SLOT(item) gItemSlots[item]
+1 -1
View File
@@ -329,7 +329,7 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c
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
View File
@@ -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")
+811 -833
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -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);
+4 -3
View File
@@ -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);
@@ -1818,7 +1818,8 @@ void DmStk_Update(Actor* thisx, PlayState* play) {
(play->csCtx.state == 0)) {
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.daySpeed);
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;
}
+1 -1
View File
@@ -748,7 +748,7 @@ void func_80BDF578(EnAl* this, PlayState* play) {
void func_80BDF5E8(EnAl* this, PlayState* play) {
ScheduleOutput sp20;
this->unk_4E0 = R_TIME_SPEED + ((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;
@@ -103,7 +103,7 @@ void func_809C10B0(EnAob01* this, s32 arg1) {
void func_809C1124(void) {
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);
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.timeSpeedOffset);
}
void func_809C1158(EnAob01* this, PlayState* play) {
+1 -1
View File
@@ -654,7 +654,7 @@ void EnBaba_GaveBlastMask(EnBaba* this, PlayState* play) {
void EnBaba_FollowSchedule(EnBaba* this, PlayState* play) {
ScheduleOutput scheduleOutput;
this->timePathTimeSpeed = R_TIME_SPEED + ((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) &&
+2 -2
View File
@@ -800,7 +800,7 @@ void func_80962F4C(EnFu* this, PlayState* play) {
gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] = SECONDS_TO_TIMER(0);
gSaveContext.timerStates[TIMER_ID_MINIGAME_2] = TIMER_STATE_STOP;
Audio_PlayFanfare(NA_BGM_GET_ITEM | 0x900);
Interface_SetMinigamePerfect(play, MINIGAME_PERFECT_TYPE_1);
Interface_SetPerfectLetters(play, PERFECT_LETTERS_TYPE_1);
this->unk_54A = 3;
func_809632D0(this);
}
@@ -848,7 +848,7 @@ void func_80963350(EnFu* this, PlayState* play) {
D_80964C24 = 1;
}
if ((this->unk_54A == 3) && !play->interfaceCtx.isMinigamePerfect) {
if ((this->unk_54A == 3) && !play->interfaceCtx.perfectLettersOn) {
this->unk_54A = 2;
D_80964C24 = 1;
}
+2 -2
View File
@@ -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;
}
+1 -1
View File
@@ -1582,7 +1582,7 @@ void func_80950C24(EnGm* this, PlayState* play) {
void func_80950CDC(EnGm* this, PlayState* play) {
ScheduleOutput sp20;
this->timePathTimeSpeed = R_TIME_SPEED + ((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;
}

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