summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorengineer124 <47598039+engineer124@users.noreply.github.com>2024-11-23 12:04:34 +1100
committerEblo <7004497+Eblo@users.noreply.github.com>2025-09-16 13:52:48 -0400
commit95f4b9695a75c8b0ae6f680a5cca11fde02fa943 (patch)
tree1aeba69c79bc04c5e579e9a6f4a56d63e12835de
parent3004a246ff958b5b8429013f7e96e6e15ad35edd (diff)
Player Docs: Rename Init Mode to Start Mode (#1744)
* rename to start mode * cleanup * rm declarations
-rw-r--r--mm/include/z64player.h51
-rw-r--r--mm/src/code/z_player_lib.c2
-rw-r--r--mm/src/code/z_scene.c6
-rw-r--r--mm/src/overlays/actors/ovl_Door_Ana/z_door_ana.c2
-rw-r--r--mm/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c2
-rw-r--r--mm/src/overlays/actors/ovl_En_Test4/z_en_test4.c6
-rw-r--r--mm/src/overlays/actors/ovl_En_Test6/z_en_test6.c4
-rw-r--r--mm/src/overlays/actors/ovl_En_Test7/z_en_test7.c2
-rw-r--r--mm/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c2
-rw-r--r--mm/src/overlays/actors/ovl_En_Toto/z_en_toto.c2
-rw-r--r--mm/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c4
-rw-r--r--mm/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c10
-rw-r--r--mm/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c2
-rw-r--r--mm/src/overlays/actors/ovl_player_actor/z_player.c124
14 files changed, 100 insertions, 119 deletions
diff --git a/mm/include/z64player.h b/mm/include/z64player.h
index c2261927f..8bbee9622 100644
--- a/mm/include/z64player.h
+++ b/mm/include/z64player.h
@@ -16,6 +16,31 @@ extern "C" {
struct Player;
struct PlayState;
+#define PLAYER_GET_BG_CAM_INDEX(thisx) ((thisx)->params & 0xFF)
+#define PLAYER_GET_START_MODE(thisx) (((thisx)->params & 0xF00) >> 8)
+
+typedef enum PlayerStartMode {
+ /* 0x0 */ PLAYER_START_MODE_0,
+ /* 0x1 */ PLAYER_START_MODE_1, // Spawning after pulling/putting-back Master sword // OoT leftover
+ /* 0x2 */ PLAYER_START_MODE_2,
+ /* 0x3 */ PLAYER_START_MODE_3,
+ /* 0x4 */ PLAYER_START_MODE_4,
+ /* 0x5 */ PLAYER_START_MODE_5,
+ /* 0x6 */ PLAYER_START_MODE_6,
+ /* 0x7 */ PLAYER_START_MODE_7,
+ /* 0x8 */ PLAYER_START_MODE_8,
+ /* 0x9 */ PLAYER_START_MODE_9,
+ /* 0xA */ PLAYER_START_MODE_A,
+ /* 0xB */ PLAYER_START_MODE_B,
+ /* 0xC */ PLAYER_START_MODE_TELESCOPE,
+ /* 0xD */ PLAYER_START_MODE_D,
+ /* 0xE */ PLAYER_START_MODE_E,
+ /* 0xF */ PLAYER_START_MODE_F,
+ /* 0x10 */ PLAYER_START_MODE_MAX // Must not exceed 0x10 as `PLAYER_GET_START_MODE` is limited to a nibble in player params
+} PlayerStartMode;
+
+#define PLAYER_PARAMS(startBgCamIndex, startMode) ((startBgCamIndex & 0xFF) | ((startMode & 0xF) << 8))
+
typedef enum PlayerShield {
/* 0 */ PLAYER_SHIELD_NONE,
/* 1 */ PLAYER_SHIELD_HEROS_SHIELD,
@@ -1077,32 +1102,6 @@ typedef enum PlayerCueId {
// Currently locked onto a hostile actor. Triggers a "battle" variant of many actions.
#define PLAYER_STATE3_HOSTILE_LOCK_ON (1 << 31)
-
-#define PLAYER_GET_BG_CAM_INDEX(thisx) ((thisx)->params & 0xFF)
-#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,
- /* 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))
-
typedef enum PlayerUnkAA5 {
/* 0 */ PLAYER_UNKAA5_0,
/* 1 */ PLAYER_UNKAA5_1,
diff --git a/mm/src/code/z_player_lib.c b/mm/src/code/z_player_lib.c
index 503f2eea6..ce70a467a 100644
--- a/mm/src/code/z_player_lib.c
+++ b/mm/src/code/z_player_lib.c
@@ -85,7 +85,7 @@ void func_80127B64(struct_801F58B0 arg0[], s32 count, Vec3f* arg2);
s32 func_801226E0(PlayState* play, s32 arg1) {
if (arg1 == 0) {
- Play_SetupRespawnPoint(play, RESPAWN_MODE_DOWN, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B));
+ Play_SetupRespawnPoint(play, RESPAWN_MODE_DOWN, PLAYER_PARAMS(0xFF, PLAYER_START_MODE_B));
if (play->sceneId == SCENE_KAKUSIANA) {
return 1;
}
diff --git a/mm/src/code/z_scene.c b/mm/src/code/z_scene.c
index 778283bdd..92ce3b57b 100644
--- a/mm/src/code/z_scene.c
+++ b/mm/src/code/z_scene.c
@@ -166,9 +166,9 @@ void Scene_CommandSpawnList(PlayState* play, SceneCmd* cmd) {
play->linkActorEntry =
(ActorEntry*)Lib_SegmentedToVirtual(cmd->spawnList.segment) + play->setupEntranceList[play->curSpawn].spawn;
- if ((PLAYER_GET_INITMODE(play->linkActorEntry) == PLAYER_INITMODE_TELESCOPE) ||
- ((gSaveContext.respawnFlag == 2) &&
- (gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams == PLAYER_PARAMS(0xFF, PLAYER_INITMODE_TELESCOPE)))) {
+ if ((PLAYER_GET_START_MODE(play->linkActorEntry) == PLAYER_START_MODE_TELESCOPE) ||
+ ((gSaveContext.respawnFlag == 2) && (gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams ==
+ PLAYER_PARAMS(0xFF, PLAYER_START_MODE_TELESCOPE)))) {
// Skull Kid Object
Object_SpawnPersistent(&play->objectCtx, OBJECT_STK);
return;
diff --git a/mm/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/mm/src/overlays/actors/ovl_Door_Ana/z_door_ana.c
index 4ab80ae4d..2169f7386 100644
--- a/mm/src/overlays/actors/ovl_Door_Ana/z_door_ana.c
+++ b/mm/src/overlays/actors/ovl_Door_Ana/z_door_ana.c
@@ -141,7 +141,7 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) {
} else {
s32 destinationIdx = DOORANA_GET_ENTRANCE(&this->actor);
- Play_SetupRespawnPoint(play, RESPAWN_MODE_UNK_3, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_4));
+ Play_SetupRespawnPoint(play, RESPAWN_MODE_UNK_3, PLAYER_PARAMS(0xFF, PLAYER_START_MODE_4));
gSaveContext.respawn[RESPAWN_MODE_UNK_3].pos.y = this->actor.world.pos.y;
gSaveContext.respawn[RESPAWN_MODE_UNK_3].yaw = this->actor.home.rot.y;
diff --git a/mm/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/mm/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c
index 286e7765a..79ad05046 100644
--- a/mm/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c
+++ b/mm/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c
@@ -951,7 +951,7 @@ void EnKakasi_DancingNightAway(EnKakasi* this, PlayState* play) {
player = GET_PLAYER(play);
Play_SetRespawnData(play, RESPAWN_MODE_DOWN, Entrance_CreateFromSpawn(0), player->unk_3CE,
- PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &player->unk_3C0, player->unk_3CC);
+ PLAYER_PARAMS(0xFF, PLAYER_START_MODE_B), &player->unk_3C0, player->unk_3CC);
func_80169EFC(play);
if ((CURRENT_TIME > CLOCK_TIME(18, 0)) || (CURRENT_TIME < CLOCK_TIME(6, 0))) {
diff --git a/mm/src/overlays/actors/ovl_En_Test4/z_en_test4.c b/mm/src/overlays/actors/ovl_En_Test4/z_en_test4.c
index 7cfa92ef3..859c61360 100644
--- a/mm/src/overlays/actors/ovl_En_Test4/z_en_test4.c
+++ b/mm/src/overlays/actors/ovl_En_Test4/z_en_test4.c
@@ -462,7 +462,7 @@ void EnTest4_HandleEvents(EnTest4* this, PlayState* play) {
// Turn day with DayTelop cutscene
gSaveContext.screenScale = 0.0f;
Play_SetRespawnData(play, RESPAWN_MODE_DOWN, Entrance_CreateFromSpawn(0), player->unk_3CE,
- PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &player->unk_3C0, player->unk_3CC);
+ PLAYER_PARAMS(0xFF, PLAYER_START_MODE_B), &player->unk_3C0, player->unk_3CC);
func_80169EFC(play);
if (player->stateFlags1 & PLAYER_STATE1_800000) {
EnHorse* rideActor = (EnHorse*)player->rideActor;
@@ -517,9 +517,9 @@ void EnTest4_HandleEvents(EnTest4* this, PlayState* play) {
u32 entrance = gSaveContext.save.entrance;
if (play->actorCtx.flags & ACTORCTX_FLAG_TELESCOPE_ON) {
- playerParams = PLAYER_PARAMS(0xFF, PLAYER_INITMODE_TELESCOPE);
+ playerParams = PLAYER_PARAMS(0xFF, PLAYER_START_MODE_TELESCOPE);
} else {
- playerParams = PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B);
+ playerParams = PLAYER_PARAMS(0xFF, PLAYER_START_MODE_B);
}
Play_SetRespawnData(play, RESPAWN_MODE_RETURN, entrance, player->unk_3CE, playerParams,
diff --git a/mm/src/overlays/actors/ovl_En_Test6/z_en_test6.c b/mm/src/overlays/actors/ovl_En_Test6/z_en_test6.c
index 3e6751a01..c6551714f 100644
--- a/mm/src/overlays/actors/ovl_En_Test6/z_en_test6.c
+++ b/mm/src/overlays/actors/ovl_En_Test6/z_en_test6.c
@@ -1084,7 +1084,7 @@ void EnTest6_SharedSoTCutscene(EnTest6* this, PlayState* play) {
case SOTCS_CUEID_DOUBLE_END:
Play_SetRespawnData(play, RESPAWN_MODE_RETURN, ((void)0, gSaveContext.save.entrance), player->unk_3CE,
- PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &player->unk_3C0, player->unk_3CC);
+ PLAYER_PARAMS(0xFF, PLAYER_START_MODE_B), &player->unk_3C0, player->unk_3CC);
this->drawType = SOTCS_DRAW_TYPE_NONE;
play->transitionTrigger = TRANS_TRIGGER_START;
play->nextEntrance = gSaveContext.respawn[RESPAWN_MODE_RETURN].entrance;
@@ -1165,7 +1165,7 @@ void EnTest6_SharedSoTCutscene(EnTest6* this, PlayState* play) {
case SOTCS_CUEID_DOUBLE_END:
if (CURRENT_TIME > CLOCK_TIME(12, 0)) {
Play_SetRespawnData(play, RESPAWN_MODE_RETURN, ((void)0, gSaveContext.save.entrance),
- player->unk_3CE, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &player->unk_3C0,
+ player->unk_3CE, PLAYER_PARAMS(0xFF, PLAYER_START_MODE_B), &player->unk_3C0,
player->unk_3CC);
this->drawType = SOTCS_DRAW_TYPE_NONE;
play->transitionTrigger = TRANS_TRIGGER_START;
diff --git a/mm/src/overlays/actors/ovl_En_Test7/z_en_test7.c b/mm/src/overlays/actors/ovl_En_Test7/z_en_test7.c
index 645c07de9..75310bc22 100644
--- a/mm/src/overlays/actors/ovl_En_Test7/z_en_test7.c
+++ b/mm/src/overlays/actors/ovl_En_Test7/z_en_test7.c
@@ -661,7 +661,7 @@ void EnTest7_WarpCsWarp(EnTest7* this, PlayState* play) {
} else if (OWL_WARP_CS_GET_OCARINA_MODE(&this->actor) == OCARINA_MODE_WARP_TO_ENTRANCE) {
func_80169F78(play);
gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams =
- PLAYER_PARAMS(gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams, PLAYER_INITMODE_6);
+ PLAYER_PARAMS(gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams, PLAYER_START_MODE_6);
gSaveContext.respawnFlag = -6;
} else {
play->nextEntrance =
diff --git a/mm/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/mm/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c
index c7e8c2618..9457dd9ea 100644
--- a/mm/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c
+++ b/mm/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c
@@ -82,7 +82,7 @@ void EnTorch2_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->collider);
Play_SetRespawnData(play, this->actor.params + RESPAWN_MODE_GORON - 1, 0xFF, 0,
- PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B), &this->actor.world.pos, this->actor.shape.rot.y);
+ PLAYER_PARAMS(0xFF, PLAYER_START_MODE_B), &this->actor.world.pos, this->actor.shape.rot.y);
play->actorCtx.elegyShells[this->actor.params] = NULL;
}
diff --git a/mm/src/overlays/actors/ovl_En_Toto/z_en_toto.c b/mm/src/overlays/actors/ovl_En_Toto/z_en_toto.c
index 32b591ec6..6498119e0 100644
--- a/mm/src/overlays/actors/ovl_En_Toto/z_en_toto.c
+++ b/mm/src/overlays/actors/ovl_En_Toto/z_en_toto.c
@@ -573,7 +573,7 @@ s32 func_80BA47E0(EnToto* this, PlayState* play) {
Math_Vec3s_ToVec3f(&spawnPos, &D_80BA50DC[i].unk6);
Actor_Spawn(&play->actorCtx, play, ACTOR_PLAYER, spawnPos.x, spawnPos.y, spawnPos.z, i + 2, 0, 0,
- PLAYER_PARAMS(0xFF, PLAYER_INITMODE_F) | 0xFFFFF000);
+ PLAYER_PARAMS(0xFF, PLAYER_START_MODE_F) | 0xFFFFF000);
}
}
func_80BA402C(this, play);
diff --git a/mm/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c b/mm/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c
index 6185a34e9..ef28ff680 100644
--- a/mm/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c
+++ b/mm/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c
@@ -205,9 +205,9 @@ void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play) {
newRespawnPos.z = playerActorEntry->pos.z;
if (WARPTAG_GET_3C0_MAX(&this->dyna.actor) == WARPTAG_3C0_MAX) {
- playerParams = PLAYER_PARAMS(0xFF, PLAYER_INITMODE_9);
+ playerParams = PLAYER_PARAMS(0xFF, PLAYER_START_MODE_9);
} else { // not used by any known variant
- playerParams = PLAYER_PARAMS(0xFF, PLAYER_INITMODE_8);
+ playerParams = PLAYER_PARAMS(0xFF, PLAYER_START_MODE_8);
}
// why are we getting player home rotation from the room data? doesnt player have home.rot.y?
diff --git a/mm/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/mm/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c
index 10e65559d..0610ecb27 100644
--- a/mm/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c
+++ b/mm/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c
@@ -62,11 +62,11 @@ static s16 sSpawnActorIds[OBJMURE_TYPE_MAX] = {
};
static s16 sSpawnParams[OBJMURE_TYPE_MAX] = {
- KUSA_BUSH_PARAMS(false, 0, false), // OBJMURE_TYPE_GRASS
- PLAYER_PARAMS(2, PLAYER_INITMODE_0), // OBJMURE_TYPE_UNDEFINED
- FISH_PARAMS(ENFISH_MINUS1), // OBJMURE_TYPE_FISH
- ENINSECT_PARAMS(false), // OBJMURE_TYPE_BUGS
- BUTTERFLY_PARAMS(BUTTERFLY_MINUS1), // OBJMURE_TYPE_BUTTERFLY
+ KUSA_BUSH_PARAMS(false, 0, false), // OBJMURE_TYPE_GRASS
+ PLAYER_PARAMS(2, PLAYER_START_MODE_0), // OBJMURE_TYPE_UNDEFINED
+ FISH_PARAMS(ENFISH_MINUS1), // OBJMURE_TYPE_FISH
+ ENINSECT_PARAMS(false), // OBJMURE_TYPE_BUGS
+ BUTTERFLY_PARAMS(BUTTERFLY_MINUS1), // OBJMURE_TYPE_BUTTERFLY
};
static InitChainEntry sInitChain[] = {
diff --git a/mm/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c b/mm/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c
index dc7a0ec82..e4e5db60a 100644
--- a/mm/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c
+++ b/mm/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c
@@ -455,7 +455,7 @@ void ObjTokeidai_TowerOpening_EndCutscene(ObjTokeidai* this, PlayState* play) {
play->nextEntrance = gSaveContext.respawn[RESPAWN_MODE_RETURN].entrance;
play->transitionType = TRANS_TYPE_FADE_BLACK;
if (gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams ==
- PLAYER_PARAMS(0xFF, PLAYER_INITMODE_TELESCOPE)) {
+ PLAYER_PARAMS(0xFF, PLAYER_START_MODE_TELESCOPE)) {
gSaveContext.nextTransitionType = TRANS_TYPE_CIRCLE;
} else {
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
diff --git a/mm/src/overlays/actors/ovl_player_actor/z_player.c b/mm/src/overlays/actors/ovl_player_actor/z_player.c
index 376b605e1..619ac3321 100644
--- a/mm/src/overlays/actors/ovl_player_actor/z_player.c
+++ b/mm/src/overlays/actors/ovl_player_actor/z_player.c
@@ -256,24 +256,6 @@ s32 Player_ActionHandler_12(Player* this, PlayState* play);
s32 Player_ActionHandler_13(Player* this, PlayState* play);
s32 Player_ActionHandler_14(Player* this, PlayState* play);
-/* Init Mode functions */
-void Player_InitMode_0(PlayState* play, Player* this);
-void Player_InitMode_1(PlayState* play, Player* this);
-void Player_InitMode_2(PlayState* play, Player* this);
-void Player_InitMode_3(PlayState* play, Player* this);
-void Player_InitMode_4(PlayState* play, Player* this);
-void Player_InitMode_5(PlayState* play, Player* this);
-void Player_InitMode_6(PlayState* play, Player* this);
-void Player_InitMode_7(PlayState* play, Player* this);
-void func_80841744(PlayState* play, Player* this);
-void func_80841744(PlayState* play, Player* this);
-void func_8083ADF0(PlayState* play, Player* this);
-void Player_InitMode_B(PlayState* play, Player* this);
-void Player_InitMode_Telescope(PlayState* play, Player* this);
-void Player_InitMode_D(PlayState* play, Player* this);
-void func_8083ADF0(PlayState* play, Player* this);
-void Player_InitMode_F(PlayState* play, Player* this);
-
/* Cutscene functions */
void Player_CsAction_0(PlayState* play, Player* this, CsCmdActorCue* cue);
void Player_CsAction_1(PlayState* play, Player* this, CsCmdActorCue* cue);
@@ -8784,7 +8766,7 @@ void func_8083A98C(Actor* thisx, PlayState* play2) {
}
// Set up using a telescope
-void Player_InitMode_Telescope(PlayState* play, Player* this) {
+void Player_StartMode_Telescope(PlayState* play, Player* this) {
this->actor.update = func_8083A98C;
this->actor.draw = NULL;
if (play->sceneId == SCENE_00KEIKOKU) {
@@ -8803,18 +8785,17 @@ void Player_InitMode_Telescope(PlayState* play, Player* this) {
play->actorCtx.flags |= ACTORCTX_FLAG_TELESCOPE_ON;
}
-void Player_InitMode_B(PlayState* play, Player* this) {
+void Player_StartMode_B(PlayState* play, Player* this) {
func_8085B384(this, play);
}
-void Player_InitMode_D(PlayState* play, Player* this) {
+void Player_StartMode_D(PlayState* play, Player* this) {
if (func_8083A878(play, this, 180.0f)) {
this->av2.actionVar2 = -20;
}
}
-// InitModes 0xA and 0xE
-void func_8083ADF0(PlayState* play, Player* this) {
+void Player_StartMode_E(PlayState* play, Player* this) {
this->speedXZ = 2.0f;
gSaveContext.entranceSpeed = 2.0f;
@@ -8823,7 +8804,7 @@ void func_8083ADF0(PlayState* play, Player* this) {
}
}
-void Player_InitMode_F(PlayState* play, Player* this) {
+void Player_StartMode_F(PlayState* play, Player* this) {
if (gSaveContext.entranceSpeed < 0.1f) {
gSaveContext.entranceSpeed = 0.1f;
}
@@ -11023,12 +11004,12 @@ s32 func_808411D4(PlayState* play, Player* this, f32* arg2, s32 arg3) {
return sp2C;
}
-void Player_InitMode_0(PlayState* play, Player* this) {
+void Player_StartMode_0(PlayState* play, Player* this) {
this->actor.update = func_801229EC;
this->actor.draw = NULL;
}
-void Player_InitMode_2(PlayState* play, Player* this) {
+void Player_StartMode_2(PlayState* play, Player* this) {
Player_SetAction(play, this, Player_Action_76, 0);
this->stateFlags1 |= PLAYER_STATE1_20000000;
PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_okarina_warp_goal, PLAYER_ANIM_ADJUSTED_SPEED,
@@ -11067,7 +11048,7 @@ void func_80841358(PlayState* play, Player* this, s32 arg2) {
Vec3f D_8085D2B4 = { -1.0f, 69.0f, 20.0f };
-void Player_InitMode_1(PlayState* play, Player* this) {
+void Player_StartMode_1(PlayState* play, Player* this) {
Player_SetAction(play, this, Player_Action_66, 0);
this->stateFlags1 |= PLAYER_STATE1_20000000;
Math_Vec3f_Copy(&this->actor.world.pos, &D_8085D2B4);
@@ -11082,30 +11063,30 @@ void Player_InitMode_1(PlayState* play, Player* this) {
this->av2.actionVar2 = 20;
}
-void Player_InitMode_3(PlayState* play, Player* this) {
+void Player_StartMode_3(PlayState* play, Player* this) {
Player_SetAction(play, this, Player_Action_78, 0);
Player_AnimReplace_Setup(play, this,
ANIM_FLAG_1 | ANIM_FLAG_UPDATE_Y | ANIM_FLAG_8 | ANIM_FLAG_NOMOVE | ANIM_FLAG_80);
}
-void Player_InitMode_4(PlayState* play, Player* this) {
+void Player_StartMode_4(PlayState* play, Player* this) {
func_80834DB8(this, &gPlayerAnim_link_normal_jump, 12.0f, play);
Player_SetAction(play, this, Player_Action_79, 0);
this->stateFlags1 |= PLAYER_STATE1_20000000;
this->fallStartHeight = this->actor.world.pos.y;
}
-void Player_InitMode_7(PlayState* play, Player* this) {
+void Player_StartMode_7(PlayState* play, Player* this) {
func_80833B18(play, this, 1, 2.0f, 2.0f, this->actor.shape.rot.y + 0x8000, 0);
}
-void Player_InitMode_5(PlayState* play, Player* this) {
+void Player_StartMode_5(PlayState* play, Player* this) {
Player_SetAction(play, this, Player_Action_75, 0);
this->actor.draw = NULL;
this->stateFlags1 |= PLAYER_STATE1_20000000;
}
-void Player_InitMode_6(PlayState* play, Player* this) {
+void Player_StartMode_6(PlayState* play, Player* this) {
if (gSaveContext.save.isOwlSave) {
Player_SetAction(play, this, Player_Action_0, 0);
Player_Anim_PlayLoopMorph(play, this, D_8085BE84[PLAYER_ANIMGROUP_nwait][this->modelAnimType]);
@@ -11122,10 +11103,9 @@ void Player_InitMode_6(PlayState* play, Player* this) {
}
}
-// InitModes 0x8 and 0x9
-void func_80841744(PlayState* play, Player* this) {
+void Player_StartMode_WarpTag(PlayState* play, Player* this) {
Player_SetAction(play, this, Player_Action_91, 0);
- if (PLAYER_GET_INITMODE(&this->actor) == PLAYER_INITMODE_8) {
+ if (PLAYER_GET_START_MODE(&this->actor) == PLAYER_START_MODE_8) {
Player_Anim_PlayOnceAdjustedReverse(play, this, D_8085D17C[this->transformation]);
this->itemAction = PLAYER_IA_OCARINA;
Player_SetModels(this, Player_ActionToModelGroup(this, this->itemAction));
@@ -11148,9 +11128,9 @@ void Player_InitCommon(Player* this, PlayState* play, FlexSkeletonHeader* skelHe
Actor_ProcessInitChain(&this->actor, sInitChain);
this->yaw = this->actor.world.rot.y;
- if ((PLAYER_GET_INITMODE(&this->actor) != PLAYER_INITMODE_TELESCOPE) &&
- ((gSaveContext.respawnFlag != 2) ||
- (gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams != PLAYER_PARAMS(0xFF, PLAYER_INITMODE_TELESCOPE)))) {
+ if ((PLAYER_GET_START_MODE(&this->actor) != PLAYER_START_MODE_TELESCOPE) &&
+ ((gSaveContext.respawnFlag != 2) || (gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams !=
+ PLAYER_PARAMS(0xFF, PLAYER_START_MODE_TELESCOPE)))) {
func_808309CC(play, this);
SkelAnime_InitPlayer(play, &this->skelAnime, skelHeader, D_8085BE84[PLAYER_ANIMGROUP_wait][this->modelAnimType],
1 | 8, this->jointTableBuffer, this->morphTableBuffer, PLAYER_LIMB_MAX);
@@ -11185,27 +11165,27 @@ void func_80841A50(PlayState* play, Player* this) {
}
}
-typedef void (*PlayerInitModeFunc)(PlayState*, Player*);
+typedef void (*PlayerStartModeFunc)(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.
-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
+PlayerStartModeFunc sStartModeFuncs[PLAYER_START_MODE_MAX] = {
+ Player_StartMode_0, // PLAYER_START_MODE_0
+ Player_StartMode_1, // PLAYER_START_MODE_1
+ Player_StartMode_2, // PLAYER_START_MODE_2
+ Player_StartMode_3, // PLAYER_START_MODE_3
+ Player_StartMode_4, // PLAYER_START_MODE_4
+ Player_StartMode_5, // PLAYER_START_MODE_5
+ Player_StartMode_6, // PLAYER_START_MODE_6
+ Player_StartMode_7, // PLAYER_START_MODE_7
+ Player_StartMode_WarpTag, // PLAYER_START_MODE_8
+ Player_StartMode_WarpTag, // PLAYER_START_MODE_9
+ Player_StartMode_E, // PLAYER_START_MODE_A
+ Player_StartMode_B, // PLAYER_START_MODE_B
+ Player_StartMode_Telescope, // PLAYER_START_MODE_TELESCOPE
+ Player_StartMode_D, // PLAYER_START_MODE_D
+ Player_StartMode_E, // PLAYER_START_MODE_E
+ Player_StartMode_F, // PLAYER_START_MODE_F
};
// sBlureInit
@@ -11232,7 +11212,6 @@ EffectTireMarkInit D_8085D330 = { 0, 63, { 0, 0, 15, 100 } };
Color_RGBA8 D_8085D338 = { 0, 0, 15, 100 };
// sTireMarkOtherColor ?
Color_RGBA8 D_8085D33C = { 0, 0, 0, 150 };
-Vec3f D_8085D340 = { 0.0f, 50.0f, 0.0f };
void Player_Init(Actor* thisx, PlayState* play) {
s32 pad;
@@ -11240,7 +11219,7 @@ void Player_Init(Actor* thisx, PlayState* play) {
s8 objectSlot;
s32 respawnFlag;
s32 var_a1;
- PlayerInitMode initMode;
+ PlayerStartMode startMode;
play->playerInit = Player_InitCommon;
play->playerUpdate = Player_UpdateCommon;
@@ -11439,7 +11418,7 @@ void Player_Init(Actor* thisx, PlayState* play) {
var_a1 = ((respawnFlag == 4) || (gSaveContext.respawnFlag == -4)) ? 1 : 0;
if (func_801226E0(play, var_a1) == 0) {
- gSaveContext.respawn[RESPAWN_MODE_DOWN].playerParams = PLAYER_PARAMS(thisx->params, PLAYER_INITMODE_D);
+ gSaveContext.respawn[RESPAWN_MODE_DOWN].playerParams = PLAYER_PARAMS(thisx->params, PLAYER_START_MODE_D);
}
gSaveContext.respawn[RESPAWN_MODE_DOWN].data = 1;
@@ -11447,29 +11426,32 @@ void Player_Init(Actor* thisx, PlayState* play) {
gSaveContext.respawn[RESPAWN_MODE_TOP] = gSaveContext.respawn[RESPAWN_MODE_DOWN];
}
gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams =
- PLAYER_PARAMS(gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams, PLAYER_INITMODE_D);
+ PLAYER_PARAMS(gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams, PLAYER_START_MODE_D);
+
+ startMode = PLAYER_GET_START_MODE(&this->actor);
- initMode = PLAYER_GET_INITMODE(&this->actor);
- if (((initMode == PLAYER_INITMODE_5) || (initMode == PLAYER_INITMODE_6)) &&
+ if (((startMode == PLAYER_START_MODE_5) || (startMode == PLAYER_START_MODE_6)) &&
(gSaveContext.save.cutsceneIndex >= 0xFFF0)) {
- initMode = PLAYER_INITMODE_D;
+ startMode = PLAYER_START_MODE_D;
}
// 2S2H [Enhancement] When we have a pause save entrance, we need unset the values to prevent them from lingering
- // Load into INITMODE_D for stationary Link spawn
+ // Load into PLAYER_START_MODE_D for stationary Link spawn
if (gSaveContext.save.shipSaveInfo.pauseSaveEntrance != -1) {
- initMode = PLAYER_INITMODE_D;
+ startMode = PLAYER_START_MODE_D;
gSaveContext.save.shipSaveInfo.pauseSaveEntrance = -1;
gSaveContext.save.isOwlSave = false;
}
- sPlayerInitModeFuncs[initMode](play, this);
+ sStartModeFuncs[startMode](play, this);
if ((this->actor.draw != NULL) && gSaveContext.save.hasTatl &&
((gSaveContext.gameMode == GAMEMODE_NORMAL) || (gSaveContext.gameMode == GAMEMODE_END_CREDITS)) &&
(play->sceneId != SCENE_SPOT00)) {
- this->tatlActor =
- Player_SpawnFairy(play, this, &this->actor.world.pos, &D_8085D340, FAIRY_PARAMS(FAIRY_TYPE_0, false, 0));
+ static Vec3f sTatlSpawnPosOffset = { 0.0f, 50.0f, 0.0f };
+
+ this->tatlActor = Player_SpawnFairy(play, this, &this->actor.world.pos, &sTatlSpawnPosOffset,
+ FAIRY_PARAMS(FAIRY_TYPE_0, false, 0));
if (gSaveContext.dogParams != 0) {
gSaveContext.dogParams |= 0x8000;
@@ -14097,7 +14079,7 @@ void func_80848640(PlayState* play, Player* this) {
if (torch2 != NULL) {
play->actorCtx.elegyShells[this->transformation] = torch2;
- Play_SetupRespawnPoint(play, this->transformation + 3, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B));
+ Play_SetupRespawnPoint(play, this->transformation + 3, PLAYER_PARAMS(0xFF, PLAYER_START_MODE_B));
}
effChange = Actor_Spawn(&play->actorCtx, play, ACTOR_EFF_CHANGE, this->actor.world.pos.x, this->actor.world.pos.y,
@@ -16247,7 +16229,7 @@ void Player_Action_36(Player* this, PlayState* play) {
}
Camera_SetFinishedFlag(Play_GetCamera(play, CAM_ID_MAIN));
- Play_SetupRespawnPoint(play, RESPAWN_MODE_DOWN, PLAYER_PARAMS(0xFF, PLAYER_INITMODE_B));
+ Play_SetupRespawnPoint(play, RESPAWN_MODE_DOWN, PLAYER_PARAMS(0xFF, PLAYER_START_MODE_B));
}
}
} else if (!(this->stateFlags1 & PLAYER_STATE1_20000000) && PlayerAnimation_OnFrame(&this->skelAnime, 15.0f)) {
@@ -19203,7 +19185,7 @@ void Player_Action_91(Player* this, PlayState* play) {
if (BINANG_SUB(this->actor.shape.rot.y, this->actor.world.rot.y) >= 0) {
this->actor.shape.rot.y = this->actor.world.rot.y;
Player_StopCutscene(this);
- if (PLAYER_GET_INITMODE(&this->actor) == PLAYER_INITMODE_8) {
+ if (PLAYER_GET_START_MODE(&this->actor) == PLAYER_START_MODE_8) {
anim = D_8085D17C[this->transformation];
func_80836A5C(this, play);
PlayerAnimation_Change(play, &this->skelAnime, anim, -PLAYER_ANIM_ADJUSTED_SPEED,