From 5284302c8fcd7a708e427968b4737d7659d1fb44 Mon Sep 17 00:00:00 2001
From: engineer124 <47598039+engineer124@users.noreply.github.com>
Date: Mon, 27 Nov 2023 21:21:52 +1100
Subject: [PATCH] `z_en_test7.c` Documentation Pass (#1497)
* copy over docs
* more docs
* some docs
* more docs
* small cleanup
* more small cleanup
* more small cleanup
* lerp time
* small reordering
* feather type
* general owl warp docs
* more cleanup
* rm redundant info
* PR Review
* PR Review
---
assets/xml/objects/gameplay_keep.xml | 18 +-
include/regs.h | 2 +-
include/z64player.h | 33 +-
include/z64save.h | 9 +-
include/z64scene.h | 31 +-
src/audio/session_config.c | 32 +-
src/code/title_setup.c | 2 +-
src/code/z_kaleido_scope_call.c | 4 +-
src/code/z_message.c | 4 +-
src/code/z_scene.c | 1 +
src/code/z_sram_NES.c | 34 +-
src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c | 32 +-
src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.h | 2 +-
src/overlays/actors/ovl_En_Dns/z_en_dns.c | 8 +-
src/overlays/actors/ovl_En_Go/z_en_go.c | 18 +-
src/overlays/actors/ovl_En_Go/z_en_go.h | 4 +-
src/overlays/actors/ovl_En_Test7/z_en_test7.c | 935 +++++++++---------
src/overlays/actors/ovl_En_Test7/z_en_test7.h | 80 +-
.../ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.c | 30 +-
.../ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.h | 2 +-
.../ovl_Obj_Warpstone/z_obj_warpstone.c | 6 +-
.../ovl_Obj_Warpstone/z_obj_warpstone.h | 3 +-
.../actors/ovl_player_actor/z_player.c | 43 +-
.../ovl_kaleido_scope/z_kaleido_map.c | 8 +-
.../ovl_kaleido_scope/z_kaleido_scope.h | 18 +-
.../ovl_kaleido_scope/z_kaleido_scope_NES.c | 62 +-
tools/disasm/functions.txt | 66 +-
tools/disasm/variables.txt | 18 +-
28 files changed, 765 insertions(+), 740 deletions(-)
diff --git a/assets/xml/objects/gameplay_keep.xml b/assets/xml/objects/gameplay_keep.xml
index 81d39a0e23..bb3f966706 100644
--- a/assets/xml/objects/gameplay_keep.xml
+++ b/assets/xml/objects/gameplay_keep.xml
@@ -1442,16 +1442,16 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
@@ -1483,7 +1483,7 @@
-
+
diff --git a/include/regs.h b/include/regs.h
index 354408378e..bc518e6ba8 100644
--- a/include/regs.h
+++ b/include/regs.h
@@ -144,7 +144,7 @@ extern RegEditor* gRegEditor;
#define R_PAUSE_DBG_MAP_CLOUD_Y XREG(53)
#define R_MOON_CRASH_TIMER_Y XREG(80)
#define R_MOON_CRASH_TIMER_X XREG(81)
-#define R_PAUSE_OWLWARP_ALPHA XREG(87)
+#define R_PAUSE_OWL_WARP_ALPHA XREG(87)
#define R_STORY_FILL_SCREEN_ALPHA XREG(91)
#define R_REVERSE_FLOOR_INDEX XREG(94)
#define R_MINIMAP_DISABLED XREG(95)
diff --git a/include/z64player.h b/include/z64player.h
index 8a09e13957..eaeef83b46 100644
--- a/include/z64player.h
+++ b/include/z64player.h
@@ -1059,22 +1059,23 @@ typedef enum PlayerCueId {
#define PLAYER_GET_INITMODE(thisx) (((thisx)->params & 0xF00) >> 8)
typedef enum PlayerInitMode {
- /* 0x0 */ PLAYER_INITMODE_0,
- /* 0x1 */ PLAYER_INITMODE_1, // Spawning after pulling/putting-back Master sword // OoT leftover
- /* 0x2 */ PLAYER_INITMODE_2,
- /* 0x3 */ PLAYER_INITMODE_3,
- /* 0x4 */ PLAYER_INITMODE_4,
- /* 0x5 */ PLAYER_INITMODE_5,
- /* 0x6 */ PLAYER_INITMODE_6,
- /* 0x7 */ PLAYER_INITMODE_7,
- /* 0x8 */ PLAYER_INITMODE_8,
- /* 0x9 */ PLAYER_INITMODE_9,
- /* 0xA */ PLAYER_INITMODE_A,
- /* 0xB */ PLAYER_INITMODE_B,
- /* 0xC */ PLAYER_INITMODE_TELESCOPE,
- /* 0xD */ PLAYER_INITMODE_D,
- /* 0xE */ PLAYER_INITMODE_E,
- /* 0xF */ PLAYER_INITMODE_F
+ /* 0x0 */ PLAYER_INITMODE_0,
+ /* 0x1 */ PLAYER_INITMODE_1, // Spawning after pulling/putting-back Master sword // OoT leftover
+ /* 0x2 */ PLAYER_INITMODE_2,
+ /* 0x3 */ PLAYER_INITMODE_3,
+ /* 0x4 */ PLAYER_INITMODE_4,
+ /* 0x5 */ PLAYER_INITMODE_5,
+ /* 0x6 */ PLAYER_INITMODE_6,
+ /* 0x7 */ PLAYER_INITMODE_7,
+ /* 0x8 */ PLAYER_INITMODE_8,
+ /* 0x9 */ PLAYER_INITMODE_9,
+ /* 0xA */ PLAYER_INITMODE_A,
+ /* 0xB */ PLAYER_INITMODE_B,
+ /* 0xC */ PLAYER_INITMODE_TELESCOPE,
+ /* 0xD */ PLAYER_INITMODE_D,
+ /* 0xE */ PLAYER_INITMODE_E,
+ /* 0xF */ PLAYER_INITMODE_F,
+ /* 0x10 */ PLAYER_INITMODE_MAX // Must not exceed 0x10 as `PLAYER_GET_INITMODE` is limited to a nibble in player params
} PlayerInitMode;
#define PLAYER_PARAMS(startBgCamIndex, initMode) ((startBgCamIndex & 0xFF) | ((initMode & 0xF) << 8))
diff --git a/include/z64save.h b/include/z64save.h
index c063fbd370..e131c8a8d3 100644
--- a/include/z64save.h
+++ b/include/z64save.h
@@ -275,7 +275,7 @@ typedef struct SavePlayerData {
/* 0x1D */ u8 isDoubleMagicAcquired; // "magic_ability"
/* 0x1E */ u8 doubleDefense; // "life_ability"
/* 0x1F */ u8 unk_1F; // "ocarina_round"
- /* 0x20 */ u8 unk_20; // "first_memory"
+ /* 0x20 */ u8 owlWarpId; // See `OwlWarpId`, "first_memory"
/* 0x22 */ u16 owlActivationFlags; // "memory_warp_point"
/* 0x24 */ u8 unk_24; // "last_warp_pt"
/* 0x26 */ s16 savedSceneId; // "scene_data_ID"
@@ -324,7 +324,7 @@ typedef struct Save {
/* 0x07 */ u8 linkAge; // "link_age"
/* 0x08 */ s32 cutsceneIndex; // "day_time"
/* 0x0C */ u16 time; // "zelda_time"
- /* 0x0E */ u16 owlSaveLocation;
+ /* 0x0E */ u16 owlWarpId; // See `OwlWarpId` enum
/* 0x10 */ s32 isNight; // "asahiru_fg"
/* 0x14 */ s32 timeSpeedOffset; // "change_zelda_time"
/* 0x18 */ s32 day; // "totalday"
@@ -460,6 +460,9 @@ typedef enum {
#define GET_PLAYER_FORM ((void)0, gSaveContext.save.playerForm)
+#define GET_OWL_STATUE_ACTIVATED(owlWarpId) (((void)0, gSaveContext.save.saveInfo.playerData.owlActivationFlags) & (u16)gBitFlags[(owlWarpId)])
+#define SET_OWL_STATUE_ACTIVATED(owlWarpId) (gSaveContext.save.saveInfo.playerData.owlActivationFlags = (((void)0, gSaveContext.save.saveInfo.playerData.owlActivationFlags) | (u16)gBitFlags[(owlWarpId)]))
+
#define SLOT(item) gItemSlots[item]
#define AMMO(item) gSaveContext.save.saveInfo.inventory.ammo[SLOT(item)]
#define INV_CONTENT(item) gSaveContext.save.saveInfo.inventory.items[SLOT(item)]
@@ -1653,7 +1656,7 @@ typedef enum {
#define STRAY_FAIRY_TOTAL 25 // total number of stray fairies, including those already in the Great Fairy Fountain
#define STRAY_FAIRY_SCATTERED_TOTAL 15 // original number of stray fairies in one dungeon area
-void Sram_ActivateOwl(u8 owlId);
+void Sram_ActivateOwl(u8 owlWarpId);
void Sram_ClearFlagsAtDawnOfTheFirstDay(void);
void Sram_SaveEndOfCycle(struct PlayState* play);
void Sram_IncrementDay(void);
diff --git a/include/z64scene.h b/include/z64scene.h
index ff09738066..c994caa08a 100644
--- a/include/z64scene.h
+++ b/include/z64scene.h
@@ -560,7 +560,7 @@ typedef union {
} SceneCmd; // size = 0x8
// Sets cursor point options on the world map
-typedef enum {
+typedef enum RegionId {
/* -1 */ REGION_NONE = -1,
/* 0x0 */ REGION_GREAT_BAY,
/* 0x1 */ REGION_ZORA_HALL,
@@ -577,23 +577,24 @@ typedef enum {
} RegionId;
// Sets warp points for owl statues
-typedef enum {
- /* 0x0 */ OWL_WARP_GREAT_BAY_COAST,
- /* 0x1 */ OWL_WARP_ZORA_CAPE,
- /* 0x2 */ OWL_WARP_SNOWHEAD,
- /* 0x3 */ OWL_WARP_MOUNTAIN_VILLAGE,
- /* 0x4 */ OWL_WARP_CLOCK_TOWN,
- /* 0x5 */ OWL_WARP_MILK_ROAD,
- /* 0x6 */ OWL_WARP_WOODFALL,
- /* 0x7 */ OWL_WARP_SOUTHERN_SWAMP,
- /* 0x8 */ OWL_WARP_IKANA_CANYON,
- /* 0x9 */ OWL_WARP_STONE_TOWER,
- /* 0xA */ OWL_WARP_ENTRANCE, // Special index for warping to the entrance of a scene
- /* 0xB */ OWL_WARP_MAX
+typedef enum OwlWarpId {
+ /* 0x0 */ OWL_WARP_GREAT_BAY_COAST,
+ /* 0x1 */ OWL_WARP_ZORA_CAPE,
+ /* 0x2 */ OWL_WARP_SNOWHEAD,
+ /* 0x3 */ OWL_WARP_MOUNTAIN_VILLAGE,
+ /* 0x4 */ OWL_WARP_CLOCK_TOWN,
+ /* 0x5 */ OWL_WARP_MILK_ROAD,
+ /* 0x6 */ OWL_WARP_WOODFALL,
+ /* 0x7 */ OWL_WARP_SOUTHERN_SWAMP,
+ /* 0x8 */ OWL_WARP_IKANA_CANYON,
+ /* 0x9 */ OWL_WARP_STONE_TOWER,
+ /* 0xA */ OWL_WARP_ENTRANCE, // Special index for warping to the entrance of a scene
+ /* 0xB */ OWL_WARP_MAX,
+ /* 0xFF */ OWL_WARP_NONE = 0xFF
} OwlWarpId;
// Sets cloud visibility on the world map
-typedef enum {
+typedef enum TingleMapId {
/* 0 */ TINGLE_MAP_CLOCK_TOWN,
/* 1 */ TINGLE_MAP_WOODFALL,
/* 2 */ TINGLE_MAP_SNOWHEAD,
diff --git a/src/audio/session_config.c b/src/audio/session_config.c
index e0881913b8..9d97222e8e 100644
--- a/src/audio/session_config.c
+++ b/src/audio/session_config.c
@@ -119,52 +119,52 @@ ReverbSettings* gReverbSettingsTable[] = {
};
AudioSpec gAudioSpecs[21] = {
- /* 0x0 */
+ /* 0x0 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
- /* 0x1 */
+ /* 0x1 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
- /* 0x2 */
+ /* 0x2 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
- /* 0x3 */
+ /* 0x3 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
- /* 0x4 */
+ /* 0x4 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
- /* 0x5 */
+ /* 0x5 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
- /* 0x6 */
+ /* 0x6 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
- /* 0x7 */
+ /* 0x7 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
- /* 0x8 */
+ /* 0x8 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
- /* 0x9 */
+ /* 0x9 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
- /* 0xA */
+ /* 0xA */
{ 32000, 1, 28, 3, 0, 0, 2, reverbSettingsA, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x2800, 0x2D00, 0, 0,
0xDC800 },
- /* 0xB */
+ /* 0xB */
{ 32000, 1, 28, 3, 0, 0, 2, reverbSettingsA, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
- /* 0xC */
+ /* 0xC */
{ 32000, 1, 28, 5, 0, 0, 2, reverbSettingsA, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xCC800 },
- /* 0xD */
+ /* 0xD */
{ 32000, 1, 24, 5, 0, 0, 3, reverbSettingsD, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
- /* 0xE */
+ /* 0xE */
{ 32000, 1, 24, 5, 0, 0, 3, reverbSettingsE, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
- /* 0xF */
+ /* 0xF */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4000, 0x2D00, 0, 0,
0xDC800 },
/* 0x10 */
diff --git a/src/code/title_setup.c b/src/code/title_setup.c
index 841c301e2a..21331d6f3b 100644
--- a/src/code/title_setup.c
+++ b/src/code/title_setup.c
@@ -24,7 +24,7 @@ void Setup_SetRegs(void) {
XREG(77) = 0x3C;
XREG(78) = 0x2F;
XREG(79) = 0x62;
- R_PAUSE_OWLWARP_ALPHA = 0;
+ R_PAUSE_OWL_WARP_ALPHA = 0;
XREG(88) = 0x56;
XREG(89) = 0x258;
XREG(90) = 0x1C2;
diff --git a/src/code/z_kaleido_scope_call.c b/src/code/z_kaleido_scope_call.c
index 1d2046e575..36d45c02b0 100644
--- a/src/code/z_kaleido_scope_call.c
+++ b/src/code/z_kaleido_scope_call.c
@@ -35,7 +35,7 @@ void KaleidoScopeCall_Update(PlayState* play) {
KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
if ((play->pauseCtx.state != PAUSE_STATE_OFF) || (play->pauseCtx.debugEditor != DEBUG_EDITOR_NONE)) {
- if ((pauseCtx->state == PAUSE_STATE_OPENING_0) || (pauseCtx->state == PAUSE_STATE_OWLWARP_0)) {
+ if ((pauseCtx->state == PAUSE_STATE_OPENING_0) || (pauseCtx->state == PAUSE_STATE_OWL_WARP_0)) {
if (ShrinkWindow_Letterbox_GetSize() == 0) {
R_PAUSE_BG_PRERENDER_STATE = PAUSE_BG_PRERENDER_SETUP;
pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE;
@@ -48,7 +48,7 @@ void KaleidoScopeCall_Update(PlayState* play) {
pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_APPEARING;
pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1;
} else if ((pauseCtx->state == PAUSE_STATE_OPENING_1) || (pauseCtx->state == PAUSE_STATE_GAMEOVER_1) ||
- (pauseCtx->state == PAUSE_STATE_OWLWARP_1)) {
+ (pauseCtx->state == PAUSE_STATE_OWL_WARP_1)) {
if (R_PAUSE_BG_PRERENDER_STATE == PAUSE_BG_PRERENDER_READY) {
pauseCtx->state++;
}
diff --git a/src/code/z_message.c b/src/code/z_message.c
index 4e541de2e7..37588bd132 100644
--- a/src/code/z_message.c
+++ b/src/code/z_message.c
@@ -5604,7 +5604,7 @@ void Message_Update(PlayState* play) {
Message_CloseTextbox(play);
}
} else if ((msgCtx->textboxEndType != TEXTBOX_ENDTYPE_10) ||
- (pauseCtx->state != PAUSE_STATE_OWLWARP_CONFIRM)) {
+ (pauseCtx->state != PAUSE_STATE_OWL_WARP_CONFIRM)) {
if ((msgCtx->textboxEndType == TEXTBOX_ENDTYPE_10) &&
(play->msgCtx.ocarinaMode == OCARINA_MODE_1B)) {
if (Message_ShouldAdvance(play)) {
@@ -5676,7 +5676,7 @@ void Message_Update(PlayState* play) {
pauseCtx->unk_2C8 = pauseCtx->pageIndex;
pauseCtx->unk_2CA = pauseCtx->cursorPoint[4];
pauseCtx->pageIndex = PAUSE_ITEM;
- pauseCtx->state = PAUSE_STATE_OWLWARP_0;
+ pauseCtx->state = PAUSE_STATE_OWL_WARP_0;
func_800F4A10(play);
pauseCtx->pageIndex = PAUSE_MAP;
sLastPlayedSong = 0xFF;
diff --git a/src/code/z_scene.c b/src/code/z_scene.c
index 8f2fe0cf69..b6d3ed1942 100644
--- a/src/code/z_scene.c
+++ b/src/code/z_scene.c
@@ -18,6 +18,7 @@ s32 Object_SpawnPersistent(ObjectContext* objectCtx, s16 id) {
objectCtx->slots[objectCtx->numEntries].id = id;
size = gObjectTable[id].vromEnd - gObjectTable[id].vromStart;
+ //! FAKE:
if (1) {}
if (size != 0) {
diff --git a/src/code/z_sram_NES.c b/src/code/z_sram_NES.c
index 1e3867bdf1..d66fee9c35 100644
--- a/src/code/z_sram_NES.c
+++ b/src/code/z_sram_NES.c
@@ -388,12 +388,11 @@ u8 sBitFlags8[] = {
u16 D_801F6AF0;
u8 D_801F6AF2;
-void Sram_ActivateOwl(u8 owlId) {
- gSaveContext.save.saveInfo.playerData.owlActivationFlags =
- ((void)0, gSaveContext.save.saveInfo.playerData.owlActivationFlags) | (u16)gBitFlags[owlId];
+void Sram_ActivateOwl(u8 owlWarpId) {
+ SET_OWL_STATUE_ACTIVATED(owlWarpId);
- if (gSaveContext.save.saveInfo.playerData.unk_20 == 0xFF) {
- gSaveContext.save.saveInfo.playerData.unk_20 = owlId;
+ if (gSaveContext.save.saveInfo.playerData.owlWarpId == OWL_WARP_NONE) {
+ gSaveContext.save.saveInfo.playerData.owlWarpId = owlWarpId;
}
}
@@ -780,8 +779,8 @@ SavePlayerData sSaveDefaultPlayerData = {
false, // isDoubleMagicAcquired
0, // doubleDefense
0, // unk_1F
- 0xFF, // unk_20
- 0x0000, // owlActivationFlags
+ OWL_WARP_NONE, // owlWarpId
+ 0, // owlActivationFlags
0xFF, // unk_24
SCENE_SPOT00, // savedSceneId
};
@@ -956,7 +955,7 @@ SavePlayerData sSaveDebugPlayerData = {
false, // isDoubleMagicAcquired
0, // doubleDefense
0, // unk_1F
- 0xFF, // unk_20
+ OWL_WARP_NONE, // owlWarpId
0, // owlActivationFlags
0xFF, // unk_24
SCENE_SPOT00, // savedSceneId
@@ -1208,12 +1207,17 @@ void Sram_ResetSaveFromMoonCrash(SramContext* sramCtx) {
gSaveContext.jinxTimer = 0;
}
-u16 D_801C6A58[] = {
- ENTRANCE(GREAT_BAY_COAST, 11), ENTRANCE(ZORA_CAPE, 6),
- ENTRANCE(SNOWHEAD, 3), ENTRANCE(MOUNTAIN_VILLAGE_WINTER, 8),
- ENTRANCE(SOUTH_CLOCK_TOWN, 9), ENTRANCE(MILK_ROAD, 4),
- ENTRANCE(WOODFALL, 4), ENTRANCE(SOUTHERN_SWAMP_POISONED, 10),
- ENTRANCE(IKANA_CANYON, 4), ENTRANCE(STONE_TOWER, 3),
+static u16 sOwlWarpEntrances[OWL_WARP_MAX - 1] = {
+ ENTRANCE(GREAT_BAY_COAST, 11), // OWL_WARP_GREAT_BAY_COAST
+ ENTRANCE(ZORA_CAPE, 6), // OWL_WARP_ZORA_CAPE
+ ENTRANCE(SNOWHEAD, 3), // OWL_WARP_SNOWHEAD
+ ENTRANCE(MOUNTAIN_VILLAGE_WINTER, 8), // OWL_WARP_MOUNTAIN_VILLAGE
+ ENTRANCE(SOUTH_CLOCK_TOWN, 9), // OWL_WARP_CLOCK_TOWN
+ ENTRANCE(MILK_ROAD, 4), // OWL_WARP_MILK_ROAD
+ ENTRANCE(WOODFALL, 4), // OWL_WARP_WOODFALL
+ ENTRANCE(SOUTHERN_SWAMP_POISONED, 10), // OWL_WARP_SOUTHERN_SWAMP
+ ENTRANCE(IKANA_CANYON, 4), // OWL_WARP_IKANA_CANYON
+ ENTRANCE(STONE_TOWER, 3), // OWL_WARP_STONE_TOWER
};
void Sram_OpenSave(FileSelectState* fileSelect, SramContext* sramCtx) {
@@ -1288,7 +1292,7 @@ void Sram_OpenSave(FileSelectState* fileSelect, SramContext* sramCtx) {
gSaveContext.save.playerForm = PLAYER_FORM_HUMAN;
}
} else {
- gSaveContext.save.entrance = D_801C6A58[(void)0, gSaveContext.save.owlSaveLocation];
+ gSaveContext.save.entrance = sOwlWarpEntrances[(void)0, gSaveContext.save.owlWarpId];
if ((gSaveContext.save.entrance == ENTRANCE(SOUTHERN_SWAMP_POISONED, 10)) &&
CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) {
gSaveContext.save.entrance = ENTRANCE(SOUTHERN_SWAMP_CLEARED, 10);
diff --git a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c
index 490ded3c61..cbf2e64ab9 100644
--- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c
+++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c
@@ -265,7 +265,7 @@ void EnBigpo_RotateSpawnCutsceneFires(EnBigpo* this) {
void EnBigpo_UpdateSpin(EnBigpo* this) {
s16 oldYaw = this->actor.shape.rot.y;
- this->actor.shape.rot.y += this->rotVelocity;
+ this->actor.shape.rot.y += this->angularVelocity;
if ((oldYaw < 0) && (this->actor.shape.rot.y > 0)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_PO_ROLL); // spinning sfx during spin attack
}
@@ -364,7 +364,7 @@ void EnBigpo_SpawnCutsceneStage2(EnBigpo* this, PlayState* play) {
* stage 3: switch to fires rotating
*/
void EnBigpo_SpawnCutsceneStage3(EnBigpo* this) {
- this->rotVelocity = 0x1000;
+ this->angularVelocity = 0x1000;
this->actionFunc = EnBigpo_SpawnCutsceneStage4;
this->fireRadius = 200.0f;
this->actor.velocity.y = 0.0f;
@@ -377,10 +377,10 @@ void EnBigpo_SpawnCutsceneStage4(EnBigpo* this, PlayState* play) {
s32 i;
if (Math_StepToF(&this->fireRadius, 30.0f, 5.0f)) {
- this->rotVelocity += 0x80;
+ this->angularVelocity += 0x80;
this->actor.velocity.y += 0.25f;
}
- this->actor.shape.rot.y += this->rotVelocity;
+ this->actor.shape.rot.y += this->angularVelocity;
EnBigpo_RotateSpawnCutsceneFires(this);
for (i = 0; i < ARRAY_COUNT(this->fires); i++) {
@@ -415,11 +415,11 @@ void EnBigpo_SpawnCutsceneStage6(EnBigpo* this, PlayState* play) {
s32 alphaPlus; // color alpha + 10
SkelAnime_Update(&this->skelAnime);
- this->actor.shape.rot.y += this->rotVelocity;
+ this->actor.shape.rot.y += this->angularVelocity;
alphaPlus = this->mainColor.a + 10; // decrease transparency
EnBigpo_RotateSpawnCutsceneFires(this);
if (alphaPlus >= 90) {
- this->rotVelocity -= 0x80;
+ this->angularVelocity -= 0x80;
this->actor.velocity.y -= 0.25f;
if (alphaPlus >= 180) {
Math_ScaledStepToS(&this->actor.world.rot.y, 0, 0x180);
@@ -486,7 +486,7 @@ void EnBigpo_SpawnCutsceneStage8(EnBigpo* this, PlayState* play) {
void EnBigpo_SetupWarpOut(EnBigpo* this) {
this->collider.base.acFlags &= ~AC_ON;
this->collider.base.ocFlags1 &= ~OC1_ON;
- this->rotVelocity = 0x2000;
+ this->angularVelocity = 0x2000;
this->idleTimer = 32;
this->actor.flags &= ~ACTOR_FLAG_TARGETABLE;
this->actor.speed = 0.0f;
@@ -496,9 +496,9 @@ void EnBigpo_SetupWarpOut(EnBigpo* this) {
void EnBigpo_WarpingOut(EnBigpo* this, PlayState* play) {
DECR(this->idleTimer);
- this->actor.shape.rot.y += this->rotVelocity;
+ this->actor.shape.rot.y += this->angularVelocity;
if (this->idleTimer < 16) {
- Math_ScaledStepToS(&this->rotVelocity, 0, 0x200);
+ Math_ScaledStepToS(&this->angularVelocity, 0, 0x200);
}
this->mainColor.a = this->idleTimer * (255.0f / 32.0f);
if (this->idleTimer == 0) {
@@ -514,7 +514,7 @@ void EnBigpo_SetupWarpIn(EnBigpo* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_APPEAR);
Animation_PlayLoop(&this->skelAnime, &gBigPoeAwakenStretchAnim);
- this->rotVelocity = 0x2000;
+ this->angularVelocity = 0x2000;
this->actor.world.pos.x = (Math_SinS(randomYaw) * distance) + player->actor.world.pos.x;
this->actor.world.pos.z = (Math_CosS(randomYaw) * distance) + player->actor.world.pos.z;
this->actionFunc = EnBigpo_WarpingIn;
@@ -522,10 +522,10 @@ void EnBigpo_SetupWarpIn(EnBigpo* this, PlayState* play) {
void EnBigpo_WarpingIn(EnBigpo* this, PlayState* play) {
this->idleTimer++;
- this->actor.shape.rot.y -= this->rotVelocity;
+ this->actor.shape.rot.y -= this->angularVelocity;
if (this->idleTimer >= 16) {
// after 16th frame, start slowing rotation
- Math_ScaledStepToS(&this->rotVelocity, 0, 0x200);
+ Math_ScaledStepToS(&this->angularVelocity, 0, 0x200);
}
this->mainColor.a = this->idleTimer * (255.0f / 32.0f);
@@ -585,16 +585,16 @@ void EnBigpo_SetupSpinUp(EnBigpo* this) {
this->collider.base.acFlags |= AC_HARD;
this->collider.info.bumper.dmgFlags &= ~0x8000;
this->collider.base.atFlags |= AT_ON;
- this->rotVelocity = 0x800;
+ this->angularVelocity = 0x800;
this->actionFunc = EnBigpo_SpinningUp;
this->actor.speed = 0.0f;
}
void EnBigpo_SpinningUp(EnBigpo* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
- this->rotVelocity += 0x200;
+ this->angularVelocity += 0x200;
EnBigpo_UpdateSpin(this);
- if (this->rotVelocity >= 0x3C00) {
+ if (this->angularVelocity >= 0x3C00) {
EnBigpo_SetupSpinAttack(this);
}
}
@@ -636,7 +636,7 @@ void EnBigpo_SpinningDown(EnBigpo* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
Math_SmoothStepToF(&this->actor.world.pos.y, player->actor.world.pos.y + 100.0f, 0.3f, 5.0f, 1.0f);
Math_StepToF(&this->actor.speed, 0.0f, 0.2f);
- if (Math_ScaledStepToS(&this->rotVelocity, 0, 0x200)) {
+ if (Math_ScaledStepToS(&this->angularVelocity, 0, 0x200)) {
// spin down complete, re-allow hittable
this->collider.base.colType = COLTYPE_HIT3;
this->collider.base.acFlags &= ~AC_HARD;
diff --git a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.h b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.h
index 6fd0db8a33..7e3f8c7a85 100644
--- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.h
+++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.h
@@ -48,7 +48,7 @@ typedef struct EnBigpo {
/* 0x204 */ u8 storePrevBgm;
/* 0x206 */ s16 idleTimer; // frame counter
/* 0x208 */ s16 unk208; // facing rotY?
- /* 0x20A */ s16 rotVelocity;
+ /* 0x20A */ s16 angularVelocity;
/* 0x20C */ s16 unk20C; // is this counting the number of frames the player is ztargeting them?
/* 0x20E */ s16 subCamId;
/* 0x210 */ s16 switchFlag;
diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c
index 6b9273a457..a76f95fad0 100644
--- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c
+++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c
@@ -308,7 +308,7 @@ s32 func_8092CCEC(EnDns* this, PlayState* play) {
s32 func_8092CE38(EnDns* this) {
static s32 D_8092DE00[] = { EN_DNS_ANIM_DANCE, EN_DNS_ANIM_DANCE, EN_DNS_ANIM_FLIP };
- s16 rotVelocity;
+ s16 angularVelocity;
s32 pad;
Vec3f sp2C;
s32 ret = false;
@@ -333,10 +333,10 @@ s32 func_8092CE38(EnDns* this) {
this->actor.shape.rot.y = this->actor.world.rot.y;
Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_JUMP);
} else if (this->skelAnime.curFrame < 13.0f) {
- rotVelocity = this->skelAnime.curFrame;
+ angularVelocity = this->skelAnime.curFrame;
this->actor.shape.rot.y = this->actor.world.rot.y;
- rotVelocity *= 0x9D8;
- this->actor.shape.rot.y += rotVelocity;
+ angularVelocity *= 0x9D8;
+ this->actor.shape.rot.y += angularVelocity;
this->unk_2E4 -= -(40.0f / 13.0f);
}
} else {
diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c
index a8634e671a..6a9d58724e 100644
--- a/src/overlays/actors/ovl_En_Go/z_en_go.c
+++ b/src/overlays/actors/ovl_En_Go/z_en_go.c
@@ -552,9 +552,9 @@ void EnGo_InitSnow(EnGoEffect effect[ENGO_SNOW_EFFECT_COUNT], Vec3f pos) {
effect->pos.y += 56.0f;
// Generate a +-15 degree rotational velocity
- effect->rotVelocity.x = (Rand_ZeroOne() - 0.5f) * (f32)0x1554;
- effect->rotVelocity.y = (Rand_ZeroOne() - 0.5f) * (f32)0x1554;
- effect->rotVelocity.z = (Rand_ZeroOne() - 0.5f) * (f32)0x1554;
+ effect->angularVelocity.x = (Rand_ZeroOne() - 0.5f) * 0x1554;
+ effect->angularVelocity.y = (Rand_ZeroOne() - 0.5f) * 0x1554;
+ effect->angularVelocity.z = (Rand_ZeroOne() - 0.5f) * 0x1554;
// Generate a radially outward velocity for each of the effects
velMagnitude = (Rand_ZeroOne() * 4.0f) + 6.0f;
@@ -632,9 +632,9 @@ void EnGo_UpdateSnow(EnGoEffect* effect, f32 dustConversionHeight) {
Math_StepToF(&effect->velocity.z, z, (sREG(14) + 40) * 0.01f);
}
- effect->rotAngle.x += effect->rotVelocity.x;
- effect->rotAngle.y += effect->rotVelocity.y;
- effect->rotAngle.z += effect->rotVelocity.z;
+ effect->rot.x += effect->angularVelocity.x;
+ effect->rot.y += effect->angularVelocity.y;
+ effect->rot.z += effect->angularVelocity.z;
}
/**
@@ -667,9 +667,9 @@ void EnGo_DrawSnow(EnGoEffect effect[ENGO_SNOW_EFFECT_COUNT], PlayState* play, G
Matrix_Push();
Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW);
Matrix_Scale(0.08f, 0.08f, 0.08f, MTXMODE_APPLY);
- Matrix_RotateZS(effect->rotAngle.z, MTXMODE_APPLY);
- Matrix_RotateXS(effect->rotAngle.x, MTXMODE_APPLY);
- Matrix_RotateYS(effect->rotAngle.y, MTXMODE_APPLY);
+ Matrix_RotateZS(effect->rot.z, MTXMODE_APPLY);
+ Matrix_RotateXS(effect->rot.x, MTXMODE_APPLY);
+ Matrix_RotateYS(effect->rot.y, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, model);
diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.h b/src/overlays/actors/ovl_En_Go/z_en_go.h
index d6173d6b24..f8c60b759a 100644
--- a/src/overlays/actors/ovl_En_Go/z_en_go.h
+++ b/src/overlays/actors/ovl_En_Go/z_en_go.h
@@ -33,8 +33,8 @@ typedef struct EnGoEffect {
/* 0x00 */ u8 type;
/* 0x01 */ u8 alphaDenom;
/* 0x02 */ u8 alphaNumer;
- /* 0x04 */ Vec3s rotVelocity;
- /* 0x0A */ Vec3s rotAngle;
+ /* 0x04 */ Vec3s angularVelocity;
+ /* 0x0A */ Vec3s rot;
/* 0x10 */ Vec3f pos;
/* 0x1C */ Vec3f accel;
/* 0x28 */ Vec3f velocity;
diff --git a/src/overlays/actors/ovl_En_Test7/z_en_test7.c b/src/overlays/actors/ovl_En_Test7/z_en_test7.c
index 6c2c6f461a..690e1a5760 100644
--- a/src/overlays/actors/ovl_En_Test7/z_en_test7.c
+++ b/src/overlays/actors/ovl_En_Test7/z_en_test7.c
@@ -17,23 +17,24 @@ void EnTest7_Destroy(Actor* thisx, PlayState* play);
void EnTest7_Update(Actor* thisx, PlayState* play);
void EnTest7_Draw(Actor* thisx, PlayState* play);
-void EnTest7_SetupAction(EnTest7* this, EnTest7ActionFunc actionFunc);
-void func_80AF19A8(EnTest7* this, PlayState* play);
-void func_80AF1A2C(EnTest7* this, PlayState* play);
-void func_80AF1CA0(EnTest7* this, PlayState* play);
-void func_80AF1E44(EnTest7* this, PlayState* play);
-void func_80AF1F48(EnTest7* this, PlayState* play);
-void func_80AF2030(EnTest7* this, PlayState* play);
-void func_80AF21E8(EnTest7* this, PlayState* play);
-void func_80AF2318(EnTest7* this, PlayState* play);
-void func_80AF2350(EnTest7* this, PlayState* play);
-void func_80AF2854(EnTest7* this, PlayState* play);
-void func_80AF2938(EnTest7* this, PlayState* play);
-void func_80AF2AE8(EnTest7* this, PlayState* play);
-void func_80AF2C48(EnTest7* this, PlayState* play);
-void func_80AF2EC8(EnTest7* this, PlayState* play);
-void func_80AF2F98(EnTest7* this, PlayState* play);
-void func_80AF30F4(EnTest7* this, PlayState* play);
+void EnTest7_StartWarpCs(EnTest7* this, PlayState* play);
+void EnTest7_WarpCsPart1(EnTest7* this, PlayState* play);
+void EnTest7_WarpCsPart2(EnTest7* this, PlayState* play);
+void EnTest7_WarpCsPart3(EnTest7* this, PlayState* play);
+void EnTest7_WarpCsPart4(EnTest7* this, PlayState* play);
+void EnTest7_WarpCsPart5(EnTest7* this, PlayState* play);
+void EnTest7_WarpCsPart6(EnTest7* this, PlayState* play);
+void EnTest7_WarpCsWait(EnTest7* this, PlayState* play);
+void EnTest7_WarpCsWarp(EnTest7* this, PlayState* play);
+
+void EnTest7_PlayerAndSubCamAction(EnTest7* this, PlayState* play);
+
+void EnTest7_SetupArriveCs(EnTest7* this, PlayState* play);
+void EnTest7_StartArriveCs(EnTest7* this, PlayState* play);
+void EnTest7_ArriveCsPart1(EnTest7* this, PlayState* play);
+void EnTest7_StartArriveCsSkip(EnTest7* this, PlayState* play);
+void EnTest7_ArriveCsPart2(EnTest7* this, PlayState* play);
+void EnTest7_ArriveCsPart3(EnTest7* this, PlayState* play);
ActorInit En_Test7_InitVars = {
/**/ ACTOR_EN_TEST7,
@@ -47,209 +48,193 @@ ActorInit En_Test7_InitVars = {
/**/ EnTest7_Draw,
};
+void EnTest7_SetupPlayerCamFunc(EnTest7* this, EnTest7PlayerCamFunc playerCamFunc) {
+ this->playerCamFunc = playerCamFunc;
+}
+
void EnTest7_SetupAction(EnTest7* this, EnTest7ActionFunc actionFunc) {
this->actionFunc = actionFunc;
}
-void func_80AF082C(EnTest7* this, EnTest7UnkFunc func) {
- this->unk_1E58 = func;
-}
-
-void func_80AF0838(EnTest7Struct2* arg0) {
- EnTest7Struct2* ptr = arg0;
+void EnTest7_InitFeathers(OwlWarpFeather* feathers) {
+ OwlWarpFeather* feather = feathers;
s32 i;
- for (i = 0, ptr = arg0; i < 100; i++, ptr++) {
+ for (i = 0, feather = feathers; i < OWL_WARP_NUM_FEATHERS; i++, feather++) {
s32 pad;
- ptr->unk_00 = 0;
- ptr->unk_04 = 0;
- ptr->unk_08.x = 0.0f;
- ptr->unk_08.y = 0.0f;
- ptr->unk_08.z = 0.0f;
- ptr->unk_14 = 0.0f;
- ptr->unk_18 = 0.0f;
- ptr->unk_1C = 0.0f;
- ptr->unk_20 = 0.0f;
- ptr->unk_24 = 0.0f;
- ptr->unk_28 = 0.0f;
- ptr->unk_2C = 0.00001f;
- ptr->unk_30.x = 0;
- ptr->unk_30.y = 0;
- ptr->unk_30.z = 0;
- ptr->unk_36 = 0;
- ptr->unk_38 = 0;
- ptr->unk_3A = 0;
+ feather->type = OWL_WARP_FEATHER_TYPE_DISABLED;
+ feather->unk_04 = 0;
+ feather->pos.x = 0.0f;
+ feather->pos.y = 0.0f;
+ feather->pos.z = 0.0f;
+ feather->velocity.x = 0.0f;
+ feather->velocity.y = 0.0f;
+ feather->velocity.z = 0.0f;
+ feather->accel.x = 0.0f;
+ feather->accel.y = 0.0f;
+ feather->accel.z = 0.0f;
+ feather->scale = 0.00001f;
+ feather->rot.x = 0;
+ feather->rot.y = 0;
+ feather->rot.z = 0;
+ feather->angularVelocity.x = 0;
+ feather->angularVelocity.y = 0;
+ feather->angularVelocity.z = 0;
}
}
-void func_80AF0984(EnTest7Struct2* arg0, Vec3f* arg1, s32 arg2) {
- s16 sp26 = Rand_ZeroOne() * 0xFFFF;
- f32 sp20;
- f32 temp_f0;
- f32 temp_f0_2;
- f32 temp_f0_3;
- f32 temp_f4;
+void EnTest7_AddFeather(OwlWarpFeather* feather, Vec3f* pos, s32 isPosYRand) {
+ s16 yaw = Rand_ZeroOne() * 0xFFFF;
+ f32 velocityXZ;
- arg0->unk_08 = *arg1;
+ feather->pos = *pos;
- if (arg2 != 0) {
- Math_CosS(sp26);
- arg0->unk_08.x = arg0->unk_08.x;
- arg0->unk_08.y += (Rand_ZeroOne() * 100.0f) - 20.0f;
- Math_SinS(sp26);
- arg0->unk_08.z = arg0->unk_08.z;
+ if (isPosYRand) {
+ feather->pos.x += Math_CosS(yaw) * 0.0f;
+ feather->pos.y += (Rand_ZeroOne() * 100.0f) - 20.0f;
+ feather->pos.z += Math_SinS(yaw) * 0.0f;
}
- sp20 = (Rand_ZeroOne() * 4.0f) + 2.0f;
+ velocityXZ = (Rand_ZeroOne() * 4.0f) + 2.0f;
- arg0->unk_14 = Math_CosS(sp26) * sp20;
- arg0->unk_18 = Rand_ZeroOne();
- arg0->unk_1C = Math_SinS(sp26) * sp20;
+ feather->velocity.x = Math_CosS(yaw) * velocityXZ;
+ feather->velocity.y = Rand_ZeroOne();
+ feather->velocity.z = Math_SinS(yaw) * velocityXZ;
- arg0->unk_20 = 0.0f;
- arg0->unk_24 = 0.0f;
- arg0->unk_28 = 0.0f;
- arg0->unk_2C = 0.25f;
- arg0->unk_30.x = Rand_ZeroOne() * 0x10000;
- arg0->unk_30.y = Rand_ZeroOne() * 0x10000;
- arg0->unk_30.z = Rand_ZeroOne() * 0x10000;
- arg0->unk_04 = 60;
+ feather->accel.x = 0.0f;
+ feather->accel.y = 0.0f;
+ feather->accel.z = 0.0f;
+
+ feather->scale = 0.25f;
+ feather->rot.x = Rand_ZeroOne() * 0x10000;
+ feather->rot.y = Rand_ZeroOne() * 0x10000;
+ feather->rot.z = Rand_ZeroOne() * 0x10000;
+ feather->unk_04 = 60;
if (Rand_ZeroOne() < 0.9f) {
- arg0->unk_00 = 1;
- arg0->unk_30.x = Rand_ZeroOne() * 0x10000;
- arg0->unk_30.y = Rand_ZeroOne() * 0x10000;
- arg0->unk_30.z = Rand_ZeroOne() * 0x10000;
- arg0->unk_36 = 0;
- arg0->unk_38 = 0;
- arg0->unk_3A = 0;
+ feather->type = OWL_WARP_FEATHER_TYPE_1;
+ feather->rot.x = Rand_ZeroOne() * 0x10000;
+ feather->rot.y = Rand_ZeroOne() * 0x10000;
+ feather->rot.z = Rand_ZeroOne() * 0x10000;
+ feather->angularVelocity.x = 0;
+ feather->angularVelocity.y = 0;
+ feather->angularVelocity.z = 0;
} else {
- arg0->unk_00 = 2;
- arg0->unk_30.x = 0;
- arg0->unk_30.y = 0;
- arg0->unk_30.z = Rand_ZeroOne() * 5000.0f;
- arg0->unk_36 = 0;
- arg0->unk_38 = (Rand_ZeroOne() * 8000.0f) + 2000.0f;
+ feather->type = OWL_WARP_FEATHER_TYPE_2;
+ feather->rot.x = 0;
+ feather->rot.y = 0;
+ feather->rot.z = Rand_ZeroOne() * 5000.0f;
+ feather->angularVelocity.x = 0;
+ feather->angularVelocity.y = (Rand_ZeroOne() * 8000.0f) + 2000.0f;
if (Rand_ZeroOne() > 0.5f) {
- arg0->unk_38 = -arg0->unk_38;
+ feather->angularVelocity.y = -feather->angularVelocity.y;
}
- arg0->unk_3A = 0;
+ feather->angularVelocity.z = 0;
}
}
-void func_80AF0C30(EnTest7Struct2* arg0, Vec3f* arg1, s32 arg2) {
- static s32 D_80AF3410 = 0;
+void EnTest7_AddAndChooseFeather(OwlWarpFeather* feathers, Vec3f* pos, s32 isPosYRand) {
+ static s32 sFeatherIndex = 0;
s32 i;
- s32 phi_t0 = false;
- EnTest7Struct2* ptr;
- s32 idx;
+ s32 featherAdded = false;
+ OwlWarpFeather* feather;
+ s32 featherIndex;
- for (i = 0, ptr = arg0; i < 100; i++, ptr++) {
- if (ptr->unk_00 == 0) {
- func_80AF0984(ptr, arg1, arg2);
- D_80AF3410 = i;
- phi_t0 = true;
+ for (i = 0, feather = feathers; i < OWL_WARP_NUM_FEATHERS; i++, feather++) {
+ if (feather->type == OWL_WARP_FEATHER_TYPE_DISABLED) {
+ EnTest7_AddFeather(feather, pos, isPosYRand);
+ sFeatherIndex = i;
+ featherAdded = true;
break;
}
}
- if (!phi_t0) {
- idx = D_80AF3410 + 1;
- if (idx >= 100) {
- idx = 0;
+ if (!featherAdded) {
+ featherIndex = sFeatherIndex + 1;
+ if (featherIndex >= OWL_WARP_NUM_FEATHERS) {
+ featherIndex = 0;
}
- func_80AF0984(&arg0[idx], arg1, arg2);
+ EnTest7_AddFeather(&feathers[featherIndex], pos, isPosYRand);
}
}
-Vec3f D_80AF3414 = { 0.0f, 1.0f, 0.0f };
+void EnTest7_UpdateFeatherType1(PlayState* play, OwlWarpFeather* feather) {
+ static Vec3f sUnitVecY = { 0.0f, 1.0f, 0.0f };
+ static Vec3f sUnitVecZ = { 0.0f, 0.0f, 1.0f };
+ static MtxF sFeatherRotMf;
+ static Vec3f sFeatherAccel;
+ static Vec3f sFeatherUnused;
+ s32 swayAngleX = feather->unk_04 % 41;
+ s32 swayAngleY = (feather->unk_04 + 7000) % 41;
+ s32 sp24 = false;
-Vec3f D_80AF3420 = { 0.0f, 0.0f, 1.0f };
+ SkinMatrix_SetRotateRPY(&sFeatherRotMf, feather->rot.x, feather->rot.y, feather->rot.z);
+ SkinMatrix_Vec3fMtxFMultXYZ(&sFeatherRotMf, &sUnitVecY, &sFeatherAccel);
+ SkinMatrix_Vec3fMtxFMultXYZ(&sFeatherRotMf, &sUnitVecZ, &sFeatherUnused);
-void func_80AF0CDC(PlayState* play, EnTest7Struct2* arg1) {
- static MtxF D_80AF38B0;
- static Vec3f D_80AF38F0;
- static f32 D_80AF38FC;
- static Vec3f D_80AF3900;
- s32 sp2C;
- s32 sp28;
- s32 sp24;
- s16 temp_v0_2;
- s16 temp_v0_3;
- s32 temp_v0;
- f32 phi_f8;
-
- sp2C = arg1->unk_04 % 41;
- sp24 = 0;
- sp28 = (arg1->unk_04 + 0x1B58) % 41;
-
- SkinMatrix_SetRotateRPY(&D_80AF38B0, arg1->unk_30.x, arg1->unk_30.y, arg1->unk_30.z);
- SkinMatrix_Vec3fMtxFMultXYZ(&D_80AF38B0, &D_80AF3414, &D_80AF38F0);
- SkinMatrix_Vec3fMtxFMultXYZ(&D_80AF38B0, &D_80AF3420, &D_80AF3900);
-
- if (arg1->unk_30.x < 0x3448) {
- arg1->unk_30.x += 0x384;
- } else if (arg1->unk_30.x >= 0x4BB9) {
- arg1->unk_30.x -= 0x384;
+ if (feather->rot.x < 0x3448) {
+ feather->rot.x += 0x384;
+ } else if (feather->rot.x >= 0x4BB9) {
+ feather->rot.x -= 0x384;
} else {
- arg1->unk_30.x = (Math_SinS((sp2C * 65535.0f) / 41.0f) * 2000.0f) + 16384.0f;
+ feather->rot.x = (Math_SinS(((f32)swayAngleX * 0xFFFF) / 41.0f) * 2000.0f) + 0x4000;
}
- if (arg1->unk_30.y < -0xBB8) {
- arg1->unk_30.y += 0x384;
- } else if (arg1->unk_30.y > 0xBB8) {
- arg1->unk_30.y -= 0x384;
+ if (feather->rot.y < -0xBB8) {
+ feather->rot.y += 0x384;
+ } else if (feather->rot.y > 0xBB8) {
+ feather->rot.y -= 0x384;
} else {
- sp24 = 1;
- arg1->unk_30.y = Math_SinS((sp28 * 65535.0f) / 41.0f) * 2000.0f;
+ sp24 = true;
+ feather->rot.y = Math_SinS(((f32)swayAngleY * 0xFFFF) / 41.0f) * 2000.0f;
}
- if (sp24 == 1) {
- if (D_80AF38F0.y < 0.0f) {
- arg1->unk_14 += D_80AF38F0.x * 0.5f;
- arg1->unk_18 += (D_80AF38F0.y * 0.5f) + 0.08f;
- arg1->unk_1C += (D_80AF38F0.z * 0.5f);
+ if (sp24 == true) {
+ if (sFeatherAccel.y < 0.0f) {
+ feather->velocity.x += sFeatherAccel.x * 0.5f;
+ feather->velocity.y += sFeatherAccel.y * 0.5f + 0.08f;
+ feather->velocity.z += sFeatherAccel.z * 0.5f;
} else {
- arg1->unk_14 += -D_80AF38F0.x * 0.5f;
- arg1->unk_18 += (-D_80AF38F0.y * 0.5f) + 0.08f;
- arg1->unk_1C += -D_80AF38F0.z * 0.5f;
+ feather->velocity.x += -sFeatherAccel.x * 0.5f;
+ feather->velocity.y += -sFeatherAccel.y * 0.5f + 0.08f;
+ feather->velocity.z += -sFeatherAccel.z * 0.5f;
}
- } else if (D_80AF38F0.y < 0.0f) {
- arg1->unk_14 += D_80AF38F0.x * 0.2f;
- arg1->unk_18 += (D_80AF38F0.y * 0.2f) + 0.08f;
- arg1->unk_1C += D_80AF38F0.z * 0.2f;
+ } else if (sFeatherAccel.y < 0.0f) {
+ feather->velocity.x += sFeatherAccel.x * 0.2f;
+ feather->velocity.y += sFeatherAccel.y * 0.2f + 0.08f;
+ feather->velocity.z += sFeatherAccel.z * 0.2f;
} else {
- arg1->unk_14 += -D_80AF38F0.x * 0.2f;
- arg1->unk_18 += (-D_80AF38F0.y * 0.2f) + 0.08f;
- arg1->unk_1C += (-D_80AF38F0.z * 0.2f);
+ feather->velocity.x += -sFeatherAccel.x * 0.2f;
+ feather->velocity.y += -sFeatherAccel.y * 0.2f + 0.08f;
+ feather->velocity.z += -sFeatherAccel.z * 0.2f;
}
- arg1->unk_08.x += arg1->unk_14;
- arg1->unk_08.y += arg1->unk_18;
- arg1->unk_08.z += arg1->unk_1C;
+ feather->pos.x += feather->velocity.x;
+ feather->pos.y += feather->velocity.y;
+ feather->pos.z += feather->velocity.z;
}
-void func_80AF10D8(PlayState* play, EnTest7Struct2* arg1) {
- arg1->unk_30.y += arg1->unk_38;
+void EnTest7_UpdateFeatherType2(PlayState* play, OwlWarpFeather* feather) {
+ feather->rot.y += feather->angularVelocity.y;
- arg1->unk_20 = Rand_Centered();
- arg1->unk_24 = Rand_Centered() + -0.01f;
- arg1->unk_28 = Rand_Centered();
+ feather->accel.x = Rand_Centered();
+ feather->accel.y = Rand_Centered() + -0.01f;
+ feather->accel.z = Rand_Centered();
- arg1->unk_14 += arg1->unk_20;
- arg1->unk_18 += arg1->unk_24;
- arg1->unk_1C += arg1->unk_28;
+ feather->velocity.x += feather->accel.x;
+ feather->velocity.y += feather->accel.y;
+ feather->velocity.z += feather->accel.z;
- arg1->unk_08.x += arg1->unk_14;
- arg1->unk_08.y += arg1->unk_18;
- arg1->unk_08.z += arg1->unk_1C;
+ feather->pos.x += feather->velocity.x;
+ feather->pos.y += feather->velocity.y;
+ feather->pos.z += feather->velocity.z;
}
-void func_80AF118C(PlayState* play, EnTest7Struct2* arg1, EnTest7* this, s32 arg3, s32 arg4) {
+void EnTest7_UpdateFeathers(PlayState* play, OwlWarpFeather* feathers, EnTest7* this, s32 arg3, s32 arg4) {
s32 pad[4];
- EnTest7Struct2* ptr;
+ OwlWarpFeather* feather;
s16 phi_s1;
s32 i;
f32 temp_f28;
@@ -260,53 +245,52 @@ void func_80AF118C(PlayState* play, EnTest7Struct2* arg1, EnTest7* this, s32 arg
f32 temp_f26;
f32 temp_f2;
- for (i = 0, ptr = arg1; i < (s32)(ARRAY_COUNT(this->unk_15C) * sizeof(this->unk_15C[0]));
- i += sizeof(this->unk_15C[0]), ptr++) {
- arg1 = ptr;
+ for (i = 0, feather = feathers; i < (OWL_WARP_NUM_FEATHERS * sizeof(OwlWarpFeather));
+ i += sizeof(OwlWarpFeather), feather++) {
- if (arg1->unk_00 == 0) {
+ if (feather->type == OWL_WARP_FEATHER_TYPE_DISABLED) {
continue;
}
- if (arg1->unk_00 == 1) {
- func_80AF0CDC(play, arg1);
+ if (feather->type == OWL_WARP_FEATHER_TYPE_1) {
+ EnTest7_UpdateFeatherType1(play, feather);
} else {
- func_80AF10D8(play, arg1);
+ EnTest7_UpdateFeatherType2(play, feather);
}
if (arg3) {
- temp_f22 = arg1->unk_08.x - this->actor.world.pos.x;
- temp_f24 = arg1->unk_08.z - this->actor.world.pos.z;
+ temp_f22 = feather->pos.x - this->actor.world.pos.x;
+ temp_f24 = feather->pos.z - this->actor.world.pos.z;
temp_f0 = SQ(temp_f22) + SQ(temp_f24);
- phi_s1 = -10000;
+ phi_s1 = -0x2710;
if (temp_f0 > SQ(20.0f)) {
phi_s1 /= ((temp_f0 - SQ(20.0f)) * 0.00125f) + 1.0f;
}
- temp_f26 = (temp_f22 * Math_CosS(phi_s1)) - (Math_SinS(phi_s1) * temp_f24);
- temp_f28 = (temp_f22 * Math_SinS(phi_s1)) + (Math_CosS(phi_s1) * temp_f24);
+ temp_f26 = (temp_f22 * Math_CosS(phi_s1)) - (temp_f24 * Math_SinS(phi_s1));
+ temp_f28 = (temp_f22 * Math_SinS(phi_s1)) + (temp_f24 * Math_CosS(phi_s1));
- arg1->unk_08.x = this->actor.world.pos.x + temp_f26;
- arg1->unk_08.z = this->actor.world.pos.z + temp_f28;
+ feather->pos.x = this->actor.world.pos.x + temp_f26;
+ feather->pos.z = this->actor.world.pos.z + temp_f28;
- temp_f22 = arg1->unk_14;
- temp_f24 = arg1->unk_1C;
+ temp_f22 = feather->velocity.x;
+ temp_f24 = feather->velocity.z;
- arg1->unk_14 = (temp_f22 * Math_CosS(phi_s1)) - (Math_SinS(phi_s1) * temp_f24);
- arg1->unk_1C = (temp_f22 * Math_SinS(phi_s1)) + (Math_CosS(phi_s1) * temp_f24);
+ feather->velocity.x = (temp_f22 * Math_CosS(phi_s1)) - (temp_f24 * Math_SinS(phi_s1));
+ feather->velocity.z = (temp_f22 * Math_SinS(phi_s1)) + (temp_f24 * Math_CosS(phi_s1));
- temp_f22 = arg1->unk_20;
- temp_f24 = arg1->unk_28;
+ temp_f22 = feather->accel.x;
+ temp_f24 = feather->accel.z;
- arg1->unk_20 = (temp_f22 * Math_CosS(phi_s1)) - (Math_SinS(phi_s1) * temp_f24);
- arg1->unk_28 = (temp_f22 * Math_SinS(phi_s1)) + (Math_CosS(phi_s1) * temp_f24);
+ feather->accel.x = (temp_f22 * Math_CosS(phi_s1)) - (temp_f24 * Math_SinS(phi_s1));
+ feather->accel.z = (temp_f22 * Math_SinS(phi_s1)) + (temp_f24 * Math_CosS(phi_s1));
}
if (arg4) {
- sp8C.x = arg1->unk_08.x - this->actor.world.pos.x;
- sp8C.y = arg1->unk_08.y - (this->actor.world.pos.y + 40.0f);
- sp8C.z = arg1->unk_08.z - this->actor.world.pos.z;
+ sp8C.x = feather->pos.x - this->actor.world.pos.x;
+ sp8C.y = feather->pos.y - (this->actor.world.pos.y + 40.0f);
+ sp8C.z = feather->pos.z - this->actor.world.pos.z;
temp_f2 = 1.0f - (0.5f / ((Math3D_Vec3fMagnitude(&sp8C) / 500.0f) + 1.0f));
@@ -314,18 +298,18 @@ void func_80AF118C(PlayState* play, EnTest7Struct2* arg1, EnTest7* this, s32 arg
sp8C.y *= temp_f2;
sp8C.z *= temp_f2;
- arg1->unk_08.x = this->actor.world.pos.x + sp8C.x;
- arg1->unk_08.y = this->actor.world.pos.y + sp8C.y + 40.0f;
- arg1->unk_08.z = this->actor.world.pos.z + sp8C.z;
+ feather->pos.x = this->actor.world.pos.x + sp8C.x;
+ feather->pos.y = this->actor.world.pos.y + sp8C.y + 40.0f;
+ feather->pos.z = this->actor.world.pos.z + sp8C.z;
}
}
}
-void func_80AF14FC(PlayState* play2, EnTest7Struct2* arg1) {
+void EnTest7_DrawFeathers(PlayState* play2, OwlWarpFeather* feathers) {
s32 pad[3];
PlayState* play = play2;
- Mtx* temp_v0;
- EnTest7Struct2* ptr;
+ Mtx* mtx;
+ OwlWarpFeather* feather;
s32 i;
MtxF sp6C;
@@ -338,37 +322,38 @@ void func_80AF14FC(PlayState* play2, EnTest7Struct2* arg1) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x80, 255, 255, 255, 255);
gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, 255);
- for (i = 0, ptr = arg1; i < 0x1770; i += 0x3C, ptr++) {
- if (ptr->unk_00 == 0) {
+ for (i = 0, feather = feathers; i < (OWL_WARP_NUM_FEATHERS * sizeof(OwlWarpFeather));
+ i += sizeof(OwlWarpFeather), feather++) {
+ if (feather->type == OWL_WARP_FEATHER_TYPE_DISABLED) {
continue;
}
- if ((ptr->unk_08.x > 30000.0f) || (ptr->unk_08.x < -30000.0f) || (ptr->unk_08.y > 30000.0f) ||
- (ptr->unk_08.y < -30000.0f) || (ptr->unk_08.z > 30000.0f) || (ptr->unk_08.z < -30000.0f)) {
- ptr->unk_00 = 0;
+ if ((feather->pos.x > 30000.0f) || (feather->pos.x < -30000.0f) || (feather->pos.y > 30000.0f) ||
+ (feather->pos.y < -30000.0f) || (feather->pos.z > 30000.0f) || (feather->pos.z < -30000.0f)) {
+ feather->type = OWL_WARP_FEATHER_TYPE_DISABLED;
continue;
}
- Matrix_Translate(ptr->unk_08.x, ptr->unk_08.y, ptr->unk_08.z, MTXMODE_NEW);
+ Matrix_Translate(feather->pos.x, feather->pos.y, feather->pos.z, MTXMODE_NEW);
- if (ptr->unk_00 == 1) {
- Matrix_RotateZYX(ptr->unk_30.x, ptr->unk_30.y, ptr->unk_30.z, MTXMODE_APPLY);
+ if (feather->type == OWL_WARP_FEATHER_TYPE_1) {
+ Matrix_RotateZYX(feather->rot.x, feather->rot.y, feather->rot.z, MTXMODE_APPLY);
} else {
- SkinMatrix_SetRotateYRP(&sp6C, ptr->unk_30.x, ptr->unk_30.y, ptr->unk_30.z);
+ SkinMatrix_SetRotateYRP(&sp6C, feather->rot.x, feather->rot.y, feather->rot.z);
Matrix_Mult(&sp6C, MTXMODE_APPLY);
}
- Matrix_Scale(ptr->unk_2C, ptr->unk_2C, ptr->unk_2C, MTXMODE_APPLY);
- if (ptr->unk_00 == 2) {
+ Matrix_Scale(feather->scale, feather->scale, feather->scale, MTXMODE_APPLY);
+ if (feather->type == OWL_WARP_FEATHER_TYPE_2) {
Matrix_Translate(0.0f, 30.0f, 0.0f, MTXMODE_APPLY);
}
- temp_v0 = Matrix_NewMtx(play->state.gfxCtx);
- if (temp_v0 == NULL) {
+ mtx = Matrix_NewMtx(play->state.gfxCtx);
+ if (mtx == NULL) {
continue;
}
- gSPMatrix(POLY_OPA_DISP++, temp_v0, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_081628);
+ gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, gSoaringWarpCsFeatherDL);
}
Matrix_Pop();
@@ -376,12 +361,12 @@ void func_80AF14FC(PlayState* play2, EnTest7Struct2* arg1) {
CLOSE_DISPS(play->state.gfxCtx);
}
-void func_80AF1730(EnTest7Struct* arg0) {
- arg0->unk_00 = 0.0f;
- arg0->unk_04 = 0.0f;
- arg0->unk_08 = 1.0f;
- arg0->unk_0C = 1.0f;
- arg0->unk_10 = 0;
+void EnTest7_InitWindCapsule(OwlWarpWindCapsule* windCapsule) {
+ windCapsule->unk_00 = 0.0f;
+ windCapsule->unk_04 = 0.0f;
+ windCapsule->xzScale = 1.0f;
+ windCapsule->yScale = 1.0f;
+ windCapsule->yaw = 0;
}
void EnTest7_Init(Actor* thisx, PlayState* play2) {
@@ -391,24 +376,26 @@ void EnTest7_Init(Actor* thisx, PlayState* play2) {
Player* player2 = GET_PLAYER(play);
this->actor.world.rot.y = this->actor.shape.rot.y = player->actor.shape.rot.y;
- this->unk_144 = 0;
- this->unk_1E54 = 0;
- this->unk_1E8E = player->actor.shape.rot.y;
- this->unk_1E90 = player->actor.scale.x;
- this->unk_1E94 = player->actor.scale.z;
+ this->flags = 0;
+ this->timer = 0;
+ this->playerYaw = player->actor.shape.rot.y;
+ this->playerScaleX = player->actor.scale.x;
+ this->playerScaleZ = player->actor.scale.z;
- func_80183430(&this->unk_18CC, &gameplay_keep_Blob_085640, &gameplay_keep_Blob_083534, this->unk_18FC,
+ // Keyframe animations
+ func_80183430(&this->skeletonInfo, &gameplay_keep_Blob_085640, &gameplay_keep_Blob_083534, this->unk_18FC,
this->unk_1BA8, NULL);
- func_801834A8(&this->unk_18CC, &gameplay_keep_Blob_083534);
- func_80AF0838(this->unk_15C);
- func_80AF1730(&this->unk_148);
+ func_801834A8(&this->skeletonInfo, &gameplay_keep_Blob_083534);
- if (ENTEST7_GET(&this->actor) == ENTEST7_MINUS1) {
- func_80AF082C(this, func_80AF2938);
- EnTest7_SetupAction(this, NULL);
+ EnTest7_InitFeathers(this->feathers);
+ EnTest7_InitWindCapsule(&this->windCapsule);
+
+ if (OWL_WARP_CS_GET_OCARINA_MODE(&this->actor) == ENTEST7_ARRIVE) {
+ EnTest7_SetupAction(this, EnTest7_SetupArriveCs);
+ EnTest7_SetupPlayerCamFunc(this, NULL);
} else {
- func_80AF082C(this, func_80AF19A8);
- EnTest7_SetupAction(this, func_80AF2854);
+ EnTest7_SetupAction(this, EnTest7_StartWarpCs);
+ EnTest7_SetupPlayerCamFunc(this, EnTest7_PlayerAndSubCamAction);
Audio_PlayBgm_StorePrevBgm(NA_BGM_SONG_OF_SOARING);
}
@@ -419,9 +406,9 @@ void EnTest7_Init(Actor* thisx, PlayState* play2) {
CutsceneManager_Queue(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]);
player2->stateFlags1 |= PLAYER_STATE1_20;
- Lights_PointNoGlowSetInfo(&this->lightInfo, (Math_SinS(this->unk_1E8E) * 90.0f) + player->actor.world.pos.x,
+ Lights_PointNoGlowSetInfo(&this->lightInfo, (Math_SinS(this->playerYaw) * 90.0f) + player->actor.world.pos.x,
player->actor.world.pos.y + 10.0f,
- (Math_CosS(this->unk_1E8E) * 90.0f) + player->actor.world.pos.z, 255, 255, 255, 255);
+ (Math_CosS(this->playerYaw) * 90.0f) + player->actor.world.pos.z, 255, 255, 255, 255);
this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo);
}
@@ -432,26 +419,26 @@ void EnTest7_Destroy(Actor* thisx, PlayState* play) {
LightContext_RemoveLight(play, &play->lightCtx, this->lightNode);
}
-void func_80AF19A8(EnTest7* this, PlayState* play) {
+void EnTest7_StartWarpCs(EnTest7* this, PlayState* play) {
if (!CutsceneManager_IsNext(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])) {
CutsceneManager_Queue(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]);
} else {
CutsceneManager_Start(play->playerCsIds[PLAYER_CS_ID_SONG_WARP], NULL);
- func_80AF082C(this, func_80AF1A2C);
+ EnTest7_SetupAction(this, EnTest7_WarpCsPart1);
play->unk_18844 = true;
}
}
-void func_80AF1A2C(EnTest7* this, PlayState* play) {
+void EnTest7_WarpCsPart1(EnTest7* this, PlayState* play) {
Color_RGB8 fogColor = { 64, 0, 0 };
Color_RGB8 ambientColor = { 220, 220, 255 };
- f32 envLerp = this->unk_1E54 / 10.0f;
+ f32 envLerp = this->timer / (f32)(10 - 0);
Environment_LerpAmbientColor(play, &ambientColor, envLerp);
Environment_LerpFogColor(play, &fogColor, envLerp);
Environment_LerpFog(play, 2000, 4000, envLerp);
- if (this->unk_1E54 >= 10) {
+ if (this->timer >= 10) {
Camera* subCam =
Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]));
@@ -459,157 +446,161 @@ void func_80AF1A2C(EnTest7* this, PlayState* play) {
this->subCamAt = subCam->at;
this->subCamFov = subCam->fov;
- func_80AF082C(this, func_80AF1CA0);
- this->unk_144 |= 0x20;
+ EnTest7_SetupAction(this, EnTest7_WarpCsPart2);
+ this->flags |= OWL_WARP_FLAGS_20;
Audio_PlaySfx_AtPos(&this->actor.projectedPos, NA_SE_PL_WARP_WING_OPEN);
Play_EnableMotionBlur(120);
}
}
-void func_80AF1B68(EnTest7* this, PlayState* play) {
- this->unk_144 |= 2;
+void EnTest7_UpdateGrowingWindCapsule(EnTest7* this, PlayState* play) {
+ this->flags |= OWL_WARP_FLAGS_DRAW_WIND_CAPSULE;
- if (this->unk_148.unk_04 < 11.0f) {
- this->unk_148.unk_04 = this->unk_148.unk_04 + 0.3f;
- this->unk_148.unk_08 = ((this->unk_148.unk_00 * -0.45f) / 11.0f) + 0.7f;
- this->unk_148.unk_0C = ((this->unk_148.unk_00 * -0.29999998f) / 11.0f) + 0.7f;
+ if (this->windCapsule.unk_04 < 11.0f) {
+ this->windCapsule.unk_04 += 0.3f;
+ this->windCapsule.xzScale = ((this->windCapsule.unk_00 * -0.45f) / 11.0f) + 0.7f;
+ this->windCapsule.yScale = ((this->windCapsule.unk_00 * -0.29999998f) / 11.0f) + 0.7f;
}
- if (this->unk_148.unk_00 < 11.0f) {
- this->unk_148.unk_00 += 1.0f;
- if (this->unk_148.unk_00 > 6.0f) {
+ if (this->windCapsule.unk_00 < 11.0f) {
+ this->windCapsule.unk_00 += 1.0f;
+ if (this->windCapsule.unk_00 > 6.0f) {
Player* player = GET_PLAYER(play);
- this->unk_144 &= ~1;
+ this->flags &= ~OWL_WARP_FLAGS_DRAW_WINGS;
player->actor.draw = NULL;
}
- } else if (this->unk_1E54 >= 87) {
- func_80AF082C(this, func_80AF1F48);
- this->unk_144 &= -9;
- this->unk_148.unk_10 -= 0x2EE0;
+ } else if (this->timer > 86) {
+ EnTest7_SetupAction(this, EnTest7_WarpCsPart4);
+ this->flags &= ~OWL_WARP_FLAGS_8;
+ this->windCapsule.yaw -= 0x2EE0;
} else {
- this->unk_148.unk_10 -= 0x2EE0;
+ this->windCapsule.yaw -= 0x2EE0;
}
}
-void func_80AF1CA0(EnTest7* this, PlayState* play) {
- Vec3f sp34;
+void EnTest7_WarpCsPart2(EnTest7* this, PlayState* play) {
+ Vec3f featherPos;
- if (func_80183DE0(&this->unk_18CC)) {
- func_80AF082C(this, func_80AF1E44);
+ if (func_80183DE0(&this->skeletonInfo)) {
+ EnTest7_SetupAction(this, EnTest7_WarpCsPart3);
}
- if (this->unk_18CC.frameCtrl.unk_10 > 60.0f) {
- func_80AF1B68(this, play);
+ if (this->skeletonInfo.frameCtrl.unk_10 > 60.0f) {
+ EnTest7_UpdateGrowingWindCapsule(this, play);
}
- if ((this->unk_18CC.frameCtrl.unk_10 > 20.0f) && !(this->unk_144 & 0x40)) {
- this->unk_144 |= 0x40;
+ if ((this->skeletonInfo.frameCtrl.unk_10 > 20.0f) && !(this->flags & OWL_WARP_FLAGS_40)) {
+ this->flags |= OWL_WARP_FLAGS_40;
Audio_PlaySfx_AtPos(&this->actor.projectedPos, NA_SE_PL_WARP_WING_CLOSE);
}
- if (this->unk_18CC.frameCtrl.unk_10 > 42.0f) {
- if (!(this->unk_144 & 0x80)) {
- this->unk_144 |= 0x80;
+ if (this->skeletonInfo.frameCtrl.unk_10 > 42.0f) {
+ if (!(this->flags & OWL_WARP_FLAGS_80)) {
+ this->flags |= OWL_WARP_FLAGS_80;
Audio_PlaySfx_AtPos(&this->actor.projectedPos, NA_SE_PL_WARP_WING_ROLL);
}
if (Rand_ZeroOne() < 0.3f) {
Camera* subCam =
Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]));
- f32 rand = Rand_ZeroOne();
+ f32 randLerp = Rand_ZeroOne();
- sp34.x = ((subCam->eye.x - this->actor.world.pos.x) * rand) + this->actor.world.pos.x;
- sp34.y = ((subCam->eye.y - this->actor.world.pos.y) * rand) + this->actor.world.pos.y;
- sp34.z = ((subCam->eye.z - this->actor.world.pos.z) * rand) + this->actor.world.pos.z;
+ featherPos.x = LERPIMP_ALT(this->actor.world.pos.x, subCam->eye.x, randLerp);
+ featherPos.y = LERPIMP_ALT(this->actor.world.pos.y, subCam->eye.y, randLerp);
+ featherPos.z = LERPIMP_ALT(this->actor.world.pos.z, subCam->eye.z, randLerp);
- func_80AF0C30(this->unk_15C, &sp34, 1);
- this->unk_144 |= 8;
+ EnTest7_AddAndChooseFeather(this->feathers, &featherPos, true);
+ this->flags |= OWL_WARP_FLAGS_8;
}
} else {
- this->unk_144 |= 1;
+ this->flags |= OWL_WARP_FLAGS_DRAW_WINGS;
}
}
-void func_80AF1E44(EnTest7* this, PlayState* play) {
- Vec3f sp34;
+void EnTest7_WarpCsPart3(EnTest7* this, PlayState* play) {
+ Vec3f featherPos;
Camera* subCam;
- f32 rand;
+ f32 randLerp;
- func_80AF1B68(this, play);
+ EnTest7_UpdateGrowingWindCapsule(this, play);
if (Rand_ZeroOne() < 0.3f) {
subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]));
- rand = Rand_ZeroOne();
- sp34.x = ((subCam->eye.x - this->actor.world.pos.x) * rand) + this->actor.world.pos.x;
- sp34.y = ((subCam->eye.y - this->actor.world.pos.y) * rand) + this->actor.world.pos.y;
- sp34.z = ((subCam->eye.z - this->actor.world.pos.z) * rand) + this->actor.world.pos.z;
- func_80AF0C30(this->unk_15C, &sp34, 1);
+ randLerp = Rand_ZeroOne();
+
+ featherPos.x = LERPIMP_ALT(this->actor.world.pos.x, subCam->eye.x, randLerp);
+ featherPos.y = LERPIMP_ALT(this->actor.world.pos.y, subCam->eye.y, randLerp);
+ featherPos.z = LERPIMP_ALT(this->actor.world.pos.z, subCam->eye.z, randLerp);
+
+ EnTest7_AddAndChooseFeather(this->feathers, &featherPos, true);
}
- Math_Vec3f_Copy(&sp34, &this->actor.world.pos);
- func_80AF0C30(this->unk_15C, &sp34, 1);
+ Math_Vec3f_Copy(&featherPos, &this->actor.world.pos);
+ EnTest7_AddAndChooseFeather(this->feathers, &featherPos, true);
this->unk_18FC[1].y += 0x2EE0;
}
-void func_80AF1F48(EnTest7* this, PlayState* play) {
+void EnTest7_WarpCsPart4(EnTest7* this, PlayState* play) {
s32 pad;
- s32 temp = this->unk_1E54 - 86;
- f32 temp_f0 = temp / 10.0f;
- Vec3f sp20;
+ s32 temp = this->timer - 86;
+ f32 temp_f0 = temp / (f32)(96 - 86);
+ Vec3f featherPos;
- this->unk_144 |= 0x10;
+ this->flags |= OWL_WARP_FLAGS_10;
- this->unk_148.unk_08 = (-0.15f * temp_f0) + 0.25f;
- this->unk_148.unk_0C = (-0.3f * temp_f0) + 0.4f;
- this->unk_148.unk_10 -= 0x2EE0;
+ this->windCapsule.xzScale = (-0.15f * temp_f0) + 0.25f;
+ this->windCapsule.yScale = (-0.3f * temp_f0) + 0.4f;
+ this->windCapsule.yaw -= 0x2EE0;
- this->unk_144 |= 4;
+ this->flags |= OWL_WARP_FLAGS_DRAW_LENS_FLARE;
- if (this->unk_1E54 >= 96) {
- func_80AF082C(this, func_80AF2030);
- this->unk_144 &= ~0x10;
+ if (this->timer >= 96) {
+ EnTest7_SetupAction(this, EnTest7_WarpCsPart5);
+ this->flags &= ~OWL_WARP_FLAGS_10;
}
- Math_Vec3f_Copy(&sp20, &this->actor.world.pos);
- func_80AF0C30(this->unk_15C, &sp20, 1);
+ Math_Vec3f_Copy(&featherPos, &this->actor.world.pos);
+ EnTest7_AddAndChooseFeather(this->feathers, &featherPos, true);
}
-void func_80AF2030(EnTest7* this, PlayState* play) {
- s32 temp = this->unk_1E54 - 96;
- f32 four = 4;
- f32 sp1C = 1.0f - (temp / four);
+void EnTest7_WarpCsPart5(EnTest7* this, PlayState* play) {
+ s32 pad;
+ s32 temp = this->timer - 96;
+ f32 lerp = 1.0f - (temp / (f32)(100 - 96));
Camera* subCam;
f32 temp_f2;
f32 temp_f4;
- this->unk_148.unk_08 = ((temp * -0.1f) / four) + 0.1f;
- this->unk_148.unk_0C = ((temp * 5.9f) / four) + 0.1f;
- this->unk_148.unk_10 -= 0x2EE0;
+ this->windCapsule.xzScale = ((temp * -0.1f) / 4) + 0.1f;
+ this->windCapsule.yScale = ((temp * 5.9f) / 4) + 0.1f;
+ this->windCapsule.yaw -= 0x2EE0;
+
this->actor.world.pos.y += 100.0f;
subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]));
subCam->focalActor = NULL;
- subCam->eye.x = ((subCam->eye.x - this->subCamEye.x) * sp1C) + this->subCamEye.x;
- subCam->eye.y = ((subCam->eye.y - this->subCamEye.y) * sp1C) + this->subCamEye.y;
- subCam->eye.z = ((subCam->eye.z - this->subCamEye.z) * sp1C) + this->subCamEye.z;
- subCam->fov = ((subCam->fov - this->subCamFov) * sp1C) + this->subCamFov;
+ subCam->eye.x = LERPIMP_ALT(this->subCamEye.x, subCam->eye.x, lerp);
+ subCam->eye.y = LERPIMP_ALT(this->subCamEye.y, subCam->eye.y, lerp);
+ subCam->eye.z = LERPIMP_ALT(this->subCamEye.z, subCam->eye.z, lerp);
- if (this->unk_1E54 >= 100) {
+ subCam->fov = LERPIMP_ALT(this->subCamFov, subCam->fov, lerp);
+
+ if (this->timer >= 100) {
R_PLAY_FILL_SCREEN_ON = true;
R_PLAY_FILL_SCREEN_R = 255;
R_PLAY_FILL_SCREEN_G = 255;
R_PLAY_FILL_SCREEN_B = 255;
R_PLAY_FILL_SCREEN_ALPHA = 255;
play->unk_18844 = false;
- this->unk_144 &= ~4;
- func_80AF082C(this, func_80AF21E8);
+ this->flags &= ~OWL_WARP_FLAGS_DRAW_LENS_FLARE;
+ EnTest7_SetupAction(this, EnTest7_WarpCsPart6);
Play_DisableMotionBlur();
}
}
-void func_80AF21E8(EnTest7* this, PlayState* play) {
- s32 sp2C = this->unk_1E54 - 100;
+void EnTest7_WarpCsPart6(EnTest7* this, PlayState* play) {
+ s32 sp2C = this->timer - 100;
f32 envLerp;
Color_RGB8 fogColor = { 64, 0, 0 };
Color_RGB8 ambientColor = { 220, 220, 255 };
@@ -623,52 +614,59 @@ void func_80AF21E8(EnTest7* this, PlayState* play) {
R_PLAY_FILL_SCREEN_ALPHA = 0;
}
- envLerp = 1.0f - (sp2C / 10.0f);
+ envLerp = 1.0f - (sp2C / (f32)(110 - 100));
Environment_LerpAmbientColor(play, &ambientColor, envLerp);
Environment_LerpFogColor(play, &fogColor, envLerp);
Environment_LerpFog(play, 2000, 4000, envLerp);
- if (this->unk_1E54 >= 110) {
- func_80AF082C(this, func_80AF2318);
+ if (this->timer >= 110) {
+ EnTest7_SetupAction(this, EnTest7_WarpCsWait);
}
}
-void func_80AF2318(EnTest7* this, PlayState* play) {
- if (this->unk_1E54 >= 130) {
- func_80AF082C(this, func_80AF2350);
+void EnTest7_WarpCsWait(EnTest7* this, PlayState* play) {
+ if (this->timer >= 130) {
+ EnTest7_SetupAction(this, EnTest7_WarpCsWarp);
}
}
-u16 D_80AF343C[] = {
- ENTRANCE(GREAT_BAY_COAST, 11), ENTRANCE(ZORA_CAPE, 6),
- ENTRANCE(SNOWHEAD, 3), ENTRANCE(MOUNTAIN_VILLAGE_WINTER, 8),
- ENTRANCE(SOUTH_CLOCK_TOWN, 9), ENTRANCE(MILK_ROAD, 4),
- ENTRANCE(WOODFALL, 4), ENTRANCE(SOUTHERN_SWAMP_POISONED, 10),
- ENTRANCE(IKANA_CANYON, 4), ENTRANCE(STONE_TOWER, 3),
+static u16 sOwlWarpEntrances[OWL_WARP_MAX - 1] = {
+ ENTRANCE(GREAT_BAY_COAST, 11), // OWL_WARP_GREAT_BAY_COAST
+ ENTRANCE(ZORA_CAPE, 6), // OWL_WARP_ZORA_CAPE
+ ENTRANCE(SNOWHEAD, 3), // OWL_WARP_SNOWHEAD
+ ENTRANCE(MOUNTAIN_VILLAGE_WINTER, 8), // OWL_WARP_MOUNTAIN_VILLAGE
+ ENTRANCE(SOUTH_CLOCK_TOWN, 9), // OWL_WARP_CLOCK_TOWN
+ ENTRANCE(MILK_ROAD, 4), // OWL_WARP_MILK_ROAD
+ ENTRANCE(WOODFALL, 4), // OWL_WARP_WOODFALL
+ ENTRANCE(SOUTHERN_SWAMP_POISONED, 10), // OWL_WARP_SOUTHERN_SWAMP
+ ENTRANCE(IKANA_CANYON, 4), // OWL_WARP_IKANA_CANYON
+ ENTRANCE(STONE_TOWER, 3), // OWL_WARP_STONE_TOWER
};
-void func_80AF2350(EnTest7* this, PlayState* play) {
- Vec3f sp2C;
+void EnTest7_WarpCsWarp(EnTest7* this, PlayState* play) {
+ Vec3f featherPos;
+ //! FAKE:
if (this) {}
- Math_Vec3f_Copy(&sp2C, &this->actor.world.pos);
+ Math_Vec3f_Copy(&featherPos, &this->actor.world.pos);
if (Rand_ZeroOne() < 0.1f) {
- func_80AF0C30(this->unk_15C, &sp2C, 1);
+ EnTest7_AddAndChooseFeather(this->feathers, &featherPos, true);
}
- this->unk_148.unk_10 -= 0x2EE0;
+ this->windCapsule.yaw -= 0x2EE0;
if (play->sceneId == SCENE_SECOM) {
play->nextEntrance = ENTRANCE(IKANA_CANYON, 6);
- } else if (ENTEST7_GET(&this->actor) == ENTEST7_26) {
+ } else if (OWL_WARP_CS_GET_OCARINA_MODE(&this->actor) == OCARINA_MODE_WARP_TO_ENTRANCE) {
func_80169F78(&play->state);
gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams =
- (gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams & 0xFF) | 0x600;
+ PLAYER_PARAMS(gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams, PLAYER_INITMODE_6);
gSaveContext.respawnFlag = -6;
} else {
- play->nextEntrance = D_80AF343C[ENTEST7_GET(&this->actor) - ENTEST7_1C];
+ play->nextEntrance =
+ sOwlWarpEntrances[OWL_WARP_CS_GET_OCARINA_MODE(&this->actor) - OCARINA_MODE_WARP_TO_GREAT_BAY_COAST];
if ((play->nextEntrance == ENTRANCE(SOUTHERN_SWAMP_POISONED, 10)) &&
CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) {
play->nextEntrance = ENTRANCE(SOUTHERN_SWAMP_CLEARED, 10);
@@ -684,116 +682,123 @@ void func_80AF2350(EnTest7* this, PlayState* play) {
gSaveContext.ambienceId = AMBIENCE_ID_DISABLED;
}
-void func_80AF24D8(EnTest7* this, PlayState* play, f32 arg2) {
- Vec3f sp3C;
- Vec3f* pos;
+void EnTest7_UpdateSubCamWarpCs2(EnTest7* this, PlayState* play, f32 lerp) {
+ Vec3f eyeNext;
+ Vec3f* playerPos;
Player* player = GET_PLAYER(play);
Camera* subCam =
Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]));
- pos = &player->actor.world.pos;
+ playerPos = &player->actor.world.pos;
subCam->focalActor = NULL;
- sp3C.x = ((180.0f * Math_SinS(this->unk_1E8E)) * Math_CosS(0xFA0)) + pos->x;
- sp3C.y = (Math_SinS(0xFA0) * 180.0f) + pos->y;
- sp3C.z = ((180.0f * Math_CosS(this->unk_1E8E)) * Math_CosS(0xFA0)) + pos->z;
+ eyeNext.x = playerPos->x + 180.0f * Math_SinS(this->playerYaw) * Math_CosS(0xFA0);
+ eyeNext.y = playerPos->y + 180.0f * Math_SinS(0xFA0);
+ eyeNext.z = playerPos->z + 180.0f * Math_CosS(this->playerYaw) * Math_CosS(0xFA0);
- subCam->eye.x = ((sp3C.x - subCam->eye.x) * arg2) + subCam->eye.x;
- subCam->eye.y = ((sp3C.y - subCam->eye.y) * arg2) + subCam->eye.y;
- subCam->eye.z = ((sp3C.z - subCam->eye.z) * arg2) + subCam->eye.z;
+ subCam->eye.x = LERPIMP_ALT(subCam->eye.x, eyeNext.x, lerp);
+ subCam->eye.y = LERPIMP_ALT(subCam->eye.y, eyeNext.y, lerp);
+ subCam->eye.z = LERPIMP_ALT(subCam->eye.z, eyeNext.z, lerp);
+
+ subCam->fov = LERPIMP_ALT(subCam->fov, this->subCamFov, lerp);
- subCam->fov = ((this->subCamFov - subCam->fov) * arg2) + subCam->fov;
subCam->at.y += 1.4444444f;
}
-void func_80AF2654(EnTest7* this, PlayState* play, f32 arg2) {
- Vec3f* pos;
+void EnTest7_UpdateSubCamWarpCs1(EnTest7* this, PlayState* play, f32 lerp) {
+ Vec3f* playerPos;
Player* player = GET_PLAYER(play);
- Camera* subCam;
- Vec3f sp30;
+ Camera* subCam =
+ Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]));
+ Vec3f eyeNext;
- subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]));
subCam->focalActor = NULL;
- pos = &player->actor.world.pos;
+ playerPos = &player->actor.world.pos;
- sp30.x = ((80.0f * Math_SinS(this->unk_1E8E)) * Math_CosS(0xBB8)) + pos->x;
- sp30.y = (Math_SinS(0xBB8) * 80.0f) + pos->y;
- sp30.z = ((80.0f * Math_CosS(this->unk_1E8E)) * Math_CosS(0xBB8)) + pos->z;
+ eyeNext.x = playerPos->x + 80.0f * Math_SinS(this->playerYaw) * Math_CosS(0xBB8);
+ eyeNext.y = playerPos->y + 80.0f * Math_SinS(0xBB8);
+ eyeNext.z = playerPos->z + 80.0f * Math_CosS(this->playerYaw) * Math_CosS(0xBB8);
- subCam->eye.x = ((sp30.x - subCam->eye.x) * arg2) + subCam->eye.x;
- subCam->eye.y = ((sp30.y - subCam->eye.y) * arg2) + subCam->eye.y;
- subCam->eye.z = ((sp30.z - subCam->eye.z) * arg2) + subCam->eye.z;
+ subCam->eye.x = LERPIMP_ALT(subCam->eye.x, eyeNext.x, lerp);
+ subCam->eye.y = LERPIMP_ALT(subCam->eye.y, eyeNext.y, lerp);
+ subCam->eye.z = LERPIMP_ALT(subCam->eye.z, eyeNext.z, lerp);
- subCam->at.x = ((pos->x - subCam->at.x) * arg2) + subCam->at.x;
- subCam->at.y = (((pos->y + 40.0f) - subCam->at.y) * arg2) + subCam->at.y;
- subCam->at.z = ((pos->z - subCam->at.z) * arg2) + subCam->at.z;
+ subCam->at.x = LERPIMP_ALT(subCam->at.x, playerPos->x, lerp);
+ subCam->at.y = LERPIMP_ALT(subCam->at.y, playerPos->y + 40.0f, lerp);
+ subCam->at.z = LERPIMP_ALT(subCam->at.z, playerPos->z, lerp);
- subCam->fov = ((this->subCamFov - subCam->fov) * arg2) + subCam->fov;
+ subCam->fov = LERPIMP_ALT(subCam->fov, this->subCamFov, lerp);
}
-void func_80AF2808(EnTest7* this, PlayState* play, f32 arg2) {
+void EnTest7_SpinAndSquishPlayer(EnTest7* this, PlayState* play, f32 lerp) {
Player* player = GET_PLAYER(play);
+ // Spin Player
player->actor.shape.rot.y += 0x2EE0;
- player->actor.scale.x = ((0.0f - this->unk_1E90) * arg2) + this->unk_1E90;
- player->actor.scale.z = ((0.0f - this->unk_1E94) * arg2) + this->unk_1E94;
+
+ // Squish Player thin
+ player->actor.scale.x = LERPIMP_ALT(this->playerScaleX, 0.0f, lerp);
+ player->actor.scale.z = LERPIMP_ALT(this->playerScaleZ, 0.0f, lerp);
}
-void func_80AF2854(EnTest7* this, PlayState* play) {
- f32 temp;
- f32 sixteen = 16.0f;
+void EnTest7_PlayerAndSubCamAction(EnTest7* this, PlayState* play) {
+ f32 lerp;
- if ((this->unk_1E54 >= 12) && (this->unk_1E54 < 31)) {
- temp = (this->unk_1E54 - 12) / 18.0f;
- func_80AF24D8(this, play, temp);
- } else if ((this->unk_1E54 >= 79) && (this->unk_1E54 < 96)) {
- temp = (this->unk_1E54 - 79) / sixteen;
- func_80AF2654(this, play, temp);
+ if ((this->timer >= 12) && (this->timer <= 30)) {
+ lerp = (this->timer - 12) / (f32)(30 - 12);
+ EnTest7_UpdateSubCamWarpCs2(this, play, lerp);
+ } else if ((this->timer >= 79) && (this->timer <= 95)) {
+ lerp = (this->timer - 79) / (f32)(95 - 79);
+ EnTest7_UpdateSubCamWarpCs1(this, play, lerp);
}
- if ((this->unk_1E54 >= 42) && (this->unk_1E54 < 69)) {
- temp = (this->unk_1E54 - 42) / 26.0f;
- func_80AF2808(this, play, temp);
+ if ((this->timer >= 42) && (this->timer <= 68)) {
+ lerp = (this->timer - 42) / (f32)(68 - 42);
+ EnTest7_SpinAndSquishPlayer(this, play, lerp);
}
}
-void func_80AF2938(EnTest7* this, PlayState* play) {
+void EnTest7_SetupArriveCs(EnTest7* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- this->unk_1E98 = player->actor.draw;
+ this->playerDrawFunc = player->actor.draw;
player->actor.draw = NULL;
player->stateFlags2 |= PLAYER_STATE2_20000000;
- this->unk_144 |= 2;
- this->unk_148.unk_04 = 30.0f;
+ this->flags |= OWL_WARP_FLAGS_DRAW_WIND_CAPSULE;
+ this->windCapsule.unk_04 = 30.0f;
+
if (play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_1) {
- func_80AF082C(this, func_80AF2AE8);
+ EnTest7_SetupAction(this, EnTest7_StartArriveCs);
} else {
- func_80AF082C(this, func_80AF2EC8);
+ EnTest7_SetupAction(this, EnTest7_StartArriveCsSkip);
}
}
-s16 D_80AF3450[] = { 0, 0x31C7 };
+typedef struct {
+ /* 0x0 */ s16 yaw;
+ /* 0x2 */ s16 pitch;
+ /* 0x4 */ f32 r;
+} OwlWarpVecGeo; // size = 0x8
-f32 D_80AF3454 = 3500.0f;
-
-void func_80AF29C0(EnTest7* this, PlayState* play) {
+void EnTest7_UpdateSubCamArrivalCs1(EnTest7* this, PlayState* play) {
+ static OwlWarpVecGeo sSubCamAtOffset = { 0, 0x31C7, 3500.0f };
s32 pad;
Player* player = GET_PLAYER(play);
Vec3f* pos = &player->actor.world.pos;
Camera* subCam =
Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]));
- subCam->at.x = ((D_80AF3454 * Math_SinS(D_80AF3450[0]) * Math_CosS(D_80AF3450[1]))) + pos->x;
- subCam->at.y = (Math_SinS(D_80AF3450[1]) * D_80AF3454) + pos->y;
- subCam->at.z = ((D_80AF3454 * Math_CosS(D_80AF3450[0])) * Math_CosS(D_80AF3450[1])) + pos->z;
+ subCam->at.x = pos->x + (sSubCamAtOffset.r * Math_SinS(sSubCamAtOffset.yaw) * Math_CosS(sSubCamAtOffset.pitch));
+ subCam->at.y = pos->y + (sSubCamAtOffset.r * Math_SinS(sSubCamAtOffset.pitch));
+ subCam->at.z = pos->z + (sSubCamAtOffset.r * Math_CosS(sSubCamAtOffset.yaw)) * Math_CosS(sSubCamAtOffset.pitch);
this->actor.world.pos.x = subCam->at.x;
this->actor.world.pos.y = subCam->at.y - 40.0f;
this->actor.world.pos.z = subCam->at.z;
}
-void func_80AF2AE8(EnTest7* this, PlayState* play) {
+void EnTest7_StartArriveCs(EnTest7* this, PlayState* play) {
Camera* subCam;
if (!CutsceneManager_IsNext(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])) {
@@ -802,129 +807,131 @@ void func_80AF2AE8(EnTest7* this, PlayState* play) {
}
CutsceneManager_Start(play->playerCsIds[PLAYER_CS_ID_SONG_WARP], NULL);
- func_80AF082C(this, func_80AF2C48);
+ EnTest7_SetupAction(this, EnTest7_ArriveCsPart1);
subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]));
this->subCamEye = subCam->eye;
this->subCamAt = subCam->at;
- func_80AF29C0(this, play);
+ EnTest7_UpdateSubCamArrivalCs1(this, play);
}
-void func_80AF2BAC(EnTest7* this, PlayState* play, Vec3f* arg2, f32 arg3) {
- f32 x;
- f32 y;
- f32 z;
+void EnTest7_UpdateSubCamArrivalCs2(EnTest7* this, PlayState* play, Vec3f* atNext, f32 lerp) {
+ Vec3f subCamAt;
Camera* subCam =
Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]));
subCam->focalActor = NULL;
- x = ((subCam->at.x - arg2->x) * arg3) + arg2->x;
- y = ((subCam->at.y - arg2->y) * arg3) + arg2->y;
- z = ((subCam->at.z - arg2->z) * arg3) + arg2->z;
- subCam->at.x = x;
- subCam->at.y = y;
- subCam->at.z = z;
+ subCamAt.x = LERPIMP_ALT(atNext->x, subCam->at.x, lerp);
+ subCamAt.y = LERPIMP_ALT(atNext->y, subCam->at.y, lerp);
+ subCamAt.z = LERPIMP_ALT(atNext->z, subCam->at.z, lerp);
+
+ subCam->at.x = subCamAt.x;
+ subCam->at.y = subCamAt.y;
+ subCam->at.z = subCamAt.z;
}
-void func_80AF2C48(EnTest7* this, PlayState* play) {
- f32 sp24 = (40 - this->unk_1E54) / 40.0f;
+void EnTest7_ArriveCsPart1(EnTest7* this, PlayState* play) {
+ f32 lerp = (40 - this->timer) / (f32)(40 - 0);
Camera* subCam;
- this->unk_148.unk_00 = 11.0f;
- this->unk_144 |= 4;
- this->unk_148.unk_08 = 0.05f;
- this->unk_148.unk_0C = 0.05f;
- this->unk_148.unk_10 += 0x2EE0;
+ this->flags |= OWL_WARP_FLAGS_DRAW_LENS_FLARE;
- this->actor.world.pos.x = ((this->actor.world.pos.x - this->actor.home.pos.x) * sp24) + this->actor.home.pos.x;
- this->actor.world.pos.y = ((this->actor.world.pos.y - this->actor.home.pos.y) * sp24) + this->actor.home.pos.y;
- this->actor.world.pos.z = ((this->actor.world.pos.z - this->actor.home.pos.z) * sp24) + this->actor.home.pos.z;
+ this->windCapsule.unk_00 = 11.0f;
+ this->windCapsule.xzScale = 0.05f;
+ this->windCapsule.yScale = 0.05f;
+ this->windCapsule.yaw += 0x2EE0;
+
+ this->actor.world.pos.x = LERPIMP_ALT(this->actor.home.pos.x, this->actor.world.pos.x, lerp);
+ this->actor.world.pos.y = LERPIMP_ALT(this->actor.home.pos.y, this->actor.world.pos.y, lerp);
+ this->actor.world.pos.z = LERPIMP_ALT(this->actor.home.pos.z, this->actor.world.pos.z, lerp);
subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]));
- func_80AF2BAC(this, play, &this->actor.home.pos, sp24);
+ EnTest7_UpdateSubCamArrivalCs2(this, play, &this->actor.home.pos, lerp);
subCam->at.x = this->actor.world.pos.x;
subCam->at.y = this->actor.world.pos.y + 40.0f;
subCam->at.z = this->actor.world.pos.z;
Actor_PlaySfx_Flagged(&this->actor, NA_SE_PL_WARP_WING_ROLL_2 - SFX_FLAG);
- if (this->unk_1E54 >= 40) {
- this->unk_144 &= ~4;
- func_80AF082C(this, func_80AF2F98);
+ if (this->timer >= 40) {
+ this->flags &= ~OWL_WARP_FLAGS_DRAW_LENS_FLARE;
+ EnTest7_SetupAction(this, EnTest7_ArriveCsPart2);
}
}
-void func_80AF2DB4(EnTest7* this, PlayState* play) {
+void EnTest7_UpdateSubCamArrivalCs3(EnTest7* this, PlayState* play) {
Camera* subCam;
Player* player = GET_PLAYER(play);
Vec3f* pos = &player->actor.world.pos;
subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]));
- subCam->eye.x = (Math_SinS(-player->actor.shape.rot.y) * 200.0f * -0.83907f) + pos->x;
- subCam->eye.y = pos->y + 108.8042f;
- subCam->eye.z = (Math_CosS(-player->actor.shape.rot.y) * 200.0f * -0.83907f) + pos->z;
+ // pitch is 147.042044 degrees
+ subCam->eye.x = pos->x + 200.0f * Math_SinS(-player->actor.shape.rot.y) * -0.83907f;
+ subCam->eye.y = pos->y + 200.0f * 0.544021f;
+ subCam->eye.z = pos->z + 200.0f * Math_CosS(-player->actor.shape.rot.y) * -0.83907f;
subCam->at.x = pos->x;
subCam->at.y = pos->y + 40.0f;
subCam->at.z = pos->z;
}
-void func_80AF2EC8(EnTest7* this, PlayState* play) {
+void EnTest7_StartArriveCsSkip(EnTest7* this, PlayState* play) {
Camera* subCam;
if (!CutsceneManager_IsNext(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])) {
CutsceneManager_Queue(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]);
} else {
CutsceneManager_Start(play->playerCsIds[PLAYER_CS_ID_SONG_WARP], NULL);
- func_80AF082C(this, func_80AF2F98);
+ EnTest7_SetupAction(this, EnTest7_ArriveCsPart2);
subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]));
this->subCamEye = subCam->eye;
this->subCamAt = subCam->at;
- this->unk_1E54 = 40;
+ this->timer = 40;
- func_80AF2DB4(this, play);
+ EnTest7_UpdateSubCamArrivalCs3(this, play);
}
}
-void func_80AF2F98(EnTest7* this, PlayState* play) {
+void EnTest7_ArriveCsPart2(EnTest7* this, PlayState* play) {
Player* player = GET_PLAYER(play);
Player* player2 = GET_PLAYER(play);
- Vec3f sp2C;
+ Vec3f featherPos;
Actor_PlaySfx_Flagged(&this->actor, NA_SE_PL_WARP_WING_ROLL_2 - SFX_FLAG);
- sp2C = this->actor.world.pos;
+ featherPos = this->actor.world.pos;
- func_80AF0C30(this->unk_15C, &sp2C, 1);
- func_80AF0C30(this->unk_15C, &sp2C, 1);
- this->unk_148.unk_04 = 70 - this->unk_1E54;
- if (this->unk_1E54 > 70) {
- func_80AF082C(this, func_80AF30F4);
+ EnTest7_AddAndChooseFeather(this->feathers, &featherPos, true);
+ EnTest7_AddAndChooseFeather(this->feathers, &featherPos, true);
+
+ this->windCapsule.unk_04 = 70 - this->timer;
+ if (this->timer > 70) {
+ EnTest7_SetupAction(this, EnTest7_ArriveCsPart3);
}
- if (this->unk_148.unk_04 > 11.0f) {
- f32 temp = this->unk_148.unk_04 - 11.0f;
+ if (this->windCapsule.unk_04 > 11.0f) {
+ f32 temp = this->windCapsule.unk_04 - 11.0f;
- this->unk_148.unk_08 = ((-0.35f * temp) / 19.0f) + 0.4f;
- this->unk_148.unk_0C = ((-0.35f * temp) / 19.0f) + 0.4f;
- this->unk_148.unk_10 += 0x2EE0;
+ this->windCapsule.xzScale = ((-0.35f * temp) / 19.0f) + 0.4f;
+ this->windCapsule.yScale = ((-0.35f * temp) / 19.0f) + 0.4f;
+ this->windCapsule.yaw += 0x2EE0;
} else {
- player2->actor.draw = this->unk_1E98;
- this->unk_148.unk_00 = this->unk_148.unk_04;
- this->unk_148.unk_08 = ((this->unk_148.unk_04 * -0.29999998f) / 11.0f) + 0.7f;
- this->unk_148.unk_0C = ((this->unk_148.unk_04 * -0.29999998f) / 11.0f) + 0.7f;
+ player2->actor.draw = this->playerDrawFunc;
+ this->windCapsule.unk_00 = this->windCapsule.unk_04;
+ this->windCapsule.xzScale = ((this->windCapsule.unk_04 * -0.29999998f) / 11.0f) + 0.7f;
+ this->windCapsule.yScale = ((this->windCapsule.unk_04 * -0.29999998f) / 11.0f) + 0.7f;
player->stateFlags2 &= ~PLAYER_STATE2_20000000;
}
}
-void func_80AF30F4(EnTest7* this, PlayState* play) {
+void EnTest7_ArriveCsPart3(EnTest7* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- if (this->unk_1E54 > 90) {
+ if (this->timer > 90) {
player->stateFlags1 &= ~PLAYER_STATE1_20;
player->stateFlags1 &= ~PLAYER_STATE1_20000000;
Actor_Kill(&this->actor);
@@ -934,25 +941,26 @@ void func_80AF30F4(EnTest7* this, PlayState* play) {
void EnTest7_Update(Actor* thisx, PlayState* play) {
EnTest7* this = THIS;
- this->unk_1E58(this, play);
+ this->actionFunc(this, play);
- if (this->actionFunc != NULL) {
- this->actionFunc(this, play);
+ if (this->playerCamFunc != NULL) {
+ this->playerCamFunc(this, play);
}
- this->unk_1E54++;
+ this->timer++;
- func_80AF118C(play, this->unk_15C, this, (this->unk_144 & 8) != 0, (this->unk_144 & 0x10) != 0);
+ EnTest7_UpdateFeathers(play, this->feathers, this, (this->flags & OWL_WARP_FLAGS_8) != 0,
+ (this->flags & OWL_WARP_FLAGS_10) != 0);
}
s32 func_80AF31D0(PlayState* play, SkeletonInfo* skeletonInfo, s32 limbIndex, Gfx** dList, u8* flags, Actor* thisx,
Vec3f* scale, Vec3s* rot, Vec3f* pos) {
EnTest7* this = THIS;
- Vec3f sp18;
+ Vec3f featherPos;
if ((*dList != NULL) && (Rand_ZeroOne() < 0.03f)) {
- Matrix_MultVec3f(&gZeroVec3f, &sp18);
- func_80AF0C30(this->unk_15C, &sp18, 0);
+ Matrix_MultVec3f(&gZeroVec3f, &featherPos);
+ EnTest7_AddAndChooseFeather(this->feathers, &featherPos, false);
}
return true;
}
@@ -962,31 +970,32 @@ void EnTest7_Draw(Actor* thisx, PlayState* play) {
EnTest7* this = THIS;
s32 sp40;
- if (this->unk_144 & 1) {
- Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, this->unk_18CC.unk_18->unk_1 * sizeof(Mtx));
+ // Draw wings
+ if (this->flags & OWL_WARP_FLAGS_DRAW_WINGS) {
+ Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, this->skeletonInfo.unk_18->unk_1 * sizeof(Mtx));
- if (mtx != NULL) {
- func_8018450C(play, &this->unk_18CC, mtx, func_80AF31D0, NULL, &this->actor);
- } else {
+ if (mtx == NULL) {
return;
}
+ func_8018450C(play, &this->skeletonInfo, mtx, func_80AF31D0, NULL, &this->actor);
}
- if (this->unk_144 & 2) {
+ // Draw windCapsule encasing that surrounds player after wings
+ if (this->flags & OWL_WARP_FLAGS_DRAW_WIND_CAPSULE) {
Matrix_Push();
Matrix_Translate(0.0f, 4000.0f, 0.0f, MTXMODE_APPLY);
- Matrix_RotateZYX(0, this->unk_148.unk_10, 0, MTXMODE_APPLY);
- Matrix_Scale(this->unk_148.unk_08 * 100.0f, this->unk_148.unk_0C * 100.0f, this->unk_148.unk_08 * 100.0f,
- MTXMODE_APPLY);
- sp40 = this->unk_148.unk_00;
- AnimatedMat_DrawStep(play, Lib_SegmentedToVirtual(&gameplay_keep_Matanimheader_0815D0), sp40);
- Gfx_DrawDListXlu(play, gameplay_keep_DL_080FC8);
+ Matrix_RotateZYX(0, this->windCapsule.yaw, 0, MTXMODE_APPLY);
+ Matrix_Scale(this->windCapsule.xzScale * 100.0f, this->windCapsule.yScale * 100.0f,
+ this->windCapsule.xzScale * 100.0f, MTXMODE_APPLY);
+ sp40 = this->windCapsule.unk_00;
+ AnimatedMat_DrawStep(play, Lib_SegmentedToVirtual(&gSoaringWarpCsWindCapsuleTexAnim), sp40);
+ Gfx_DrawDListXlu(play, gSoaringWarpCsWindCapsuleDL);
Matrix_Pop();
}
- func_80AF14FC(play, this->unk_15C);
+ EnTest7_DrawFeathers(play, this->feathers);
- if (this->unk_144 & 4) {
+ if (this->flags & OWL_WARP_FLAGS_DRAW_LENS_FLARE) {
Environment_DrawLensFlare(play, &play->envCtx, &play->view, play->state.gfxCtx, this->actor.world.pos, 70.0f,
5.0f, 0, false);
}
diff --git a/src/overlays/actors/ovl_En_Test7/z_en_test7.h b/src/overlays/actors/ovl_En_Test7/z_en_test7.h
index 30bf8e73cf..87c26a3564 100644
--- a/src/overlays/actors/ovl_En_Test7/z_en_test7.h
+++ b/src/overlays/actors/ovl_En_Test7/z_en_test7.h
@@ -5,61 +5,69 @@
struct EnTest7;
+typedef void (*EnTest7PlayerCamFunc)(struct EnTest7*, PlayState*);
typedef void (*EnTest7ActionFunc)(struct EnTest7*, PlayState*);
-typedef void (*EnTest7UnkFunc)(struct EnTest7*, PlayState*);
-typedef void (*EnTest7UnkDrawFunc)(Actor*, PlayState*);
-#define ENTEST7_GET(thisx) ((thisx)->params)
+#define OWL_WARP_CS_GET_OCARINA_MODE(thisx) ((thisx)->params)
-#define ENTEST7_MINUS1 -1
-#define ENTEST7_26 0x26
-#define ENTEST7_1C 0x1C
+#define ENTEST7_ARRIVE -1
typedef struct {
/* 0x00 */ f32 unk_00;
/* 0x04 */ f32 unk_04;
- /* 0x08 */ f32 unk_08;
- /* 0x0C */ f32 unk_0C;
- /* 0x10 */ s16 unk_10;
-} EnTest7Struct; // size >= 0x14
+ /* 0x08 */ f32 xzScale;
+ /* 0x0C */ f32 yScale;
+ /* 0x10 */ s16 yaw;
+} OwlWarpWindCapsule; // size = 0x14
+
+typedef enum OwlWarpFeatherType {
+ /* 0 */ OWL_WARP_FEATHER_TYPE_DISABLED,
+ /* 1 */ OWL_WARP_FEATHER_TYPE_1,
+ /* 2 */ OWL_WARP_FEATHER_TYPE_2
+} OwlWarpFeatherType;
typedef struct {
- /* 0x00 */ s32 unk_00;
+ /* 0x00 */ OwlWarpFeatherType type;
/* 0x04 */ s32 unk_04;
- /* 0x08 */ Vec3f unk_08;
- /* 0x14 */ f32 unk_14;
- /* 0x18 */ f32 unk_18;
- /* 0x1C */ f32 unk_1C;
- /* 0x20 */ f32 unk_20;
- /* 0x24 */ f32 unk_24;
- /* 0x28 */ f32 unk_28;
- /* 0x2C */ f32 unk_2C;
- /* 0x30 */ Vec3s unk_30;
- /* 0x36 */ s16 unk_36;
- /* 0x38 */ s16 unk_38;
- /* 0x3A */ s16 unk_3A;
-} EnTest7Struct2; // size = 0x3C
+ /* 0x08 */ Vec3f pos;
+ /* 0x14 */ Vec3f velocity;
+ /* 0x20 */ Vec3f accel;
+ /* 0x2C */ f32 scale;
+ /* 0x30 */ Vec3s rot;
+ /* 0x36 */ Vec3s angularVelocity;
+} OwlWarpFeather; // size = 0x3C
+
+#define OWL_WARP_NUM_FEATHERS 100
+
+#define OWL_WARP_FLAGS_DRAW_WINGS (1 << 0)
+#define OWL_WARP_FLAGS_DRAW_WIND_CAPSULE (1 << 1)
+#define OWL_WARP_FLAGS_DRAW_LENS_FLARE (1 << 2)
+#define OWL_WARP_FLAGS_8 (1 << 3)
+#define OWL_WARP_FLAGS_10 (1 << 4)
+#define OWL_WARP_FLAGS_20 (1 << 5)
+#define OWL_WARP_FLAGS_40 (1 << 6)
+#define OWL_WARP_FLAGS_80 (1 << 7)
typedef struct EnTest7 {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ s32 unk_144;
- /* 0x0148 */ EnTest7Struct unk_148;
- /* 0x015C */ EnTest7Struct2 unk_15C[100];
- /* 0x18CC */ SkeletonInfo unk_18CC;
- /* 0x18FC */ Vec3s unk_18FC[114];
+ /* 0x0144 */ s32 flags;
+ /* 0x0148 */ OwlWarpWindCapsule windCapsule;
+ /* 0x015C */ OwlWarpFeather feathers[OWL_WARP_NUM_FEATHERS];
+ /* 0x18CC */ SkeletonInfo skeletonInfo; // wingsSkeletonInfo
+ /* 0x18FC */ Vec3s unk_18FC[114]; // wingsFrameData
/* 0x1BA8 */ Vec3s unk_1BA8[114];
- /* 0x1E54 */ s32 unk_1E54;
- /* 0x1E58 */ EnTest7UnkFunc unk_1E58;
- /* 0x1E5C */ EnTest7ActionFunc actionFunc;
+ /* 0x1E54 */ s32 timer;
+ /* 0x1E58 */ EnTest7ActionFunc actionFunc;
+ /* 0x1E5C */ EnTest7PlayerCamFunc playerCamFunc;
/* 0x1E60 */ Vec3f subCamEye;
/* 0x1E6C */ Vec3f subCamAt;
/* 0x1E78 */ f32 subCamFov;
/* 0x1E7C */ LightNode* lightNode;
/* 0x1E80 */ LightInfo lightInfo;
- /* 0x1E8E */ s16 unk_1E8E;
- /* 0x1E90 */ f32 unk_1E90;
- /* 0x1E94 */ f32 unk_1E94;
- /* 0x1E98 */ EnTest7UnkDrawFunc unk_1E98;
+ /* 0x1E8E */ s16 playerYaw;
+ /* 0x1E90 */ f32 playerScaleX;
+ /* 0x1E94 */ f32 playerScaleZ;
+ /* 0x1E98 */ ActorFunc playerDrawFunc;
} EnTest7; // size = 0x1E9C
#endif // Z_EN_TEST7_H
diff --git a/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.c b/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.c
index 927cae59f8..b490af0b82 100644
--- a/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.c
+++ b/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.c
@@ -220,7 +220,7 @@ void ObjKendoKanban_Init(Actor* thisx, PlayState* play) {
this->rootCornerPos = sZeroVec;
this->rotAxis = sUnitVecX;
this->rotAngle = 0;
- this->rotVelocity = 0;
+ this->angularVelocity = 0;
this->indexLastRootCornerPos = -1;
this->hasNewRootCornerPos = false;
this->numBounces = 0;
@@ -261,7 +261,7 @@ void ObjKendoKanban_SetupTumble(ObjKendoKanban* this, PlayState* play) {
// Vertical cuts initialize the right half, spawn the left half.
this->boardFragments = OBJKENDOKANBAN_RIGHT_HALF;
- this->rotVelocity = 0x71C; // 10 degrees
+ this->angularVelocity = 0x71C; // 10 degrees
this->actor.velocity = sVelocityRightHalf;
this->centerPoint = sCenterPointRightHalf;
@@ -276,7 +276,7 @@ void ObjKendoKanban_SetupTumble(ObjKendoKanban* this, PlayState* play) {
} else {
// Horizontal cuts initialize the bottom half, spawn the top half.
this->boardFragments = OBJKENDOKANBAN_BOTTOM_HALF;
- this->rotVelocity = -0x71C; // -10 degrees
+ this->angularVelocity = -0x71C; // -10 degrees
this->actor.velocity = sVelocityBottomHalf;
this->centerPoint = sCenterPointBottomHalf;
@@ -290,7 +290,7 @@ void ObjKendoKanban_SetupTumble(ObjKendoKanban* this, PlayState* play) {
}
} else if (this->boardFragments == OBJKENDOKANBAN_LEFT_HALF) {
// Initialize the newly spawned left half
- this->rotVelocity = 0x71C; // 10 degrees
+ this->angularVelocity = 0x71C; // 10 degrees
this->actor.velocity = sVelocityLeftHalf;
this->centerPoint = sCenterPointLeftHalf;
@@ -300,7 +300,7 @@ void ObjKendoKanban_SetupTumble(ObjKendoKanban* this, PlayState* play) {
this->cornerPoints[3] = sPointBL;
} else if (this->boardFragments == OBJKENDOKANBAN_TOP_HALF) {
// Initialize the newly spawned top half
- this->rotVelocity = 0x71C; // 10 degrees
+ this->angularVelocity = 0x71C; // 10 degrees
this->actor.velocity = sVelocityTopHalf;
this->centerPoint = sCenterPointTopHalf;
@@ -317,7 +317,7 @@ void ObjKendoKanban_SetupTumble(ObjKendoKanban* this, PlayState* play) {
void ObjKendoKanban_Tumble(ObjKendoKanban* this, PlayState* play) {
this->actor.velocity.y += this->actor.gravity;
Actor_UpdatePos(&this->actor);
- this->rotAngle += this->rotVelocity;
+ this->rotAngle += this->angularVelocity;
ObjKendoKanban_HandlePhysics(this, play);
if (this->actor.world.pos.y < -200.0f) {
this->actor.world.pos.y = -200.0f;
@@ -351,9 +351,9 @@ void ObjKendoKanban_HandlePhysics(ObjKendoKanban* this, PlayState* play) {
vecCenterOut.z -= this->centerPos.z;
verticalScalar = (this->rotAxis.x * vecCenterOut.z) + (this->rotAxis.z * -vecCenterOut.x);
if (verticalScalar < 0.0f) {
- this->rotVelocity += 0x64;
+ this->angularVelocity += 0x64;
} else {
- this->rotVelocity -= 0x64;
+ this->angularVelocity -= 0x64;
}
// Find the lowest point
@@ -396,7 +396,7 @@ void ObjKendoKanban_HandlePhysics(ObjKendoKanban* this, PlayState* play) {
deltaRotAngle -= 0x4000; // 90 degrees
}
this->rotAngle -= deltaRotAngle;
- this->rotVelocity = 0;
+ this->angularVelocity = 0;
ObjKendoKanban_SetupSettled(this);
return;
}
@@ -417,16 +417,16 @@ void ObjKendoKanban_HandlePhysics(ObjKendoKanban* this, PlayState* play) {
// Adjust and (potentially) reverse rotation depending on the current
// facing of the board and the direction in which it is rotating.
if (verticalScalar > 0.0f) {
- if (this->rotVelocity > 0) {
- this->rotVelocity *= 1.2f;
+ if (this->angularVelocity > 0) {
+ this->angularVelocity *= 1.2f;
} else {
- this->rotVelocity *= -0.6f;
+ this->angularVelocity *= -0.6f;
}
} else {
- if (this->rotVelocity < 0) {
- this->rotVelocity *= 1.2f;
+ if (this->angularVelocity < 0) {
+ this->angularVelocity *= 1.2f;
} else {
- this->rotVelocity *= -0.6f;
+ this->angularVelocity *= -0.6f;
}
}
}
diff --git a/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.h b/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.h
index 72bf6e71ec..84836ef7f2 100644
--- a/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.h
+++ b/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.h
@@ -24,7 +24,7 @@ typedef struct ObjKendoKanban {
/* 0x2FC */ s32 indexLastRootCornerPos;
/* 0x300 */ s16 hasNewRootCornerPos;
/* 0x302 */ s16 rotAngle;
- /* 0x304 */ s16 rotVelocity;
+ /* 0x304 */ s16 angularVelocity;
/* 0x306 */ UNK_TYPE1 pad306[2];
/* 0x308 */ s16 numBounces;
/* 0x30A */ s16 unk_30A;
diff --git a/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c b/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c
index 3908c4c8d9..e139763f2c 100644
--- a/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c
+++ b/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c
@@ -71,7 +71,7 @@ void ObjWarpstone_Init(Actor* thisx, PlayState* play) {
Collider_InitAndSetCylinder(play, &this->collider, &this->dyna.actor, &sCylinderInit);
Actor_SetFocus(&this->dyna.actor, 40.0f);
- if (!OBJ_WARPSTONE_IS_ACTIVATED(OBJ_WARPSTONE_GET_ID(&this->dyna.actor))) {
+ if (!GET_OWL_STATUE_ACTIVATED(OBJ_WARPSTONE_GET_OWL_WARP_ID(&this->dyna.actor))) {
ObjWarpstone_SetupAction(this, ObjWarpstone_ClosedIdle);
} else {
ObjWarpstone_SetupAction(this, ObjWarpstone_OpenedIdle);
@@ -110,7 +110,7 @@ s32 ObjWarpstone_BeginOpeningCutscene(ObjWarpstone* this, PlayState* play) {
s32 ObjWarpstone_PlayOpeningCutscene(ObjWarpstone* this, PlayState* play) {
if (this->openingCSTimer++ >= OBJ_WARPSTONE_TIMER_ACTIVATE_THRESHOLD) {
CutsceneManager_Stop(this->dyna.actor.csId);
- Sram_ActivateOwl(OBJ_WARPSTONE_GET_ID(&this->dyna.actor));
+ Sram_ActivateOwl(OBJ_WARPSTONE_GET_OWL_WARP_ID(&this->dyna.actor));
ObjWarpstone_SetupAction(this, ObjWarpstone_OpenedIdle);
} else if (this->openingCSTimer < OBJ_WARPSTONE_TIMER_OPEN_THRESHOLD) {
Math_StepToF(&this->dyna.actor.velocity.x, 0.01f, 0.001f);
@@ -144,7 +144,7 @@ void ObjWarpstone_Update(Actor* thisx, PlayState* play) {
play->msgCtx.msgMode = MSGMODE_OWL_SAVE_0;
play->msgCtx.unk120D6 = 0;
play->msgCtx.unk120D4 = 0;
- gSaveContext.save.owlSaveLocation = OBJ_WARPSTONE_GET_ID(&this->dyna.actor);
+ gSaveContext.save.owlWarpId = OBJ_WARPSTONE_GET_OWL_WARP_ID(&this->dyna.actor);
} else {
Message_CloseTextbox(play);
}
diff --git a/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.h b/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.h
index 241eb825dc..29bfe32027 100644
--- a/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.h
+++ b/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.h
@@ -26,7 +26,6 @@ typedef struct ObjWarpstone {
/* 0x1AC */ ObjWarpstoneActionFunc actionFunc;
} ObjWarpstone; // size = 0x1B0
-#define OBJ_WARPSTONE_GET_ID(thisx) ((u16)((thisx)->params & 0xF))
-#define OBJ_WARPSTONE_IS_ACTIVATED(owlId) (((void)0, gSaveContext.save.saveInfo.playerData.owlActivationFlags) & (u16)gBitFlags[(owlId)])
+#define OBJ_WARPSTONE_GET_OWL_WARP_ID(thisx) ((u16)((thisx)->params & 0xF))
#endif // Z_OBJ_WARPSTONE_H
diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c
index 1a1983b864..a4768d6ec8 100644
--- a/src/overlays/actors/ovl_player_actor/z_player.c
+++ b/src/overlays/actors/ovl_player_actor/z_player.c
@@ -10541,7 +10541,7 @@ void Player_InitMode_6(PlayState* play, Player* this) {
this->stateFlags1 |= PLAYER_STATE1_20000000;
this->stateFlags2 |= PLAYER_STATE2_20000000;
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_TEST7, this->actor.world.pos.x, this->actor.world.pos.y,
- this->actor.world.pos.z, 0, 0, 0, ENTEST7_MINUS1);
+ this->actor.world.pos.z, 0, 0, 0, ENTEST7_ARRIVE);
}
}
@@ -10610,26 +10610,25 @@ void func_80841A50(PlayState* play, Player* this) {
typedef void (*PlayerInitModeFunc)(PlayState*, Player*);
-// Initialisation functions for various gameplay modes depending on spawn params. There may be at most 0x10 due to it
-// using a single nybble.
-// sInitModeFuncs
-PlayerInitModeFunc D_8085D2CC[0x10] = {
- /* 0x0 */ Player_InitMode_0,
- /* 0x1 */ Player_InitMode_1,
- /* 0x2 */ Player_InitMode_2,
- /* 0x3 */ Player_InitMode_3,
- /* 0x4 */ Player_InitMode_4,
- /* 0x5 */ Player_InitMode_5,
- /* 0x6 */ Player_InitMode_6,
- /* 0x7 */ Player_InitMode_7,
- /* 0x8 */ func_80841744,
- /* 0x9 */ func_80841744,
- /* 0xA */ func_8083ADF0,
- /* 0xB */ Player_InitMode_B,
- /* 0xC */ Player_InitMode_Telescope,
- /* 0xD */ Player_InitMode_D,
- /* 0xE */ func_8083ADF0,
- /* 0xF */ Player_InitMode_F,
+// Initialisation functions for various gameplay modes depending on spawn params.
+// There may be at most 0x10 due to it using a single nybble.
+PlayerInitModeFunc sPlayerInitModeFuncs[PLAYER_INITMODE_MAX] = {
+ Player_InitMode_0, // PLAYER_INITMODE_0
+ Player_InitMode_1, // PLAYER_INITMODE_1
+ Player_InitMode_2, // PLAYER_INITMODE_2
+ Player_InitMode_3, // PLAYER_INITMODE_3
+ Player_InitMode_4, // PLAYER_INITMODE_4
+ Player_InitMode_5, // PLAYER_INITMODE_5
+ Player_InitMode_6, // PLAYER_INITMODE_6
+ Player_InitMode_7, // PLAYER_INITMODE_7
+ func_80841744, // PLAYER_INITMODE_8
+ func_80841744, // PLAYER_INITMODE_9
+ func_8083ADF0, // PLAYER_INITMODE_A
+ Player_InitMode_B, // PLAYER_INITMODE_B
+ Player_InitMode_Telescope, // PLAYER_INITMODE_TELESCOPE
+ Player_InitMode_D, // PLAYER_INITMODE_D
+ func_8083ADF0, // PLAYER_INITMODE_E
+ Player_InitMode_F, // PLAYER_INITMODE_F
};
// sBlureInit
@@ -10867,7 +10866,7 @@ void Player_Init(Actor* thisx, PlayState* play) {
initMode = PLAYER_INITMODE_D;
}
- D_8085D2CC[initMode](play, this);
+ sPlayerInitModeFuncs[initMode](play, this);
if ((this->actor.draw != NULL) && gSaveContext.save.hasTatl &&
((gSaveContext.gameMode == GAMEMODE_NORMAL) || (gSaveContext.gameMode == GAMEMODE_END_CREDITS)) &&
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c
index ec1ca83ec9..3af7105d73 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c
@@ -661,17 +661,17 @@ void KaleidoScope_DrawWorldMap(PlayState* play) {
}
}
- if (IS_PAUSE_STATE_OWLWARP) {
+ if (IS_PAUSE_STATE_OWL_WARP) {
gDPPipeSync(POLY_OPA_DISP++);
gDPSetRenderMode(POLY_OPA_DISP++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
gDPSetCombineMode(POLY_OPA_DISP++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
- gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, R_PAUSE_OWLWARP_ALPHA);
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, R_PAUSE_OWL_WARP_ALPHA);
gDPFillRectangle(POLY_OPA_DISP++, 50, 62, 270, 190);
}
Gfx_SetupDL42_Opa(play->state.gfxCtx);
- if (!IS_PAUSE_STATE_OWLWARP) {
+ if (!IS_PAUSE_STATE_OWL_WARP) {
// Browsing the world map regions on the pause menu
gDPLoadTextureBlock(POLY_OPA_DISP++, gWorldMapDotTex, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
@@ -953,7 +953,7 @@ void KaleidoScope_UpdateWorldMapCursor(PlayState* play) {
if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_WORLD_MAP]) {
Audio_PlaySfx(NA_SE_SY_CURSOR);
}
- } else if (pauseCtx->state == PAUSE_STATE_OWLWARP_SELECT) {
+ } else if (pauseCtx->state == PAUSE_STATE_OWL_WARP_SELECT) {
pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_BLUE;
oldCursorPoint = pauseCtx->cursorPoint[PAUSE_WORLD_MAP];
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h
index c82a40e67e..fc7b531078 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h
@@ -48,13 +48,13 @@ typedef enum {
/* 0x10 */ PAUSE_STATE_GAMEOVER_8,
/* 0x11 */ PAUSE_STATE_GAMEOVER_CONTINUE_PROMPT,
/* 0x12 */ PAUSE_STATE_GAMEOVER_10,
- /* 0x13 */ PAUSE_STATE_OWLWARP_0,
- /* 0x14 */ PAUSE_STATE_OWLWARP_1,
- /* 0x15 */ PAUSE_STATE_OWLWARP_2,
- /* 0x16 */ PAUSE_STATE_OWLWARP_3,
- /* 0x17 */ PAUSE_STATE_OWLWARP_SELECT, // Selecting the destination
- /* 0x18 */ PAUSE_STATE_OWLWARP_CONFIRM, // Confirming the choice given
- /* 0x19 */ PAUSE_STATE_OWLWARP_6,
+ /* 0x13 */ PAUSE_STATE_OWL_WARP_0,
+ /* 0x14 */ PAUSE_STATE_OWL_WARP_1,
+ /* 0x15 */ PAUSE_STATE_OWL_WARP_2,
+ /* 0x16 */ PAUSE_STATE_OWL_WARP_3,
+ /* 0x17 */ PAUSE_STATE_OWL_WARP_SELECT, // Selecting the destination
+ /* 0x18 */ PAUSE_STATE_OWL_WARP_CONFIRM, // Confirming the choice given
+ /* 0x19 */ PAUSE_STATE_OWL_WARP_6,
/* 0x1A */ PAUSE_STATE_UNPAUSE_SETUP, // Unpause
/* 0x1B */ PAUSE_STATE_UNPAUSE_CLOSE
} PauseState;
@@ -89,8 +89,8 @@ typedef enum {
#define IS_PAUSE_STATE_GAMEOVER \
((pauseCtx->state >= PAUSE_STATE_GAMEOVER_0) && (pauseCtx->state <= PAUSE_STATE_GAMEOVER_10))
-#define IS_PAUSE_STATE_OWLWARP \
- ((pauseCtx->state >= PAUSE_STATE_OWLWARP_2) && (pauseCtx->state <= PAUSE_STATE_OWLWARP_6))
+#define IS_PAUSE_STATE_OWL_WARP \
+ ((pauseCtx->state >= PAUSE_STATE_OWL_WARP_2) && (pauseCtx->state <= PAUSE_STATE_OWL_WARP_6))
#define IS_PAUSE_MAIN_STATE_SONG_PROMPT \
((pauseCtx->mainState >= PAUSE_MAIN_STATE_SONG_PROMPT_INIT) && \
diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c
index d3034bab1d..7e741194de 100644
--- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c
+++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c
@@ -662,8 +662,8 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) {
} else {
Matrix_RotateYF(R_PAUSE_WORLD_MAP_YAW / 1000.0f, MTXMODE_NEW);
- if ((pauseCtx->state == PAUSE_STATE_OPENING_3) || (pauseCtx->state == PAUSE_STATE_OWLWARP_3) ||
- (pauseCtx->state >= PAUSE_STATE_OWLWARP_6) ||
+ if ((pauseCtx->state == PAUSE_STATE_OPENING_3) || (pauseCtx->state == PAUSE_STATE_OWL_WARP_3) ||
+ (pauseCtx->state >= PAUSE_STATE_OWL_WARP_6) ||
((pauseCtx->state == PAUSE_STATE_SAVEPROMPT) &&
((pauseCtx->savePromptState == PAUSE_SAVEPROMPT_STATE_3) ||
(pauseCtx->savePromptState == PAUSE_SAVEPROMPT_STATE_7)))) {
@@ -1175,8 +1175,8 @@ void KaleidoScope_DrawOwlWarpMapPage(PlayState* play) {
Matrix_RotateYF(R_PAUSE_WORLD_MAP_YAW / 1000.0f, MTXMODE_NEW);
- if ((pauseCtx->state == PAUSE_STATE_OPENING_3) || (pauseCtx->state == PAUSE_STATE_OWLWARP_3) ||
- (pauseCtx->state >= PAUSE_STATE_OWLWARP_6) ||
+ if ((pauseCtx->state == PAUSE_STATE_OPENING_3) || (pauseCtx->state == PAUSE_STATE_OWL_WARP_3) ||
+ (pauseCtx->state >= PAUSE_STATE_OWL_WARP_6) ||
((pauseCtx->state == PAUSE_STATE_SAVEPROMPT) && ((pauseCtx->savePromptState == PAUSE_SAVEPROMPT_STATE_3) ||
(pauseCtx->savePromptState == PAUSE_SAVEPROMPT_STATE_7)))) {
Matrix_Translate(0.0f, (R_PAUSE_WORLD_MAP_Y_OFFSET - 8000) / 100.0f, R_PAUSE_WORLD_MAP_DEPTH / 100.0f,
@@ -1376,7 +1376,7 @@ void KaleidoScope_DrawOwlWarpInfoPanel(PlayState* play) {
ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
gDPSetEnvColor(POLY_OPA_DISP++, 20, 30, 40, 0);
- if ((pauseCtx->state == PAUSE_STATE_OWLWARP_SELECT) && (pauseCtx->namedItem != PAUSE_ITEM_NONE) &&
+ if ((pauseCtx->state == PAUSE_STATE_OWL_WARP_SELECT) && (pauseCtx->namedItem != PAUSE_ITEM_NONE) &&
(pauseCtx->nameDisplayTimer < 40)) {
pauseCtx->infoPanelVtx[16].v.ob[0] = pauseCtx->infoPanelVtx[18].v.ob[0] = -63;
@@ -1950,8 +1950,8 @@ void KaleidoScope_SetVertices(PlayState* play, GraphicsContext* gfxCtx) {
pauseCtx->offsetY = 0;
- if ((pauseCtx->state == PAUSE_STATE_OPENING_3) || (pauseCtx->state == PAUSE_STATE_OWLWARP_3) ||
- (pauseCtx->state >= PAUSE_STATE_OWLWARP_6) ||
+ if ((pauseCtx->state == PAUSE_STATE_OPENING_3) || (pauseCtx->state == PAUSE_STATE_OWL_WARP_3) ||
+ (pauseCtx->state >= PAUSE_STATE_OWL_WARP_6) ||
((pauseCtx->state == PAUSE_STATE_SAVEPROMPT) && ((pauseCtx->savePromptState == PAUSE_SAVEPROMPT_STATE_3) ||
(pauseCtx->savePromptState == PAUSE_SAVEPROMPT_STATE_7)))) {
pauseCtx->offsetY = 80;
@@ -2473,14 +2473,14 @@ void KaleidoScope_UpdateCursorSize(PlayState* play) {
case PAUSE_MAP:
if (!sInDungeonScene) {
- if (IS_PAUSE_STATE_OWLWARP) {
+ if (IS_PAUSE_STATE_OWL_WARP) {
pauseCtx->cursorX = sOwlWarpWorldMapCursorsX[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]];
pauseCtx->cursorY = sOwlWarpWorldMapCursorsY[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]];
} else {
pauseCtx->cursorX = sWorldMapCursorsX[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]];
pauseCtx->cursorY = sWorldMapCursorsY[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]];
}
- if (!IS_PAUSE_STATE_OWLWARP) {
+ if (!IS_PAUSE_STATE_OWL_WARP) {
pauseCtx->cursorHeight = 10.0f;
pauseCtx->cursorWidth = 10.0f;
} else {
@@ -2684,7 +2684,7 @@ void KaleidoScope_Draw(PlayState* play) {
KaleidoScope_SetView(pauseCtx, pauseCtx->eye.x, pauseCtx->eye.y, pauseCtx->eye.z);
Gfx_SetupDL42_Opa(play->state.gfxCtx);
- if (!IS_PAUSE_STATE_OWLWARP) {
+ if (!IS_PAUSE_STATE_OWL_WARP) {
// Draw Default or Game Over Menus
KaleidoScope_SetVertices(play, play->state.gfxCtx);
KaleidoScope_DrawPages(play, play->state.gfxCtx);
@@ -2723,7 +2723,7 @@ void KaleidoScope_Draw(PlayState* play) {
KaleidoScope_DrawOwlWarpInfoPanel(play);
KaleidoScope_UpdateCursorSize(play);
- if (pauseCtx->state == PAUSE_STATE_OWLWARP_SELECT) {
+ if (pauseCtx->state == PAUSE_STATE_OWL_WARP_SELECT) {
KaleidoScope_DrawCursor(play);
}
}
@@ -3417,7 +3417,7 @@ void KaleidoScope_Update(PlayState* play) {
}
break;
- case PAUSE_STATE_OWLWARP_2:
+ case PAUSE_STATE_OWL_WARP_2:
sPauseMenuVerticalOffset = -6240.0f;
sUnpausedButtonStatus[EQUIP_SLOT_B] = gSaveContext.buttonStatus[EQUIP_SLOT_B];
@@ -3455,13 +3455,13 @@ void KaleidoScope_Update(PlayState* play) {
DmaMgr_SendRequest0(pauseCtx->iconItemVtxSegment, SEGMENT_ROM_START(icon_item_vtx_static),
SEGMENT_ROM_SIZE(icon_item_vtx_static));
- pauseCtx->state = PAUSE_STATE_OWLWARP_3;
+ pauseCtx->state = PAUSE_STATE_OWL_WARP_3;
sGameOverRectPosY = 98;
pauseCtx->promptChoice = PAUSE_PROMPT_YES;
break;
- case PAUSE_STATE_OWLWARP_3:
- R_PAUSE_OWLWARP_ALPHA += 20;
+ case PAUSE_STATE_OWL_WARP_3:
+ R_PAUSE_OWL_WARP_ALPHA += 20;
pauseCtx->infoPanelOffsetY += 10;
pauseCtx->mapPageRoll -= 40.0f;
interfaceCtx->startAlpha += 63;
@@ -3476,15 +3476,15 @@ void KaleidoScope_Update(PlayState* play) {
pauseCtx->alpha = 255;
pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE;
pauseCtx->cursorSpecialPos = 0;
- pauseCtx->state = PAUSE_STATE_OWLWARP_SELECT;
- R_PAUSE_OWLWARP_ALPHA = 120;
+ pauseCtx->state = PAUSE_STATE_OWL_WARP_SELECT;
+ R_PAUSE_OWL_WARP_ALPHA = 120;
}
break;
- case PAUSE_STATE_OWLWARP_SELECT:
+ case PAUSE_STATE_OWL_WARP_SELECT:
if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_B)) {
func_8011552C(play, DO_ACTION_NONE);
- pauseCtx->state = PAUSE_STATE_OWLWARP_6;
+ pauseCtx->state = PAUSE_STATE_OWL_WARP_6;
sPauseMenuVerticalOffset = -6240.0f;
Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE);
play->msgCtx.ocarinaMode = OCARINA_MODE_END;
@@ -3492,38 +3492,38 @@ void KaleidoScope_Update(PlayState* play) {
} else if (CHECK_BTN_ALL(input->press.button, BTN_A)) {
Audio_PlaySfx(NA_SE_SY_DECIDE);
Message_StartTextbox(play, 0x1B93, NULL);
- pauseCtx->state = PAUSE_STATE_OWLWARP_CONFIRM;
+ pauseCtx->state = PAUSE_STATE_OWL_WARP_CONFIRM;
} else {
KaleidoScope_UpdateOwlWarpNamePanel(play);
}
break;
- case PAUSE_STATE_OWLWARP_CONFIRM:
+ case PAUSE_STATE_OWL_WARP_CONFIRM:
if (CHECK_BTN_ALL(input->press.button, BTN_A)) {
msgCtx->msgLength = 0;
msgCtx->msgMode = MSGMODE_NONE;
if (msgCtx->choiceIndex == 0) {
func_8011552C(play, DO_ACTION_NONE);
- pauseCtx->state = PAUSE_STATE_OWLWARP_6;
+ pauseCtx->state = PAUSE_STATE_OWL_WARP_6;
sPauseMenuVerticalOffset = -6240.0f;
Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE);
play->msgCtx.ocarinaMode = sCursorPointsToOcarinaModes[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]];
Audio_PlaySfx(NA_SE_SY_DECIDE);
} else {
- pauseCtx->state = PAUSE_STATE_OWLWARP_SELECT;
+ pauseCtx->state = PAUSE_STATE_OWL_WARP_SELECT;
func_8011552C(play, DO_ACTION_WARP);
Audio_PlaySfx(NA_SE_SY_MESSAGE_PASS);
}
} else if (CHECK_BTN_ALL(input->press.button, BTN_B)) {
msgCtx->msgLength = 0;
msgCtx->msgMode = MSGMODE_NONE;
- pauseCtx->state = PAUSE_STATE_OWLWARP_SELECT;
+ pauseCtx->state = PAUSE_STATE_OWL_WARP_SELECT;
Audio_PlaySfx(NA_SE_SY_MESSAGE_PASS);
} else if (CHECK_BTN_ALL(input->press.button, BTN_START)) {
msgCtx->msgLength = 0;
msgCtx->msgMode = MSGMODE_NONE;
func_8011552C(play, DO_ACTION_NONE);
- pauseCtx->state = PAUSE_STATE_OWLWARP_6;
+ pauseCtx->state = PAUSE_STATE_OWL_WARP_6;
sPauseMenuVerticalOffset = -6240.0f;
Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE);
play->msgCtx.ocarinaMode = OCARINA_MODE_END;
@@ -3531,11 +3531,11 @@ void KaleidoScope_Update(PlayState* play) {
}
break;
- case PAUSE_STATE_OWLWARP_6:
+ case PAUSE_STATE_OWL_WARP_6:
if (pauseCtx->mapPageRoll != 160.0f) {
- R_PAUSE_OWLWARP_ALPHA -= 60;
- if (R_PAUSE_OWLWARP_ALPHA <= 0) {
- R_PAUSE_OWLWARP_ALPHA = 0;
+ R_PAUSE_OWL_WARP_ALPHA -= 60;
+ if (R_PAUSE_OWL_WARP_ALPHA <= 0) {
+ R_PAUSE_OWL_WARP_ALPHA = 0;
}
pauseCtx->infoPanelOffsetY -= 10;
pauseCtx->mapPageRoll += 40.0f;
@@ -3691,7 +3691,7 @@ void KaleidoScope_Update(PlayState* play) {
// Process the Cursor input
if ((R_PAUSE_BG_PRERENDER_STATE == PAUSE_BG_PRERENDER_READY) && (pauseCtx->debugEditor == DEBUG_EDITOR_NONE) &&
- !IS_PAUSE_STATE_OWLWARP &&
+ !IS_PAUSE_STATE_OWL_WARP &&
(((pauseCtx->state >= PAUSE_STATE_OPENING_3) && (pauseCtx->state <= PAUSE_STATE_SAVEPROMPT)) ||
((pauseCtx->state >= PAUSE_STATE_GAMEOVER_2) && (pauseCtx->state <= PAUSE_STATE_UNPAUSE_SETUP)))) {
if (!IS_PAUSE_STATE_GAMEOVER) {
@@ -3726,7 +3726,7 @@ void KaleidoScope_Update(PlayState* play) {
if (pauseCtx->state == PAUSE_STATE_MAIN) {
KaleidoScope_UpdateNamePanel(play);
}
- } else if (pauseCtx->state == PAUSE_STATE_OWLWARP_SELECT) {
+ } else if (pauseCtx->state == PAUSE_STATE_OWL_WARP_SELECT) {
KaleidoScope_UpdateWorldMapCursor(play);
KaleidoScope_UpdateNamePanel(play);
}
diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt
index d5d5e1f6f2..bf421506cb 100644
--- a/tools/disasm/functions.txt
+++ b/tools/disasm/functions.txt
@@ -12618,41 +12618,41 @@
0x80AF0530:("func_80AF0530",),
0x80AF06CC:("ObjLupygamelift_Update",),
0x80AF06F0:("ObjLupygamelift_Draw",),
- 0x80AF0820:("EnTest7_SetupAction",),
- 0x80AF082C:("func_80AF082C",),
- 0x80AF0838:("func_80AF0838",),
- 0x80AF0984:("func_80AF0984",),
- 0x80AF0C30:("func_80AF0C30",),
- 0x80AF0CDC:("func_80AF0CDC",),
- 0x80AF10D8:("func_80AF10D8",),
- 0x80AF118C:("func_80AF118C",),
- 0x80AF14FC:("func_80AF14FC",),
- 0x80AF1730:("func_80AF1730",),
+ 0x80AF0820:("EnTest7_SetupPlayerCamFunc",),
+ 0x80AF082C:("EnTest7_SetupAction",),
+ 0x80AF0838:("EnTest7_InitFeathers",),
+ 0x80AF0984:("EnTest7_AddFeather",),
+ 0x80AF0C30:("EnTest7_AddAndChooseFeather",),
+ 0x80AF0CDC:("EnTest7_UpdateFeatherType1",),
+ 0x80AF10D8:("EnTest7_UpdateFeatherType2",),
+ 0x80AF118C:("EnTest7_UpdateFeathers",),
+ 0x80AF14FC:("EnTest7_DrawFeathers",),
+ 0x80AF1730:("EnTest7_InitWindCapsule",),
0x80AF175C:("EnTest7_Init",),
0x80AF1960:("EnTest7_Destroy",),
- 0x80AF19A8:("func_80AF19A8",),
- 0x80AF1A2C:("func_80AF1A2C",),
- 0x80AF1B68:("func_80AF1B68",),
- 0x80AF1CA0:("func_80AF1CA0",),
- 0x80AF1E44:("func_80AF1E44",),
- 0x80AF1F48:("func_80AF1F48",),
- 0x80AF2030:("func_80AF2030",),
- 0x80AF21E8:("func_80AF21E8",),
- 0x80AF2318:("func_80AF2318",),
- 0x80AF2350:("func_80AF2350",),
- 0x80AF24D8:("func_80AF24D8",),
- 0x80AF2654:("func_80AF2654",),
- 0x80AF2808:("func_80AF2808",),
- 0x80AF2854:("func_80AF2854",),
- 0x80AF2938:("func_80AF2938",),
- 0x80AF29C0:("func_80AF29C0",),
- 0x80AF2AE8:("func_80AF2AE8",),
- 0x80AF2BAC:("func_80AF2BAC",),
- 0x80AF2C48:("func_80AF2C48",),
- 0x80AF2DB4:("func_80AF2DB4",),
- 0x80AF2EC8:("func_80AF2EC8",),
- 0x80AF2F98:("func_80AF2F98",),
- 0x80AF30F4:("func_80AF30F4",),
+ 0x80AF19A8:("EnTest7_StartWarpCs",),
+ 0x80AF1A2C:("EnTest7_WarpCsPart1",),
+ 0x80AF1B68:("EnTest7_UpdateGrowingWindCapsule",),
+ 0x80AF1CA0:("EnTest7_WarpCsPart2",),
+ 0x80AF1E44:("EnTest7_WarpCsPart3",),
+ 0x80AF1F48:("EnTest7_WarpCsPart4",),
+ 0x80AF2030:("EnTest7_WarpCsPart5",),
+ 0x80AF21E8:("EnTest7_WarpCsPart6",),
+ 0x80AF2318:("EnTest7_WarpCsWait",),
+ 0x80AF2350:("EnTest7_WarpCsWarp",),
+ 0x80AF24D8:("EnTest7_UpdateSubCamWarpCs2",),
+ 0x80AF2654:("EnTest7_UpdateSubCamWarpCs1",),
+ 0x80AF2808:("EnTest7_SpinAndSquishPlayer",),
+ 0x80AF2854:("EnTest7_PlayerAndSubCamAction",),
+ 0x80AF2938:("EnTest7_SetupArriveCs",),
+ 0x80AF29C0:("EnTest7_UpdateSubCamArrivalCs1",),
+ 0x80AF2AE8:("EnTest7_StartArriveCs",),
+ 0x80AF2BAC:("EnTest7_UpdateSubCamArrivalCs2",),
+ 0x80AF2C48:("EnTest7_ArriveCsPart1",),
+ 0x80AF2DB4:("EnTest7_UpdateSubCamArrivalCs3",),
+ 0x80AF2EC8:("EnTest7_StartArriveCsSkip",),
+ 0x80AF2F98:("EnTest7_ArriveCsPart2",),
+ 0x80AF30F4:("EnTest7_ArriveCsPart3",),
0x80AF3144:("EnTest7_Update",),
0x80AF31D0:("func_80AF31D0",),
0x80AF3248:("EnTest7_Draw",),
diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt
index 5fa224d616..2acc10f21e 100644
--- a/tools/disasm/variables.txt
+++ b/tools/disasm/variables.txt
@@ -1935,7 +1935,7 @@
0x801C6A44:("sSaveDebugChecksum","u16","",0x2),
0x801C6A48:("D_801C6A48","UNK_TYPE1","",0x1),
0x801C6A50:("D_801C6A50","UNK_TYPE1","",0x1),
- 0x801C6A58:("D_801C6A58","UNK_TYPE1","",0x1),
+ 0x801C6A58:("sOwlWarpEntrances","UNK_TYPE1","",0x1),
0x801C6A70:("D_801C6A70","UNK_TYPE1","",0x1),
0x801C6A74:("sOcarinaButtonIndexBufPos","UNK_TYPE2","",0x2),
0x801C6A78:("sOcarinaButtonIndexBufLen","UNK_TYPE2","",0x2),
@@ -4980,7 +4980,7 @@
0x8085D2B4:("D_8085D2B4","UNK_TYPE1","",0x1),
0x8085D2C0:("sInitChain","ActorInitVar","",0x4),
0x8085D2C4:("sPlayerSkeletonBaseTransl","UNK_TYPE4","",0x4),
- 0x8085D2CC:("D_8085D2CC","UNK_PTR","",0x4),
+ 0x8085D2CC:("sPlayerInitModeFuncs","UNK_PTR","",0x4),
0x8085D30C:("D_8085D30C","EffectBlureInit2","",0x24),
0x8085D330:("D_8085D330","EffectTireMarkInit","",0x8),
0x8085D338:("D_8085D338","UNK_TYPE4","",0x4),
@@ -13145,16 +13145,16 @@
0x80AF0778:("D_80AF0778","f32","",0x4),
0x80AF33F0:("En_Test7_InitVars","UNK_TYPE1","",0x1),
0x80AF3404:("D_80AF3404","UNK_TYPE1","",0x1),
- 0x80AF3410:("D_80AF3410","UNK_TYPE4","",0x4),
- 0x80AF3414:("D_80AF3414","UNK_TYPE1","",0x1),
- 0x80AF3420:("D_80AF3420","UNK_TYPE1","",0x1),
+ 0x80AF3410:("sFeatherIndex","UNK_TYPE4","",0x4),
+ 0x80AF3414:("sUnitVecY","UNK_TYPE1","",0x1),
+ 0x80AF3420:("sUnitVecZ","UNK_TYPE1","",0x1),
0x80AF342C:("D_80AF342C","UNK_TYPE4","",0x4),
0x80AF3430:("D_80AF3430","UNK_TYPE4","",0x4),
0x80AF3434:("D_80AF3434","UNK_TYPE4","",0x4),
0x80AF3438:("D_80AF3438","UNK_TYPE4","",0x4),
0x80AF3450:("D_80AF3450","UNK_TYPE2","",0x2),
0x80AF3452:("D_80AF3452","UNK_TYPE2","",0x2),
- 0x80AF3454:("D_80AF3454","f32","",0x4),
+ 0x80AF3454:("sSubCamAtOffset","f32","",0x4),
0x80AF3460:("D_80AF3460","f32","",0x4),
0x80AF3464:("D_80AF3464","f32","",0x4),
0x80AF3468:("D_80AF3468","f32","",0x4),
@@ -13194,10 +13194,10 @@
0x80AF34F0:("D_80AF34F0","f32","",0x4),
0x80AF34F4:("D_80AF34F4","f32","",0x4),
0x80AF34F8:("D_80AF34F8","f32","",0x4),
- 0x80AF38B0:("D_80AF38B0","UNK_TYPE1","",0x1),
- 0x80AF38F0:("D_80AF38F0","Vec3f","",0xC),
+ 0x80AF38B0:("sFeatherRotMf","UNK_TYPE1","",0x1),
+ 0x80AF38F0:("sFeatherAccel","Vec3f","",0xC),
0x80AF38FC:("D_80AF38FC","UNK_TYPE4","",0x4),
- 0x80AF3900:("D_80AF3900","Vec3f","",0xC),
+ 0x80AF3900:("sFeatherUnused","Vec3f","",0xC),
0x80AF3E80:("Obj_Lightblock_InitVars","UNK_TYPE1","",0x1),
0x80AF3EA0:("D_80AF3EA0","UNK_TYPE1","",0x1),
0x80AF3ECC:("D_80AF3ECC","UNK_TYPE1","",0x1),