From 4d74fed7f019c98c7662730153608bcb43864613 Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Tue, 31 Oct 2023 12:44:36 +1100 Subject: [PATCH] Cutscene Camera OK (Some Docs) (#1411) * import WIP * Match func_80161E4C * Match func_801620CC * Match func_80162FF8 * Match func_801631DC * Match func_80162FF8 * Import bss * fix bss * type docs * more docs? * waypoint? * names * cleanup * PR Review * comments * PR Review * waypoints as 1 word * adjust names * Path order * remove pathing * fix bss --------- Co-authored-by: Derek Hensley --- include/variables.h | 15 +- include/z64cutscene.h | 58 +- spec | 1 - src/code/cutscene_camera.c | 685 ++++++++++++++++-- src/overlays/actors/ovl_En_Test6/z_en_test6.c | 52 +- tools/disasm/functions.txt | 18 +- tools/disasm/variables.txt | 2 +- tools/sizes/code_functions.csv | 18 +- 8 files changed, 695 insertions(+), 154 deletions(-) diff --git a/include/variables.h b/include/variables.h index 9c0df58f4e..743f138caf 100644 --- a/include/variables.h +++ b/include/variables.h @@ -1679,20 +1679,7 @@ extern SaveContext gSaveContext; // extern UNK_TYPE4 D_801F6B00; // extern UNK_TYPE4 D_801F6B04; // extern UNK_TYPE4 D_801F6B08; -// extern UNK_TYPE1 D_801F6B0C; -// extern UNK_TYPE1 D_801F6B0E; -// extern UNK_TYPE1 D_801F6B10; -// extern UNK_TYPE1 D_801F6B12; -// extern UNK_TYPE1 D_801F6B14; -// extern UNK_TYPE1 D_801F6B16; -// extern UNK_TYPE1 D_801F6B18; -// extern UNK_TYPE1 D_801F6B1A; -// extern UNK_TYPE1 D_801F6B1C; -// extern UNK_TYPE1 D_801F6B1E; -// extern UNK_TYPE1 D_801F6B20; -// extern UNK_TYPE1 D_801F6B22; -// extern UNK_TYPE4 sCurCsCamera; -// extern UNK_TYPE1 D_801F6B58; + extern void (*sKaleidoScopeUpdateFunc)(PlayState* play); extern void (*sKaleidoScopeDrawFunc)(PlayState* play); diff --git a/include/z64cutscene.h b/include/z64cutscene.h index 8cdd01a66c..52a6cf1bd3 100644 --- a/include/z64cutscene.h +++ b/include/z64cutscene.h @@ -737,18 +737,21 @@ typedef struct { /* 0xA */ s16 relativeTo; // see `CutsceneCamRelativeTo` } CsCmdCamPoint; // size = 0xC -typedef enum { - /* 0 */ CS_CAM_INTERP_0, - /* 1 */ CS_CAM_INTERP_1, - /* 2 */ CS_CAM_INTERP_2, - /* 3 */ CS_CAM_INTERP_3, - /* 4 */ CS_CAM_INTERP_4, - /* 5 */ CS_CAM_INTERP_5, - /* 6 */ CS_CAM_INTERP_6, - /* 7 */ CS_CAM_INTERP_7 +typedef enum CutsceneCamInterpType { + /* 0 */ CS_CAM_INTERP_NONE, // values do not change. + // values 1-3 only uses a single point from the cmd + /* 1 */ CS_CAM_INTERP_SET, // values immediately set to cmd values. + /* 2 */ CS_CAM_INTERP_LINEAR, // Lerp to the target position + /* 3 */ CS_CAM_INTERP_SCALE, // Step to the target position in increments scaled by the remaining distance + // values 4-5 uses multiple points from the cmd + /* 4 */ CS_CAM_INTERP_MP_CUBIC, // cubic multi-point (identical to SM64/OoT) + /* 5 */ CS_CAM_INTERP_MP_QUAD, // quadratic multi-point + // value 6 only uses a single point from the cmd + /* 6 */ CS_CAM_INTERP_GEO, // does VecGeo calculations using fov + /* 7 */ CS_CAM_INTERP_OFF // interpolation is not processed. } CutsceneCamInterpType; -typedef enum { +typedef enum CutsceneCamRelativeTo { /* 0 */ CS_CAM_REL_0, /* 1 */ CS_CAM_REL_1, /* 2 */ CS_CAM_REL_2, @@ -759,26 +762,25 @@ typedef enum { // Roll and Fov Data -typedef struct { - /* 0x0 */ s16 unused0; // unused +typedef struct CsCmdCamMisc { + /* 0x0 */ s16 unused0; // used only in the unused interp function /* 0x2 */ s16 roll; /* 0x4 */ s16 fov; /* 0x6 */ s16 unused1; // unused } CsCmdCamMisc; // size = 0x8 -typedef struct { - /* 0x00 */ Vec3f unk_00; - /* 0x0C */ Vec3f unk_0C; - /* 0x18 */ f32 unk_18; - /* 0x1C */ f32 unk_1C; - /* 0x2A */ f32 unk_20; - /* 0x24 */ s16 unk_24; - /* 0x26 */ s16 unk_26; - /* 0x28 */ s16 unk_28; +typedef struct CutsceneCameraInterp { + /* 0x00 */ Vec3f curPos; + /* 0x0C */ Vec3f initPos; + /* 0x18 */ f32 initFov; + /* 0x1C */ f32 initRoll; + /* 0x2A */ f32 unk_20; // position adjustment based on fov? + /* 0x24 */ s16 curFrame; + /* 0x26 */ s16 waypoint; + /* 0x28 */ s16 duration; /* 0x2A */ s16 numEntries; /* 0x1E */ u8 curPoint; - /* 0x2D */ u8 unk_2D; - /* 0x2E */ UNK_TYPE1 unk_2E[2]; + /* 0x2D */ u8 type; // See `CutsceneCamInterpType` } CutsceneCameraInterp; // size = 0x30 typedef struct CutsceneCamera { @@ -798,11 +800,11 @@ typedef struct CutsceneCamera { } CutsceneCamera; // size = 0x80 typedef enum { - /* 0 */ CS_CAM_STATE_UPDATE_ALL, // Update spline and next spline timer - /* 0 */ CS_CAM_STATE_UPDATE_SPLINE, // Update spline, do not advance next spline timer - /* 0 */ CS_CAM_STATE_PAUSE, // No updates - /* 0 */ CS_CAM_STATE_DONE_SPLINE, // Finished the current spline, ready for the next one - /* 0 */ CS_CAM_STATE_DONE = 999 // Finished all the splines. + /* 0 */ CS_CAM_STATE_UPDATE_ALL, // Update spline and next spline timer + /* 1 */ CS_CAM_STATE_UPDATE_SPLINE, // Update spline, do not advance next spline timer + /* 2 */ CS_CAM_STATE_PAUSE, // No updates + /* 3 */ CS_CAM_STATE_DONE_SPLINE, // Finished the current spline, ready for the next one + /* 999 */ CS_CAM_STATE_DONE = 999 // Finished all the splines. } CutsceneCameraState; // OoT Remnant diff --git a/spec b/spec index f39198bd9b..0df798ceea 100644 --- a/spec +++ b/spec @@ -531,7 +531,6 @@ beginseg include "build/src/code/z_player_call.o" include "build/src/code/z_shrink_window.o" include "build/src/code/cutscene_camera.o" - include "build/data/code/cutscene_camera.bss.o" include "build/src/code/z_kaleido_manager.o" include "build/src/code/z_kaleido_scope_call.o" include "build/src/code/z_fbdemo_dlftbls.o" diff --git a/src/code/cutscene_camera.c b/src/code/cutscene_camera.c index d92d119ddd..24f6fcc181 100644 --- a/src/code/cutscene_camera.c +++ b/src/code/cutscene_camera.c @@ -1,31 +1,34 @@ #include "global.h" -extern CutsceneCamera* sCurCsCamera; +static CutsceneCamera* sCurCsCamera; typedef s16 (*CsCamInterpolateCallback)(Vec3f*, f32*, s16*, CsCmdCamPoint*, CsCmdCamMisc*, CutsceneCameraInterp*); -// function declarations -s16 func_80161180(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc, - CutsceneCameraInterp* interp); -s16 func_8016237C(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc, - CutsceneCameraInterp* interp); -s16 func_8016253C(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc, - CutsceneCameraInterp* interp); -s16 func_80162A50(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc, - CutsceneCameraInterp* interp); -s16 func_801623E4(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc, - CutsceneCameraInterp* interp); -s16 func_80161C20(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc, - CutsceneCameraInterp* interp); -s16 func_80161E4C(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc, - CutsceneCameraInterp* interp); -s16 func_801620CC(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc, - CutsceneCameraInterp* interp); -s16 func_80163334(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc, - CutsceneCameraInterp* interp); +s16 CutsceneCamera_Interp_Off(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCamPoint* pointCmd, CsCmdCamMisc* miscCmd, + CutsceneCameraInterp* interpState); +s16 CutsceneCamera_Interp_None(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCamPoint* pointCmd, CsCmdCamMisc* miscCmd, + CutsceneCameraInterp* interpState); +s16 CutsceneCamera_Interp_MultiPointQuadratic(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCamPoint* pointCmd, + CsCmdCamMisc* miscCmd, CutsceneCameraInterp* interpState); +s16 CutsceneCamera_Interp_MultiPointCubic(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCamPoint* pointCmd, + CsCmdCamMisc* miscCmd, CutsceneCameraInterp* interpState); +s16 CutsceneCamera_Interp_Set(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCamPoint* pointCmd, CsCmdCamMisc* miscCmd, + CutsceneCameraInterp* interpState); +s16 CutsceneCamera_Interp_Linear(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCamPoint* pointCmd, + CsCmdCamMisc* miscCmd, CutsceneCameraInterp* interpState); +s16 CutsceneCamera_Interp_Scale(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCamPoint* pointCmd, + CsCmdCamMisc* miscCmd, CutsceneCameraInterp* interpState); +s16 CutsceneCamera_Interp_Geo(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCamPoint* pointCmd, CsCmdCamMisc* miscCmd, + CutsceneCameraInterp* interpState); +s16 CutsceneCamera_Interp_Unused(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCamPoint* pointCmd, + CsCmdCamMisc* miscCmd, CutsceneCameraInterp* interpState); + f32 func_80163660(Actor* actor); -#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80161180.s") +s16 CutsceneCamera_Interp_Off(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCamPoint* pointCmd, CsCmdCamMisc* miscCmd, + CutsceneCameraInterp* interpState) { + return 0; +} /** * Initializes Cutscene Camera Info @@ -44,44 +47,44 @@ s32 CutsceneCamera_Init(Camera* camera, CutsceneCamera* csCamera) { __osMemset(&csCamera->eyeInterp, 0, sizeof(CutsceneCameraInterp)); __osMemset(&csCamera->atInterp, 0, sizeof(CutsceneCameraInterp)); - csCamera->eyeInterp.unk_2D = csCamera->atInterp.unk_2D = 7; + csCamera->eyeInterp.type = csCamera->atInterp.type = CS_CAM_INTERP_OFF; return 1; } CsCamInterpolateCallback CutsceneCamera_Interpolate(u8 interpType) { switch (interpType) { - case CS_CAM_INTERP_7: + case CS_CAM_INTERP_OFF: default: - return func_80161180; + return CutsceneCamera_Interp_Off; - case CS_CAM_INTERP_0: - return func_8016237C; + case CS_CAM_INTERP_NONE: + return CutsceneCamera_Interp_None; - case CS_CAM_INTERP_5: - return func_8016253C; + case CS_CAM_INTERP_MP_QUAD: + return CutsceneCamera_Interp_MultiPointQuadratic; - case CS_CAM_INTERP_4: - return func_80162A50; + case CS_CAM_INTERP_MP_CUBIC: + return CutsceneCamera_Interp_MultiPointCubic; - case CS_CAM_INTERP_1: - return func_801623E4; + case CS_CAM_INTERP_SET: + return CutsceneCamera_Interp_Set; - case CS_CAM_INTERP_2: - return func_80161C20; + case CS_CAM_INTERP_LINEAR: + return CutsceneCamera_Interp_Linear; - case CS_CAM_INTERP_3: - return func_80161E4C; + case CS_CAM_INTERP_SCALE: + return CutsceneCamera_Interp_Scale; - case CS_CAM_INTERP_6: - return func_801620CC; + case CS_CAM_INTERP_GEO: + return CutsceneCamera_Interp_Geo; } } u8 CutsceneCamera_ProcessSpline(CutsceneCamera* csCamera) { s32 sp5C; - f32* fov; - s16* roll; + f32* camFov; + s16* camRoll; CsCamInterpolateCallback interpHandler; Player* player; Actor* target; @@ -100,19 +103,19 @@ u8 CutsceneCamera_ProcessSpline(CutsceneCamera* csCamera) { sp5C = false; } - csCamera->eyeInterp.unk_00 = csCamera->camera->eye; - csCamera->atInterp.unk_00 = csCamera->camera->at; + csCamera->eyeInterp.curPos = csCamera->camera->eye; + csCamera->atInterp.curPos = csCamera->camera->at; if (sp5C) { - fov = NULL; + camFov = NULL; } else { - fov = &csCamera->camera->fov; + camFov = &csCamera->camera->fov; } if (sp5C) { - roll = NULL; + camRoll = NULL; } else { - roll = &csCamera->camera->roll; + camRoll = &csCamera->camera->roll; } interpHandler = CutsceneCamera_Interpolate(csCamera->atCmd[csCamera->eyeInterp.curPoint].interpType); @@ -142,7 +145,7 @@ u8 CutsceneCamera_ProcessSpline(CutsceneCamera* csCamera) { break; } - numPoints = interpHandler(&csCamera->camera->at, fov, roll, &csCamera->atCmd[csCamera->eyeInterp.curPoint], + numPoints = interpHandler(&csCamera->camera->at, camFov, camRoll, &csCamera->atCmd[csCamera->eyeInterp.curPoint], &csCamera->miscCmd[csCamera->eyeInterp.curPoint], &csCamera->eyeInterp); switch (csCamera->atCmd[csCamera->eyeInterp.curPoint].relativeTo) { @@ -174,15 +177,15 @@ u8 CutsceneCamera_ProcessSpline(CutsceneCamera* csCamera) { csCamera->eyeInterp.curPoint += numPoints; if (sp5C) { - fov = &csCamera->camera->fov; + camFov = &csCamera->camera->fov; } else { - fov = NULL; + camFov = NULL; } if (sp5C) { - roll = &csCamera->camera->roll; + camRoll = &csCamera->camera->roll; } else { - roll = NULL; + camRoll = NULL; } interpHandler = CutsceneCamera_Interpolate(csCamera->eyeCmd[csCamera->atInterp.curPoint].interpType); @@ -212,7 +215,7 @@ u8 CutsceneCamera_ProcessSpline(CutsceneCamera* csCamera) { break; } - numPoints = interpHandler(&csCamera->camera->eye, fov, roll, &csCamera->eyeCmd[csCamera->atInterp.curPoint], + numPoints = interpHandler(&csCamera->camera->eye, camFov, camRoll, &csCamera->eyeCmd[csCamera->atInterp.curPoint], &csCamera->miscCmd[csCamera->atInterp.curPoint], &csCamera->atInterp); switch (csCamera->eyeCmd[csCamera->atInterp.curPoint].relativeTo) { @@ -308,7 +311,7 @@ s32 CutsceneCamera_UpdateSplines(u8* script, CutsceneCamera* csCamera) { csCamera->splineIndex = (csCamera->splineIndex & 0xFFFF) + 1; csCamera->state = CS_CAM_STATE_UPDATE_ALL; csCamera->nextSplineTimer = csCamera->updateSplineTimer = 0; - csCamera->eyeInterp.unk_2D = csCamera->atInterp.unk_2D = 7; + csCamera->eyeInterp.type = csCamera->atInterp.type = CS_CAM_INTERP_OFF; } csCamera->nextSplineTimer++; @@ -353,28 +356,578 @@ void CutsceneCamera_Reset(void) { sCurCsCamera->state = CS_CAM_STATE_UPDATE_ALL; } -#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80161C20.s") +// Linear interpolation from initial values to cmd values. Set weight to 100 to go all the way to the cmd value. +s16 CutsceneCamera_Interp_Linear(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCamPoint* pointCmd, + CsCmdCamMisc* miscCmd, CutsceneCameraInterp* interpState) { + f32 lerp; -#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80161E4C.s") + if (interpState->type != CS_CAM_INTERP_LINEAR) { + // Initialize + interpState->type = CS_CAM_INTERP_LINEAR; + interpState->waypoint = 0; + interpState->curFrame = 0; + interpState->duration = 1; + if (camPos != NULL) { + interpState->initPos.x = camPos->x; + interpState->initPos.y = camPos->y; + interpState->initPos.z = camPos->z; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_801620CC.s") + if (camFov != NULL) { + interpState->initFov = *camFov; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_8016237C.s") + if (camRoll != NULL) { + interpState->initRoll = *camRoll; + } + } -#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_801623E4.s") + interpState->curFrame++; -#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_801624EC.s") + lerp = ((f32)interpState->curFrame / pointCmd->duration) * (pointCmd->weight / 100.0f); -#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_8016253C.s") + if (camPos != NULL) { + VEC3F_LERPIMPDST(camPos, &interpState->initPos, &pointCmd->pos, lerp); + } -#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_801629BC.s") + if (camFov != NULL) { + *camFov = LERPIMP(interpState->initFov, miscCmd->fov, lerp); + } -#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80162A50.s") + if (camRoll != NULL) { + s16 targetRoll; + s16 rollDiffToTarget; -#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80162FF8.s") + targetRoll = CAM_DEG_TO_BINANG(miscCmd->roll); -#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_801631DC.s") + rollDiffToTarget = (s16)(targetRoll - (s16)interpState->initRoll); -#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80163334.s") + *camRoll = (s16)interpState->initRoll + (s16)(rollDiffToTarget * lerp); + } -#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80163660.s") + if (interpState->curFrame >= pointCmd->duration) { + // Finished + interpState->type = CS_CAM_INTERP_OFF; + return 1; + } + + return 0; +} + +s16 CutsceneCamera_Interp_Scale(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCamPoint* pointCmd, + CsCmdCamMisc* miscCmd, CutsceneCameraInterp* interpState) { + f32 lerp; + f32 tmp1; + f32 tmp2; + + if (interpState->type != CS_CAM_INTERP_SCALE) { + // Initialize + interpState->type = CS_CAM_INTERP_SCALE; + interpState->waypoint = 0; + interpState->curFrame = 0; + interpState->duration = 1; + if (camPos != NULL) { + interpState->initPos.x = camPos->x; + interpState->initPos.y = camPos->y; + interpState->initPos.z = camPos->z; + } + if (camFov != NULL) { + interpState->initFov = *camFov; + } + if (camRoll != NULL) { + interpState->initRoll = *camRoll; + } + } + + tmp2 = (((pointCmd->weight + 100) * (pointCmd->duration / 2)) + + (((pointCmd->weight + 100) / 2) * (pointCmd->duration & 1))); + if (pointCmd->duration < 2) { + lerp = 1.0f; + } else { + tmp1 = (f32)(pointCmd->weight - 100) / (pointCmd->duration - 1); + lerp = ((interpState->curFrame * tmp1) + 100.0f) / tmp2; + } + + interpState->curFrame++; + + if (camPos != NULL) { + camPos->x += (pointCmd->pos.x - interpState->initPos.x) * lerp; + camPos->y += (pointCmd->pos.y - interpState->initPos.y) * lerp; + camPos->z += (pointCmd->pos.z - interpState->initPos.z) * lerp; + } + + if (camFov != NULL) { + *camFov += (miscCmd->fov - interpState->initFov) * lerp; + } + + if (camRoll != NULL) { + s16 targetRoll; + s16 rollDiffToTarget; + + targetRoll = CAM_DEG_TO_BINANG(miscCmd->roll); + + rollDiffToTarget = (s16)(targetRoll - (s16)interpState->initRoll); + + *camRoll += (s16)(rollDiffToTarget * lerp); + } + + if (interpState->curFrame >= pointCmd->duration) { + // Finished + interpState->type = CS_CAM_INTERP_OFF; + return 1; + } + + return 0; +} + +s16 CutsceneCamera_Interp_Geo(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCamPoint* pointCmd, CsCmdCamMisc* miscCmd, + CutsceneCameraInterp* interpState) { + VecGeo sp40; + f32 lerp; + f32 tmp1; + f32 tmp2; + + if (interpState->type != CS_CAM_INTERP_GEO) { + // Initialize + interpState->type = CS_CAM_INTERP_GEO; + interpState->waypoint = 0; + interpState->curFrame = 0; + interpState->duration = 1; + if (camPos != NULL) { + interpState->unk_20 = OLib_Vec3fDist(&interpState->curPos, camPos) * Math_FTanF(DEG_TO_RAD(*camFov)); + } + if (camFov != NULL) { + interpState->initFov = *camFov; + } + if (camRoll != NULL) { + interpState->initRoll = *camRoll; + } + } + + tmp2 = (((pointCmd->weight + 100) * (pointCmd->duration / 2)) + + (((pointCmd->weight + 100) / 2) * (pointCmd->duration & 1))); + if (pointCmd->duration < 2) { + lerp = 1.0f; + } else { + tmp1 = (f32)(pointCmd->weight - 100) / (pointCmd->duration - 1); + lerp = ((interpState->curFrame * tmp1) + 100.0f) / tmp2; + } + + interpState->curFrame++; + + if (camPos != NULL) { + OLib_Vec3fDiffToVecGeo(&sp40, &interpState->curPos, camPos); + sp40.r = interpState->unk_20 / Math_FTanF(DEG_TO_RAD(*camFov)); + OLib_AddVecGeoToVec3f(camPos, &interpState->curPos, &sp40); + } + + if (camFov != NULL) { + *camFov += (miscCmd->fov - interpState->initFov) * lerp; + } + + if (camRoll != NULL) { + s16 targetRoll; + s16 rollDiffToTarget; + + targetRoll = CAM_DEG_TO_BINANG(miscCmd->roll); + + rollDiffToTarget = (s16)(targetRoll - (s16)interpState->initRoll); + + *camRoll += (s16)(rollDiffToTarget * lerp); + } + + if (interpState->curFrame >= pointCmd->duration) { + // Finished + interpState->type = CS_CAM_INTERP_OFF; + return 1; + } + + return 0; +} + +// Updates the interpolation state but does not change the pos/fov/roll values +s16 CutsceneCamera_Interp_None(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCamPoint* pointCmd, CsCmdCamMisc* miscCmd, + CutsceneCameraInterp* interpState) { + if (interpState->type != CS_CAM_INTERP_NONE) { + // Initialize + interpState->type = CS_CAM_INTERP_NONE; + interpState->waypoint = 0; + interpState->curFrame = 0; + interpState->duration = 1; + } + + interpState->curFrame++; + + if (interpState->curFrame >= pointCmd->duration) { + // Finishes + interpState->type = CS_CAM_INTERP_OFF; + return 1; + } + + return 0; +} + +// Immediately sets the values +s16 CutsceneCamera_Interp_Set(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCamPoint* pointCmd, CsCmdCamMisc* miscCmd, + CutsceneCameraInterp* interpState) { + s16 pad; + + if (interpState->type != CS_CAM_INTERP_SET) { + // Initialize + interpState->type = CS_CAM_INTERP_SET; + interpState->waypoint = 0; + interpState->curFrame = 0; + interpState->duration = 1; + if (camFov != NULL) { + *camFov = miscCmd->fov; + } + if (camRoll != NULL) { + *camRoll = CAM_DEG_TO_BINANG(miscCmd->roll); + } + } + + if (camPos != NULL) { + camPos->x = pointCmd->pos.x; + camPos->y = pointCmd->pos.y; + camPos->z = pointCmd->pos.z; + } + + interpState->curFrame++; + + if (interpState->curFrame >= pointCmd->duration) { + // Finished + interpState->type = CS_CAM_INTERP_OFF; + return 1; + } + + return 0; +} + +void func_801624EC(f32 u, f32* coeff) { + f32 u1 = 1.0f - u; + + coeff[0] = u1 * u1 * 0.5f; + coeff[1] = u * u1 + 0.5f; + coeff[2] = u * u * 0.5f; +} + +s16 CutsceneCamera_Interp_MultiPointQuadratic(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCamPoint* pointCmd, + CsCmdCamMisc* miscCmd, CutsceneCameraInterp* interpState) { + f32 new_var; + f32 coeff[3]; + s32 waypoints[3]; + + if (interpState->type != CS_CAM_INTERP_MP_QUAD) { + // Initialize + interpState->type = CS_CAM_INTERP_MP_QUAD; + interpState->waypoint = 0; + interpState->duration = pointCmd->duration; + interpState->curFrame = 0; + } + + new_var = (f32)interpState->curFrame / pointCmd[interpState->waypoint + 1].duration; + + if (interpState->waypoint < (interpState->duration - 1)) { + waypoints[0] = interpState->waypoint; + } else { + waypoints[0] = interpState->duration - 1; + } + + if ((interpState->waypoint + 1) < (interpState->duration - 1)) { + waypoints[1] = interpState->waypoint + 1; + } else { + waypoints[1] = interpState->duration - 1; + } + + if ((interpState->waypoint + 2) < (interpState->duration - 1)) { + waypoints[2] = interpState->waypoint + 2; + } else { + waypoints[2] = interpState->duration - 1; + } + + func_801624EC(new_var, coeff); + + if (camPos != NULL) { + camPos->x = (coeff[0] * pointCmd[waypoints[0]].pos.x) + (coeff[1] * pointCmd[waypoints[1]].pos.x) + + (coeff[2] * pointCmd[waypoints[2]].pos.x); + camPos->y = (coeff[0] * pointCmd[waypoints[0]].pos.y) + (coeff[1] * pointCmd[waypoints[1]].pos.y) + + (coeff[2] * pointCmd[waypoints[2]].pos.y); + camPos->z = (coeff[0] * pointCmd[waypoints[0]].pos.z) + (coeff[1] * pointCmd[waypoints[1]].pos.z) + + (coeff[2] * pointCmd[waypoints[2]].pos.z); + } + + if (camFov != NULL) { + *camFov = (coeff[0] * miscCmd[waypoints[0]].fov) + (coeff[1] * miscCmd[waypoints[1]].fov) + + (coeff[2] * miscCmd[waypoints[2]].fov); + } + + if (camRoll != NULL) { + s16 targetRolls[3]; + s32 sp28[2]; + s32 rollDiffToTarget; + + targetRolls[0] = CAM_DEG_TO_BINANG(miscCmd[waypoints[0]].roll); + targetRolls[1] = CAM_DEG_TO_BINANG(miscCmd[waypoints[1]].roll); + targetRolls[2] = CAM_DEG_TO_BINANG(miscCmd[waypoints[2]].roll); + + sp28[0] = (s16)(targetRolls[1] - targetRolls[0]); + sp28[1] = sp28[0] + (s16)(targetRolls[2] - targetRolls[1]); + + rollDiffToTarget = ((coeff[1] * sp28[0]) + (coeff[2] * sp28[1])); + *camRoll = targetRolls[0] + rollDiffToTarget; + } + + interpState->curFrame++; + + if (interpState->curFrame == pointCmd[interpState->waypoint + 1].duration) { + interpState->waypoint++; + interpState->curFrame = 0; + if (interpState->waypoint >= (interpState->duration - 2)) { + interpState->type = CS_CAM_INTERP_OFF; + return interpState->duration; + } + } + return 0; +} + +/** + * This code is very similar to the spline system in OoT's func_800BB0A0 + * in that it is based on the Super Mario 64 cutscene camera movement + */ +void func_801629BC(f32 u, f32* coeff) { + coeff[0] = (1.0f - u) * (1.0f - u) * (1.0f - u) * (1.0f / 6.0f); + coeff[1] = ((u * u * u * 0.5f) - u * u) + (2.0f / 3.0f); + coeff[2] = (u * u * u * -0.5f) + (u * u * 0.5f) + (u * 0.5f) + (1.0f / 6.0f); + coeff[3] = u * u * u * (1.0f / 6.0f); +} + +s16 CutsceneCamera_Interp_MultiPointCubic(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCamPoint* pointCmd, + CsCmdCamMisc* miscCmd, CutsceneCameraInterp* interpState) { + f32 new_var; + f32 coeff[4]; + s32 waypoints[4]; + + if (interpState->type != CS_CAM_INTERP_MP_CUBIC) { + // Initialize + interpState->type = CS_CAM_INTERP_MP_CUBIC; + interpState->waypoint = 0; + interpState->duration = pointCmd->duration; + interpState->curFrame = 0; + } + + new_var = (f32)interpState->curFrame / pointCmd[interpState->waypoint + 1].duration; + + if (interpState->waypoint < (interpState->duration - 1)) { + waypoints[0] = interpState->waypoint; + } else { + waypoints[0] = interpState->duration - 1; + } + + if ((interpState->waypoint + 1) < (interpState->duration - 1)) { + waypoints[1] = interpState->waypoint + 1; + } else { + waypoints[1] = interpState->duration - 1; + } + + if ((interpState->waypoint + 2) < (interpState->duration - 1)) { + waypoints[2] = interpState->waypoint + 2; + } else { + waypoints[2] = interpState->duration - 1; + } + + if ((interpState->waypoint + 3) < (interpState->duration - 1)) { + waypoints[3] = interpState->waypoint + 3; + } else { + waypoints[3] = interpState->duration - 1; + } + + func_801629BC(new_var, coeff); + + if (camPos != NULL) { + camPos->x = (coeff[0] * pointCmd[waypoints[0]].pos.x) + (coeff[1] * pointCmd[waypoints[1]].pos.x) + + (coeff[2] * pointCmd[waypoints[2]].pos.x) + (coeff[3] * pointCmd[waypoints[3]].pos.x); + camPos->y = (coeff[0] * pointCmd[waypoints[0]].pos.y) + (coeff[1] * pointCmd[waypoints[1]].pos.y) + + (coeff[2] * pointCmd[waypoints[2]].pos.y) + (coeff[3] * pointCmd[waypoints[3]].pos.y); + camPos->z = (coeff[0] * pointCmd[waypoints[0]].pos.z) + (coeff[1] * pointCmd[waypoints[1]].pos.z) + + (coeff[2] * pointCmd[waypoints[2]].pos.z) + (coeff[3] * pointCmd[waypoints[3]].pos.z); + } + + if (camFov != NULL) { + *camFov = (coeff[0] * miscCmd[waypoints[0]].fov) + (coeff[1] * miscCmd[waypoints[1]].fov) + + (coeff[2] * miscCmd[waypoints[2]].fov) + (coeff[3] * miscCmd[waypoints[3]].fov); + } + + if (camRoll != NULL) { + s16 targetRolls[4]; + s32 sp2C[3]; + s32 rollDiffToTarget; + + targetRolls[0] = CAM_DEG_TO_BINANG(miscCmd[waypoints[0]].roll); + targetRolls[1] = CAM_DEG_TO_BINANG(miscCmd[waypoints[1]].roll); + targetRolls[2] = CAM_DEG_TO_BINANG(miscCmd[waypoints[2]].roll); + targetRolls[3] = CAM_DEG_TO_BINANG(miscCmd[waypoints[3]].roll); + + sp2C[0] = (s16)(targetRolls[1] - targetRolls[0]); + sp2C[1] = sp2C[0] + (s16)(targetRolls[2] - targetRolls[1]); + sp2C[2] = sp2C[1] + (s16)(targetRolls[3] - targetRolls[2]); + + rollDiffToTarget = ((coeff[1] * sp2C[0]) + (coeff[2] * sp2C[1]) + (coeff[3] * sp2C[2])); + *camRoll = targetRolls[0] + rollDiffToTarget; + } + + interpState->curFrame++; + + if (interpState->curFrame == pointCmd[interpState->waypoint + 1].duration) { + interpState->curFrame = 0; + interpState->waypoint++; + if (interpState->waypoint >= (interpState->duration - 3)) { + interpState->type = CS_CAM_INTERP_OFF; + return interpState->duration; + } + } + return 0; +} + +static f32 sKnots[38]; + +// Only used by unused CutsceneCamera_Interp_Unused +void func_80162FF8(s16 arg0) { + f32 val = 0.0f; + s32 i; + + sKnots[0] = 0.0f; + sKnots[1] = 0.0f; + sKnots[2] = 0.0f; + + for (i = 3; i < arg0; i++) { + if (i == 3) { + val += 0.9f; + } else if ((i == 4) || (i == (arg0 - 1))) { + val += 0.6f; + } else { + val += 0.3f; + } + + sKnots[i] = val; + } + + val += 0.9f; + sKnots[i++] = val; + sKnots[i++] = val; + sKnots[i++] = val; +} + +#define FUNC_801631DC_ORDER 3 + +// Only used by unused CutsceneCamera_Interp_Unused +void func_801631DC(f32 progress, s32 arg2, f32* coeff) { + f32 coeffTemp[4][4]; + s32 i; + s32 j; + s32 k; + + for (i = 0; i < FUNC_801631DC_ORDER + 1; i++) { + for (j = 0; j < FUNC_801631DC_ORDER + 1; j++) { + coeffTemp[i][j] = 0.0f; + } + } + + coeffTemp[0][FUNC_801631DC_ORDER - 1] = 1.0f; + + for (i = 1; i < FUNC_801631DC_ORDER; i++) { + for (j = arg2 - i, k = (FUNC_801631DC_ORDER - 1) - i; j <= arg2; j++, k++) { + if (sKnots[j + i] != sKnots[j]) { + coeffTemp[i][k] = ((progress - sKnots[j]) / (sKnots[j + i] - sKnots[j])) * coeffTemp[i - 1][k]; + } else { + coeffTemp[i][k] = 0.0f; + } + + if (sKnots[j + i + 1] != sKnots[j + 1]) { + coeffTemp[i][k] += + ((sKnots[j + i + 1] - progress) / (sKnots[j + i + 1] - sKnots[j + 1])) * coeffTemp[i - 1][k + 1]; + } + } + } + for (j = 0; j < FUNC_801631DC_ORDER; j++) { + coeff[j] = coeffTemp[FUNC_801631DC_ORDER - 1][j]; + } +} + +s16 CutsceneCamera_Interp_Unused(Vec3f* camPos, f32* camFov, s16* camRoll, CsCmdCamPoint* pointCmd, + CsCmdCamMisc* miscCmd, CutsceneCameraInterp* interpState) { + s32 index; + f32 coeff[3]; + + if (interpState->type != CS_CAM_INTERP_MP_CUBIC) { + // Initialize + interpState->type = CS_CAM_INTERP_MP_CUBIC; + interpState->waypoint = 0; + interpState->duration = pointCmd->duration; + func_80162FF8(interpState->duration); + interpState->curFrame = 0; + } + + index = interpState->waypoint + 2; + func_801631DC(F32_LERPIMP(sKnots[index], sKnots[index + 1], + (f32)interpState->curFrame / miscCmd[interpState->waypoint].unused0), + index, coeff); + + if (camPos != NULL) { + camPos->x = (coeff[0] * pointCmd[interpState->waypoint].pos.x) + + (coeff[1] * pointCmd[interpState->waypoint + 1].pos.x) + + (coeff[2] * pointCmd[interpState->waypoint + 2].pos.x); + camPos->y = (coeff[0] * pointCmd[interpState->waypoint].pos.y) + + (coeff[1] * pointCmd[interpState->waypoint + 1].pos.y) + + (coeff[2] * pointCmd[interpState->waypoint + 2].pos.y); + camPos->z = (coeff[0] * pointCmd[interpState->waypoint].pos.z) + + (coeff[1] * pointCmd[interpState->waypoint + 1].pos.z) + + (coeff[2] * pointCmd[interpState->waypoint + 2].pos.z); + } + + if (camFov != NULL) { + *camFov = (coeff[0] * miscCmd[interpState->waypoint].fov) + + (coeff[1] * miscCmd[interpState->waypoint + 1].fov) + + (coeff[2] * miscCmd[interpState->waypoint + 2].fov); + } + + if (camRoll != NULL) { + *camRoll = CAM_DEG_TO_BINANG((coeff[0] * miscCmd[interpState->waypoint].roll) + + (coeff[1] * miscCmd[interpState->waypoint + 1].roll) + + (coeff[2] * miscCmd[interpState->waypoint + 2].roll)); + } + + interpState->curFrame++; + + if (interpState->curFrame >= miscCmd[interpState->waypoint].unused0) { + interpState->waypoint++; + interpState->curFrame = 0; + if (interpState->waypoint >= (interpState->duration - 2)) { + interpState->type = CS_CAM_INTERP_OFF; + return interpState->duration; + } + } + return 0; +} + +f32 func_80163660(Actor* actor) { + if (actor->category != ACTORCAT_PLAYER) { + return 38.0f - (actor->focus.pos.y - actor->world.pos.y); + } + + switch (((Player*)actor)->transformation) { + case PLAYER_FORM_DEKU: + return -8.0f; + + case PLAYER_FORM_GORON: + return 23.0f; + + case PLAYER_FORM_ZORA: + return 27.0f; + + case PLAYER_FORM_FIERCE_DEITY: + return 17.0f; + + default: + return 0.0f; + } +} diff --git a/src/overlays/actors/ovl_En_Test6/z_en_test6.c b/src/overlays/actors/ovl_En_Test6/z_en_test6.c index 5d99b99d4f..6f1ed50909 100644 --- a/src/overlays/actors/ovl_En_Test6/z_en_test6.c +++ b/src/overlays/actors/ovl_En_Test6/z_en_test6.c @@ -68,34 +68,34 @@ CutsceneData sDoubleSoTCsCamData[] = { CS_CAM_SPLINE(13, 424, 0, 100), // Camera At Data - /* 0x0 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 13, 0, 21, -19, CS_CAM_REL_0), - /* 0x1 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 18, 0, 21, -19, CS_CAM_REL_0), - /* 0x2 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 16, 0, 21, -19, CS_CAM_REL_0), - /* 0x3 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 17, -26, -5, -32, CS_CAM_REL_0), - /* 0x4 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 15, 0, 18, -32, CS_CAM_REL_0), - /* 0x5 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 14, 1, 22, -27, CS_CAM_REL_0), - /* 0x6 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 12, 0, 1, -5, CS_CAM_REL_0), - /* 0x7 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 7, 16, 29, -77, CS_CAM_REL_0), - /* 0x8 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 3, 1, 19, 111, CS_CAM_REL_0), - /* 0x9 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 3, -59, 21, 91, CS_CAM_REL_0), - /* 0xA */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 3, -19, 59, 84, CS_CAM_REL_0), - /* 0xB */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 136, -19, 59, 84, CS_CAM_REL_0), - /* 0xC */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 108, -17, 57, 82, CS_CAM_REL_0), + /* 0x0 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 13, 0, 21, -19, CS_CAM_REL_0), + /* 0x1 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 18, 0, 21, -19, CS_CAM_REL_0), + /* 0x2 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 16, 0, 21, -19, CS_CAM_REL_0), + /* 0x3 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 17, -26, -5, -32, CS_CAM_REL_0), + /* 0x4 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 15, 0, 18, -32, CS_CAM_REL_0), + /* 0x5 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 14, 1, 22, -27, CS_CAM_REL_0), + /* 0x6 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 12, 0, 1, -5, CS_CAM_REL_0), + /* 0x7 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 7, 16, 29, -77, CS_CAM_REL_0), + /* 0x8 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 3, 1, 19, 111, CS_CAM_REL_0), + /* 0x9 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 3, -59, 21, 91, CS_CAM_REL_0), + /* 0xA */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 3, -19, 59, 84, CS_CAM_REL_0), + /* 0xB */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 136, -19, 59, 84, CS_CAM_REL_0), + /* 0xC */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 108, -17, 57, 82, CS_CAM_REL_0), // Camera Eye Data - /* 0x0 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 13, 0, 50, 681, CS_CAM_REL_0), - /* 0x1 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 18, 0, 50, 681, CS_CAM_REL_0), - /* 0x2 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 16, 0, 50, 681, CS_CAM_REL_0), - /* 0x3 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 17, -104, 375, 345, CS_CAM_REL_0), - /* 0x4 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 15, 0, -62, 289, CS_CAM_REL_0), - /* 0x5 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 14, -47, 125, 205, CS_CAM_REL_0), - /* 0x6 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 12, -58, -17, 199, CS_CAM_REL_0), - /* 0x7 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 7, 16, 53, 211, CS_CAM_REL_0), - /* 0x8 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 3, -31, 63, 623, CS_CAM_REL_0), - /* 0x9 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 3, -341, 464, 542, CS_CAM_REL_0), - /* 0xA */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 3, -341, 464, 542, CS_CAM_REL_0), - /* 0xB */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 136, -341, 464, 542, CS_CAM_REL_0), - /* 0xC */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 108, -339, 462, 540, CS_CAM_REL_0), + /* 0x0 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 13, 0, 50, 681, CS_CAM_REL_0), + /* 0x1 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 18, 0, 50, 681, CS_CAM_REL_0), + /* 0x2 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 16, 0, 50, 681, CS_CAM_REL_0), + /* 0x3 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 17, -104, 375, 345, CS_CAM_REL_0), + /* 0x4 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 15, 0, -62, 289, CS_CAM_REL_0), + /* 0x5 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 14, -47, 125, 205, CS_CAM_REL_0), + /* 0x6 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 12, -58, -17, 199, CS_CAM_REL_0), + /* 0x7 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 7, 16, 53, 211, CS_CAM_REL_0), + /* 0x8 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 3, -31, 63, 623, CS_CAM_REL_0), + /* 0x9 */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 3, -341, 464, 542, CS_CAM_REL_0), + /* 0xA */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 3, -341, 464, 542, CS_CAM_REL_0), + /* 0xB */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 136, -341, 464, 542, CS_CAM_REL_0), + /* 0xC */ CS_CAM_POINT(CS_CAM_INTERP_MP_CUBIC, 100, 108, -339, 462, 540, CS_CAM_REL_0), // Camera Roll and Fov Data /* 0x0 */ CS_CAM_MISC(15, 0xA, 70, 0), diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 78cb49b61c..7e1f262c48 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -2904,7 +2904,7 @@ 0x80160CD4:("ShrinkWindow_Destroy",), 0x80160CE4:("ShrinkWindow_Update",), 0x80160D98:("ShrinkWindow_Draw",), - 0x80161180:("func_80161180",), + 0x80161180:("CutsceneCamera_Interp_Off",), 0x8016119C:("CutsceneCamera_Init",), 0x8016122C:("CutsceneCamera_Interpolate",), 0x801612B8:("CutsceneCamera_ProcessSpline",), @@ -2912,18 +2912,18 @@ 0x80161BAC:("func_80161BAC",), 0x80161BE0:("CutsceneCamera_SetState",), 0x80161C0C:("CutsceneCamera_Reset",), - 0x80161C20:("func_80161C20",), - 0x80161E4C:("func_80161E4C",), - 0x801620CC:("func_801620CC",), - 0x8016237C:("func_8016237C",), - 0x801623E4:("func_801623E4",), + 0x80161C20:("CutsceneCamera_Interp_Linear",), + 0x80161E4C:("CutsceneCamera_Interp_Scale",), + 0x801620CC:("CutsceneCamera_Interp_Geo",), + 0x8016237C:("CutsceneCamera_Interp_None",), + 0x801623E4:("CutsceneCamera_Interp_Set",), 0x801624EC:("func_801624EC",), - 0x8016253C:("func_8016253C",), + 0x8016253C:("CutsceneCamera_Interp_MultiPointQuadratic",), 0x801629BC:("func_801629BC",), - 0x80162A50:("func_80162A50",), + 0x80162A50:("CutsceneCamera_Interp_MultiPointCubic",), 0x80162FF8:("func_80162FF8",), 0x801631DC:("func_801631DC",), - 0x80163334:("func_80163334",), + 0x80163334:("CutsceneCamera_Interp_Unused",), 0x80163660:("func_80163660",), 0x80163700:("KaleidoManager_FaultAddrConv",), 0x80163758:("KaleidoManager_LoadOvl",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 05ae147913..d80ea80a38 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -3971,7 +3971,7 @@ 0x801F6B40:("sShrinkWindow","ShrinkWindow","",0x4), 0x801F6B44:("sShrinkWindowPtr","ShrinkWindow*","",0x4), 0x801F6B50:("sCurCsCamera","UNK_TYPE4","",0x4), - 0x801F6B58:("D_801F6B58","UNK_TYPE1","",0x1), + 0x801F6B58:("sKnots","UNK_TYPE1","",0x1), 0x801F6BF0:("sKaleidoMgrFaultAddrConvClient","FaultAddrConvClient","",0xC), 0x801F6C00:("sKaleidoScopeUpdateFunc","void*","",0x4), 0x801F6C04:("sKaleidoScopeDrawFunc","void*","",0x4), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index 3a4de09cee..d4c9913495 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -2418,7 +2418,7 @@ asm/non_matchings/code/z_shrink_window/ShrinkWindow_Init.s,ShrinkWindow_Init,0x8 asm/non_matchings/code/z_shrink_window/ShrinkWindow_Destroy.s,ShrinkWindow_Destroy,0x80160CD4,0x4 asm/non_matchings/code/z_shrink_window/ShrinkWindow_Update.s,ShrinkWindow_Update,0x80160CE4,0x2D asm/non_matchings/code/z_shrink_window/ShrinkWindow_Draw.s,ShrinkWindow_Draw,0x80160D98,0xFA -asm/non_matchings/code/cutscene_camera/func_80161180.s,func_80161180,0x80161180,0x7 +asm/non_matchings/code/cutscene_camera/CutsceneCamera_Interp_Off.s,CutsceneCamera_Interp_Off,0x80161180,0x7 asm/non_matchings/code/cutscene_camera/CutsceneCamera_Init.s,CutsceneCamera_Init,0x8016119C,0x24 asm/non_matchings/code/cutscene_camera/CutsceneCamera_Interpolate.s,CutsceneCamera_Interpolate,0x8016122C,0x23 asm/non_matchings/code/cutscene_camera/CutsceneCamera_ProcessSpline.s,CutsceneCamera_ProcessSpline,0x801612B8,0x1B8 @@ -2426,18 +2426,18 @@ asm/non_matchings/code/cutscene_camera/CutsceneCamera_UpdateSplines.s,CutsceneCa asm/non_matchings/code/cutscene_camera/func_80161BAC.s,func_80161BAC,0x80161BAC,0xD asm/non_matchings/code/cutscene_camera/CutsceneCamera_SetState.s,CutsceneCamera_SetState,0x80161BE0,0xB asm/non_matchings/code/cutscene_camera/CutsceneCamera_Reset.s,CutsceneCamera_Reset,0x80161C0C,0x5 -asm/non_matchings/code/cutscene_camera/func_80161C20.s,func_80161C20,0x80161C20,0x8B -asm/non_matchings/code/cutscene_camera/func_80161E4C.s,func_80161E4C,0x80161E4C,0xA0 -asm/non_matchings/code/cutscene_camera/func_801620CC.s,func_801620CC,0x801620CC,0xAC -asm/non_matchings/code/cutscene_camera/func_8016237C.s,func_8016237C,0x8016237C,0x1A -asm/non_matchings/code/cutscene_camera/func_801623E4.s,func_801623E4,0x801623E4,0x42 +asm/non_matchings/code/cutscene_camera/CutsceneCamera_Interp_Linear.s,CutsceneCamera_Interp_Linear,0x80161C20,0x8B +asm/non_matchings/code/cutscene_camera/CutsceneCamera_Interp_Scale.s,CutsceneCamera_Interp_Scale,0x80161E4C,0xA0 +asm/non_matchings/code/cutscene_camera/CutsceneCamera_Interp_Geo.s,CutsceneCamera_Interp_Geo,0x801620CC,0xAC +asm/non_matchings/code/cutscene_camera/CutsceneCamera_Interp_None.s,CutsceneCamera_Interp_None,0x8016237C,0x1A +asm/non_matchings/code/cutscene_camera/CutsceneCamera_Interp_Set.s,CutsceneCamera_Interp_Set,0x801623E4,0x42 asm/non_matchings/code/cutscene_camera/func_801624EC.s,func_801624EC,0x801624EC,0x14 -asm/non_matchings/code/cutscene_camera/func_8016253C.s,func_8016253C,0x8016253C,0x120 +asm/non_matchings/code/cutscene_camera/CutsceneCamera_Interp_MultiPointQuadratic.s,CutsceneCamera_Interp_MultiPointQuadratic,0x8016253C,0x120 asm/non_matchings/code/cutscene_camera/func_801629BC.s,func_801629BC,0x801629BC,0x25 -asm/non_matchings/code/cutscene_camera/func_80162A50.s,func_80162A50,0x80162A50,0x16A +asm/non_matchings/code/cutscene_camera/CutsceneCamera_Interp_MultiPointCubic.s,CutsceneCamera_Interp_MultiPointCubic,0x80162A50,0x16A asm/non_matchings/code/cutscene_camera/func_80162FF8.s,func_80162FF8,0x80162FF8,0x79 asm/non_matchings/code/cutscene_camera/func_801631DC.s,func_801631DC,0x801631DC,0x56 -asm/non_matchings/code/cutscene_camera/func_80163334.s,func_80163334,0x80163334,0xCB +asm/non_matchings/code/cutscene_camera/CutsceneCamera_Interp_Unused.s,CutsceneCamera_Interp_Unused,0x80163334,0xCB asm/non_matchings/code/cutscene_camera/func_80163660.s,func_80163660,0x80163660,0x28 asm/non_matchings/code/z_kaleido_manager/func_80163700.s,func_80163700,0x80163700,0x16 asm/non_matchings/code/z_kaleido_manager/func_80163758.s,func_80163758,0x80163758,0x17