1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-05 22:00:15 +00:00

document code_8008E6A0 (frame advance) (#737)

* OK

* fixes

* format

* remove gotos, thanks petrie
This commit is contained in:
fig02 2021-03-28 19:35:16 -04:00 committed by GitHub
parent 7f3be6e37f
commit 187d2d1500
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 71 additions and 78 deletions

View file

@ -59,7 +59,7 @@ void DemoGt_SpawnDust(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec
void func_8097D7D8(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velOffset, f32 scale, s32 arg4, s32 arg5, s16 life) {
s32 pad;
if (func_800C0D28(globalCtx) == 0) {
if (!FrameAdvance_IsEnabled(globalCtx)) {
s32 frames = globalCtx->gameplayFrames;
if (ABS(frames % arg4) == arg5) {
@ -281,7 +281,7 @@ void func_8097E454(GlobalContext* globalCtx, Vec3f* spawnerPos, Vec3f* velocity,
f32 dustScale = 300.0f * scale;
Vec3f pos;
if ((func_800C0D28(globalCtx) == 0) && (arg7 > 0) && (arg6 > 0)) {
if ((!FrameAdvance_IsEnabled(globalCtx)) && (arg7 > 0) && (arg6 > 0)) {
frames = (ABS((s32)globalCtx->gameplayFrames) % arg7);
phi_s0 = 0x10000 * frames / arg6;
increment = 0x10000 / arg6;
@ -1298,7 +1298,7 @@ void DemoGt_Draw4(DemoGt* this, GlobalContext* globalCtx) {
Matrix_Translate(sp48.x, sp48.y, sp48.z, MTXMODE_APPLY);
Matrix_ToMtx(sp60, "../z_demo_gt_part4_1.c", 232);
if (func_800C0D28(globalCtx2) == 0) {
if (!FrameAdvance_IsEnabled(globalCtx2)) {
func_80980F8C(this, globalCtx2);
}
@ -1417,7 +1417,7 @@ void DemoGt_Draw5(DemoGt* this, GlobalContext* globalCtx) {
Matrix_Translate(sp48.x, sp48.y, sp48.z, MTXMODE_APPLY);
Matrix_ToMtx(sp60, "../z_demo_gt_part4_2.c", 227);
if (func_800C0D28(globalCtx) == 0) {
if (!FrameAdvance_IsEnabled(globalCtx)) {
func_80981458(this, globalCtx);
}

View file

@ -73,7 +73,7 @@ void EnOkarinaEffect_TriggerStorm(EnOkarinaEffect* this, GlobalContext* globalCt
void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx) {
Flags_UnsetEnv(globalCtx, 5); // clear storms env flag
if (((globalCtx->pauseCtx.state == 0) && (globalCtx->unk_10A20 == 0) && (globalCtx->msgCtx.unk_E300 == 0) &&
(func_800C0D28(globalCtx) == 0) && ((globalCtx->transitionMode == 0) || (gSaveContext.gameMode != 0))) ||
(!FrameAdvance_IsEnabled(globalCtx)) && ((globalCtx->transitionMode == 0) || (gSaveContext.gameMode != 0))) ||
(this->timer >= 250)) {
if (globalCtx->envCtx.unk_1E != 0 || globalCtx->envCtx.unk_1F != 1) {
this->timer--;

View file

@ -455,7 +455,7 @@ s32 func_80B4F45C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
Matrix_Translate(362.0f, -133.0f, 0.0f, MTXMODE_APPLY);
Matrix_Get(&sp34);
func_800D20CC(&sp34, &sp2C, 0);
if (!func_800C0D28(globalCtx)) {
if (!FrameAdvance_IsEnabled(globalCtx)) {
func_80B4EE38(this, sp2C.y, 0);
func_80B4F230(this, sp2C.x, 1);
func_80B4EF64(this, sp2C.z, 2);
@ -465,7 +465,7 @@ s32 func_80B4F45C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
Matrix_ToMtx(&sp74[0], "../z_en_zl2.c", 1056);
Matrix_Get(&sp34);
func_800D20CC(&sp34, &sp2C, 0);
if (!func_800C0D28(globalCtx)) {
if (!FrameAdvance_IsEnabled(globalCtx)) {
func_80B4EE38(this, sp2C.y, 3);
func_80B4F230(this, sp2C.x, 4);
}
@ -474,7 +474,7 @@ s32 func_80B4F45C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
Matrix_ToMtx(&sp74[1], "../z_en_zl2.c", 1100);
Matrix_Get(&sp34);
func_800D20CC(&sp34, &sp2C, 0);
if (!func_800C0D28(globalCtx)) {
if (!FrameAdvance_IsEnabled(globalCtx)) {
func_80B4EE38(this, sp2C.y, 6);
func_80B4F230(this, sp2C.x, 7);
}
@ -486,7 +486,7 @@ s32 func_80B4F45C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
Matrix_Translate(467.0f, 265.0f, 389.0f, MTXMODE_APPLY);
Matrix_Get(&sp34);
func_800D20CC(&sp34, &sp2C, 0);
if (!func_800C0D28(globalCtx)) {
if (!FrameAdvance_IsEnabled(globalCtx)) {
func_80B4EE38(this, sp2C.y, 9);
func_80B4F230(this, sp2C.x, 10);
func_80B4EF64(this, sp2C.z, 11);
@ -496,7 +496,7 @@ s32 func_80B4F45C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
Matrix_ToMtx(&sp74[3], "../z_en_zl2.c", 1145);
Matrix_Get(&sp34);
func_800D20CC(&sp34, &sp2C, 0);
if (!func_800C0D28(globalCtx)) {
if (!FrameAdvance_IsEnabled(globalCtx)) {
func_80B4EE38(this, sp2C.y, 12);
func_80B4F230(this, sp2C.x, 13);
func_80B4EF64(this, sp2C.z, 14);
@ -509,7 +509,7 @@ s32 func_80B4F45C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
Matrix_Translate(467.0f, 265.0f, -389.0f, MTXMODE_APPLY);
Matrix_Get(&sp34);
func_800D20CC(&sp34, &sp2C, 0);
if (!func_800C0D28(globalCtx)) {
if (!FrameAdvance_IsEnabled(globalCtx)) {
func_80B4EE38(this, sp2C.y, 15);
func_80B4F230(this, sp2C.x, 16);
func_80B4EF64(this, sp2C.z, 17);
@ -519,7 +519,7 @@ s32 func_80B4F45C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
Matrix_ToMtx(&sp74[5], "../z_en_zl2.c", 1189);
Matrix_Get(&sp34);
func_800D20CC(&sp34, &sp2C, 0);
if (!func_800C0D28(globalCtx)) {
if (!FrameAdvance_IsEnabled(globalCtx)) {
func_80B4EE38(this, sp2C.y, 18);
func_80B4F230(this, sp2C.x, 19);
func_80B4EF64(this, sp2C.z, 20);

View file

@ -621,7 +621,7 @@ s32 func_80B5458C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
Matrix_Translate(362.0f, -133.0f, 0.0f, MTXMODE_APPLY);
Matrix_Get(&sp38);
func_800D20CC(&sp38, &sp30, 0);
if (!func_800C0D28(globalCtx)) {
if (!FrameAdvance_IsEnabled(globalCtx)) {
func_80B53980(this, sp30.y, 0);
func_80B54360(this, sp30.x, 1);
func_80B53B64(this, sp30.z, 2);
@ -631,7 +631,7 @@ s32 func_80B5458C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
Matrix_ToMtx(&sp78[0], "../z_en_zl3.c", 1490);
Matrix_Get(&sp38);
func_800D20CC(&sp38, &sp30, 0);
if (!func_800C0D28(globalCtx)) {
if (!FrameAdvance_IsEnabled(globalCtx)) {
func_80B53980(this, sp30.y, 3);
}
Matrix_RotateRPY(unk_28C[3] + kREG(34), unk_28C[4] + kREG(35), unk_28C[5] + kREG(36), MTXMODE_APPLY);
@ -639,7 +639,7 @@ s32 func_80B5458C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
Matrix_ToMtx(&sp78[1], "../z_en_zl3.c", 1534);
Matrix_Get(&sp38);
func_800D20CC(&sp38, &sp30, 0);
if (!func_800C0D28(globalCtx)) {
if (!FrameAdvance_IsEnabled(globalCtx)) {
func_80B54360(this, sp30.x, 7);
}
Matrix_RotateRPY(unk_28C[6] + kREG(37), unk_28C[7] + kREG(38), unk_28C[8] + kREG(39), MTXMODE_APPLY);
@ -650,7 +650,7 @@ s32 func_80B5458C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
Matrix_Translate(467.0f, 265.0f, 389.0f, MTXMODE_APPLY);
Matrix_Get(&sp38);
func_800D20CC(&sp38, &sp30, 0);
if (!func_800C0D28(globalCtx)) {
if (!FrameAdvance_IsEnabled(globalCtx)) {
func_80B53980(this, sp30.y, 9);
func_80B54360(this, sp30.x, 10);
func_80B53B64(this, sp30.z, 11);
@ -660,7 +660,7 @@ s32 func_80B5458C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
Matrix_ToMtx(&sp78[3], "../z_en_zl3.c", 1579);
Matrix_Get(&sp38);
func_800D20CC(&sp38, &sp30, 0);
if (!func_800C0D28(globalCtx)) {
if (!FrameAdvance_IsEnabled(globalCtx)) {
func_80B53980(this, sp30.y, 12);
func_80B54360(this, sp30.x, 13);
func_80B53B64(this, sp30.z, 14);
@ -673,7 +673,7 @@ s32 func_80B5458C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
Matrix_Translate(467.0f, 265.0f, -389.0f, MTXMODE_APPLY);
Matrix_Get(&sp38);
func_800D20CC(&sp38, &sp30, 0);
if (!func_800C0D28(globalCtx)) {
if (!FrameAdvance_IsEnabled(globalCtx)) {
func_80B53980(this, sp30.y, 15);
func_80B54360(this, sp30.x, 16);
func_80B53B64(this, sp30.z, 17);
@ -683,7 +683,7 @@ s32 func_80B5458C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
Matrix_ToMtx(&sp78[5], "../z_en_zl3.c", 1623);
Matrix_Get(&sp38);
func_800D20CC(&sp38, &sp30, 0);
if (!func_800C0D28(globalCtx)) {
if (!FrameAdvance_IsEnabled(globalCtx)) {
func_80B53980(this, sp30.y, 18);
func_80B54360(this, sp30.x, 19);
func_80B53B64(this, sp30.z, 20);