1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-18 04:52:03 +00:00

Misc Cleanup 2 (#1007)

* Cleanup `UNK_TYPE`, `UNK_PTR` usage

* Add some missing empty lines after declarations

* Remove some legacy comments from non-matching times

* Fix some grammar (mostly "it's"/"its")

* Use proper names for two symbols after ZAPD bugfix

* Cleanup `place_title_cards.xml`

* Use `NULL` to check against `D_8012D260` pointer

* Parentheses around some macro arguments

* wip proofread headers up to z64animation.h
This commit is contained in:
Dragorn421 2021-12-01 00:40:42 +01:00 committed by GitHub
parent 04a9d51e90
commit 669732abbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
104 changed files with 217 additions and 92 deletions

View file

@ -355,7 +355,7 @@ void func_808806BC(BgHakaTrap* this, GlobalContext* globalCtx) {
f32 tempf20;
f32 temp;
s32 i;
UNK_TYPE sp64;
s32 sp64;
this->dyna.actor.velocity.y *= 1.6f;

View file

@ -214,6 +214,7 @@ void BgHidanSima_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
if (this->dyna.actor.params != 0) {
s32 temp = (this->dyna.actor.world.rot.y == this->dyna.actor.shape.rot.y) ? this->timer : (this->timer + 80);
if (this->actionFunc == func_8088E7A8) {
temp += 20;
}

View file

@ -127,6 +127,7 @@ void func_80891DD4(BgIceShutter* this, GlobalContext* globalCtx) {
void BgIceShutter_Update(Actor* thisx, GlobalContext* globalCtx) {
BgIceShutter* this = THIS;
this->actionFunc(this, globalCtx);
}

View file

@ -133,6 +133,7 @@ void BgJyaIronobj_SpawnPillarParticles(BgJyaIronobj* this, GlobalContext* global
coss = Math_CosS(rotY);
for (j = 0; j < 32; j++) {
f32 rand = Rand_ZeroOne();
if (rand < 0.1f) {
unkArg5 = 0x60;
} else if (rand < 0.8f) {
@ -191,6 +192,7 @@ void BgJyaIronobj_SpawnThoneParticles(BgJyaIronobj* this, GlobalContext* arg1, E
for (j = 0; j < 32; j++) {
f32 rand = Rand_ZeroOne();
if (rand < 0.1f) {
unkArg5 = 0x60;
} else if (rand < 0.8f) {

View file

@ -110,6 +110,7 @@ void BgMjin_Draw(Actor* thisx, GlobalContext* globalCtx) {
if (thisx->params != 0) {
// thisx is required
s32 objBankIndex = Object_GetIndex(&globalCtx->objectCtx, sObjectIDs[thisx->params - 1]);
if (objBankIndex >= 0) {
gSegments[6] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[objBankIndex].segment);
}

View file

@ -66,6 +66,7 @@ void BgTokiHikari_DoNothing(BgTokiHikari* this, GlobalContext* globalCtx) {
void BgTokiHikari_Update(Actor* thisx, GlobalContext* globalCtx) {
BgTokiHikari* this = THIS;
this->actionFunc(this, globalCtx);
}

View file

@ -109,7 +109,6 @@ void BgVbSima_Update(Actor* thisx, GlobalContext* globalCtx) {
} else {
edgeZ = 80.0f;
if (Rand_ZeroOne() < 0.5f) {
// minus1 = -1.0f; // Not a fake match; the game really does this.
edgeZ = 80.0f * minus1;
}
edgeX = Rand_CenteredFloat(160.0f);

View file

@ -416,6 +416,7 @@ void BgYdanSp_WallWebIdle(BgYdanSp* this, GlobalContext* globalCtx) {
void BgYdanSp_Update(Actor* thisx, GlobalContext* globalCtx) {
BgYdanSp* this = THIS;
this->actionFunc(this, globalCtx);
}

View file

@ -1053,6 +1053,7 @@ s32 BossDodongo_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx**
f32 mtxScaleY;
f32 mtxScaleZ;
BossDodongo* this = THIS;
// required for matching
if ((limbIndex == 6) || (limbIndex == 7)) {
if (this->unk_25C) {}

View file

@ -912,6 +912,7 @@ void BossGoma_Encounter(BossGoma* this, GlobalContext* globalCtx) {
if (this->framesUntilNextAction != 0) {
f32 s = sinf(this->framesUntilNextAction * 3.1415f * 0.5f);
this->subCameraAt.y = this->framesUntilNextAction * s * 0.7f + this->actor.world.pos.y;
} else {
Math_ApproachF(&this->subCameraAt.y, this->actor.focus.pos.y, 0.1f, 10.0f);

View file

@ -407,27 +407,26 @@ void BossMo_SetupTentacle(BossMo* this, GlobalContext* globalCtx) {
}
void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
// variables marked real are put on the stack and cannot be reordered
s16 tentXrot;
s16 sp1B4 = 0; // real
s16 sp1B4 = 0;
s32 buttons;
Player* player = GET_PLAYER(globalCtx);
s16 indS0;
s16 indS1;
Camera* camera1;
Camera* camera2;
BossMo* otherTent = (BossMo*)this->otherTent; // real
f32 maxSwingRateX; // real
f32 maxSwingLagX; // real
f32 maxSwingSizeX; // real
f32 maxSwingRateZ; // real
f32 maxSwingLagZ; // real
f32 maxSwingSizeZ; // real
f32 swingRateAccel; // real
f32 swingSizeAccel; // real
s16 rippleCount; // real
BossMo* otherTent = (BossMo*)this->otherTent;
f32 maxSwingRateX;
f32 maxSwingLagX;
f32 maxSwingSizeX;
f32 maxSwingRateZ;
f32 maxSwingLagZ;
f32 maxSwingSizeZ;
f32 swingRateAccel;
f32 swingSizeAccel;
s16 rippleCount;
s16 indT5;
Vec3f ripplePos; // real
Vec3f ripplePos;
f32 randAngle;
f32 randFloat;
f32 tempf1;
@ -438,21 +437,21 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
f32 dx;
f32 dy;
f32 dz;
Vec3f sp138; // real
Vec3f sp12C; // real
Vec3f sp120; // real
Vec3f sp138;
Vec3f sp12C;
Vec3f sp120;
s32 pad11C;
s32 pad118;
s32 pad114;
s32 pad110;
s32 pad10C;
s32 pad108;
Vec3f spFC; // real
Vec3f spF0; // real
Vec3f spFC;
Vec3f spF0;
f32 padEC;
Vec3f spE0; // real
Vec3f spD4; // real
Vec3f spC8; // real
Vec3f spE0;
Vec3f spD4;
Vec3f spC8;
if (this->work[MO_TENT_ACTION_STATE] <= MO_TENT_DEATH_3) {
this->actor.world.pos.y = MO_WATER_LEVEL(globalCtx);
@ -1117,8 +1116,8 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
(this->work[MO_TENT_ACTION_STATE] == MO_TENT_DEATH_2) || (this->work[MO_TENT_ACTION_STATE] == MO_TENT_CURL) ||
(this->work[MO_TENT_ACTION_STATE] == MO_TENT_GRAB)) &&
(Rand_ZeroOne() < 0.8f) && (this->actor.scale.x > 0.001f)) {
Vec3f pos; // real
Vec3f velocity = { 0.0f, 0.0f, 0.0f }; // real
Vec3f pos;
Vec3f velocity = { 0.0f, 0.0f, 0.0f };
f32 scale;
f32 temp;

View file

@ -1093,6 +1093,7 @@ void BossTw_ShootBeam(BossTw* this, GlobalContext* globalCtx) {
case 0:
if (this->timers[0] != 0) {
s32 beamReflection = BossTw_CheckBeamReflection(this, globalCtx);
if (beamReflection == 1) {
Vec3f pos;
Vec3f velocity;

View file

@ -3594,6 +3594,7 @@ void BossVa_DrawEffects(BossVaEffect* effect, GlobalContext* globalCtx) {
for (i = 0, flag = 0; i < ARRAY_COUNT(sVaEffects); i++, effect++) {
if (effect->type == VA_TUMOR) {
BossVa* parent = effect->parent;
if (!flag) {
func_80093D18(globalCtx->state.gfxCtx);
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, effect->envColor[3]);

View file

@ -886,6 +886,7 @@ void func_8096F544(DemoEc* this, s32 changeAnim) {
void func_8096F578(DemoEc* this, GlobalContext* globalCtx, s32 arg2) {
CsCmdActorAction* npcAction;
s32 sp18;
npcAction = DemoEc_GetNpcAction(globalCtx, arg2);
if (npcAction != NULL) {
sp18 = npcAction->action;

View file

@ -1134,7 +1134,7 @@ void DemoEffect_UpdateLgtShower(DemoEffect* this, GlobalContext* globalCtx) {
* Update action for the God Lgt Din Actor.
* This is the Goddess Din.
* This function moves God Lgt Din based on the current cutscene command.
* This function also spawns a Fireball Actor and sets it's update function to the special InitCreationFireball.
* This function also spawns a Fireball Actor and sets its update function to the special InitCreationFireball.
* The spawned Fireball Actor is also scaled to be smaller than regular by this function.
*/
void DemoEffect_UpdateGodLgtDin(DemoEffect* this, GlobalContext* globalCtx) {

View file

@ -157,6 +157,7 @@ void func_809781FC(DemoGeff* this, GlobalContext* globalCtx) {
void func_809782A0(DemoGeff* this, GlobalContext* globalCtx) {
DemoGt* demoGt = this->demoGt;
s16 params = this->actor.params;
if (demoGt != NULL && (params != 6) && (params != 7) && (params != 8)) {
this->actor.world.pos.x = demoGt->dyna.actor.world.pos.x + this->deltaPosX;
this->actor.world.pos.y = demoGt->dyna.actor.world.pos.y + this->deltaPosY;

View file

@ -107,6 +107,7 @@ void func_8097C9B8(DemoGo* this) {
void func_8097C9DC(DemoGo* this) {
s32 pad[2];
if (Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 25.0f)) {
func_80078914(&this->actor.projectedPos, NA_SE_EN_MORIBLIN_WALK);
}

View file

@ -648,6 +648,7 @@ void func_809862E0(DemoIm* this, GlobalContext* globalCtx) {
if (npcAction != NULL) {
u32 action = npcAction->action;
u32 unk_274 = this->unk_274;
if (action != unk_274) {
switch (action) {
case 1:

View file

@ -873,6 +873,7 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, GlobalContext* globalCtx) {
sWarpSparkleEnvColors[globalCtx->msgCtx.lastPlayedSong].b, 255);
} else {
s8 respawnData = gSaveContext.respawn[1].data;
gDPSetEnvColor(POLY_XLU_DISP++, sWarpSparkleEnvColors[respawnData].r,
sWarpSparkleEnvColors[respawnData].g, sWarpSparkleEnvColors[respawnData].b, 255);
}

View file

@ -96,6 +96,7 @@ void DoorAna_Destroy(Actor* thisx, GlobalContext* globalCtx) {
// update routine for grottos that are currently "hidden"/unopened
void DoorAna_WaitClosed(DoorAna* this, GlobalContext* globalCtx) {
u32 openGrotto = false;
if (!(this->actor.params & 0x200)) {
// opening with song of storms
if (this->actor.xyzDistToPlayerSq < 40000.0f && Flags_GetEnv(globalCtx, 5)) {

View file

@ -37,8 +37,6 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F(scale, 1, ICHAIN_STOP),
};
extern UNK_TYPE D_80994B70;
void DoorGerudo_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
DoorGerudo* this = THIS;

View file

@ -234,6 +234,7 @@ void EnAnubiceFire_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_Push();
for (i = this->unk_15E; i < 6; ++i) {
f32 scale = this->actor.scale.x - (i * 0.2f);
if (scale < 0.0f) {
scale = 0.0f;
}

View file

@ -100,6 +100,7 @@ void func_809C1E00(EnBird* this, s16 params) {
void func_809C1E40(EnBird* this, GlobalContext* globalCtx) {
f32 fVar4 = sinf(this->unk_1B4);
this->actor.shape.yOffset += fVar4 * this->unk_1A0;
Math_SmoothStepToF(&this->actor.speedXZ, this->unk_1A8, 0.1f, this->unk_1AC, 0.0f);

View file

@ -166,7 +166,7 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
}
}
// Decrement the return timer and check if its 0. If it is, check if Link can catch it and handle accordingly.
// Decrement the return timer and check if it's 0. If it is, check if Link can catch it and handle accordingly.
// Otherwise handle grabbing and colliding.
if (DECR(this->returnTimer) == 0) {
distFromLink = Math_Vec3f_DistXYZ(&this->actor.world.pos, &player->actor.focus.pos);
@ -179,7 +179,7 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
Math_Vec3f_Copy(&target->world.pos, &player->actor.world.pos);
// If the grabbed actor is EnItem00 (HP/Key etc) set gravity and flags so it falls in front of Link.
// Otherwise if its a Skulltula Token, just set flags so he collides with it to collect it.
// Otherwise if it's a Skulltula Token, just set flags so he collides with it to collect it.
if (target->id == ACTOR_EN_ITEM00) {
target->gravity = -0.9f;
target->bgCheckFlags &= ~0x03;
@ -202,7 +202,7 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
&hitPoint, &this->actor.wallPoly, true, true, true, true, &hitDynaID);
if (collided) {
// If the boomerang collides with something and its is a Jabu Object actor with params equal to 0, then
// If the boomerang collides with something and it's is a Jabu Object actor with params equal to 0, then
// set collided to 0 so that the boomerang will go through the wall.
// Otherwise play a clank sound and keep collided set to bounce back.
if (func_8002F9EC(globalCtx, &this->actor, this->actor.wallPoly, hitDynaID, &hitPoint) != 0 ||

View file

@ -224,6 +224,7 @@ void EnBx_Draw(Actor* thisx, GlobalContext* globalCtx) {
for (i = 3; i >= 0; i--) {
s16 off = (0x2000 * i);
this->unk_184[i].z = this->unk_184[i].x = (Math_CosS(this->unk_14E + off) * 0.0075f) + 0.015f;
this->unk_1B4[i].x = thisx->shape.rot.x;
this->unk_1B4[i].y = thisx->shape.rot.y;

View file

@ -293,6 +293,7 @@ void EnDoor_Open(EnDoor* this, GlobalContext* globalCtx) {
void EnDoor_Update(Actor* thisx, GlobalContext* globalCtx) {
EnDoor* this = THIS;
this->actionFunc(this, globalCtx);
}

View file

@ -76,6 +76,7 @@ void EnEncount2_Wait(EnEncount2* this, GlobalContext* globalCtx) {
}
} else if ((this->actor.xzDistToPlayer < 700.0f) && (Flags_GetSwitch(globalCtx, 0x37))) {
s16 scene = globalCtx->sceneNum;
if (((scene == SCENE_GANON_DEMO) || (scene == SCENE_GANON_FINAL) || (scene == SCENE_GANON_SONOGO) ||
(scene == SCENE_GANONTIKA_SONOGO)) &&
(!this->collapseSpawnerInactive)) {

View file

@ -318,6 +318,7 @@ void EnFireRock_Update(Actor* thisx, GlobalContext* globalCtx) {
if (this->type != FIRE_ROCK_CEILING_SPOT_SPAWNER) {
f32 temp;
this->rockRotation.x += this->angularVelocity.x;
this->rockRotation.y += this->angularVelocity.y;
this->rockRotation.z += this->angularVelocity.z;

View file

@ -232,6 +232,7 @@ void EnFloormas_SetupRun(EnFloormas* this) {
void EnFloormas_SetupTurn(EnFloormas* this) {
s16 rotDelta = this->actionTarget - this->actor.shape.rot.y;
this->actor.speedXZ = 0.0f;
if (rotDelta > 0) {
Animation_MorphToPlayOnce(&this->skelAnime, &gFloormasterTurnAnim, -3.0f);
@ -470,6 +471,7 @@ void EnFloormas_Stand(EnFloormas* this, GlobalContext* globalCtx) {
void EnFloormas_BigWalk(EnFloormas* this, GlobalContext* globalCtx) {
s32 animPastFrame;
SkelAnime_Update(&this->skelAnime);
animPastFrame = Animation_OnFrame(&this->skelAnime, 0.0f);
if (animPastFrame) {
@ -1082,6 +1084,7 @@ void EnFloormas_Update(Actor* thisx, GlobalContext* globalCtx) {
s32 EnFloormas_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
void* thisx, Gfx** gfx) {
EnFloormas* this = THIS;
if (limbIndex == 1) {
pos->z += this->zOffset;
}

View file

@ -746,6 +746,7 @@ void EnFr_ChildSong(EnFr* this, GlobalContext* globalCtx) {
void EnFr_ChildSongFirstTime(EnFr* this, GlobalContext* globalCtx) {
EnFr* frog = sEnFrPointers.frogs[sSongToFrog[this->songIndex]];
if (frog->isActive == false) {
this->actor.textId = 0x40A9;
EnFr_SetupReward(this, globalCtx, true);

View file

@ -417,6 +417,7 @@ void EnGoma_Dead(EnGoma* this, GlobalContext* globalCtx) {
if (this->actionTimer == 0 && Math_SmoothStepToF(&this->actor.scale.y, 0.0f, 0.5f, 0.00225f, 0.00001f) <= 0.001f) {
if (this->actor.params < 6) {
BossGoma* parent = (BossGoma*)this->actor.parent;
parent->childrenGohmaState[this->actor.params] = -1;
}
Audio_PlaySoundGeneral(NA_SE_EN_EXTINCT, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8);
@ -659,6 +660,7 @@ void EnGoma_UpdateHit(EnGoma* this, GlobalContext* globalCtx) {
// die if still an egg
if (this->actor.params <= 5) { //! BossGoma only has 3 children
BossGoma* parent = (BossGoma*)this->actor.parent;
parent->childrenGohmaState[this->actor.params] = -1;
}

View file

@ -725,7 +725,7 @@ void EnGoroiwa_Update(Actor* thisx, GlobalContext* globalCtx) {
EnGoroiwa* this = THIS;
Player* player = GET_PLAYER(globalCtx);
s32 pad;
UNK_TYPE sp30;
s32 sp30;
if (!(player->stateFlags1 & 0x300000C0)) {
if (this->collisionDisabledTimer > 0) {

View file

@ -275,6 +275,7 @@ void func_80A56994(EnHeishi4* this, GlobalContext* globalCtx) {
void func_80A56A50(EnHeishi4* this, GlobalContext* globalCtx) {
f32 frames = Animation_GetLastFrame(&gEnHeishiDyingGuardDieAnim);
this->unk_288 = frames;
Animation_Change(&this->skelAnime, &gEnHeishiDyingGuardDieAnim, 1.0f, 0.0f, frames, ANIMMODE_ONCE, -10.0f);
this->actionFunc = func_80A56ACC;

View file

@ -103,6 +103,7 @@ void EnHintnuts_Init(Actor* thisx, GlobalContext* globalCtx) {
void EnHintnuts_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnHintnuts* this = THIS;
if (this->actor.params != 0xA) {
Collider_DestroyCylinder(globalCtx, &this->collider);
}

View file

@ -317,6 +317,7 @@ void EnHoll_NextAction(EnHoll* this, GlobalContext* globalCtx) {
void EnHoll_Update(Actor* thisx, GlobalContext* globalCtx) {
EnHoll* this = THIS;
this->actionFunc(this, globalCtx);
}

View file

@ -472,6 +472,7 @@ s32 EnHorse_BgCheckBridgeJumpPoint(EnHorse* this, GlobalContext* globalCtx) {
xMax = (xMin + sBridgeJumps[i].xMax) + sBridgeJumps[i].xOffset;
if (xMax < xMin) {
f32 temp = xMin;
xMin = xMax;
xMax = temp;
}
@ -504,6 +505,7 @@ s32 EnHorse_CheckBridgeJumps(EnHorse* this, GlobalContext* globalCtx) {
if (xMax < xMin) {
f32 temp = xMin;
xMin = xMax;
xMax = temp;
}
@ -987,6 +989,7 @@ void EnHorse_UpdateSpeed(EnHorse* this, GlobalContext* globalCtx, f32 brakeDecel
f32 temp_f12;
f32 traction;
s16 turn;
if (!EnHorse_PlayerCanMove(this, globalCtx)) {
if (this->actor.speedXZ > 8) {
this->actor.speedXZ -= decel;

View file

@ -609,6 +609,7 @@ s32 func_80A6AD84(Actor* thisx, GlobalContext* globalCtx, s32 arg2, PSkinAwb* ar
if (arg2 == 0xD) {
u8 index = sEyeIndexOrder[this->eyeTexIndex];
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sEyeTextures[index]));
}

View file

@ -1171,6 +1171,7 @@ void EnIk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
switch (limbIndex) {
case 13: {
EnIk* this = THIS;
if (EnIk_curFrame(&this->actor) < 30.0f) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_en_ik_inAwake.c", 267),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@ -1189,9 +1190,8 @@ void EnIk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
break;
case 26: {
EnIk* this = THIS;
if (EnIk_curFrame(&this->actor) < 30.0f) {
// s32 pad;
if (EnIk_curFrame(&this->actor) < 30.0f) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_en_ik_inAwake.c", 288),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016BE0);
@ -1199,9 +1199,8 @@ void EnIk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
} break;
case 27: {
EnIk* this = THIS;
if (EnIk_curFrame(&this->actor) < 30.0f) {
// s32 pad;
if (EnIk_curFrame(&this->actor) < 30.0f) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_en_ik_inAwake.c", 297),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016CD8);

View file

@ -324,6 +324,7 @@ void func_80A89A6C(EnJsjutan* this, GlobalContext* globalCtx) {
f32 rotX;
f32 rotZ;
s32 pad;
// Carpet size is 12x12.
if ((i % 12) == 11) { // Last column.
j = i - 1;

View file

@ -544,6 +544,7 @@ s16 func_80A97738(GlobalContext* globalCtx, Actor* thisx) {
s32 EnKo_GetForestQuestState(EnKo* this) {
s32 result;
if (!LINK_IS_ADULT) {
// Obtained Zelda's Letter
if (gSaveContext.eventChkInf[4] & 1) {

View file

@ -85,6 +85,7 @@ static void* sEyeTextures[] = {
u16 EnMa1_GetText(GlobalContext* globalCtx, Actor* thisx) {
u16 faceReaction = Text_GetFaceReaction(globalCtx, 0x17);
if (faceReaction != 0) {
return faceReaction;
}

View file

@ -64,6 +64,7 @@ static struct_D_80AA1678 sAnimationInfo[] = {
u16 func_80AA19A0(GlobalContext* globalCtx, Actor* thisx) {
u16 faceReaction = Text_GetFaceReaction(globalCtx, 23);
if (faceReaction != 0) {
return faceReaction;
}

View file

@ -1166,11 +1166,13 @@ void func_80AB36DC(EnNb* this, GlobalContext* globalCtx) {
if ((((u16)((u16)(kREG(17) + 25) - 4))) > moveTime) {
s16 invScale = 4 - moveTime;
if (invScale > 0) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->pathYaw, invScale, 6200, 100);
}
} else {
s16 invScale = (u16)(kREG(17) + 25) - moveTime;
if (invScale > 0) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, invScale, 6200, 100);
}

View file

@ -552,6 +552,7 @@ void EnNy_Draw(Actor* thisx, GlobalContext* globalCtx) {
Vec3f tempVec;
Vec3f* fireOffset;
s16 temp;
temp = this->unk_1CA - 1;
this->actor.colorFilterTimer++;
if (temp == 0) {

View file

@ -254,7 +254,7 @@ void func_80ABF4C8(EnOkarinaTag* this, GlobalContext* globalCtx) {
gSaveContext.cutsceneTrigger = 1;
break;
case 6:
globalCtx->csCtx.segment = LINK_IS_ADULT ? SEGMENTED_TO_VIRTUAL(&spot02_sceneCutsceneData0x003C80)
globalCtx->csCtx.segment = LINK_IS_ADULT ? SEGMENTED_TO_VIRTUAL(&spot02_scene_Cs_003C80)
: SEGMENTED_TO_VIRTUAL(&spot02_scene_Cs_005020);
gSaveContext.cutsceneTrigger = 1;
gSaveContext.eventChkInf[1] |= 0x2000;

View file

@ -120,7 +120,7 @@ void EnOkuta_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
WaterBox* outWaterBox;
f32 ySurface;
UNK_TYPE sp30;
s32 sp30;
Actor_ProcessInitChain(thisx, sInitChain);
this->numShots = (thisx->params >> 8) & 0xFF;

View file

@ -455,6 +455,7 @@ void EnOssan_UpdateShopOfferings(EnOssan* this, GlobalContext* globalCtx) {
shopItem = &storeItems[i];
if (shopItem->shopItemIndex >= 0 && this->shelfSlots[i] == NULL) {
s16 params = sShopItemReplaceFunc[shopItem->shopItemIndex](shopItem->shopItemIndex);
if (params >= 0) {
this->shelfSlots[i] = (EnGirlA*)Actor_Spawn(
&globalCtx->actorCtx, globalCtx, ACTOR_EN_GIRLA,

View file

@ -591,6 +591,7 @@ void func_80ACB148(EnOwl* this, GlobalContext* globalCtx) {
void EnOwl_WaitHyliaShortcut(EnOwl* this, GlobalContext* globalCtx) {
u16 textId = (gSaveContext.infTable[25] & 0x20) ? 0x4004 : 0x4003;
// Spoke to Owl in Lake Hylia
EnOwl_LookAtLink(this, globalCtx);
if (func_80ACA558(this, globalCtx, textId)) {

View file

@ -183,6 +183,7 @@ void func_80ACE5C8(EnPart* this, GlobalContext* globalCtx) {
if (sqrt(this->actor.xyzDistToPlayerSq) <= 40.0f) {
u8 prevInvincibilityTimer = player->invincibilityTimer;
if (player->invincibilityTimer <= 0) {
if (player->invincibilityTimer <= -40) {
player->invincibilityTimer = 0;
@ -217,6 +218,7 @@ void func_80ACE7E8(EnPart* this, GlobalContext* globalCtx) {
if (this->timer == 0) {
f32 diffsSum = Math_SmoothStepToF(&this->actor.world.pos.x, this->actor.home.pos.x, 1.0f, 5.0f, 0.0f);
diffsSum += Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 1.0f, 5.0f, 0.0f);
diffsSum += Math_SmoothStepToF(&this->actor.world.pos.z, this->actor.home.pos.z, 1.0f, 5.0f, 0.0f);
diffsSum += Math_SmoothStepToF(&this->rotZ, 0.0f, 1.0f, 0.25f, 0.0f);

View file

@ -284,6 +284,7 @@ void EnPeehat_HitWhenGrounded(EnPeehat* this, GlobalContext* globalCtx) {
this->colCylinder.base.acFlags &= ~AC_HIT;
if ((globalCtx->gameplayFrames & 0xF) == 0) {
Vec3f itemDropPos = this->actor.world.pos;
itemDropPos.y += 70.0f;
Item_DropCollectibleRandom(globalCtx, &this->actor, &itemDropPos, 0x40);
Item_DropCollectibleRandom(globalCtx, &this->actor, &itemDropPos, 0x40);
@ -291,6 +292,7 @@ void EnPeehat_HitWhenGrounded(EnPeehat* this, GlobalContext* globalCtx) {
this->unk2D4 = 240;
} else {
s32 i;
this->colCylinder.base.acFlags &= ~AC_HIT;
for (i = MAX_LARVA - this->unk2FA; i > 0; i--) {
Actor* larva =
@ -298,6 +300,7 @@ void EnPeehat_HitWhenGrounded(EnPeehat* this, GlobalContext* globalCtx) {
Rand_CenteredFloat(25.0f) + this->actor.world.pos.x,
Rand_CenteredFloat(25.0f) + (this->actor.world.pos.y + 50.0f),
Rand_CenteredFloat(25.0f) + this->actor.world.pos.z, 0, 0, 0, PEAHAT_TYPE_LARVA);
if (larva != NULL) {
larva->velocity.y = 6.0f;
larva->shape.rot.y = larva->world.rot.y = Rand_CenteredFloat(0xFFFF);

View file

@ -977,6 +977,7 @@ void func_80ADB770(EnPoSisters* this, GlobalContext* globalCtx) {
}
} else if (this->unk_195 != 0) {
EnPoSisters* realMeg = (EnPoSisters*)this->actor.parent;
if (realMeg->actionFunc == func_80ADAAA4) {
func_80AD95D8(this);
}
@ -1195,7 +1196,7 @@ void EnPoSisters_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 0.0f, 5);
} else {
Vec3f vec;
UNK_TYPE sp34;
s32 sp34;
vec.x = this->actor.world.pos.x;
vec.y = this->actor.world.pos.y + 10.0f;

View file

@ -990,7 +990,7 @@ void EnPoh_UpdateLiving(Actor* thisx, GlobalContext* globalCtx) {
EnPoh* this = THIS;
s32 pad;
Vec3f vec;
UNK_TYPE sp38;
s32 sp38;
if (this->colliderSph.base.atFlags & AT_HIT) {
this->colliderSph.base.atFlags &= ~AT_HIT;
@ -1180,6 +1180,7 @@ void EnPoh_DrawSoul(Actor* thisx, GlobalContext* globalCtx) {
if (this->infoIdx == EN_POH_INFO_COMPOSER) {
Color_RGBA8* envColor = (this->actor.params == EN_POH_SHARP) ? &D_80AE1B4C : &D_80AE1B50;
s32 pad;
gSPDisplayList(POLY_OPA_DISP++, gPoeComposerLanternBottomDL);
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, envColor->r, envColor->g, envColor->b, 255);

View file

@ -482,6 +482,7 @@ void func_80AEB7D0(EnRu1* this) {
f32 func_80AEB7E0(CsCmdActorAction* csCmdNPCAction, GlobalContext* globalCtx) {
s32 csCtxFrames = globalCtx->csCtx.frames;
if ((csCtxFrames < csCmdNPCAction->endFrame) && (csCmdNPCAction->endFrame - csCmdNPCAction->startFrame > 0)) {
return (Math_CosS(((csCtxFrames - csCmdNPCAction->startFrame) /
(f32)(csCmdNPCAction->endFrame - csCmdNPCAction->startFrame)) *
@ -548,6 +549,7 @@ void func_80AEBA2C(EnRu1* this, GlobalContext* globalCtx) {
f32 temp_ret_2;
CsCmdActorAction* csCmdNPCAction = func_80AEB438(globalCtx);
s32 pad2;
if (csCmdNPCAction != NULL) {
temp_ret_2 = func_80AEB7E0(csCmdNPCAction, globalCtx);
thisPos = &this->actor.world.pos;
@ -1513,6 +1515,7 @@ s32 func_80AEE264(EnRu1* this, GlobalContext* globalCtx) {
void func_80AEE2F8(EnRu1* this, GlobalContext* globalCtx) {
DynaPolyActor* dynaPolyActor;
s32 floorBgId;
if ((this->actor.bgCheckFlags & 1) && (this->actor.floorBgId != BGCHECK_SCENE)) {
floorBgId = this->actor.floorBgId;
dynaPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, floorBgId);

View file

@ -314,7 +314,7 @@ void func_80AF2BC0(EnRu2* this, GlobalContext* globalCtx) {
}
}
void func_80AF2C54(EnRu2* this, UNK_TYPE arg1) {
void func_80AF2C54(EnRu2* this, s32 arg1) {
if (arg1 != 0) {
this->action = 5;
}
@ -355,7 +355,7 @@ void func_80AF2D2C(EnRu2* this, GlobalContext* globalCtx) {
}
void func_80AF2D6C(EnRu2* this, GlobalContext* globalCtx) {
UNK_TYPE something;
s32 something;
func_80AF2744(this, globalCtx);
something = EnRu2_UpdateSkelAnime(this);
@ -531,7 +531,7 @@ void func_80AF34F0(EnRu2* this) {
this->action = 13;
}
void func_80AF3530(EnRu2* this, UNK_TYPE arg1) {
void func_80AF3530(EnRu2* this, s32 arg1) {
if (arg1 != 0) {
func_80AF28E8(this, &gAdultRutoLookingDownLeftAnim, 0, 0.0f, 0);
}
@ -583,7 +583,7 @@ void func_80AF366C(EnRu2* this, GlobalContext* globalCtx) {
}
void func_80AF36AC(EnRu2* this, GlobalContext* globalCtx) {
UNK_TYPE something;
s32 something;
func_80AF2744(this, globalCtx);
something = EnRu2_UpdateSkelAnime(this);

View file

@ -591,7 +591,7 @@ void func_80AF683C(EnSa* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (!(player->actor.world.pos.z >= -2220.0f) && !Gameplay_InCsMode(globalCtx)) {
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(spot05_sceneCutsceneData0x005730);
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(spot05_scene_Cs_005730);
gSaveContext.cutsceneTrigger = 1;
this->actionFunc = func_80AF68E4;
}

View file

@ -176,6 +176,7 @@ void EnSkb_Init(Actor* thisx, GlobalContext* globalCtx) {
void EnSkb_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnSkb* this = THIS;
if (this->actor.parent != NULL) {
EnEncount1* spawner = (EnEncount1*)this->actor.parent;
@ -378,6 +379,7 @@ void func_80AFD644(EnSkb* this) {
void func_80AFD6CC(EnSkb* this, GlobalContext* globalCtx) {
// this cast is likely not real, but allows for a match
u8* new_var;
new_var = &this->unk_283;
if ((this->unk_283 != 1) || BodyBreak_SpawnParts(&this->actor, &this->bodyBreak, globalCtx, 1)) {
if ((*new_var) != 0) {

View file

@ -1113,6 +1113,7 @@ void EnSkj_SetupWaitForLandAnimFinish(EnSkj* this) {
void EnSkj_WaitForLandAnimFinish(EnSkj* this, GlobalContext* globalCtx) {
s16 lastFrame = Animation_GetLastFrame(&gSkullKidLandAnim);
if (this->skelAnime.curFrame == lastFrame) {
EnSkj_SetupWalkToPlayer(this);
}

View file

@ -774,6 +774,7 @@ void func_80B1585C(EnTa* this, GlobalContext* globalCtx) {
if (this->superCuccos[i] != NULL) {
EnNiw* niw = this->superCuccos[i];
niw->unk_308 = 1;
niw->actor.gravity = 0.0f;
}
@ -1181,6 +1182,7 @@ s32 EnTa_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
this->unk_2E0 &= ~0x8;
} else if ((limbIndex == 8) || (limbIndex == 10) || (limbIndex == 13)) {
s32 limbIdx50 = limbIndex * 50;
rot->y += Math_SinS(globalCtx->state.frames * (limbIdx50 + 0x814)) * 200.0f;
rot->z += Math_CosS(globalCtx->state.frames * (limbIdx50 + 0x940)) * 200.0f;
}

View file

@ -1004,6 +1004,7 @@ void EnTite_Draw(Actor* thisx, GlobalContext* globalCtx) {
if ((this->spawnIceTimer & 3) == 0) {
Vec3f iceChunk;
s32 idx = this->spawnIceTimer >> 2;
iceChunk.x = thisx->world.pos.x + sIceChunks[idx].x;
iceChunk.y = thisx->world.pos.y + sIceChunks[idx].y;
iceChunk.z = thisx->world.pos.z + sIceChunks[idx].z;

View file

@ -288,6 +288,7 @@ s32 EnXc_MinuetCS(EnXc* this, GlobalContext* globalCtx) {
if (this->actor.params == SHEIK_TYPE_MINUET) {
Player* player = GET_PLAYER(globalCtx);
f32 z = player->actor.world.pos.z;
if (z < -2225.0f) {
if (!Gameplay_InCsMode(globalCtx)) {
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gMinuetCs);
@ -347,6 +348,7 @@ s32 EnXc_SerenadeCS(EnXc* this, GlobalContext* globalCtx) {
if (this->actor.params == SHEIK_TYPE_SERENADE) {
Player* player = GET_PLAYER(globalCtx);
s32 stateFlags = player->stateFlags1;
if (CHECK_OWNED_EQUIP(EQUIP_BOOTS, 1) && !(gSaveContext.eventChkInf[5] & 4) && !(stateFlags & 0x20000000) &&
!Gameplay_InCsMode(globalCtx)) {
Cutscene_SetSegment(globalCtx, &gIceCavernSerenadeCs);
@ -491,6 +493,7 @@ void EnXc_SpawnFlame(EnXc* this, GlobalContext* globalCtx) {
f32 xPos = npcAction->startPos.x;
f32 yPos = npcAction->startPos.y;
f32 zPos = npcAction->startPos.z;
this->flameActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_LIGHT, xPos, yPos, zPos, 0, 0, 0, 5);
sFlameSpawned = true;
}
@ -526,6 +529,7 @@ void EnXc_InitFlame(EnXc* this, GlobalContext* globalCtx) {
CsCmdActorAction* npcAction = EnXc_GetCsCmd(globalCtx, 0);
if (npcAction != NULL) {
s32 action = npcAction->action;
if (D_80B41DA8 != action) {
if (action != 1) {
EnXc_SpawnFlame(this, globalCtx);
@ -564,6 +568,7 @@ AnimationHeader* EnXc_GetCurrentHarpAnim(GlobalContext* globalCtx, s32 index) {
if (npcAction != NULL) {
u16 action = npcAction->action;
if (action == 11) {
animation = &gSheikPlayingHarp3Anim;
} else if (action == 12) {
@ -1570,6 +1575,7 @@ void EnXc_CalcTriforce(Actor* thisx, GlobalContext* globalCtx) {
if (this->unk_274 == 1) {
if (*timer < kREG(25) + 40.0f) {
f32 div = *timer / (kREG(25) + 40.0f);
prim[2] = -85.0f * div + 255;
prim[3] = 255.0f * div;
env[1] = 100.0f * div + 100;
@ -1584,6 +1590,7 @@ void EnXc_CalcTriforce(Actor* thisx, GlobalContext* globalCtx) {
scale[2] = kREG(21) * 0.1f + 40.0f;
} else if (this->unk_274 == 2) {
f32 maxTime = (kREG(25) + 40.0f) + (kREG(27) + 90.0f);
if (*timer < maxTime) {
f32 div = (*timer - (kREG(25) + 40.0f)) / (kREG(27) + 90.0f);
scale[0] = (kREG(19) * 0.1f + 40.0f) + div * ((kREG(26) + 50.0f) * (kREG(19) * 0.1f + 40.0f));

View file

@ -19,11 +19,11 @@ typedef struct EnZl1 {
/* 0x01E6 */ s16 unk_1E6;
/* 0x01E8 */ s16 unk_1E8;
/* 0x01EA */ char unk_1EA[0x2];
/* 0x01EC */ UNK_PTR unk_1EC;
/* 0x01EC */ void* unk_1EC;
/* 0x01F0 */ char unk_1F0[0x2];
/* 0x01F2 */ s16 unk_1F2;
/* 0x01F4 */ UNK_PTR unk_1F4;
/* 0x01F8 */ UNK_PTR unk_1F8;
/* 0x01F4 */ void* unk_1F4;
/* 0x01F8 */ void* unk_1F8;
/* 0x01FC */ s16 unk_1FC;
/* 0x01FE */ s16 unk_1FE;
/* 0x0200 */ Vec3s unk_200;

View file

@ -2491,6 +2491,7 @@ s32 func_80B59698(EnZl3* this, GlobalContext* globalCtx) {
if (cond) {
u8 curSpawn = globalCtx->curSpawn;
if ((func_80B54DB4(this) == 0x20) && (curSpawn == 0) &&
((gSaveContext.timer2Value <= 0) || (gSaveContext.timer2State == 0))) {
return 1;

View file

@ -82,6 +82,7 @@ void ObjBombiwa_Init(Actor* thisx, GlobalContext* globalCtx) {
CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit);
if (thisx->shape.rot.y == 0) {
s16 rand = (s16)Rand_ZeroFloat(65536.0f);
thisx->world.rot.y = rand;
thisx->shape.rot.y = rand;
}

View file

@ -70,10 +70,12 @@ u32 ObjTimeblock_CalculateIsVisible(ObjTimeblock* this) {
return this->unk_175;
} else {
u8 temp = ((this->dyna.actor.params >> 15) & 1) ? true : false;
if (this->unk_177 == 1) {
return this->unk_174 ^ temp;
} else {
u8 linkIsYoung = (LINK_AGE_IN_YEARS == YEARS_CHILD) ? true : false;
return this->unk_174 ^ temp ^ linkIsYoung;
}
}
@ -254,6 +256,7 @@ void ObjTimeblock_Normal(ObjTimeblock* this, GlobalContext* globalCtx) {
void func_80BA06AC(ObjTimeblock* this, GlobalContext* globalCtx) {
s32 switchFlag = this->dyna.actor.params & 0x3F;
this->unk_172 = globalCtx->msgCtx.lastPlayedSong;
if (this->demoEffectFirstPartTimer > 0 && --this->demoEffectFirstPartTimer == 0) {

View file

@ -191,6 +191,7 @@ s32 func_80BA228C(ObjWarp2block* this, GlobalContext* globalCtx) {
s32 func_80BA2304(ObjWarp2block* this, GlobalContext* globalCtx) {
s32 ret = this->func_168(this, globalCtx);
this->unk_172 = globalCtx->msgCtx.lastPlayedSong;
return ret;

View file

@ -7418,6 +7418,7 @@ s32 func_80842964(Player* this, GlobalContext* globalCtx) {
void func_808429B4(GlobalContext* globalCtx, s32 speed, s32 y, s32 countdown) {
s32 quakeIdx = Quake_Add(Gameplay_GetCamera(globalCtx, 0), 3);
Quake_SetSpeed(quakeIdx, speed);
Quake_SetQuakeValues(quakeIdx, y, 0, 0, 0);
Quake_SetCountdown(quakeIdx, countdown);
@ -11579,6 +11580,7 @@ void func_8084D610(Player* this, GlobalContext* globalCtx) {
if (sp34 != 0.0f) {
s16 temp = this->actor.shape.rot.y - sp32;
if ((ABS(temp) > 0x6000) && !Math_StepToF(&this->linearVelocity, 0.0f, 1.0f)) {
return;
}