Decompile and partially document some functions in z_play (#582)

* Decomp 10 functions in z_play, start documentation

* Add numbers to enums in z_en_torch2.h

* Decompile a 5 more functions (56 unattempted)

* Add more details, name some more variables

* Bit more Doxygen

* Format

* Fix arguments

* Add symbols to actorfixer.py

* Merge branch 'master' into play

* Fix z_actor

* Review

* Deduplicate CycleSceneFlags

* Fix warning

* Fix unk4

* Review
This commit is contained in:
EllipticEllipsis 2022-03-05 14:57:28 +00:00 committed by GitHub
parent 6017869b1e
commit 7fcefd8d3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 326 additions and 101 deletions

View File

@ -2818,21 +2818,20 @@ void Play_CameraChangeSetting(GlobalContext* globalCtx, s16 camId, s16 setting);
void func_80169AFC(GlobalContext* globalCtx, s16 camId, s16 arg2);
s16 Play_GetCsCamDataSetting(GlobalContext* globalCtx, s32 camId);
Vec3s* Play_GetCsCamDataVec3s(GlobalContext* globalCtx, s32 camId);
s16 convert_scene_number_among_shared_scenes(s16 arg0);
void func_80169D40(GlobalContext* globalCtx);
void func_80169DCC(GlobalContext* globalCtx, s32 arg1, u16 arg2, s32 arg3, s32 arg4, Vec3f* arg5, s16 arg6);
void func_80169E6C(GlobalContext* globalCtx, s32 param_1, s32 param_2);
// void func_80169ECC(void);
void func_80169EFC(GlobalContext* globalCtx);
void func_80169F78(GlobalContext* globalCtx);
void func_80169FDC(GlobalContext* globalCtx);
// void func_80169FFC(void);
s32 FrameAdvance_IsEnabled(GlobalContext* globalCtx);
// UNK_TYPE4 func_8016A02C(s32 param_1, s32 param_2, s16* param_3);
// void func_8016A0AC(void);
s16 Play_GetOriginalSceneNumber(s16 sceneNum);
void Play_SaveCycleSceneFlags(GameState* gameState);
void Play_SetRespawnData(GameState* gameState, s32 respawnNumber, u16 sceneSetup, s32 roomIndex, s32 playerParams, Vec3f* pos, s16 yaw);
void Play_SetupRespawnPoint(GameState* gameState, s32 respawnNumber, s32 playerParams);
void func_80169EFC(GameState* gameState);
void func_80169F78(GameState* gameState);
void func_80169FDC(GameState* gameState);
s32 func_80169FFC(GameState* gameState);
s32 FrameAdvance_IsEnabled(GameState* gameState);
s32 func_8016A02C(GameState* gameState, Actor* actor, s16* yaw);
s32 Play_IsUnderwater(GlobalContext* globalCtx, Vec3f* pos);
s32 func_8016A168(void);
// void func_8016A178(void);
void func_8016A268(GlobalContext* globalCtx, s32 param_2, s32 param_3, s32 param_4, s32 param_5, s32 param_6);
void Play_AssignPlayerActorCsIdsFromScene(GameState* gameState, s32 cutscene);
void func_8016A268(GameState* gameState, s16 arg1, u8 arg2, u8 arg3, u8 arg4, u8 arg5);
void Play_Init(GameState* gameState);
// void func_8016AC10(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10);
// void func_8016AE1C(void);

View File

@ -1291,7 +1291,7 @@ struct GlobalContext {
/* 0x18790 */ void (*unk_18790)(struct GlobalContext* globalCtx, s16 arg1, Actor* actor);
/* 0x18794 */ void* unk_18794; //! @TODO: Determine function prototype
/* 0x18798 */ s32 (*setPlayerTalkAnim)(struct GlobalContext* globalCtx, void* talkAnim, s32 arg2);
/* 0x1879C */ s16 unk_1879C[10];
/* 0x1879C */ s16 playerActorCsIds[10];
/* 0x187B0 */ MtxF viewProjectionMtxF;
/* 0x187F0 */ Vec3f unk_187F0;
/* 0x187FC */ MtxF billboardMtxF;
@ -1319,7 +1319,7 @@ struct GlobalContext {
/* 0x1887C */ s8 unk_1887C;
/* 0x1887D */ s8 unk_1887D;
/* 0x1887E */ s8 unk_1887E;
/* 0x1887F */ u8 unk_1887F;
/* 0x1887F */ u8 unk_1887F; // fadeTransition
/* 0x18880 */ u8 unk_18880;
/* 0x18884 */ CollisionCheckContext colChkCtx;
/* 0x18B20 */ u16 envFlags[20];

View File

@ -2016,7 +2016,7 @@ s32 Actor_PickUp(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRa
player->getItemDirection = absYawDiff;
if ((getItemId > GI_NONE) && (getItemId < GI_MAX)) {
ActorCutscene_SetIntentToPlay(globalCtx->unk_1879C[1]);
ActorCutscene_SetIntentToPlay(globalCtx->playerActorCsIds[1]);
}
return true;
@ -2237,7 +2237,7 @@ void Actor_InitContext(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEn
s32 i;
gSaveContext.weekEventReg[92] |= 0x80;
cycleFlags = &gSaveContext.cycleSceneFlags[convert_scene_number_among_shared_scenes(globalCtx->sceneNum)];
cycleFlags = &gSaveContext.cycleSceneFlags[Play_GetOriginalSceneNumber(globalCtx->sceneNum)];
bzero(actorCtx, sizeof(ActorContext));
ActorOverlayTable_Init();
@ -3037,7 +3037,7 @@ void Actor_CleanupContext(ActorContext* actorCtx, GlobalContext* globalCtx) {
actorCtx->absoluteSpace = NULL;
}
func_80169D40(globalCtx);
Play_SaveCycleSceneFlags(&globalCtx->state);
ActorOverlayTable_Cleanup();
}

View File

@ -1145,7 +1145,7 @@ ColChkResetFunc sATResetFuncs[] = {
s32 CollisionCheck_SetAT(GlobalContext* globalCtx, CollisionCheckContext* colCtxt, Collider* collider) {
s32 index;
if (FrameAdvance_IsEnabled(globalCtx)) {
if (FrameAdvance_IsEnabled(&globalCtx->state)) {
return -1;
}
sATResetFuncs[collider->shape](globalCtx, collider);
@ -1171,7 +1171,7 @@ s32 CollisionCheck_SetAT(GlobalContext* globalCtx, CollisionCheckContext* colCtx
* will be inserted into the next slot.
*/
s32 CollisionCheck_SetAT_SAC(GlobalContext* globalCtx, CollisionCheckContext* colCtxt, Collider* collider, s32 index) {
if (FrameAdvance_IsEnabled(globalCtx)) {
if (FrameAdvance_IsEnabled(&globalCtx->state)) {
return -1;
}
sATResetFuncs[collider->shape](globalCtx, collider);
@ -1205,7 +1205,7 @@ ColChkResetFunc sACResetFuncs[] = {
s32 CollisionCheck_SetAC(GlobalContext* globalCtx, CollisionCheckContext* colCtxt, Collider* collider) {
s32 index;
if (FrameAdvance_IsEnabled(globalCtx)) {
if (FrameAdvance_IsEnabled(&globalCtx->state)) {
return -1;
}
sACResetFuncs[collider->shape](globalCtx, collider);
@ -1231,7 +1231,7 @@ s32 CollisionCheck_SetAC(GlobalContext* globalCtx, CollisionCheckContext* colCtx
* will be inserted into the next slot
*/
s32 CollisionCheck_SetAC_SAC(GlobalContext* globalCtx, CollisionCheckContext* colCtxt, Collider* collider, s32 index) {
if (FrameAdvance_IsEnabled(globalCtx)) {
if (FrameAdvance_IsEnabled(&globalCtx->state)) {
return -1;
}
sACResetFuncs[collider->shape](globalCtx, collider);
@ -1265,7 +1265,7 @@ ColChkResetFunc sOCResetFuncs[] = {
s32 CollisionCheck_SetOC(GlobalContext* globalCtx, CollisionCheckContext* colCtxt, Collider* collider) {
s32 index;
if (FrameAdvance_IsEnabled(globalCtx)) {
if (FrameAdvance_IsEnabled(&globalCtx->state)) {
return -1;
}
sOCResetFuncs[collider->shape](globalCtx, collider);
@ -1291,7 +1291,7 @@ s32 CollisionCheck_SetOC(GlobalContext* globalCtx, CollisionCheckContext* colCtx
* will be inserted into the next slot.
*/
s32 CollisionCheck_SetOC_SAC(GlobalContext* globalCtx, CollisionCheckContext* colCtxt, Collider* collider, s32 index) {
if (FrameAdvance_IsEnabled(globalCtx)) {
if (FrameAdvance_IsEnabled(&globalCtx->state)) {
return -1;
}
sOCResetFuncs[collider->shape](globalCtx, collider);
@ -1323,7 +1323,7 @@ s32 CollisionCheck_SetOC_SAC(GlobalContext* globalCtx, CollisionCheckContext* co
s32 CollisionCheck_SetOCLine(GlobalContext* globalCtx, CollisionCheckContext* colCtxt, OcLine* line) {
s32 index;
if (FrameAdvance_IsEnabled(globalCtx)) {
if (FrameAdvance_IsEnabled(&globalCtx->state)) {
return -1;
}

View File

@ -124,7 +124,7 @@ void Effect_Add(GlobalContext* globalCtx, s32* pIndex, s32 type, u8 arg3, u8 arg
*pIndex = TOTAL_EFFECT_COUNT;
if (FrameAdvance_IsEnabled(globalCtx) != true) {
if (FrameAdvance_IsEnabled(&globalCtx->state) != true) {
slotFound = false;
switch (type) {
case EFFECT_SPARK:

View File

@ -152,7 +152,7 @@ s32 EffectSS_FindFreeSpace(s32 priority, s32* tableEntry) {
void EffectSS_Copy(GlobalContext* globalCtx, EffectSs* effectsSs) {
s32 index;
if (FrameAdvance_IsEnabled(globalCtx) != true) {
if (FrameAdvance_IsEnabled(&globalCtx->state) != true) {
if (EffectSS_FindFreeSpace(effectsSs->priority, &index) == 0) {
sEffectSsInfo.searchIndex = index + 1;
sEffectSsInfo.data_table[index] = *effectsSs;

View File

@ -67,7 +67,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
break;
case GAMEOVER_DEATH_FADE_OUT:
if (func_801A8A50(1) != NA_BGM_GAME_OVER) {
func_80169F78(globalCtx);
func_80169F78(&globalCtx->state);
if (gSaveContext.respawnFlag != -7) {
gSaveContext.respawnFlag = -6;
}

View File

@ -110,34 +110,254 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_GetCsCamDataVec3s.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/convert_scene_number_among_shared_scenes.s")
/**
* Converts the number of a scene to its "original" equivalent, the default version of the area which the player first
* enters.
*/
s16 Play_GetOriginalSceneNumber(s16 sceneNum) {
// Inverted Stone Tower Temple -> Stone Tower Temple
if (sceneNum == SCENE_INISIE_R) {
return SCENE_INISIE_N;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169D40.s")
// Purified Southern Swamp -> Poisoned Sothern Swamp
if (sceneNum == SCENE_20SICHITAI2) {
return SCENE_20SICHITAI;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169DCC.s")
// Spring Mountain Village -> Winter Mountain Village
if (sceneNum == SCENE_10YUKIYAMANOMURA2) {
return SCENE_10YUKIYAMANOMURA;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169E6C.s")
// Spring Goron Village -> Winter Goron Village
if (sceneNum == SCENE_11GORONNOSATO2) {
return SCENE_11GORONNOSATO;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169ECC.s")
// Spring Path to Goron Village -> Winter Path to Goron Village
if (sceneNum == SCENE_17SETUGEN2) {
return SCENE_17SETUGEN;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169EFC.s")
// Inverted Stone Tower -> Stone Tower
if (sceneNum == SCENE_F41) {
return SCENE_F40;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169F78.s")
return sceneNum;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169FDC.s")
/**
* Copies the flags set in ActorContext over to the current scene's CycleSceneFlags, usually using the original scene
* number. Exception for Inverted Stone Tower Temple, which uses its own.
*/
void Play_SaveCycleSceneFlags(GameState* gameState) {
GlobalContext* globalCtx = (GlobalContext*)gameState;
CycleSceneFlags* cycleSceneFlags;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169FFC.s")
cycleSceneFlags = &gSaveContext.cycleSceneFlags[Play_GetOriginalSceneNumber(globalCtx->sceneNum)];
cycleSceneFlags->chest = globalCtx->actorCtx.flags.chest;
cycleSceneFlags->swch0 = globalCtx->actorCtx.flags.switches[0];
cycleSceneFlags->swch1 = globalCtx->actorCtx.flags.switches[1];
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/FrameAdvance_IsEnabled.s")
if (globalCtx->sceneNum == SCENE_INISIE_R) { // Inverted Stone Tower Temple
cycleSceneFlags = &gSaveContext.cycleSceneFlags[globalCtx->sceneNum];
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_8016A02C.s")
cycleSceneFlags->collectible = globalCtx->actorCtx.flags.collectible[0];
cycleSceneFlags->clearedRoom = globalCtx->actorCtx.flags.clearedRoom;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_8016A0AC.s")
void Play_SetRespawnData(GameState* gameState, s32 respawnMode, u16 entranceIndex, s32 roomIndex, s32 playerParams,
Vec3f* pos, s16 yaw) {
GlobalContext* globalCtx = (GlobalContext*)gameState;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_8016A168.s")
gSaveContext.respawn[respawnMode].entranceIndex = Entrance_CreateIndex(entranceIndex >> 9, 0, entranceIndex & 0xF);
gSaveContext.respawn[respawnMode].roomIndex = roomIndex;
gSaveContext.respawn[respawnMode].pos = *pos;
gSaveContext.respawn[respawnMode].yaw = yaw;
gSaveContext.respawn[respawnMode].playerParams = playerParams;
gSaveContext.respawn[respawnMode].tempSwchFlags = globalCtx->actorCtx.flags.switches[2];
gSaveContext.respawn[respawnMode].unk_18 = globalCtx->actorCtx.flags.collectible[1];
gSaveContext.respawn[respawnMode].tempCollectFlags = globalCtx->actorCtx.flags.collectible[2];
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_8016A178.s")
void Play_SetupRespawnPoint(GameState* gameState, s32 respawnMode, s32 playerParams) {
GlobalContext* globalCtx = (GlobalContext*)gameState;
Player* player = GET_PLAYER(globalCtx);
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_8016A268.s")
if (globalCtx->sceneNum != SCENE_KAKUSIANA) { // Grottos
Play_SetRespawnData(&globalCtx->state, respawnMode, (u16)((void)0, gSaveContext.entranceIndex),
globalCtx->roomCtx.currRoom.num, playerParams, &player->actor.world.pos,
player->actor.shape.rot.y);
}
}
// Override respawn data in Sakon's Hideout
void func_80169ECC(GlobalContext* globalCtx) {
if (globalCtx->sceneNum == SCENE_SECOM) {
globalCtx->nextEntranceIndex = 0x2060;
gSaveContext.respawnFlag = -7;
}
}
// Gameplay_TriggerVoidOut ?
// Used by Player, Ikana_Rotaryroom, Bji01, Kakasi, LiftNuts, Test4, Warptag, WarpUzu, Roomtimer
void func_80169EFC(GameState* gameState) {
GlobalContext* globalCtx = (GlobalContext*)gameState;
gSaveContext.respawn[0].tempSwchFlags = globalCtx->actorCtx.flags.switches[2];
gSaveContext.respawn[0].unk_18 = globalCtx->actorCtx.flags.collectible[1];
gSaveContext.respawn[0].tempCollectFlags = globalCtx->actorCtx.flags.collectible[2];
globalCtx->nextEntranceIndex = gSaveContext.respawn[0].entranceIndex;
gSaveContext.respawnFlag = 1;
func_80169ECC(globalCtx);
globalCtx->sceneLoadFlag = 0x14;
globalCtx->unk_1887F = 2;
}
// Gameplay_LoadToLastEntrance ?
// Used by game_over and Test7
void func_80169F78(GameState* gameState) {
GlobalContext* globalCtx = (GlobalContext*)gameState;
globalCtx->nextEntranceIndex = gSaveContext.respawn[2].entranceIndex;
gSaveContext.respawnFlag = -1;
func_80169ECC(globalCtx);
globalCtx->sceneLoadFlag = 0x14;
globalCtx->unk_1887F = 2;
}
// Gameplay_TriggerRespawn ?
// Used for void by Wallmaster, Deku Shrine doors. Also used by Player, Kaleido, DoorWarp1
void func_80169FDC(GameState* gameState) {
func_80169F78(gameState);
}
// Used by Kankyo to determine how to change the lighting, e.g. for game over.
s32 func_80169FFC(GameState* gameState) {
GlobalContext* globalCtx = (GlobalContext*)gameState;
return globalCtx->roomCtx.currRoom.mesh->type0.type != 1;
}
s32 FrameAdvance_IsEnabled(GameState* gameState) {
GlobalContext* globalCtx = (GlobalContext*)gameState;
return globalCtx->frameAdvCtx.enabled != 0;
}
// Unused, unchanged from OoT, which uses it only in one Camera function.
/**
* @brief Tests if \p actor is a door and the sides are different rooms.
*
* @param[in] gameState GameState, promoted to globalCtx inside.
* @param[in] actor Actor to test.
* @param[out] yaw Facing angle of the actor, or reverse if in the back room.
* @return true if \p actor is a door and the sides are in different rooms, false otherwise
*/
s32 func_8016A02C(GameState* gameState, Actor* actor, s16* yaw) {
GlobalContext* globalCtx = (GlobalContext*)gameState;
TransitionActorEntry* transitionActor;
s8 frontRoom;
if (actor->category != ACTORCAT_DOOR) {
return false;
}
transitionActor = &globalCtx->doorCtx.transitionActorList[(u16)actor->params >> 10];
frontRoom = transitionActor->sides[0].room;
if (frontRoom == transitionActor->sides[1].room) {
return false;
}
if (frontRoom == actor->room) {
*yaw = actor->shape.rot.y;
} else {
*yaw = actor->shape.rot.y + 0x8000;
}
return true;
}
// Unused
/**
* @brief Tests if \p pos is underwater.
*
* @param[in] globalCtx GlobalContext
* @param[in] pos position to test
* @return true if inside a waterbox and not above a void.
*/
s32 Play_IsUnderwater(GlobalContext* globalCtx, Vec3f* pos) {
WaterBox* waterBox;
CollisionPoly* poly;
Vec3f waterSurfacePos;
s32 bgId;
waterSurfacePos = *pos;
if ((WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, waterSurfacePos.x, waterSurfacePos.z, &waterSurfacePos.y,
&waterBox) == true) &&
(pos->y < waterSurfacePos.y) &&
(BgCheck_EntityRaycastFloor3(&globalCtx->colCtx, &poly, &bgId, &waterSurfacePos) != BGCHECK_Y_MIN)) {
return true;
} else {
return false;
}
}
// z_demo and EnTest4
// This data appears to be a boolean. It is only set by Play_Init.
s32 func_8016A168(void) {
return D_801D0D50;
}
// A mapping from playerActorCsIds to sGlobalCamDataSettings indices.
extern s16 D_801D0D64[];
// s16 D_801D0D64[] = { -3, -2, -4, -5, -7, -11, -8, -9, -6, -16 };
// Used by Player
/**
* Extract the common actor cutscene ids used by Player from the scene and set the actor cutscene ids in
* globalCtx->playerActorCsIds. If a playerActorCsId is not present in the scene, then that particular id is set
* to -1. Otherwise, if there is an ActorCutscene where csCamSceneDataId matches the appropriate element of D_801D0D64,
* set the corresponding playerActorCsId (and possibly change its priority for the zeroth one)
*/
void Play_AssignPlayerActorCsIdsFromScene(GameState* gameState, s32 startActorCsId) {
GlobalContext* globalCtx = (GlobalContext*)gameState;
s32 i;
s16* curPlayerActorCsId = globalCtx->playerActorCsIds;
s16* phi_s1 = D_801D0D64;
for (i = 0; i < ARRAY_COUNT(globalCtx->playerActorCsIds); i++, curPlayerActorCsId++, phi_s1++) {
ActorCutscene* actorCutscene;
s32 curActorCsId;
*curPlayerActorCsId = -1;
for (curActorCsId = startActorCsId; curActorCsId != -1; curActorCsId = actorCutscene->additionalCutscene) {
actorCutscene = ActorCutscene_GetCutscene(curActorCsId);
if (actorCutscene->csCamSceneDataId == *phi_s1) {
if ((actorCutscene->csCamSceneDataId == -3) &&
(actorCutscene->priority == 700)) { // override ocarina cs priority
actorCutscene->priority = 550;
}
*curPlayerActorCsId = curActorCsId;
break;
}
}
}
}
// These regs are used by Gameplay_Draw, and several actors, purpose as yet unclear.
void func_8016A268(GameState* gameState, s16 arg1, u8 arg2, u8 arg3, u8 arg4, u8 arg5) {
MREG(64) = arg1;
MREG(65) = arg2;
MREG(66) = arg3;
MREG(67) = arg4;
MREG(68) = arg5;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_Init.s")

View File

@ -647,7 +647,7 @@ void func_80B814B8(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) {
if (player->actor.bgCheckFlags & 0x100) {
func_800B8E58(player, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->unk_92);
func_80169EFC(globalCtx);
func_80169EFC(&globalCtx->state);
func_800B8E58(player, NA_SE_VO_LI_TAKEN_AWAY + player->ageProperties->unk_92);
globalCtx->unk_18845 = 1;
play_sound(NA_SE_OC_ABYSS);

View File

@ -1566,7 +1566,7 @@ void DmStk_Update(Actor* thisx, GlobalContext* globalCtx) {
}
if ((globalCtx->actorCtx.unk5 & 2) && (globalCtx->msgCtx.msgMode != 0) &&
(globalCtx->msgCtx.unk11F04 == 0x5E6) && !FrameAdvance_IsEnabled(globalCtx) &&
(globalCtx->msgCtx.unk11F04 == 0x5E6) && !FrameAdvance_IsEnabled(&globalCtx->state) &&
(globalCtx->sceneLoadFlag == 0) && (ActorCutscene_GetCurrentIndex() == -1) &&
(globalCtx->csCtx.state == 0)) {
time = gSaveContext.time;

View File

@ -147,7 +147,7 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) {
// unused in vanilla, the highest params bits can directly index an address
entranceIndex = GET_DOORANA_DIRECT_ENTRANCE(this);
func_80169E6C(globalCtx, 3, 0x4FF);
Play_SetupRespawnPoint(&globalCtx->state, 3, 0x4FF);
gSaveContext.respawn[3].pos.y = this->actor.world.pos.y;
gSaveContext.respawn[3].yaw = this->actor.home.rot.y;

View File

@ -376,7 +376,7 @@ void func_808B93A0(DoorWarp1* this, GlobalContext* globalCtx) {
}
void func_808B94A4(DoorWarp1* this, GlobalContext* globalCtx) {
if (!func_808B866C(this, globalCtx) && (ActorCutscene_GetCurrentIndex() != globalCtx->unk_1879C[8])) {
if (!func_808B866C(this, globalCtx) && (ActorCutscene_GetCurrentIndex() != globalCtx->playerActorCsIds[8])) {
DoorWarp1_SetupAction(this, func_808B921C);
}
func_808BB8D4(this, globalCtx, 1);
@ -384,10 +384,10 @@ void func_808B94A4(DoorWarp1* this, GlobalContext* globalCtx) {
}
void func_808B9524(DoorWarp1* this, GlobalContext* globalCtx) {
if (!ActorCutscene_GetCanPlayNext(globalCtx->unk_1879C[9])) {
ActorCutscene_SetIntentToPlay(globalCtx->unk_1879C[9]);
if (!ActorCutscene_GetCanPlayNext(globalCtx->playerActorCsIds[9])) {
ActorCutscene_SetIntentToPlay(globalCtx->playerActorCsIds[9]);
} else {
ActorCutscene_Start(globalCtx->unk_1879C[9], NULL);
ActorCutscene_Start(globalCtx->playerActorCsIds[9], NULL);
DoorWarp1_SetupAction(this, func_808B958C);
}
}
@ -456,10 +456,10 @@ void func_808B977C(DoorWarp1* this, GlobalContext* globalCtx) {
}
void func_808B9840(DoorWarp1* this, GlobalContext* globalCtx) {
if (!ActorCutscene_GetCanPlayNext(globalCtx->unk_1879C[9])) {
ActorCutscene_SetIntentToPlay(globalCtx->unk_1879C[9]);
if (!ActorCutscene_GetCanPlayNext(globalCtx->playerActorCsIds[9])) {
ActorCutscene_SetIntentToPlay(globalCtx->playerActorCsIds[9]);
} else {
ActorCutscene_Start(globalCtx->unk_1879C[9], NULL);
ActorCutscene_Start(globalCtx->playerActorCsIds[9], NULL);
DoorWarp1_SetupAction(this, func_808B98A8);
}
}
@ -488,7 +488,7 @@ void func_808B98A8(DoorWarp1* this, GlobalContext* globalCtx) {
Scene_SetExitFade(globalCtx);
globalCtx->sceneLoadFlag = 0x14;
} else {
func_80169FDC(globalCtx);
func_80169FDC(&globalCtx->state);
}
}
}
@ -615,10 +615,10 @@ void func_808B9FD0(DoorWarp1* this, GlobalContext* globalCtx) {
return;
}
if (!ActorCutscene_GetCanPlayNext(globalCtx->unk_1879C[9])) {
ActorCutscene_SetIntentToPlay(globalCtx->unk_1879C[9]);
if (!ActorCutscene_GetCanPlayNext(globalCtx->playerActorCsIds[9])) {
ActorCutscene_SetIntentToPlay(globalCtx->playerActorCsIds[9]);
} else {
ActorCutscene_Start(globalCtx->unk_1879C[9], NULL);
ActorCutscene_Start(globalCtx->playerActorCsIds[9], NULL);
Audio_PlaySfxGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &D_801DB4B0, &D_801DB4B0, &D_801DB4B8);
Animation_ChangeImpl(&this->skelAnime, &object_warp1_Anim_001374, 1.0f,
Animation_GetLastFrame(&object_warp1_Anim_001374.common),
@ -767,7 +767,7 @@ void func_808BA10C(DoorWarp1* this, GlobalContext* globalCtx) {
Scene_SetExitFade(globalCtx);
globalCtx->sceneLoadFlag = 0x14;
} else {
func_80169FDC(globalCtx);
func_80169FDC(&globalCtx->state);
}
}

View File

@ -299,7 +299,7 @@ void func_809CD634(EnBji01* this, GlobalContext* globalCtx) {
Audio_QueueSeqCmd(0xE0000101);
globalCtx->nextEntranceIndex = 0x54A0; /* Termina Field from telescope */
gSaveContext.respawn[0].entranceIndex = globalCtx->nextEntranceIndex;
func_80169EFC(globalCtx); /* Load new entrance? */
func_80169EFC(&globalCtx->state); /* Load new entrance? */
gSaveContext.respawnFlag = -2;
this->actionFunc = EnBji01_DoNothing;
}

View File

@ -262,7 +262,7 @@ void func_80997E4C(EnGs* this, GlobalContext* globalCtx) {
}
void func_80997FF0(EnGs* this, GlobalContext* globalCtx) {
if (SubS_StartActorCutscene(&this->actor, globalCtx->unk_1879C[0], -1, SUBS_CUTSCENE_NORMAL)) {
if (SubS_StartActorCutscene(&this->actor, globalCtx->playerActorCsIds[0], -1, SUBS_CUTSCENE_NORMAL)) {
func_80998040(this, globalCtx);
}
}
@ -339,7 +339,7 @@ void func_8099807C(EnGs* this, GlobalContext* globalCtx) {
void func_80998300(EnGs* this, GlobalContext* globalCtx) {
if (this->actor.cutscene != -1) {
ActorCutscene_Stop(globalCtx->unk_1879C[0]);
ActorCutscene_Stop(globalCtx->playerActorCsIds[0]);
}
}

View File

@ -934,9 +934,9 @@ void EnKakasi_DancingNightAway(EnKakasi* this, GlobalContext* globalCtx) {
if (this->unk204 == 0) {
player = GET_PLAYER(globalCtx);
func_80169DCC(globalCtx, 0, Entrance_CreateIndexFromSpawn(0), player->unk_3CE, 0xBFF, &player->unk_3C0,
player->unk_3CC);
func_80169EFC(globalCtx);
Play_SetRespawnData(&globalCtx->state, 0, Entrance_CreateIndexFromSpawn(0), player->unk_3CE, 0xBFF,
&player->unk_3C0, player->unk_3CC);
func_80169EFC(&globalCtx->state);
if (0) {}
if (gSaveContext.time > CLOCK_TIME(18, 0) || gSaveContext.time < CLOCK_TIME(6, 0)) {

View File

@ -58,7 +58,7 @@ void func_8096B104(EnOkarinaEffect* this, GlobalContext* globalCtx) {
void func_8096B174(EnOkarinaEffect* this, GlobalContext* globalCtx) {
DECR(this->unk144);
if (!globalCtx->pauseCtx.state && !globalCtx->gameOverCtx.state && !globalCtx->msgCtx.unk11F10 &&
!FrameAdvance_IsEnabled(globalCtx) && this->unk144 == 0) {
!FrameAdvance_IsEnabled(&globalCtx->state) && this->unk144 == 0) {
EnOkarinaEffect_SetupAction(this, func_8096B1FC);
}
}

View File

@ -399,9 +399,9 @@ void func_80A42AB8(EnTest4* this, GlobalContext* globalCtx) {
func_80A41FA4(this, globalCtx);
} else {
gSaveContext.unk_3F64 = 0.0f;
func_80169DCC(globalCtx, 0, Entrance_CreateIndexFromSpawn(0), player->unk_3CE, 0xBFF,
&player->unk_3C0, player->unk_3CC);
func_80169EFC(globalCtx);
Play_SetRespawnData(&globalCtx->state, 0, Entrance_CreateIndexFromSpawn(0), player->unk_3CE, 0xBFF,
&player->unk_3C0, player->unk_3CC);
func_80169EFC(&globalCtx->state);
if (player->stateFlags1 & 0x800000) {
EnHorse* rideActor = (EnHorse*)player->rideActor;
@ -440,16 +440,16 @@ void func_80A42AB8(EnTest4* this, GlobalContext* globalCtx) {
if ((this->nextBellTime == CLOCK_TIME(0, 0)) &&
((gSaveContext.inventory.items[SLOT_OCARINA] == ITEM_NONE) ||
(globalCtx->sceneNum == SCENE_CLOCKTOWER))) {
s32 phi_v0;
s32 playerParams;
u32 entranceIndex = gSaveContext.entranceIndex;
if ((globalCtx->actorCtx.unk5 & 2)) {
phi_v0 = 0xCFF;
playerParams = 0xCFF;
} else {
phi_v0 = 0xBFF;
playerParams = 0xBFF;
}
func_80169DCC(globalCtx, 1, entranceIndex, player->unk_3CE, phi_v0, &player->unk_3C0,
player->unk_3CC);
Play_SetRespawnData(&globalCtx->state, 1, entranceIndex, player->unk_3CE, playerParams,
&player->unk_3C0, player->unk_3CC);
if ((globalCtx->sceneNum == SCENE_TENMON_DAI) || (globalCtx->sceneNum == SCENE_00KEIKOKU)) {
globalCtx->nextEntranceIndex = 0x5400;

View File

@ -74,7 +74,8 @@ void EnTorch2_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnTorch2* this = THIS;
Collider_DestroyCylinder(globalCtx, &this->collider);
func_80169DCC(globalCtx, this->actor.params + 3, 0xFF, 0, 0xBFF, &this->actor.world.pos, this->actor.shape.rot.y);
Play_SetRespawnData(&globalCtx->state, this->actor.params + 3, 0xFF, 0, 0xBFF, &this->actor.world.pos,
this->actor.shape.rot.y);
globalCtx->actorCtx.unk254[this->actor.params] = 0;
}

View File

@ -14,19 +14,19 @@ typedef struct EnTorch2 {
} EnTorch2; // size = 0x194
typedef enum {
TORCH2_PARAM_HUMAN,
TORCH2_PARAM_GORON,
TORCH2_PARAM_ZORA,
TORCH2_PARAM_DEKU,
TORCH2_PARAM_FIERCE_DEITY,
/* 0 */ TORCH2_PARAM_HUMAN,
/* 1 */ TORCH2_PARAM_GORON,
/* 2 */ TORCH2_PARAM_ZORA,
/* 3 */ TORCH2_PARAM_DEKU,
/* 4 */ TORCH2_PARAM_FIERCE_DEITY,
} EnTorch2Param;
typedef enum {
TORCH2_STATE_INITIALIZED,
TORCH2_STATE_FADING_IN,
TORCH2_STATE_SOLID,
TORCH2_STATE_IDLE,
TORCH2_STATE_DYING,
/* 0 */ TORCH2_STATE_INITIALIZED,
/* 1 */ TORCH2_STATE_FADING_IN,
/* 2 */ TORCH2_STATE_SOLID,
/* 3 */ TORCH2_STATE_IDLE,
/* 4 */ TORCH2_STATE_DYING,
} EnTorch2State;
extern const ActorInit En_Torch2_InitVars;

View File

@ -944,7 +944,7 @@ s32 func_80A87B48(Actor* thisx, GlobalContext* globalCtx) {
sp4C.z = 40.0f;
Lib_Vec3f_TranslateAndRotateY(&this->actor.world.pos, sp3E, &sp4C, &sp40);
func_80A85620(this->unk_394, &sp40, 2.0f, 0.08f, 60.0f);
func_8016A268(globalCtx, 1, 160, 160, 160, 0);
func_8016A268(&globalCtx->state, 1, 160, 160, 160, 0);
this->unk_370 = 20;
this->unk_372 = 10;
this->unk_364++;

View File

@ -113,7 +113,7 @@ void func_80A66278(EnWarpUzu* this, GlobalContext* globalCtx) {
void func_80A66384(EnWarpUzu* this, GlobalContext* globalCtx) {
globalCtx->nextEntranceIndex = 0x22A0;
gSaveContext.respawn[0].entranceIndex = globalCtx->nextEntranceIndex;
func_80169EFC(globalCtx);
func_80169EFC(&globalCtx->state);
gSaveContext.respawnFlag = -2;
this->actionFunc = EnWarpUzu_DoNothing;
}

View File

@ -485,7 +485,7 @@ void EnWeatherTag_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
if ((globalCtx->actorCtx.unk5 & 2) && (globalCtx->msgCtx.msgMode != 0) && (globalCtx->msgCtx.unk11F04 == 0x5E6) &&
(!FrameAdvance_IsEnabled(globalCtx)) && (globalCtx->sceneLoadFlag == 0) &&
(!FrameAdvance_IsEnabled(&globalCtx->state)) && (globalCtx->sceneLoadFlag == 0) &&
(ActorCutscene_GetCurrentIndex() == -1) && (globalCtx->csCtx.state == 0)) {
oldTime = gSaveContext.time;

View File

@ -68,7 +68,7 @@ void func_80973D3C(ObjRoomtimer* this, GlobalContext* globalCtx) {
this->actionFunc = func_80973DE0;
} else if (this->actor.params != 0x1FF && gSaveContext.unk_3DD0[4] == 0) {
play_sound(NA_SE_OC_ABYSS);
func_80169EFC(globalCtx);
func_80169EFC(&globalCtx->state);
Actor_MarkForDeath(&this->actor);
}
}

View File

@ -409,6 +409,11 @@ animdict = {
"func_800A81F0": "EffectBlure_AddVertex",
"func_800A8514": "EffectBlure_AddSpace",
"Effect_GetParams": "Effect_GetByIndex",
"convert_scene_number_among_shared_scenes": "Play_GetOriginalSceneNumber",
"func_80169D40": "Play_SaveCycleSceneFlags",
"func_80169DCC": "Play_SetRespawnData",
"func_80169E6C": "Play_SetupRespawnPoint",
"func_8016A0AC": "Play_IsUnderwater",
"func_800F5A8C": "Environment_LerpWeight",
"func_801A3F54": "Audio_SetCutsceneFlag",
"func_801518B0": "Message_StartTextbox",

View File

@ -3024,10 +3024,10 @@
0x80169BF8:("func_80169BF8",),
0x80169C64:("Play_GetCsCamDataSetting",),
0x80169C84:("Play_GetCsCamDataVec3s",),
0x80169CBC:("convert_scene_number_among_shared_scenes",),
0x80169D40:("func_80169D40",),
0x80169DCC:("func_80169DCC",),
0x80169E6C:("func_80169E6C",),
0x80169CBC:("Play_GetOriginalSceneNumber",),
0x80169D40:("Play_SaveCycleSceneFlags",),
0x80169DCC:("Play_SetRespawnData",),
0x80169E6C:("Play_SetupRespawnPoint",),
0x80169ECC:("func_80169ECC",),
0x80169EFC:("func_80169EFC",),
0x80169F78:("func_80169F78",),
@ -3035,9 +3035,9 @@
0x80169FFC:("func_80169FFC",),
0x8016A01C:("FrameAdvance_IsEnabled",),
0x8016A02C:("func_8016A02C",),
0x8016A0AC:("func_8016A0AC",),
0x8016A0AC:("Play_IsUnderwater",),
0x8016A168:("func_8016A168",),
0x8016A178:("func_8016A178",),
0x8016A178:("Play_AssignPlayerActorCsIdsFromScene",),
0x8016A268:("func_8016A268",),
0x8016A2C8:("Play_Init",),
0x8016AC10:("func_8016AC10",),

View File

@ -2179,7 +2179,7 @@
0x801D0D58:("D_801D0D58","UNK_TYPE2","",0x2),
0x801D0D5C:("D_801D0D5C","UNK_TYPE2","",0x2),
0x801D0D60:("D_801D0D60","Input*","",0x4),
0x801D0D64:("D_801D0D64","UNK_TYPE2","",0x2),
0x801D0D64:("D_801D0D64","s16","[10]",0x14),
0x801D0D7A:("D_801D0D7A","UNK_TYPE1","",0x1),
0x801D0D80:("D_801D0D80","UNK_TYPE1","",0x1),
0x801D11F4:("D_801D11F4","UNK_TYPE1","",0x1),

View File

@ -2538,10 +2538,10 @@ asm/non_matchings/code/z_play/Play_CameraGetUID.s,Play_CameraGetUID,0x80169BC4,0
asm/non_matchings/code/z_play/func_80169BF8.s,func_80169BF8,0x80169BF8,0x1B
asm/non_matchings/code/z_play/Play_GetCsCamDataSetting.s,Play_GetCsCamDataSetting,0x80169C64,0x8
asm/non_matchings/code/z_play/Play_GetCsCamDataVec3s.s,Play_GetCsCamDataVec3s,0x80169C84,0xE
asm/non_matchings/code/z_play/convert_scene_number_among_shared_scenes.s,convert_scene_number_among_shared_scenes,0x80169CBC,0x21
asm/non_matchings/code/z_play/func_80169D40.s,func_80169D40,0x80169D40,0x23
asm/non_matchings/code/z_play/func_80169DCC.s,func_80169DCC,0x80169DCC,0x28
asm/non_matchings/code/z_play/func_80169E6C.s,func_80169E6C,0x80169E6C,0x18
asm/non_matchings/code/z_play/Play_GetOriginalSceneNumber.s,Play_GetOriginalSceneNumber,0x80169CBC,0x21
asm/non_matchings/code/z_play/Play_SaveCycleSceneFlags.s,Play_SaveCycleSceneFlags,0x80169D40,0x23
asm/non_matchings/code/z_play/Play_SetRespawnData.s,Play_SetRespawnData,0x80169DCC,0x28
asm/non_matchings/code/z_play/Play_SetupRespawnPoint.s,Play_SetupRespawnPoint,0x80169E6C,0x18
asm/non_matchings/code/z_play/func_80169ECC.s,func_80169ECC,0x80169ECC,0xC
asm/non_matchings/code/z_play/func_80169EFC.s,func_80169EFC,0x80169EFC,0x1F
asm/non_matchings/code/z_play/func_80169F78.s,func_80169F78,0x80169F78,0x19
@ -2549,7 +2549,7 @@ asm/non_matchings/code/z_play/func_80169FDC.s,func_80169FDC,0x80169FDC,0x8
asm/non_matchings/code/z_play/func_80169FFC.s,func_80169FFC,0x80169FFC,0x8
asm/non_matchings/code/z_play/FrameAdvance_IsEnabled.s,FrameAdvance_IsEnabled,0x8016A01C,0x4
asm/non_matchings/code/z_play/func_8016A02C.s,func_8016A02C,0x8016A02C,0x20
asm/non_matchings/code/z_play/func_8016A0AC.s,func_8016A0AC,0x8016A0AC,0x2F
asm/non_matchings/code/z_play/Play_IsUnderwater.s,Play_IsUnderwater,0x8016A0AC,0x2F
asm/non_matchings/code/z_play/func_8016A168.s,func_8016A168,0x8016A168,0x4
asm/non_matchings/code/z_play/func_8016A178.s,func_8016A178,0x8016A178,0x3C
asm/non_matchings/code/z_play/func_8016A268.s,func_8016A268,0x8016A268,0x18

1 asm/non_matchings/code/z_en_a_keep/EnAObj_Init.s EnAObj_Init 0x800A5AC0 0x2B
2538 asm/non_matchings/code/z_play/func_80169BF8.s func_80169BF8 0x80169BF8 0x1B
2539 asm/non_matchings/code/z_play/Play_GetCsCamDataSetting.s Play_GetCsCamDataSetting 0x80169C64 0x8
2540 asm/non_matchings/code/z_play/Play_GetCsCamDataVec3s.s Play_GetCsCamDataVec3s 0x80169C84 0xE
2541 asm/non_matchings/code/z_play/convert_scene_number_among_shared_scenes.s asm/non_matchings/code/z_play/Play_GetOriginalSceneNumber.s convert_scene_number_among_shared_scenes Play_GetOriginalSceneNumber 0x80169CBC 0x21
2542 asm/non_matchings/code/z_play/func_80169D40.s asm/non_matchings/code/z_play/Play_SaveCycleSceneFlags.s func_80169D40 Play_SaveCycleSceneFlags 0x80169D40 0x23
2543 asm/non_matchings/code/z_play/func_80169DCC.s asm/non_matchings/code/z_play/Play_SetRespawnData.s func_80169DCC Play_SetRespawnData 0x80169DCC 0x28
2544 asm/non_matchings/code/z_play/func_80169E6C.s asm/non_matchings/code/z_play/Play_SetupRespawnPoint.s func_80169E6C Play_SetupRespawnPoint 0x80169E6C 0x18
2545 asm/non_matchings/code/z_play/func_80169ECC.s func_80169ECC 0x80169ECC 0xC
2546 asm/non_matchings/code/z_play/func_80169EFC.s func_80169EFC 0x80169EFC 0x1F
2547 asm/non_matchings/code/z_play/func_80169F78.s func_80169F78 0x80169F78 0x19
2549 asm/non_matchings/code/z_play/func_80169FFC.s func_80169FFC 0x80169FFC 0x8
2550 asm/non_matchings/code/z_play/FrameAdvance_IsEnabled.s FrameAdvance_IsEnabled 0x8016A01C 0x4
2551 asm/non_matchings/code/z_play/func_8016A02C.s func_8016A02C 0x8016A02C 0x20
2552 asm/non_matchings/code/z_play/func_8016A0AC.s asm/non_matchings/code/z_play/Play_IsUnderwater.s func_8016A0AC Play_IsUnderwater 0x8016A0AC 0x2F
2553 asm/non_matchings/code/z_play/func_8016A168.s func_8016A168 0x8016A168 0x4
2554 asm/non_matchings/code/z_play/func_8016A178.s func_8016A178 0x8016A178 0x3C
2555 asm/non_matchings/code/z_play/func_8016A268.s func_8016A268 0x8016A268 0x18