summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Hensley <hensley.derek58@gmail.com>2025-02-16 09:30:27 -0800
committerEblo <7004497+Eblo@users.noreply.github.com>2025-09-16 20:10:33 -0400
commita985ca5b76c09d4bcb195d37a03861b104b712c9 (patch)
tree416ce869ec7934754d6f0cbc51781f3eb2f97ea8
parent18ea7bfa83d93c2b1a96492f38d860bc098e3b6c (diff)
Misc FAKE fixes (#1783)
* CutsceneCamera_UpdateSplines fake match * CutsceneCamera_Init -1 splineIndex * Eye Point comment * func_80B781DC better fake * func_80B32F04 * ObjSwitch_Update * ObjSwitch_InitTrisCollider * ObjAqua_Init * EnTrt_ItemGiven * func_80C10E98 partly * EnTest7_WarpCsWarp this to 1 * EnTest6_InvertedSoTCutscene better fake * EnTest6_DrawAmmoDropRupee * EnPoSisters_MatchPlayerY * func_8095B76C * EnMinifrog_Init * func_80A5C0B8 * EnKnight_UpdateEffects * EnKnight_FlyingHeadAttack * EnKakasi_Init * EnInvadepoh_ModelInfo_GetNextFaceAnim * BgAstrBombwall_InitCollider like func_809CE068 * Player_UpdateInterface * Player_CsAction_TranslateReverse * DynaPoly_AddBgActorToLookup better fake * CutsceneManager_FindEntranceCsId * func_800AE930 better fake * Math3D_CylVsLineSeg better fake * MapDisp_InitBossRoomStorey * Play_Init * EnTimeTag_Diary_Wait better fake * Remove fake label from Player_SwordFromIA * Player_PostLimbDrawGameplay partly * EffectBlure_AddVertex prev temp * Player_PostLimbDrawGameplay attempt 2 * AudioMgr_StopAllSfxExceptSystem * Camera_Normal0 * Camera_Jump2 * Camera_Normal3 * PR review
-rw-r--r--mm/include/z64player.h2
-rw-r--r--mm/src/code/audio_stop_all_sfx.c14
-rw-r--r--mm/src/code/cutscene_camera.c10
-rw-r--r--mm/src/code/sys_math3d.c6
-rw-r--r--mm/src/code/z_actor.c2
-rw-r--r--mm/src/code/z_bgcheck.c2
-rw-r--r--mm/src/code/z_camera.c195
-rw-r--r--mm/src/code/z_eff_blure.c7
-rw-r--r--mm/src/code/z_eff_tire_mark.c7
-rw-r--r--mm/src/code/z_eventmgr.c14
-rw-r--r--mm/src/code/z_map_disp.c17
-rw-r--r--mm/src/code/z_play.c10
-rw-r--r--mm/src/code/z_player_lib.c21
-rw-r--r--mm/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c4
-rw-r--r--mm/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c4
-rw-r--r--mm/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c6
-rw-r--r--mm/src/overlays/actors/ovl_En_Knight/z_en_knight.c28
-rw-r--r--mm/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c8
-rw-r--r--mm/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c31
-rw-r--r--mm/src/overlays/actors/ovl_En_Owl/z_en_owl.c42
-rw-r--r--mm/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c4
-rw-r--r--mm/src/overlays/actors/ovl_En_Test6/z_en_test6.c10
-rw-r--r--mm/src/overlays/actors/ovl_En_Test7/z_en_test7.c2
-rw-r--r--mm/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c7
-rw-r--r--mm/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c6
-rw-r--r--mm/src/overlays/actors/ovl_En_Trt/z_en_trt.c5
-rw-r--r--mm/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c12
-rw-r--r--mm/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c13
-rw-r--r--mm/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c19
-rw-r--r--mm/src/overlays/actors/ovl_Obj_Um/z_obj_um.c5
-rw-r--r--mm/src/overlays/actors/ovl_player_actor/z_player.c34
31 files changed, 242 insertions, 305 deletions
diff --git a/mm/include/z64player.h b/mm/include/z64player.h
index 2c7efafbd..17b8b0e05 100644
--- a/mm/include/z64player.h
+++ b/mm/include/z64player.h
@@ -1378,7 +1378,7 @@ s32 Player_IsFacingActor(Actor* actor, s16 maxAngleDiff, struct PlayState* play)
PlayerItemAction Player_GetExchangeItemAction(struct PlayState* play);
-void func_800B8D10(struct PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5, u32 arg6);
+void func_800B8D10(struct PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, s32 arg5, u32 arg6);
void func_800B8D50(struct PlayState* play, Actor* actor, f32 arg2, s16 yaw, f32 arg4, u32 arg5);
void func_800B8D98(struct PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4);
void func_800B8DD4(struct PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5);
diff --git a/mm/src/code/audio_stop_all_sfx.c b/mm/src/code/audio_stop_all_sfx.c
index 94b55d4df..f4f6942f2 100644
--- a/mm/src/code/audio_stop_all_sfx.c
+++ b/mm/src/code/audio_stop_all_sfx.c
@@ -5,11 +5,17 @@ const u8 sSfxBankIds[] = {
};
void AudioMgr_StopAllSfxExceptSystem(void) {
- volatile const u8* bankIdPtr;
+ const u8* bankIdPtr;
+ s32 dbgVar;
- for (bankIdPtr = sSfxBankIds; bankIdPtr < (sSfxBankIds + ARRAY_COUNT(sSfxBankIds)); bankIdPtr++) {
- if (*bankIdPtr != BANK_SYSTEM) {
- AudioSfx_StopByBank(*bankIdPtr);
+ // Remnant of debug
+ dbgVar = 0;
+
+ if (dbgVar != 2) {
+ for (bankIdPtr = &sSfxBankIds[0]; bankIdPtr < (sSfxBankIds + ARRAY_COUNT(sSfxBankIds)); bankIdPtr++) {
+ if ((dbgVar != 0) || (*bankIdPtr != BANK_SYSTEM)) {
+ AudioSfx_StopByBank(*bankIdPtr);
+ }
}
}
}
diff --git a/mm/src/code/cutscene_camera.c b/mm/src/code/cutscene_camera.c
index ee43ee43c..c6ebc4eef 100644
--- a/mm/src/code/cutscene_camera.c
+++ b/mm/src/code/cutscene_camera.c
@@ -38,7 +38,7 @@ s32 CutsceneCamera_Init(Camera* camera, CutsceneCamera* csCamera) {
csCamera->nextSplineTimer = csCamera->updateSplineTimer = 0;
csCamera->cmdIndex = 0;
- csCamera->splineIndex = 0xFFFF;
+ csCamera->splineIndex = -1;
csCamera->splineNeedsInit = true;
csCamera->state = CS_CAM_STATE_UPDATE_ALL;
@@ -299,7 +299,7 @@ s32 CutsceneCamera_UpdateSplines(u8* script, CutsceneCamera* csCamera) {
csCamera->atCmd = (CsCmdCamPoint*)&script[csCamera->cmdIndex];
csCamera->cmdIndex += (s16)(csCamera->eyeInterp.numEntries * sizeof(CsCmdCamPoint));
- // Misc Point
+ // Eye Point
csCamera->eyeCmd = (CsCmdCamPoint*)&script[csCamera->cmdIndex];
csCamera->cmdIndex += (s16)(csCamera->eyeInterp.numEntries * sizeof(CsCmdCamPoint));
@@ -308,12 +308,10 @@ s32 CutsceneCamera_UpdateSplines(u8* script, CutsceneCamera* csCamera) {
csCamera->cmdIndex += (s16)(csCamera->eyeInterp.numEntries * sizeof(CsCmdCamMisc));
// Other Params
- csCamera->eyeInterp.curPoint = 0;
- csCamera->atInterp.curPoint = 0;
+ csCamera->eyeInterp.curPoint = csCamera->atInterp.curPoint = 0;
csCamera->splineNeedsInit = false;
- //! FAKE: csCamera->splineIndex++;
- csCamera->splineIndex = (csCamera->splineIndex & 0xFFFF) + 1;
+ csCamera->splineIndex++;
csCamera->state = CS_CAM_STATE_UPDATE_ALL;
csCamera->nextSplineTimer = csCamera->updateSplineTimer = 0;
csCamera->eyeInterp.type = csCamera->atInterp.type = CS_CAM_INTERP_OFF;
diff --git a/mm/src/code/sys_math3d.c b/mm/src/code/sys_math3d.c
index ee0252b74..506a67797 100644
--- a/mm/src/code/sys_math3d.c
+++ b/mm/src/code/sys_math3d.c
@@ -1879,12 +1879,12 @@ s32 Math3D_CylVsLineSeg(Cylinder16* cyl, Vec3f* linePointA, Vec3f* linePointB, V
fracA = 0.0f;
fracB = 0.0f;
-//! FAKE:
-dummy:;
-
zero = 0.0f;
intFlags = 0;
+ //! FAKE:
+ if (1) {}
+
if (Math3D_PointInCyl(cyl, linePointA) && Math3D_PointInCyl(cyl, linePointB)) {
// both points are in the cylinder
*intersectA = *linePointA;
diff --git a/mm/src/code/z_actor.c b/mm/src/code/z_actor.c
index c93cde7a9..0968276dd 100644
--- a/mm/src/code/z_actor.c
+++ b/mm/src/code/z_actor.c
@@ -2453,7 +2453,7 @@ s32 Actor_HasNoRider(PlayState* play, Actor* horse) {
return false;
}
-void func_800B8D10(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5, u32 arg6) {
+void func_800B8D10(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, s32 arg5, u32 arg6) {
Player* player = GET_PLAYER(play);
player->unk_B74 = arg6;
diff --git a/mm/src/code/z_bgcheck.c b/mm/src/code/z_bgcheck.c
index 90dbfb4a2..c625597f2 100644
--- a/mm/src/code/z_bgcheck.c
+++ b/mm/src/code/z_bgcheck.c
@@ -2876,7 +2876,7 @@ void DynaPoly_AddBgActorToLookup(PlayState* play, DynaCollisionContext* dyna, s3
pos.y += actor->shape.yOffset * actor->scale.y;
//! FAKE:
- if (pbgdata && pbgdata) {}
+ if (1) {}
ScaleRotPos_SetValue(&dyna->bgActors[bgId].curTransform, &actor->scale, &actor->shape.rot, &pos);
diff --git a/mm/src/code/z_camera.c b/mm/src/code/z_camera.c
index d8cc4f518..0fbe0c8cd 100644
--- a/mm/src/code/z_camera.c
+++ b/mm/src/code/z_camera.c
@@ -2325,11 +2325,11 @@ s32 Camera_Normal2(Camera* camera) {
* Riding Epona and Zora
*/
s32 Camera_Normal3(Camera* camera) {
- Normal3ReadOnlyData* roData = &camera->paramData.norm3.roData;
- Normal3ReadWriteData* rwData = &camera->paramData.norm3.rwData;
- f32 sp8C;
+ Vec3f* eye = &camera->eye;
+ Vec3f* at = &camera->at;
+ f32 sp94;
f32 sp90;
- f32 temp_f2; // multi-use temp
+ f32 temp_f2;
f32 sp88;
VecGeo sp80;
VecGeo sp78;
@@ -2339,10 +2339,10 @@ s32 Camera_Normal3(Camera* camera) {
s16 sp62;
s16 phi_v1_2;
Player* player = (Player*)camera->focalActor;
- Vec3f* eye = &camera->eye;
- Vec3f* at = &camera->at;
Vec3f* eyeNext = &camera->eyeNext;
PosRot* focalActorPosRot = &camera->focalActorPosRot;
+ Normal3ReadOnlyData* roData = &camera->paramData.norm3.roData;
+ Normal3ReadWriteData* rwData = &camera->paramData.norm3.rwData;
temp_f2 = Camera_GetFocalActorHeight(camera);
@@ -2354,11 +2354,9 @@ s32 Camera_Normal3(Camera* camera) {
if (RELOAD_PARAMS(camera)) {
CameraModeValue* values = sCameraSettings[camera->setting].cameraModes[camera->mode].values;
- temp_f2 = CAM_RODATA_UNSCALE(temp_f2);
-
- roData->yOffset = GET_NEXT_RO_DATA(values) * temp_f2;
- roData->distMin = GET_NEXT_RO_DATA(values) * temp_f2;
- roData->distMax = GET_NEXT_RO_DATA(values) * temp_f2;
+ roData->yOffset = GET_NEXT_RO_DATA(values) * CAM_RODATA_UNSCALE(temp_f2);
+ roData->distMin = GET_NEXT_RO_DATA(values) * CAM_RODATA_UNSCALE(temp_f2);
+ roData->distMax = GET_NEXT_RO_DATA(values) * CAM_RODATA_UNSCALE(temp_f2);
roData->pitchTarget = CAM_DEG_TO_BINANG(GET_NEXT_RO_DATA(values));
roData->yawUpdateRateInv = GET_NEXT_RO_DATA(values);
roData->pitchUpdateRateInv = GET_NEXT_RO_DATA(values);
@@ -2372,30 +2370,34 @@ s32 Camera_Normal3(Camera* camera) {
sUpdateCameraDirection = true;
sCameraInterfaceFlags = roData->interfaceFlags;
- //! FAKE: fake temp
- phi_v1_2 = camera->animState;
- if (!((phi_v1_2 == 0) || (phi_v1_2 == 10) || (phi_v1_2 == 20))) {
- } else {
- rwData->isZero = 0;
- rwData->curPitch = 0;
- rwData->yPosOffset = camera->focalActorFloorHeight;
-
- D_801EDC30[camera->camId].yaw = D_801EDC30[camera->camId].pitch = D_801EDC30[camera->camId].unk_64 = 0;
- D_801EDC30[camera->camId].swingUpdateRate = roData->yawUpdateRateInv;
- rwData->yawUpdateRate = BINANG_SUB(BINANG_ROT180(camera->focalActorPosRot.rot.y), sp70.yaw) * (1.0f / 6.0f);
- rwData->distTimer = 0;
- rwData->is1200 = 1200;
-
- if (roData->interfaceFlags & NORMAL3_FLAG_1) {
- rwData->yawTimer = 6;
- Camera_SetStateFlag(camera, CAM_STATE_DISABLE_MODE_CHANGE);
- } else {
- rwData->yawTimer = 0;
- }
+ switch (camera->animState) {
+ case 0:
+ case 10:
+ case 20:
+ rwData->isZero = 0;
+ rwData->curPitch = 0;
+ rwData->yPosOffset = camera->focalActorFloorHeight;
- camera->animState = 1;
- D_801EDC30[camera->camId].timer = 0;
- rwData->flag = NORMAL3_RW_FLAG;
+ D_801EDC30[camera->camId].yaw = D_801EDC30[camera->camId].pitch = D_801EDC30[camera->camId].unk_64 = 0;
+ D_801EDC30[camera->camId].swingUpdateRate = roData->yawUpdateRateInv;
+ rwData->yawUpdateRate = BINANG_SUB(BINANG_ROT180(camera->focalActorPosRot.rot.y), sp70.yaw) * (1.0f / 6.0f);
+ rwData->distTimer = 0;
+ rwData->is1200 = 1200;
+
+ if (roData->interfaceFlags & NORMAL3_FLAG_1) {
+ rwData->yawTimer = 6;
+ Camera_SetStateFlag(camera, CAM_STATE_DISABLE_MODE_CHANGE);
+ } else {
+ rwData->yawTimer = 0;
+ }
+
+ camera->animState = 1;
+ D_801EDC30[camera->camId].timer = 0;
+ rwData->flag = NORMAL3_RW_FLAG;
+ break;
+
+ default:
+ break;
}
if (rwData->distTimer != 0) {
@@ -2403,23 +2405,23 @@ s32 Camera_Normal3(Camera* camera) {
}
sp90 = ((camera->speedRatio * 3.0f) + 1.0f) * 0.25f * 0.5f;
- sp8C = temp_f2 = camera->speedRatio * 0.2f;
+ sp94 = temp_f2 = camera->speedRatio * 0.2f;
if (D_801EDC30[camera->camId].timer != 0) {
camera->yawUpdateRateInv = Camera_ScaledStepToCeilF(
(D_801EDC30[camera->camId].timer * 2) + roData->yawUpdateRateInv, camera->yawUpdateRateInv, sp90, 0.1f);
camera->pitchUpdateRateInv = Camera_ScaledStepToCeilF((D_801EDC30[camera->camId].timer * 2) + 16.0f,
- camera->pitchUpdateRateInv, sp8C, 0.1f);
+ camera->pitchUpdateRateInv, sp94, 0.1f);
D_801EDC30[camera->camId].timer--;
} else {
camera->yawUpdateRateInv =
Camera_ScaledStepToCeilF(roData->yawUpdateRateInv, camera->yawUpdateRateInv, sp90, 0.1f);
- camera->pitchUpdateRateInv = Camera_ScaledStepToCeilF(16.0f, camera->pitchUpdateRateInv, sp8C, 0.1f);
+ camera->pitchUpdateRateInv = Camera_ScaledStepToCeilF(16.0f, camera->pitchUpdateRateInv, sp94, 0.1f);
}
camera->yOffsetUpdateRate = Camera_ScaledStepToCeilF(0.05f, camera->yOffsetUpdateRate, sp90, 0.001f);
- camera->xzOffsetUpdateRate = Camera_ScaledStepToCeilF(0.05f, camera->xzOffsetUpdateRate, sp8C, 0.0001f);
- camera->fovUpdateRate = Camera_ScaledStepToCeilF(0.05f, camera->fovUpdateRate, sp8C, 0.0001f);
+ camera->xzOffsetUpdateRate = Camera_ScaledStepToCeilF(0.05f, camera->xzOffsetUpdateRate, sp94, 0.0001f);
+ camera->fovUpdateRate = Camera_ScaledStepToCeilF(0.05f, camera->fovUpdateRate, sp94, 0.0001f);
phi_v1_2 = Camera_GetPitchAdjFromFloorHeightDiffs(camera, BINANG_ROT180(sp70.yaw), rwData->flag & NORMAL3_RW_FLAG);
temp_f2 = ((1.0f / roData->pitchUpdateRateInv) * 0.5f) * (1.0f - camera->speedRatio);
@@ -2545,9 +2547,9 @@ s32 Camera_Normal0(Camera* camera) {
s16 phi_a1;
s16 phi_a0;
BgCamFuncData* bgCamFuncData;
- f32 new_var;
Normal0ReadOnlyData* roData = &camera->paramData.norm0.roData;
Normal0ReadWriteData* rwData = &camera->paramData.norm0.rwData;
+ s32 pad2;
if (!RELOAD_PARAMS(camera)) {
} else {
@@ -2566,46 +2568,50 @@ s32 Camera_Normal0(Camera* camera) {
sCameraInterfaceFlags = roData->interfaceFlags;
- if (RELOAD_PARAMS(camera)) {
- bgCamFuncData = (BgCamFuncData*)Camera_GetBgCamOrActorCsCamFuncData(camera, camera->bgCamIndex);
- rwData->unk_00 = Camera_Vec3sToVec3f(&bgCamFuncData->pos);
- rwData->unk_20 = bgCamFuncData->rot.x;
- rwData->unk_22 = bgCamFuncData->rot.y;
- rwData->unk_24 = focalActorPosRot->pos.y;
- if (bgCamFuncData->fov == -1) {
- rwData->unk_1C = roData->unk_14;
- } else {
- if (bgCamFuncData->fov > 360) {
- phi_f0 = CAM_RODATA_UNSCALE(bgCamFuncData->fov);
+ switch (camera->animState) {
+ case 0:
+ case 10:
+ case 20:
+ bgCamFuncData = (BgCamFuncData*)Camera_GetBgCamOrActorCsCamFuncData(camera, camera->bgCamIndex);
+ rwData->unk_00 = Camera_Vec3sToVec3f(&bgCamFuncData->pos);
+ rwData->unk_20 = bgCamFuncData->rot.x;
+ rwData->unk_22 = bgCamFuncData->rot.y;
+ rwData->unk_24 = focalActorPosRot->pos.y;
+ if (bgCamFuncData->fov == -1) {
+ rwData->unk_1C = roData->unk_14;
} else {
- phi_f0 = bgCamFuncData->fov;
+ if (bgCamFuncData->fov > 360) {
+ phi_f0 = CAM_RODATA_UNSCALE(bgCamFuncData->fov);
+ } else {
+ phi_f0 = bgCamFuncData->fov;
+ }
+ rwData->unk_1C = phi_f0;
}
- rwData->unk_1C = phi_f0;
- }
- if (bgCamFuncData->unk_0E == -1) {
- rwData->unk_2C = 0;
- } else {
- rwData->unk_2C = bgCamFuncData->unk_0E;
- }
+ if (bgCamFuncData->unk_0E == -1) {
+ rwData->unk_2C = 0;
+ } else {
+ rwData->unk_2C = bgCamFuncData->unk_0E;
+ }
- rwData->unk_18 = 0.0f;
- rwData->unk_28 = 120.0f;
+ rwData->unk_18 = 0.0f;
+ rwData->unk_28 = 120.0f;
- if (roData->interfaceFlags & NORMAL0_FLAG_2) {
- sp88.pitch = rwData->unk_20;
- sp88.yaw = rwData->unk_22;
- sp88.r = 100.0f;
- rwData->unk_0C = OLib_VecGeoToVec3f(&sp88);
- }
- camera->animState = 1;
- camera->yawUpdateRateInv = 50.0f;
- } else {
- if (func_800CB950(camera)) {
- rwData->unk_24 = focalActorPosRot->pos.y;
- }
- //! FAKE:
- if (1) {}
+ if (roData->interfaceFlags & NORMAL0_FLAG_2) {
+ sp88.pitch = rwData->unk_20;
+ sp88.yaw = rwData->unk_22;
+ sp88.r = 100.0f;
+ rwData->unk_0C = OLib_VecGeoToVec3f(&sp88);
+ }
+ camera->animState = 1;
+ camera->yawUpdateRateInv = 50.0f;
+ break;
+
+ default:
+ if (func_800CB950(camera)) {
+ rwData->unk_24 = focalActorPosRot->pos.y;
+ }
+ break;
}
sp80 = OLib_Vec3fDiffToVecGeo(at, eye);
@@ -2641,32 +2647,13 @@ s32 Camera_Normal0(Camera* camera) {
sp88 = OLib_Vec3fDiffToVecGeo(&rwData->unk_00, at);
sp90 = OLib_Vec3fDiffToVecGeo(at, eyeNext);
- if (rwData->unk_2C & 2) {
- phi_a1 = rwData->unk_22;
- } else {
- phi_a1 = roData->unk_1C;
- }
-
- temp_v1_2 = sp90.yaw - sp88.yaw;
- if (((phi_a1 <= 0x4000) && (phi_a1 < ABS(temp_v1_2))) || ((phi_a1 > 0x4000) && (ABS(temp_v1_2) < phi_a1))) {
- //! FAKE: Needed to swap v0/v1
- if (1) {}
- if (1) {}
- if (1) {}
- if (1) {}
-
- //! FAKE: Needed because the *1.0f isn't being multiplied
- new_var = 1.0f;
-
- if (temp_v1_2 < 0) {
- phi_a0 = -phi_a1;
- } else {
- phi_a0 = phi_a1;
- }
-
+ phi_a1 = (rwData->unk_2C & 2) ? rwData->unk_22 : roData->unk_1C;
+ phi_a0 = sp90.yaw - sp88.yaw;
+ if (((phi_a1 <= 0x4000) && (phi_a1 < ABS(phi_a0))) || ((phi_a1 > 0x4000) && (ABS(phi_a0) < phi_a1))) {
+ phi_a0 = (phi_a0 < 0) ? -phi_a1 : phi_a1;
phi_a0 += sp88.yaw;
- sp98.yaw = Camera_ScaledStepToCeilS(phi_a0, sp80.yaw,
- (1.0f / camera->yawUpdateRateInv) * new_var * camera->speedRatio, 5);
+ sp98.yaw =
+ Camera_ScaledStepToCeilS(phi_a0, sp80.yaw, (1 / camera->yawUpdateRateInv) * 1 * camera->speedRatio, 5);
if (rwData->unk_2C & 1) {
sp98.pitch = Camera_CalcDefaultPitch(camera, sp78.pitch, rwData->unk_20, 0);
} else {
@@ -3092,7 +3079,7 @@ s32 Camera_Jump2(Camera* camera) {
VecGeo sp9C;
s16 temp_t2;
s16 yawDiff;
- s32 pad;
+ f32 tmp;
f32 sp90;
f32 sp8C;
s32 sp88;
@@ -3177,11 +3164,9 @@ s32 Camera_Jump2(Camera* camera) {
Camera_CalcAtDefault(camera, &spA4, roData->unk_00, 0);
spB4 = OLib_Vec3fDiffToVecGeo(at, eye);
- //! FAKE: Unused
- yNormal = roData->unk_04;
-
+ tmp = roData->unk_04;
phi_f2 = roData->unk_08 + (roData->unk_08 * roData->unk_0C);
- temp_f16 = roData->unk_04 - (roData->unk_04 * roData->unk_0C);
+ temp_f16 = tmp - (roData->unk_04 * roData->unk_0C);
if (spB4.r > phi_f2) {
spB4.r = phi_f2;
diff --git a/mm/src/code/z_eff_blure.c b/mm/src/code/z_eff_blure.c
index b6b71fd6a..49afc6269 100644
--- a/mm/src/code/z_eff_blure.c
+++ b/mm/src/code/z_eff_blure.c
@@ -44,10 +44,11 @@ void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2) {
MtxF sp50;
Vec3f sp44;
Vec3f sp38;
+ EffectBlureElement* prev = elem - 1;
- sp16C.x = ((f32)(elem - 1)->p2.x + (f32)(elem - 1)->p1.x) / 2.0f;
- sp16C.y = ((f32)(elem - 1)->p2.y + (f32)(elem - 1)->p1.y) / 2.0f;
- sp16C.z = ((f32)(elem - 1)->p2.z + (f32)(elem - 1)->p1.z) / 2.0f;
+ sp16C.x = ((f32)prev->p2.x + (f32)prev->p1.x) / 2.0f;
+ sp16C.y = ((f32)prev->p2.y + (f32)prev->p1.y) / 2.0f;
+ sp16C.z = ((f32)prev->p2.z + (f32)prev->p1.z) / 2.0f;
sp160.x = (p1->x + p2->x) / 2.0f;
sp160.y = (p1->y + p2->y) / 2.0f;
sp160.z = (p1->z + p2->z) / 2.0f;
diff --git a/mm/src/code/z_eff_tire_mark.c b/mm/src/code/z_eff_tire_mark.c
index 41e806a6c..3d73695d0 100644
--- a/mm/src/code/z_eff_tire_mark.c
+++ b/mm/src/code/z_eff_tire_mark.c
@@ -74,6 +74,10 @@ void func_800AE930(CollisionContext* colCtx, EffectTireMark* this, Vec3f* pos, f
spA8->p2.y = sp78.y;
spA8->p2.z = sp78.z;
spA8->life = this->elemDuration;
+
+ //! FAKE:
+ if (1) {}
+
spA8->colPoly = NULL;
this->numElements++;
@@ -82,9 +86,6 @@ void func_800AE930(CollisionContext* colCtx, EffectTireMark* this, Vec3f* pos, f
spAC->flags |= EFFECT_TIRE_MARK_ELEMENT_FLAG_1;
}
- //! FAKE:
- if (spA8) {}
-
spA8 = &this->elements[this->numElements];
spA8->flags = 0;
spA8->p1 = spB0;
diff --git a/mm/src/code/z_eventmgr.c b/mm/src/code/z_eventmgr.c
index 2f05d19cf..b8dc22bae 100644
--- a/mm/src/code/z_eventmgr.c
+++ b/mm/src/code/z_eventmgr.c
@@ -521,12 +521,14 @@ s16 CutsceneManager_FindEntranceCsId(void) {
s32 csId;
for (csId = 0; csId < sSceneCutsceneCount; csId++) {
- //! FAKE:
- if ((sSceneCutsceneList[csId].scriptIndex != CS_SCRIPT_ID_NONE) &&
- (sSceneCutsceneList[csId].scriptIndex < (play = sCutsceneMgr.play)->csCtx.scriptListCount) &&
- (sCutsceneMgr.play->curSpawn ==
- sCutsceneMgr.play->csCtx.scriptList[sSceneCutsceneList[csId].scriptIndex].spawn)) {
- return csId;
+ if (sSceneCutsceneList[csId].scriptIndex != CS_SCRIPT_ID_NONE) {
+ PlayState* play = sCutsceneMgr.play;
+
+ if ((sSceneCutsceneList[csId].scriptIndex < play->csCtx.scriptListCount) &&
+ (sCutsceneMgr.play->curSpawn ==
+ sCutsceneMgr.play->csCtx.scriptList[sSceneCutsceneList[csId].scriptIndex].spawn)) {
+ return csId;
+ }
}
}
diff --git a/mm/src/code/z_map_disp.c b/mm/src/code/z_map_disp.c
index 3232dbf12..f373bb1ac 100644
--- a/mm/src/code/z_map_disp.c
+++ b/mm/src/code/z_map_disp.c
@@ -880,17 +880,14 @@ void MapDisp_InitBossRoomStorey(PlayState* play) {
s32 i;
for (i = 0; i < transitionActors->count; i++) {
- if (MapDisp_IsBossDoor(sTransitionActors[i].params)) {
- if (ABS_ALT(sTransitionActors[i].id) != ACTOR_EN_HOLL) {
+ TransitionActorEntry* entry = &sTransitionActors[i];
+
+ if (MapDisp_IsBossDoor(entry->params)) {
+ if (ABS_ALT(entry->id) != ACTOR_EN_HOLL) {
for (storey = 0; storey < sMapDisp.numStoreys; storey++) {
- //! FAKE: needed for matching
- s32 temp = (sMapDisp.storeyYList[storey] - 5);
-
- if (((storey == sMapDisp.numStoreys - 1) &&
- (sTransitionActors[i].pos.y >= (sMapDisp.storeyYList[storey] - 5))) ||
- ((storey != sMapDisp.numStoreys - 1) &&
- (sTransitionActors[i].pos.y >= (sMapDisp.storeyYList[storey] - 5)) &&
- (sTransitionActors[i].pos.y < (sMapDisp.storeyYList[storey + 1] - 5)))) {
+ if (((storey == sMapDisp.numStoreys - 1) && (entry->pos.y >= (sMapDisp.storeyYList[storey] - 5))) ||
+ ((storey != sMapDisp.numStoreys - 1) && (entry->pos.y >= (sMapDisp.storeyYList[storey] - 5)) &&
+ (entry->pos.y < (sMapDisp.storeyYList[storey + 1] - 5)))) {
sMapDisp.bossRoomStorey = storey;
return;
}
diff --git a/mm/src/code/z_play.c b/mm/src/code/z_play.c
index 330e06ed7..470aeb796 100644
--- a/mm/src/code/z_play.c
+++ b/mm/src/code/z_play.c
@@ -2220,9 +2220,9 @@ void Play_Init(GameState* thisx) {
s32 zAllocSize;
Player* player;
s32 i;
- s32 spawn;
- u8 sceneLayer;
s32 scene;
+ u8 sceneLayer;
+ s32 pad2;
if ((gSaveContext.respawnFlag == -4) || (gSaveContext.respawnFlag == -0x63)) {
if (CHECK_EVENTINF(EVENTINF_TRIGGER_DAYTELOP)) {
@@ -2254,7 +2254,6 @@ void Play_Init(GameState* thisx) {
if ((gSaveContext.nextCutsceneIndex == 0xFFEF) || (gSaveContext.nextCutsceneIndex == 0xFFF0)) {
scene = ((void)0, gSaveContext.save.entrance) >> 9;
- spawn = (((void)0, gSaveContext.save.entrance) >> 4) & 0x1F;
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE)) {
if (scene == ENTR_SCENE_MOUNTAIN_VILLAGE_WINTER) {
@@ -2295,9 +2294,8 @@ void Play_Init(GameState* thisx) {
gSaveContext.nextCutsceneIndex = 0xFFF4;
}
}
- //! FAKE:
- gSaveContext.save.entrance =
- Entrance_Create(((void)0, scene), spawn, ((void)0, gSaveContext.save.entrance) & 0xF);
+ gSaveContext.save.entrance = Entrance_Create(scene, (((void)0, gSaveContext.save.entrance) >> 4) & 0x1F,
+ ((void)0, gSaveContext.save.entrance) & 0xF);
}
GameState_Realloc(&this->state, 0);
diff --git a/mm/src/code/z_player_lib.c b/mm/src/code/z_player_lib.c
index 69dd6dad0..54a045bc8 100644
--- a/mm/src/code/z_player_lib.c
+++ b/mm/src/code/z_player_lib.c
@@ -1753,9 +1753,8 @@ PlayerExplosive Player_GetExplosiveHeld(Player* player) {
PlayerSword Player_SwordFromIA(Player* player, PlayerItemAction itemAction) {
PlayerSword sword = PLAYER_SWORD_KOKIRI;
- //! FAKE:
if ((itemAction == PLAYER_IA_LAST_USED) ||
- ((sword = GET_SWORD_FROM_IA(itemAction), (sword > PLAYER_SWORD_NONE)) && (sword < PLAYER_SWORD_MAX))) {
+ (sword = GET_SWORD_FROM_IA(itemAction), ((sword > PLAYER_SWORD_NONE) && (sword < PLAYER_SWORD_MAX)))) {
return sword;
}
@@ -3960,8 +3959,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
}
}
} else if (limbIndex == PLAYER_LIMB_HEAD) {
- //! FAKE:
- if (((*dList1 != NULL) && ((((void)0, player->currentMask)) != (((void)0, PLAYER_MASK_NONE)))) &&
+ if (((*dList1 != NULL) && ((u32)player->currentMask != PLAYER_MASK_NONE)) &&
(((player->transformation == PLAYER_FORM_HUMAN) &&
((!BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_cl_setmask)) ||
(player->skelAnime.curFrame >= 12.0f))) ||
@@ -3969,21 +3967,21 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
((player->transformation + PLAYER_MASK_FIERCE_DEITY) != player->currentMask)) &&
(player->skelAnime.curFrame >= 10.0f)))) {
if (func_80127438(play, player, player->currentMask)) {
- s32 maskMinusOne = ((void)0, player->currentMask) - 1;
+ s32 maskMinusOne = player->currentMask - 1;
OPEN_DISPS(play->state.gfxCtx);
- if (((void)0, player->currentMask) == PLAYER_MASK_COUPLE) {
+ if (player->currentMask == PLAYER_MASK_COUPLE) {
Player_DrawCouplesMask(play, player);
- } else if (((void)0, player->currentMask) == PLAYER_MASK_CIRCUS_LEADER) {
+ } else if (player->currentMask == PLAYER_MASK_CIRCUS_LEADER) {
Player_DrawCircusLeadersMask(play, player);
- } else if (((void)0, player->currentMask) == PLAYER_MASK_BLAST) {
+ } else if (player->currentMask == PLAYER_MASK_BLAST) {
Player_DrawBlastMask(play, player);
- } else if (((void)0, player->currentMask) == PLAYER_MASK_BUNNY) {
+ } else if (player->currentMask == PLAYER_MASK_BUNNY) {
Player_DrawBunnyHood(play);
- } else if (((void)0, player->currentMask) == PLAYER_MASK_GREAT_FAIRY) {
+ } else if (player->currentMask == PLAYER_MASK_GREAT_FAIRY) {
Player_DrawGreatFairysMask(play, player);
- } else if (((void)0, player->currentMask) >= PLAYER_MASK_FIERCE_DEITY) {
+ } else if (player->currentMask >= PLAYER_MASK_FIERCE_DEITY) {
static Vec2f D_801C0E04[PLAYER_FORM_MAX] = {
{ 140.0f, -130.0f }, // PLAYER_FORM_FIERCE_DEITY
{ 0.0f, -200.0f }, // PLAYER_FORM_GORON
@@ -4157,6 +4155,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
} else if ((limbIndex == PLAYER_LIMB_HAT) && (player->stateFlags3 & PLAYER_STATE3_100000)) {
Vec3f sp5C;
Vec3f sp50;
+ s32 pad;
Matrix_MultVecX(3000.0f, &sp5C);
Matrix_MultVecX(2300.0f, &sp50);
diff --git a/mm/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c b/mm/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c
index 85dbec511..d857ce66e 100644
--- a/mm/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c
+++ b/mm/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c
@@ -86,9 +86,7 @@ void BgAstrBombwall_InitCollider(ColliderTrisInit* init, Vec3f* pos, Vec3s* rot,
for (i = 0; i < init->count; i++) {
for (j = 0; j < 3; j++) {
- //! FAKE:
- // https://decomp.me/scratch/JrEnl
- Matrix_MultVec3f(&(init->elements + i)->dim.vtx[j], &sp54[j]);
+ Matrix_MultVec3f(init->elements[i].dim.vtx + j, &sp54[j]);
Math_Vec3f_Sum(&sp54[j], pos, &sp54[j]);
}
Collider_SetTrisVertices(collider, i, &sp54[0], &sp54[1], &sp54[2]);
diff --git a/mm/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c b/mm/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c
index c89efd997..6d55e117e 100644
--- a/mm/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c
+++ b/mm/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c
@@ -1683,8 +1683,8 @@ s8 EnInvadepoh_ModelInfo_GetNextFaceAnim(EnInvadepohFaceAnimNext* nextAnims, s32
}
}
- //! FAKE:
- return (nextAnims + nextIndex)->index;
+ nextAnim = &nextAnims[nextIndex];
+ return nextAnim->index;
}
void EnInvadepoh_ModelInfo_SetNextFaceAnim(EnInvadepohFaceAnimInfo* faceInfo, EnInvadepohFaceAnimBase* faceAnim) {
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 f70d1c502..5a8425a7e 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
@@ -186,8 +186,10 @@ void EnKakasi_Init(Actor* thisx, PlayState* play) {
i = 0;
csId = this->picto.actor.csId;
while (csId != CS_ID_NONE) {
- //! FAKE:
- csId = CutsceneManager_GetAdditionalCsId(this->csIdList[i] = csId);
+ // clang-format off
+ this->csIdList[i] = csId; \
+ csId = CutsceneManager_GetAdditionalCsId(csId);
+ // clang-format on
i++;
}
diff --git a/mm/src/overlays/actors/ovl_En_Knight/z_en_knight.c b/mm/src/overlays/actors/ovl_En_Knight/z_en_knight.c
index 91a855550..91b7192cb 100644
--- a/mm/src/overlays/actors/ovl_En_Knight/z_en_knight.c
+++ b/mm/src/overlays/actors/ovl_En_Knight/z_en_knight.c
@@ -3463,27 +3463,11 @@ void EnKnight_FlyingHeadAttack(EnKnight* this, PlayState* play) {
if (CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) ||
CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_B)) {
- if (1) {} //! FAKE:
- if (this->timers[0] != 0) {
- this->timers[0]--;
- if (1) {}
- }
-
- if (this->timers[0] != 0) {
- this->timers[0]--;
- }
-
- if (this->timers[0] != 0) {
- this->timers[0]--;
- }
-
- if (this->timers[0] != 0) {
- this->timers[0]--;
- }
-
- if (this->timers[0] != 0) {
- this->timers[0]--;
- }
+ DECR(this->timers[0]);
+ DECR(this->timers[0]);
+ DECR(this->timers[0]);
+ DECR(this->timers[0]);
+ DECR(this->timers[0]);
}
Math_ApproachF(&this->actor.world.pos.x, player->actor.world.pos.x + targetHeight.x, 1.0f,
@@ -4341,7 +4325,7 @@ void EnKnight_UpdateEffects(EnKnight* this, PlayState* play) {
eff->accel.y = BREG(56) * 0.01f + 1.0f;
- if (eff->active == (u32) true) { //! FAKE:
+ if (eff->active == true) {
Math_ApproachF(&eff->scale, (KREG(59) * 0.01f + 1.0f) * eff->scaleTarget, 0.1f,
eff->scaleTarget * 0.1f);
diff --git a/mm/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c b/mm/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c
index 31916dd45..7c7d4c26b 100644
--- a/mm/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c
+++ b/mm/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c
@@ -413,10 +413,10 @@ EnKusa2UnkBssSubStruct2* func_80A5C0B8(EnKusa2UnkBssStruct* arg0) {
EnKusa2UnkBssSubStruct2* phi_v1 = &arg0->unk_0480[0];
for (i = 1; i < ARRAY_COUNT(D_80A5F1C0.unk_0480); i++) {
- if (phi_v1->unk_2C > arg0->unk_0480[i].unk_2C) {
- phi_v1 = &arg0->unk_0480[i];
- //! FAKE:
- if (1) {}
+ EnKusa2UnkBssSubStruct2* iter = &arg0->unk_0480[i];
+
+ if (iter->unk_2C < phi_v1->unk_2C) {
+ phi_v1 = iter;
if (phi_v1->unk_2C <= 0) {
break;
diff --git a/mm/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c b/mm/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c
index a0908e404..95b947e71 100644
--- a/mm/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c
+++ b/mm/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c
@@ -81,12 +81,12 @@ void EnMinifrog_Init(Actor* thisx, PlayState* play) {
EnMinifrog* this = (EnMinifrog*)thisx;
s32 i;
- Actor_ProcessInitChain(&this->actor, sInitChain);
- ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 15.0f);
+ Actor_ProcessInitChain(thisx, sInitChain);
+ ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 15.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &gFrogSkel, &gFrogIdleAnim, this->jointTable, this->morphTable,
FROG_LIMB_MAX);
- CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
- Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
+ CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit);
+ Collider_InitAndSetCylinder(play, &this->collider, thisx, &sCylinderInit);
if (!sTexturesDesegmented) {
for (i = 0; i < ARRAY_COUNT(sEyeTextures); i++) {
@@ -95,20 +95,17 @@ void EnMinifrog_Init(Actor* thisx, PlayState* play) {
sTexturesDesegmented = true;
}
- this->frogIndex = (this->actor.params & 0xF);
+ this->frogIndex = (thisx->params & 0xF);
if (this->frogIndex >= 5) {
this->frogIndex = FROG_YELLOW;
}
- this->actor.speed = 0.0f;
+ thisx->speed = 0.0f;
this->actionFunc = EnMinifrog_Idle;
this->jumpState = FROG_STATE_GROUND;
this->flags = 0;
this->timer = 0;
- //! FAKE:
- if (1) {}
-
if (!EN_FROG_IS_RETURNED(&this->actor)) {
if ((this->frogIndex == FROG_YELLOW) ||
GameInteractor_Should(VB_DESPAWN_FROG, CHECK_WEEKEVENTREG(sIsFrogReturnedFlags[this->frogIndex]), this)) {
@@ -118,29 +115,29 @@ void EnMinifrog_Init(Actor* thisx, PlayState* play) {
this->timer = 30;
this->actionFunc = EnMinifrog_SpawnGrowAndShrink;
- this->actor.textId = 0xD81;
- this->actor.colChkInfo.mass = 30;
+ thisx->textId = 0xD81;
+ thisx->colChkInfo.mass = 30;
} else { // Frogs in mountain village
if (this->frogIndex == FROG_YELLOW) {
- this->actor.textId = 0;
+ thisx->textId = 0;
this->actionFunc = EnMinifrog_SetupYellowFrogDialog;
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_34_01)) {
- this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
+ thisx->flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
}
- this->actor.home.rot.x = this->actor.home.rot.z = 0;
+ thisx->home.rot.x = thisx->home.rot.z = 0;
this->frog = NULL;
} else {
this->frog = EnMinifrog_GetFrog(play);
- this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
+ thisx->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
// Frog has been returned
if (CHECK_WEEKEVENTREG(sIsFrogReturnedFlags[this->frogIndex])) {
this->actionFunc = EnMinifrog_SetupNextFrogInit;
} else {
- this->actor.draw = NULL;
- this->actor.update = EnMinifrog_UpdateMissingFrog;
+ thisx->draw = NULL;
+ thisx->update = EnMinifrog_UpdateMissingFrog;
}
}
}
diff --git a/mm/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/mm/src/overlays/actors/ovl_En_Owl/z_en_owl.c
index 579d6bbab..47ecb0afd 100644
--- a/mm/src/overlays/actors/ovl_En_Owl/z_en_owl.c
+++ b/mm/src/overlays/actors/ovl_En_Owl/z_en_owl.c
@@ -544,23 +544,19 @@ void func_8095B6C8(EnOwl* this, PlayState* play) {
}
void func_8095B76C(EnOwl* this, PlayState* play) {
- s32 pad;
+ Actor* thisx = &this->actor;
s16 sp4A;
- f32 sp44 = Path_OrientAndGetDistSq(&this->actor, this->path, this->unk_3F8, &sp4A);
- Vec3s* points;
+ f32 sp44 = Path_OrientAndGetDistSq(thisx, this->path, this->unk_3F8, &sp4A);
+ Vec3s* point;
- Math_SmoothStepToS(&this->actor.world.rot.y, sp4A, 6, 0x800, 0x200);
- this->actor.shape.rot.y = this->actor.world.rot.y;
- if (sp44 < SQ(this->actor.speed)) {
- this->actor.speed = 0.0f;
- points = Lib_SegmentedToVirtual(this->path->points);
- points += this->unk_3F8;
+ Math_SmoothStepToS(&thisx->world.rot.y, sp4A, 6, 0x800, 0x200);
+ thisx->shape.rot.y = thisx->world.rot.y;
+ if (sp44 < SQ(thisx->speed)) {
+ thisx->speed = 0.0f;
+ point = &((Vec3s*)Lib_SegmentedToVirtual(this->path->points))[this->unk_3F8];
- //! FAKE:
- if (1) {
- this->actor.world.pos.x = points->x;
- this->actor.world.pos.z = points->z;
- }
+ thisx->world.pos.x = point->x;
+ thisx->world.pos.z = point->z;
this->unk_3F8++;
if (this->unk_3F8 >= this->path->count) {
@@ -568,21 +564,21 @@ void func_8095B76C(EnOwl* this, PlayState* play) {
return;
}
- Actor_Spawn(&play->actorCtx, play, ACTOR_EN_OWL, this->actor.world.pos.x, this->actor.world.pos.y,
- this->actor.world.pos.z, 0, 0, 0, 0xF00);
- this->actor.home.rot.x++;
- if (this->actor.home.rot.x >= 3) {
+ Actor_Spawn(&play->actorCtx, play, ACTOR_EN_OWL, thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, 0,
+ 0, 0, 0xF00);
+ thisx->home.rot.x++;
+ if (thisx->home.rot.x >= 3) {
func_8095ACEC(this);
}
func_8095B0C8(this);
} else if (sp44 < SQ(21.0f)) {
- if (this->actor.speed > 1.0f) {
- this->actor.speed -= 1.0f;
+ if (thisx->speed > 1.0f) {
+ thisx->speed -= 1.0f;
} else {
- this->actor.speed = 1.0f;
+ thisx->speed = 1.0f;
}
- } else if (this->actor.speed < 6.0f) {
- this->actor.speed += 1.0f;
+ } else if (thisx->speed < 6.0f) {
+ thisx->speed += 1.0f;
}
func_8095B06C(this);
diff --git a/mm/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/mm/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c
index adc0089a3..d2e0f4a08 100644
--- a/mm/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c
+++ b/mm/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c
@@ -263,10 +263,8 @@ void EnPoSisters_MatchPlayerY(EnPoSisters* this, PlayState* play) {
// equalize to player height
Math_ApproachF(&this->actor.world.pos.y, player->actor.world.pos.y + 5.0f, 0.5f, 3.0f);
- if (this->floatingBobbingTimer == 0) {
+ if ((u32)this->floatingBobbingTimer == 0) {
this->floatingBobbingTimer = 32;
- //! FAKE:
- if (this->floatingBobbingTimer) {}
}
DECR(this->floatingBobbingTimer);
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 922e2cae2..078003d29 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
@@ -307,9 +307,7 @@ void EnTest6_DrawAmmoDropRupee(EnTest6* this, PlayState* play, SoTCsAmmoDrops* a
if (gfxHead != NULL) {
Gfx_SetupDL25_Opa(play->state.gfxCtx);
- //! FAKE: & 0xFFFF
- gDPSetTileSize(gfx++, 1, hilite->h.x1 & 0xFFFF, hilite->h.y1 & 0xFFFF, (hilite->h.x1 + 60) & 0xFFFF,
- (hilite->h.y1 + 60) & 0xFFFF);
+ gDPSetHilite1Tile(gfx++, 1, hilite, 0x10, 0x10);
gSPEndDisplayList(gfx++);
gSPSegment(POLY_OPA_DISP++, 0x07, gfxHead);
@@ -567,9 +565,6 @@ void EnTest6_InvertedSoTCutscene(EnTest6* this, PlayState* play) {
}
for (i = 0; i < SOTCS_INV_NUM_CLOCKS; i++) {
- //! FAKE:
- if (player != NULL) {}
-
clockYaw += 0x10000 / SOTCS_INV_NUM_CLOCKS;
this->invSoTClockPos[i].x = player->actor.world.pos.x + (Math_SinS(clockYaw) * this->clockDist);
this->invSoTClockPos[i].y = player->actor.world.pos.y;
@@ -671,6 +666,9 @@ void EnTest6_InvertedSoTCutscene(EnTest6* this, PlayState* play) {
// Update white screen
if (this->screenFillAlpha != 0) {
+ //! FAKE:
+ if (1) {}
+
EnTest6_EnableWhiteFillScreen(play, this->screenFillAlpha * 0.05f);
subCam->fov += (mainCam->fov - subCam->fov) * 0.05f;
this->screenFillAlpha++;
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 84f9cee8f..1252c73b9 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
@@ -645,7 +645,7 @@ void EnTest7_WarpCsWarp(EnTest7* this, PlayState* play) {
Vec3f featherPos;
//! FAKE:
- if (this) {}
+ if (1) {}
Math_Vec3f_Copy(&featherPos, &this->actor.world.pos);
diff --git a/mm/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c b/mm/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c
index 565e20636..6578e242c 100644
--- a/mm/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c
+++ b/mm/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c
@@ -364,9 +364,6 @@ s32 func_80C10E98(PlayState* play) {
i = sp5C - phi_s0_2;
- //! FAKE:
- if (i) {}
-
sp5C = phi_s0_2 * 50;
sp98 -= sp5C;
@@ -396,9 +393,7 @@ s32 func_80C10E98(PlayState* play) {
func_80C10DE8(dropItem00Ids, spA8, ITEM00_RUPEE_GREEN);
if ((spB0 + spAC + phi_s0_2 + spA0 + phi_s2 + spA8) == 0) {
return false;
- }
-
- {
+ } else {
Vec3f sp64;
for (i = 0; i < ARRAY_COUNT(dropItem00Ids); i++) {
diff --git a/mm/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c b/mm/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c
index 817ddc4b0..efc62258a 100644
--- a/mm/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c
+++ b/mm/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c
@@ -265,13 +265,13 @@ void EnTimeTag_Diary_Wait(EnTimeTag* this, PlayState* play) {
Message_StartTextbox(play, 0x122B, &this->actor);
}
TIMETAG_DIARY_TIMER(&this->actor) = 1;
+
+ //! FAKE:
+ if (1) {}
} else {
// unable to read Zora script
Message_StartTextbox(play, 0x122A, &this->actor);
- //! FAKE: https://decomp.me/scratch/AHRNe
- if (0) {}
-
((EnElf*)GET_PLAYER(play)->tatlActor)->unk_264 |= 4;
Actor_ChangeFocus(&this->actor, play, GET_PLAYER(play)->tatlActor);
TIMETAG_DIARY_TIMER(&this->actor) = 0;
diff --git a/mm/src/overlays/actors/ovl_En_Trt/z_en_trt.c b/mm/src/overlays/actors/ovl_En_Trt/z_en_trt.c
index 8c4a155cf..cd8d098d4 100644
--- a/mm/src/overlays/actors/ovl_En_Trt/z_en_trt.c
+++ b/mm/src/overlays/actors/ovl_En_Trt/z_en_trt.c
@@ -1063,10 +1063,9 @@ void EnTrt_ItemGiven(EnTrt* this, PlayState* play) {
break;
default:
- //! FAKE:
- if (1) {}
this->textId = 0x849;
- break;
+ // note break is missing
+ // break;
}
Message_ContinueTextbox(play, this->textId);
} else {
diff --git a/mm/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c b/mm/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c
index 7d58258b6..19b9624b0 100644
--- a/mm/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c
+++ b/mm/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c
@@ -665,10 +665,10 @@ void func_80B32F04(Actor* thisx, PlayState* play) {
f32 sp78;
f32 sp74;
EnZoraegg* this = (EnZoraegg*)thisx;
- s32 pad[3];
+ Vec3f pos;
s16 sp62;
s16 sp60;
- f32 temp_f2;
+ s32 pad;
Gfx* gfx;
Vec3f sp4C;
s32 pad2;
@@ -684,9 +684,11 @@ void func_80B32F04(Actor* thisx, PlayState* play) {
sp78 = -(15.0f * Math_SinS(sp60));
sp7C = -((15.0f * Math_CosS(sp62)) * Math_CosS(sp60));
- //! FAKE: temp_f2 =
- Matrix_Translate(this->actor.world.pos.x + sp74, this->actor.world.pos.y + sp78 + 6.0f,
- temp_f2 = this->actor.world.pos.z + sp7C, MTXMODE_NEW);
+ pos.x = this->actor.world.pos.x + sp74;
+ pos.y = this->actor.world.pos.y + sp78 + 6.0f;
+ pos.z = this->actor.world.pos.z + sp7C;
+
+ Matrix_Translate(pos.x, pos.y, pos.z, MTXMODE_NEW);
sp7C = Math_SinS(play->gameplayFrames * 0x4000);
diff --git a/mm/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c b/mm/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c
index 9d1c10057..f5420c4c6 100644
--- a/mm/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c
+++ b/mm/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c
@@ -145,22 +145,19 @@ void ObjAqua_Init(Actor* thisx, PlayState* play) {
ObjAqua* this = (ObjAqua*)thisx;
s32 i;
- Actor_ProcessInitChain(&this->actor, sInitChain);
+ Actor_ProcessInitChain(thisx, sInitChain);
this->actor.scale.x = 0.0009f;
this->actor.scale.y = 0.0005f;
this->actor.scale.z = 0.0009f;
Collider_InitCylinder(play, &this->collider);
- Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
- ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 60.0f);
+ Collider_SetCylinder(play, &this->collider, thisx, &sCylinderInit);
+ ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 60.0f);
- //! FAKE:
- if (1) {}
-
- this->actor.shape.shadowAlpha = 140;
+ thisx->shape.shadowAlpha = 140;
this->alpha = 255;
if (ObjAqua_IsUnderwater(this, play)) {
for (i = 0; i < 8; i++) {
- EffectSsBubble_Spawn(play, &this->actor.world.pos, -4.0f, 4.0f, 4.0f, (Rand_ZeroOne() * 0.09f) + 0.03f);
+ EffectSsBubble_Spawn(play, &thisx->world.pos, -4.0f, 4.0f, 4.0f, (Rand_ZeroOne() * 0.09f) + 0.03f);
}
func_80ACBDCC(this);
} else {
diff --git a/mm/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/mm/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c
index a18cec588..db1003e51 100644
--- a/mm/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c
+++ b/mm/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c
@@ -203,8 +203,8 @@ static Gfx* sEyeSwitchDL[] = { gEyeSwitchGoldDL, gEyeSwitchSilverDL };
static AnimatedMaterial* sCrystalSwitchAnimatedMat;
-void ObjSwitch_InitJntSphCollider(ObjSwitch* this, PlayState* play, ColliderJntSphInit* init) {
- s32 pad;
+void ObjSwitch_InitJntSphCollider(Actor* thisx, PlayState* play, ColliderJntSphInit* init) {
+ ObjSwitch* this = (ObjSwitch*)thisx;
Collider_InitJntSph(play, &this->colliderJntSph);
Collider_SetJntSph(play, &this->colliderJntSph, &this->dyna.actor, init, this->colliderJntSphElements);
@@ -216,8 +216,8 @@ void ObjSwitch_InitJntSphCollider(ObjSwitch* this, PlayState* play, ColliderJntS
Collider_UpdateSpheres(0, &this->colliderJntSph);
}
-void ObjSwitch_InitTrisCollider(ObjSwitch* this, PlayState* play, ColliderTrisInit* init) {
- s32 pad;
+void ObjSwitch_InitTrisCollider(Actor* thisx, PlayState* play, ColliderTrisInit* init) {
+ ObjSwitch* this = (ObjSwitch*)thisx;
s32 i;
s32 j;
Vec3f vtx[3];
@@ -231,9 +231,6 @@ void ObjSwitch_InitTrisCollider(ObjSwitch* this, PlayState* play, ColliderTrisIn
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
for (i = 0; i < ARRAY_COUNT(this->colliderTrisElements); i++) {
- //! FAKE:
- if (this) {}
-
for (j = 0; j < ARRAY_COUNT(vtx); j++) {
Matrix_MultVec3f(&init->elements[i].dim.vtx[j], &vtx[j]);
}
@@ -375,11 +372,11 @@ void ObjSwitch_Init(Actor* thisx, PlayState* play) {
Actor_SetFocus(&this->dyna.actor, sHeights[type]);
if (type == OBJSWITCH_TYPE_FLOOR_RUSTY) {
- ObjSwitch_InitTrisCollider(this, play, &sRustyFloorTrisInit);
+ ObjSwitch_InitTrisCollider(&this->dyna.actor, play, &sRustyFloorTrisInit);
} else if (type == OBJSWITCH_TYPE_EYE) {
- ObjSwitch_InitTrisCollider(this, play, &sEyeSwitchTrisInit);
+ ObjSwitch_InitTrisCollider(&this->dyna.actor, play, &sEyeSwitchTrisInit);
} else if (type == OBJSWITCH_TYPE_CRYSTAL || type == OBJSWITCH_TYPE_CRYSTAL_TARGETABLE) {
- ObjSwitch_InitJntSphCollider(this, play, &sJntSphInit);
+ ObjSwitch_InitJntSphCollider(&this->dyna.actor, play, &sJntSphInit);
}
if (type == OBJSWITCH_TYPE_CRYSTAL_TARGETABLE) {
this->dyna.actor.attentionRangeType = ATTENTION_RANGE_4;
@@ -925,7 +922,7 @@ void ObjSwitch_Update(Actor* thisx, PlayState* play) {
}
this->actionFunc(this, play);
if (this->floorSwitchPlayerSnapState != 0) {
- s32 pad;
+ s32 requiredScopeTemp;
ObjSwitch_FloorSwitchSnapPlayerToSwitchEdge(this, play);
if (this->floorSwitchPlayerSnapState == 2) {
diff --git a/mm/src/overlays/actors/ovl_Obj_Um/z_obj_um.c b/mm/src/overlays/actors/ovl_Obj_Um/z_obj_um.c
index f8b1c9586..118bc6903 100644
--- a/mm/src/overlays/actors/ovl_Obj_Um/z_obj_um.c
+++ b/mm/src/overlays/actors/ovl_Obj_Um/z_obj_um.c
@@ -319,9 +319,10 @@ s32 func_80B781DC(ObjUm* this, EnHorse* bandit1, EnHorse* bandit2, PlayState* pl
phi_f20 *= -1.0f;
}
phi_s2 = D_80B7C164[i].unk_10;
+
+ //! FAKE:
+ if (1) {}
}
- //! FAKE:
- ;
}
}
}
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 1ebae6e31..f3e119be0 100644
--- a/mm/src/overlays/actors/ovl_player_actor/z_player.c
+++ b/mm/src/overlays/actors/ovl_player_actor/z_player.c
@@ -283,7 +283,7 @@ void Player_CsAction_20(PlayState* play, Player* this, CsCmdActorCue* cue);
void Player_CsAction_21(PlayState* play, Player* this, CsCmdActorCue* cue);
void Player_CsAction_22(PlayState* play, Player* this, CsCmdActorCue* cue);
void Player_CsAction_23(PlayState* play, Player* this, CsCmdActorCue* cue);
-void Player_CsAction_TranslateReverse(PlayState* play, Player* this, CsCmdActorCue* cue);
+void Player_CsAction_TranslateReverse(PlayState* play, Player* this, CsCmdActorCue* cue2);
void Player_CsAction_25(PlayState* play, Player* this, CsCmdActorCue* cue);
void Player_CsAction_26(PlayState* play, Player* this, CsCmdActorCue* cue);
void Player_CsAction_27(PlayState* play, Player* this, CsCmdActorCue* cue);
@@ -11641,7 +11641,6 @@ void Player_UpdateInterface(PlayState* play, Player* this) {
doActionA = DO_ACTION_RETURN;
} else if ((this->heldItemAction == PLAYER_IA_FISHING_ROD) && (this->unk_B28 != 0)) {
doActionA = (this->unk_B28 == 2) ? DO_ACTION_REEL : DO_ACTION_NONE;
- doActionA = (this->unk_B28 == 2) ? DO_ACTION_REEL : DO_ACTION_NONE; //! FAKE: duplicated statement
} else if (this->stateFlags3 & PLAYER_STATE3_2000) {
doActionA = DO_ACTION_DOWN;
} else if ((this->doorType != PLAYER_DOORTYPE_NONE) && (this->doorType != PLAYER_DOORTYPE_STAIRCASE) &&
@@ -21107,28 +21106,15 @@ void Player_CsAction_23(PlayState* play, Player* this, CsCmdActorCue* cue) {
}
}
-void Player_CsAction_TranslateReverse(PlayState* play, Player* this, CsCmdActorCue* cue) {
- s32 pad;
- f32 xEnd;
- f32 yEnd;
- f32 zEnd;
- f32 xDiff;
- f32 yDiff;
- f32 zDiff;
- f32 progress;
-
- xEnd = cue->endPos.x;
- yEnd = cue->endPos.y;
- zEnd = cue->endPos.z;
-
- xDiff = cue->startPos.x - xEnd;
- yDiff = cue->startPos.y - yEnd;
- zDiff = cue->startPos.z - zEnd;
-
- //! FAKE:
- if (1) {}
-
- progress = ((f32)(cue->endFrame - play->csCtx.curFrame)) / ((f32)(cue->endFrame - cue->startFrame));
+void Player_CsAction_TranslateReverse(PlayState* play, Player* this, CsCmdActorCue* cue2) {
+ CsCmdActorCue* cue = cue2;
+ f32 xEnd = cue->endPos.x;
+ f32 yEnd = cue->endPos.y;
+ f32 zEnd = cue->endPos.z;
+ f32 xDiff = cue->startPos.x - xEnd;
+ f32 yDiff = cue->startPos.y - yEnd;
+ f32 zDiff = cue->startPos.z - zEnd;
+ f32 progress = (f32)(cue->endFrame - play->csCtx.curFrame) / (f32)(cue->endFrame - cue->startFrame);
this->actor.world.pos.x = (xDiff * progress) + xEnd;
this->actor.world.pos.y = (yDiff * progress) + yEnd;