From 1149530c92419eb808861496671f1dfaf85e00fb Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Thu, 12 Jan 2023 16:06:31 -0500 Subject: [PATCH] DbCamera to DebugCamera (#1482) * better dbCam prefix * missed some * PR Suggestions * alignment * more debug * cleanup --- include/functions.h | 41 +- include/regs.h | 2 +- include/variables.h | 2 +- include/z64camera.h | 28 +- src/code/db_camera.c | 1899 +++++++++-------- src/code/z_actor.c | 10 +- src/code/z_camera.c | 64 +- src/code/z_camera_data.inc.c | 4 +- src/code/z_debug.c | 62 +- src/code/z_demo.c | 2 +- src/code/z_play.c | 2 +- src/overlays/actors/ovl_En_Holl/z_en_holl.c | 2 +- src/overlays/actors/ovl_En_Ko/z_en_ko.c | 4 +- src/overlays/actors/ovl_En_Md/z_en_md.c | 2 +- .../actors/ovl_player_actor/z_player.c | 2 +- 15 files changed, 1050 insertions(+), 1076 deletions(-) diff --git a/include/functions.h b/include/functions.h index e7fe35e57e..38fd36dfba 100644 --- a/include/functions.h +++ b/include/functions.h @@ -761,8 +761,8 @@ u8 CollisionCheck_GetSwordDamage(s32 dmgFlags); void SaveContext_Init(void); s32 func_800635D0(s32); void Regs_Init(void); -void DbCamera_ScreenText(u8 x, u8 y, const char* text); -void DbCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text); +void DebugCamera_ScreenText(u8 x, u8 y, const char* text); +void DebugCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text); void Regs_UpdateEditor(Input* input); void Debug_DrawText(GraphicsContext* gfxCtx); void DebugDisplay_Init(void); @@ -1252,39 +1252,10 @@ u32 Letterbox_GetSize(void); void Letterbox_Init(void); void Letterbox_Destroy(void); void Letterbox_Update(s32 updateRate); -// ? DbCamera_AddVecGeoToVec3f(?); -// ? DbCamera_CalcUpFromPitchYawRoll(?); -// ? DbCamera_SetTextValue(?); -// ? DbCamera_Vec3SToF(?); -// ? DbCamera_Vec3FToS(?); -// ? DbCamera_CopyVec3f(?); -// ? DbCamera_Vec3SToF2(?); -// ? func_800B3F94(?); -// ? func_800B3FF4(?); -// ? func_800B404C(?); -// ? func_800B4088(?); -// ? func_800B41DC(?); -// ? func_800B42C0(?); -// ? func_800B4370(?); -// ? func_800B44E0(?); -// ? DbCamera_PrintPoints(?); -// ? DbCamera_PrintF32Bytes(?); -// ? DbCamera_PrintU16Bytes(?); -// ? DbCamera_PrintS16Bytes(?); -// ? DbCamera_PrintCutBytes(?); -void DbCamera_Init(DbCamera* dbCamera, Camera* cameraPtr); -void DbgCamera_Enable(DbCamera* dbCamera, Camera* cam); -void DbCamera_Update(DbCamera* dbCamera, Camera* cam); -// ? DbCamera_GetFirstAvailableLetter(?); -// ? DbCamera_InitCut(?); -// ? DbCamera_ResetCut(?); -// ? DbCamera_CalcMempakAllocSize(?); -// ? DbCamera_GetMempakAllocSize(?); -// ? DbCamera_DrawSlotLetters(?); -// ? DbCamera_PrintAllCuts(?); -// ? func_800B91B0(?); -void DbCamera_Reset(Camera* cam, DbCamera* dbCam); -// ? DbCamera_UpdateDemoControl(?); +void DebugCamera_Init(DebugCam* debugCam, Camera* cameraPtr); +void DebugCamera_Enable(DebugCam* debugCam, Camera* cam); +void DebugCamera_Update(DebugCam* debugCam, Camera* cam); +void DebugCamera_Reset(Camera* cam, DebugCam* debugCam); void func_800BB0A0(f32 u, Vec3f* pos, f32* roll, f32* viewAngle, f32* point0, f32* point1, f32* point2, f32* point3); s32 func_800BB2B4(Vec3f* pos, f32* roll, f32* fov, CutsceneCameraPoint* point, s16* keyFrame, f32* curFrame); void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl); diff --git a/include/regs.h b/include/regs.h index 1296593ca6..732f16ac0c 100644 --- a/include/regs.h +++ b/include/regs.h @@ -91,7 +91,7 @@ #define R_CAM_YOFFSET_NORM OREG(46) #define R_CAM_DATA(type) PREG(0 + (type)) #define R_CAM_PARALLEL_LOCKON_CALC_SLOPE_Y_ADJ PREG(76) -#define R_DBG_CAM_UPDATE PREG(80) +#define R_DEBUG_CAM_UPDATE PREG(80) #define R_DBG_REG_UPDATE PREG(82) #define R_RELOAD_CAM_PARAMS QREG(0) #define R_SCENE_CAM_TYPE YREG(15) diff --git a/include/variables.h b/include/variables.h index c0fcc8dc4f..b57e8f7d73 100644 --- a/include/variables.h +++ b/include/variables.h @@ -55,7 +55,7 @@ extern EffectSsOverlay gEffectSsOverlayTable[EFFECT_SS_TYPE_MAX]; extern Gfx D_80116280[]; extern ActorOverlay gActorOverlayTable[ACTOR_ID_MAX]; // original name: "actor_dlftbls" 801162A0 extern s32 gMaxActorId; // original name: "MaxProfile" -extern s32 gDbgCamEnabled; +extern s32 gDebugCamEnabled; extern GameStateOverlay gGameStateOverlayTable[6]; extern u8 gWeatherMode; extern u8 gLightConfigAfterUnderwater; diff --git a/include/z64camera.h b/include/z64camera.h index 82fe5c5d72..b98bb2e001 100644 --- a/include/z64camera.h +++ b/include/z64camera.h @@ -1628,7 +1628,7 @@ typedef struct { /* 0x1046 */ s16 demoCtrlActionIdx; // e (?), s (save), l (load), c (clear) /* 0x1048 */ s16 demoCtrlToggleSwitch; /* 0x104A */ Vec3s unk_104A; -} DbCameraSub; // size = 0x1050 +} DebugCamSub; // size = 0x1050 typedef struct { /* 0x00 */ s32 unk_00; @@ -1650,8 +1650,8 @@ typedef struct { /* 0x6C */ Vec3f unk_6C; /* 0x78 */ s16 unk_78; /* 0x7A */ s16 unk_7A; - /* 0x7C */ DbCameraSub sub; -} DbCamera; // size = 0x10CC + /* 0x7C */ DebugCamSub sub; +} DebugCam; // size = 0x10CC typedef struct { /* 0x00 */ char letter; @@ -1661,7 +1661,7 @@ typedef struct { /* 0x08 */ CutsceneCameraPoint* lookAt; /* 0x0C */ s16 nFrames; /* 0x0E */ s16 nPoints; -} DbCameraCut; // size = 0x10 +} DebugCamCut; // size = 0x10 typedef struct { /* 0x00 */ f32 curFrame; @@ -1673,17 +1673,17 @@ typedef struct { /* 0x1C */ Vec3f lookAtPos; /* 0x28 */ f32 roll; /* 0x2C */ f32 fov; -} DbCameraAnim; // size = 0x30 +} DebugCamAnim; // size = 0x30 typedef enum { - /* 0 */ DBCAMERA_TEXT_YELLOW, - /* 1 */ DBCAMERA_TEXT_PEACH, - /* 2 */ DBCAMERA_TEXT_BROWN, - /* 3 */ DBCAMERA_TEXT_ORANGE, - /* 4 */ DBCAMERA_TEXT_GOLD, - /* 5 */ DBCAMERA_TEXT_WHITE, - /* 6 */ DBCAMERA_TEXT_BLUE, - /* 7 */ DBCAMERA_TEXT_GREEN -} DbCameraTextColor; + /* 0 */ DEBUG_CAM_TEXT_YELLOW, + /* 1 */ DEBUG_CAM_TEXT_PEACH, + /* 2 */ DEBUG_CAM_TEXT_BROWN, + /* 3 */ DEBUG_CAM_TEXT_ORANGE, + /* 4 */ DEBUG_CAM_TEXT_GOLD, + /* 5 */ DEBUG_CAM_TEXT_WHITE, + /* 6 */ DEBUG_CAM_TEXT_BLUE, + /* 7 */ DEBUG_CAM_TEXT_GREEN +} DebugCamTextColor; #endif diff --git a/src/code/db_camera.c b/src/code/db_camera.c index ff7efdddda..b2d5bc9df4 100644 --- a/src/code/db_camera.c +++ b/src/code/db_camera.c @@ -1,6 +1,6 @@ #include "global.h" -#define DBCAM_CONTROLLER_PORT 2 +#define DEBUG_CAM_CONTROLLER_PORT 2 static PlayState* sPlay; @@ -86,16 +86,16 @@ char D_8012D0F8[] = GFXP_HIRAGANA "Yカイテン \0\0"; #define DEMO_CTRL_MENU(actionIdx, menuIdx) (actionIdx * 100 + menuIdx) -s32 DbCamera_SaveCallback(char* c); -s32 DbCamera_LoadCallback(char* c); -s32 DbCamera_ClearCallback(char* c); -s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam); +s32 DebugCamera_SaveCallback(char* c); +s32 DebugCamera_LoadCallback(char* c); +s32 DebugCamera_ClearCallback(char* c); +s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam); -static DbCamera* sDbCamPtr; +static DebugCam* sDebugCamPtr; static s16 D_8016110C; -static DbCameraAnim sDbCamAnim; +static DebugCamAnim sDebugCamAnim; -Vec3f* DbCamera_AddVecGeoToVec3f(Vec3f* dest, Vec3f* a, VecGeo* geo) { +Vec3f* DebugCamera_AddVecGeoToVec3f(Vec3f* dest, Vec3f* a, VecGeo* geo) { Vec3f sum; Vec3f b; @@ -113,7 +113,7 @@ Vec3f* DbCamera_AddVecGeoToVec3f(Vec3f* dest, Vec3f* a, VecGeo* geo) { /** * Calculates a new Up vector from the pitch, yaw, roll */ -Vec3f* DbCamera_CalcUpFromPitchYawRoll(Vec3f* viewUp, s16 pitch, s16 yaw, s16 roll) { +Vec3f* DebugCamera_CalcUpFromPitchYawRoll(Vec3f* viewUp, s16 pitch, s16 yaw, s16 roll) { f32 sinP = Math_SinS(pitch); f32 cosP = Math_CosS(pitch); f32 sinY = Math_SinS(yaw); @@ -160,7 +160,7 @@ Vec3f* DbCamera_CalcUpFromPitchYawRoll(Vec3f* viewUp, s16 pitch, s16 yaw, s16 ro return viewUp; } -char* DbCamera_SetTextValue(s16 value, char* str, u8 endIdx) { +char* DebugCamera_SetTextValue(s16 value, char* str, u8 endIdx) { char* strIter; char sign; @@ -193,25 +193,25 @@ char* DbCamera_SetTextValue(s16 value, char* str, u8 endIdx) { return strIter; } -void DbCamera_Vec3SToF(Vec3s* in, Vec3f* out) { +void DebugCamera_Vec3SToF(Vec3s* in, Vec3f* out) { out->x = in->x; out->y = in->y; out->z = in->z; } -void DbCamera_Vec3FToS(Vec3f* in, Vec3s* out) { +void DebugCamera_Vec3FToS(Vec3f* in, Vec3s* out) { out->x = in->x; out->y = in->y; out->z = in->z; } -void DbCamera_CopyVec3f(Vec3f* in, Vec3f* out) { +void DebugCamera_CopyVec3f(Vec3f* in, Vec3f* out) { out->x = in->x; out->y = in->y; out->z = in->z; } -void DbCamera_Vec3SToF2(Vec3s* in, Vec3f* out) { +void DebugCamera_Vec3SToF2(Vec3s* in, Vec3f* out) { out->x = in->x; out->y = in->y; out->z = in->z; @@ -224,194 +224,194 @@ void func_800B3F94(PosRot* posRot, Vec3f* vec, Vec3s* out) { OLib_Vec3fDiffToVecGeo(&geo, &posRot->pos, vec); geo.yaw -= posRot->rot.y; OLib_VecGeoToVec3f(&tempVec, &geo); - DbCamera_Vec3FToS(&tempVec, out); + DebugCamera_Vec3FToS(&tempVec, out); } void func_800B3FF4(PosRot* posRot, Vec3f* vec, Vec3f* out) { VecGeo geo; Vec3f tempVec; - DbCamera_CopyVec3f(vec, &tempVec); + DebugCamera_CopyVec3f(vec, &tempVec); OLib_Vec3fToVecGeo(&geo, &tempVec); geo.yaw += posRot->rot.y; - DbCamera_AddVecGeoToVec3f(out, &posRot->pos, &geo); + DebugCamera_AddVecGeoToVec3f(out, &posRot->pos, &geo); } void func_800B404C(PosRot* posRot, Vec3s* vec, Vec3f* out) { Vec3f tempVec; - DbCamera_Vec3SToF(vec, &tempVec); + DebugCamera_Vec3SToF(vec, &tempVec); func_800B3FF4(posRot, &tempVec, out); } -s32 func_800B4088(DbCamera* dbCamera, Camera* cam) { +s32 func_800B4088(DebugCam* debugCam, Camera* cam) { CutsceneCameraPoint* position; CutsceneCameraPoint* lookAt; s32 i; - position = &dbCamera->sub.position[dbCamera->sub.unkIdx]; - lookAt = &dbCamera->sub.lookAt[dbCamera->sub.unkIdx]; + position = &debugCam->sub.position[debugCam->sub.unkIdx]; + lookAt = &debugCam->sub.lookAt[debugCam->sub.unkIdx]; position->continueFlag = CS_CAM_STOP; lookAt->continueFlag = position->continueFlag; position->nextPointFrame = 0; lookAt->nextPointFrame = 30; - lookAt->cameraRoll = position->cameraRoll = dbCamera->roll * (360.0f / 256.0f); - lookAt->viewAngle = position->viewAngle = dbCamera->fov; + lookAt->cameraRoll = position->cameraRoll = debugCam->roll * (360.0f / 256.0f); + lookAt->viewAngle = position->viewAngle = debugCam->fov; - if (dbCamera->sub.mode != 1) { - DbCamera_Vec3FToS(&dbCamera->eye, &position->pos); - DbCamera_Vec3FToS(&dbCamera->at, &lookAt->pos); + if (debugCam->sub.mode != 1) { + DebugCamera_Vec3FToS(&debugCam->eye, &position->pos); + DebugCamera_Vec3FToS(&debugCam->at, &lookAt->pos); } else { - func_800B3F94(&cam->playerPosRot, &dbCamera->at, &lookAt->pos); - func_800B3F94(&cam->playerPosRot, &dbCamera->eye, &position->pos); + func_800B3F94(&cam->playerPosRot, &debugCam->at, &lookAt->pos); + func_800B3F94(&cam->playerPosRot, &debugCam->eye, &position->pos); } - for (i = 0; i < (dbCamera->sub.nPoints - 2); i++) { - dbCamera->sub.position[i].continueFlag = dbCamera->sub.lookAt[i].continueFlag = CS_CAM_CONTINUE; + for (i = 0; i < (debugCam->sub.nPoints - 2); i++) { + debugCam->sub.position[i].continueFlag = debugCam->sub.lookAt[i].continueFlag = CS_CAM_CONTINUE; } - dbCamera->sub.position[i].continueFlag = dbCamera->sub.lookAt[i].continueFlag = CS_CAM_STOP; + debugCam->sub.position[i].continueFlag = debugCam->sub.lookAt[i].continueFlag = CS_CAM_STOP; - return dbCamera->sub.unkIdx; + return debugCam->sub.unkIdx; } -s16 func_800B41DC(DbCamera* dbCamera, s16 idx, Camera* cameraPtr) { - CutsceneCameraPoint* position = &dbCamera->sub.position[idx]; - CutsceneCameraPoint* lookAt = &dbCamera->sub.lookAt[idx]; +s16 func_800B41DC(DebugCam* debugCam, s16 idx, Camera* cameraPtr) { + CutsceneCameraPoint* position = &debugCam->sub.position[idx]; + CutsceneCameraPoint* lookAt = &debugCam->sub.lookAt[idx]; - if (dbCamera->sub.mode != 1) { - DbCamera_Vec3SToF2(&position->pos, &dbCamera->eye); - DbCamera_Vec3SToF2(&lookAt->pos, &dbCamera->at); + if (debugCam->sub.mode != 1) { + DebugCamera_Vec3SToF2(&position->pos, &debugCam->eye); + DebugCamera_Vec3SToF2(&lookAt->pos, &debugCam->at); } else { - func_800B404C(&cameraPtr->playerPosRot, &lookAt->pos, &dbCamera->at); - func_800B404C(&cameraPtr->playerPosRot, &position->pos, &dbCamera->eye); + func_800B404C(&cameraPtr->playerPosRot, &lookAt->pos, &debugCam->at); + func_800B404C(&cameraPtr->playerPosRot, &position->pos, &debugCam->eye); } - dbCamera->roll = lookAt->cameraRoll; - dbCamera->rollDegrees = dbCamera->roll * (360.0f / 256.0f); - dbCamera->fov = lookAt->viewAngle; + debugCam->roll = lookAt->cameraRoll; + debugCam->rollDegrees = debugCam->roll * (360.0f / 256.0f); + debugCam->fov = lookAt->viewAngle; return idx; } -s32 func_800B42C0(DbCamera* dbCamera, Camera* cameraPtr) { +s32 func_800B42C0(DebugCam* debugCam, Camera* cameraPtr) { - CutsceneCameraPoint* position = &dbCamera->sub.position[dbCamera->sub.unkIdx]; - CutsceneCameraPoint* lookAt = &dbCamera->sub.lookAt[dbCamera->sub.unkIdx]; + CutsceneCameraPoint* position = &debugCam->sub.position[debugCam->sub.unkIdx]; + CutsceneCameraPoint* lookAt = &debugCam->sub.lookAt[debugCam->sub.unkIdx]; position->continueFlag = lookAt->continueFlag = CS_CAM_CONTINUE; - if (dbCamera->sub.mode != 1) { - DbCamera_Vec3FToS(&dbCamera->eye, &position->pos); - DbCamera_Vec3FToS(&dbCamera->at, &lookAt->pos); + if (debugCam->sub.mode != 1) { + DebugCamera_Vec3FToS(&debugCam->eye, &position->pos); + DebugCamera_Vec3FToS(&debugCam->at, &lookAt->pos); } else { - func_800B3F94(&cameraPtr->playerPosRot, &dbCamera->at, &lookAt->pos); - func_800B3F94(&cameraPtr->playerPosRot, &dbCamera->eye, &position->pos); + func_800B3F94(&cameraPtr->playerPosRot, &debugCam->at, &lookAt->pos); + func_800B3F94(&cameraPtr->playerPosRot, &debugCam->eye, &position->pos); } - return dbCamera->sub.unkIdx; + return debugCam->sub.unkIdx; } -s32 func_800B4370(DbCamera* dbCamera, s16 idx, Camera* cam) { - CutsceneCameraPoint* lookAt = &dbCamera->sub.lookAt[idx]; - CutsceneCameraPoint* position = &dbCamera->sub.position[idx]; +s32 func_800B4370(DebugCam* debugCam, s16 idx, Camera* cam) { + CutsceneCameraPoint* lookAt = &debugCam->sub.lookAt[idx]; + CutsceneCameraPoint* position = &debugCam->sub.position[idx]; VecGeo geo; Vec3f at; - if (dbCamera->sub.mode != 1) { - if (dbCamera->sub.unk_0C) { - DbCamera_Vec3SToF2(&position->pos, &dbCamera->at); + if (debugCam->sub.mode != 1) { + if (debugCam->sub.unk_0C) { + DebugCamera_Vec3SToF2(&position->pos, &debugCam->at); } else { - DbCamera_Vec3SToF2(&lookAt->pos, &dbCamera->at); + DebugCamera_Vec3SToF2(&lookAt->pos, &debugCam->at); } } else { - if (dbCamera->sub.unk_0C) { + if (debugCam->sub.unk_0C) { func_800B404C(&cam->playerPosRot, &position->pos, &at); } else { func_800B404C(&cam->playerPosRot, &lookAt->pos, &at); } - dbCamera->at = at; + debugCam->at = at; } geo.pitch = 0x2000; geo.yaw -= 0x7FFF; geo.r = 250.0f; - DbCamera_AddVecGeoToVec3f(&dbCamera->eye, &dbCamera->at, &geo); - dbCamera->roll = lookAt->cameraRoll; - dbCamera->rollDegrees = dbCamera->roll * (360.0f / 256.0f); - dbCamera->fov = lookAt->viewAngle; + DebugCamera_AddVecGeoToVec3f(&debugCam->eye, &debugCam->at, &geo); + debugCam->roll = lookAt->cameraRoll; + debugCam->rollDegrees = debugCam->roll * (360.0f / 256.0f); + debugCam->fov = lookAt->viewAngle; return idx; } -void func_800B44E0(DbCamera* dbCamera, Camera* cam) { +void func_800B44E0(DebugCam* debugCam, Camera* cam) { s32 i; - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_CRIGHT)) { - sDbCamAnim.keyframe = 0; - sDbCamAnim.unk_0A = 1; - sDbCamAnim.curFrame = 0.0f; - sDbCamAnim.unk_04 = 0; + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CRIGHT)) { + sDebugCamAnim.keyframe = 0; + sDebugCamAnim.unk_0A = 1; + sDebugCamAnim.curFrame = 0.0f; + sDebugCamAnim.unk_04 = 0; - for (i = 0; i < (dbCamera->sub.nPoints - 2); i++) { - dbCamera->sub.position[i].continueFlag = dbCamera->sub.lookAt[i].continueFlag = CS_CAM_CONTINUE; + for (i = 0; i < (debugCam->sub.nPoints - 2); i++) { + debugCam->sub.position[i].continueFlag = debugCam->sub.lookAt[i].continueFlag = CS_CAM_CONTINUE; } - dbCamera->sub.position[i].continueFlag = dbCamera->sub.lookAt[i].continueFlag = CS_CAM_STOP; + debugCam->sub.position[i].continueFlag = debugCam->sub.lookAt[i].continueFlag = CS_CAM_STOP; } - if (dbCamera->sub.nPoints < 6) { - if (sDbCamAnim.unk_0A != 0) { + if (debugCam->sub.nPoints < 6) { + if (sDebugCamAnim.unk_0A != 0) { Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - sDbCamAnim.unk_0A = 0; + sDebugCamAnim.unk_0A = 0; } - DbCamera_ScreenTextColored(17, 23, DBCAMERA_TEXT_ORANGE, D_8012CEE0[0]); - DbCamera_ScreenTextColored(18, 24, DBCAMERA_TEXT_ORANGE, D_8012CEE4); - DbCamera_ScreenTextColored(16, 26, DBCAMERA_TEXT_PEACH, D_8012CEE8); + DebugCamera_ScreenTextColored(17, 23, DEBUG_CAM_TEXT_ORANGE, D_8012CEE0[0]); + DebugCamera_ScreenTextColored(18, 24, DEBUG_CAM_TEXT_ORANGE, D_8012CEE4); + DebugCamera_ScreenTextColored(16, 26, DEBUG_CAM_TEXT_PEACH, D_8012CEE8); return; } - if (!func_800BB2B4(&sDbCamAnim.positionPos, &sDbCamAnim.roll, &sDbCamAnim.fov, dbCamera->sub.position, - &sDbCamAnim.keyframe, &sDbCamAnim.curFrame) && - !func_800BB2B4(&sDbCamAnim.lookAtPos, &sDbCamAnim.roll, &sDbCamAnim.fov, dbCamera->sub.lookAt, - &sDbCamAnim.keyframe, &sDbCamAnim.curFrame) && - sDbCamAnim.unk_0A == 1) { + if (!func_800BB2B4(&sDebugCamAnim.positionPos, &sDebugCamAnim.roll, &sDebugCamAnim.fov, debugCam->sub.position, + &sDebugCamAnim.keyframe, &sDebugCamAnim.curFrame) && + !func_800BB2B4(&sDebugCamAnim.lookAtPos, &sDebugCamAnim.roll, &sDebugCamAnim.fov, debugCam->sub.lookAt, + &sDebugCamAnim.keyframe, &sDebugCamAnim.curFrame) && + sDebugCamAnim.unk_0A == 1) { Audio_PlaySfxGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - sDbCamAnim.unk_04++; + sDebugCamAnim.unk_04++; - if (dbCamera->sub.nFrames > 0 && dbCamera->sub.nFrames < sDbCamAnim.unk_04) { - sDbCamAnim.unk_0A = 0; - DbCamera_ScreenTextColored(15, 26, DBCAMERA_TEXT_PEACH, D_8012CEEC); + if (debugCam->sub.nFrames > 0 && debugCam->sub.nFrames < sDebugCamAnim.unk_04) { + sDebugCamAnim.unk_0A = 0; + DebugCamera_ScreenTextColored(15, 26, DEBUG_CAM_TEXT_PEACH, D_8012CEEC); } - if (dbCamera->sub.mode != 1) { - DbCamera_CopyVec3f(&sDbCamAnim.positionPos, &dbCamera->eye); - DbCamera_CopyVec3f(&sDbCamAnim.lookAtPos, &dbCamera->at); + if (debugCam->sub.mode != 1) { + DebugCamera_CopyVec3f(&sDebugCamAnim.positionPos, &debugCam->eye); + DebugCamera_CopyVec3f(&sDebugCamAnim.lookAtPos, &debugCam->at); } else { - func_800B3FF4(&cam->playerPosRot, &sDbCamAnim.lookAtPos, &dbCamera->at); - func_800B3FF4(&cam->playerPosRot, &sDbCamAnim.positionPos, &dbCamera->eye); + func_800B3FF4(&cam->playerPosRot, &sDebugCamAnim.lookAtPos, &debugCam->at); + func_800B3FF4(&cam->playerPosRot, &sDebugCamAnim.positionPos, &debugCam->eye); } - dbCamera->fov = sDbCamAnim.fov; - dbCamera->roll = sDbCamAnim.roll; - dbCamera->rollDegrees = sDbCamAnim.roll * (360.0f / 256.0f); + debugCam->fov = sDebugCamAnim.fov; + debugCam->roll = sDebugCamAnim.roll; + debugCam->rollDegrees = sDebugCamAnim.roll * (360.0f / 256.0f); - DbCamera_SetTextValue(sDbCamAnim.unk_04, &D_8012CFB4[8], 4); - DbCamera_ScreenTextColored(16, 23, DBCAMERA_TEXT_ORANGE, D_8012CFB4); - D_8012CFC4[5] = ((sDbCamAnim.keyframe + 1) / 10) + '0'; - D_8012CFC4[6] = ((sDbCamAnim.keyframe + 1) % 10) + '0'; - D_8012CFC4[8] = ((dbCamera->sub.nPoints - 5) / 10) + '0'; - D_8012CFC4[9] = ((dbCamera->sub.nPoints - 5) % 10) + '0'; - DbCamera_ScreenTextColored(16, 24, DBCAMERA_TEXT_ORANGE, D_8012CFC4); - DbCamera_ScreenTextColored(16, 26, DBCAMERA_TEXT_PEACH, D_8012CEF0); + DebugCamera_SetTextValue(sDebugCamAnim.unk_04, &D_8012CFB4[8], 4); + DebugCamera_ScreenTextColored(16, 23, DEBUG_CAM_TEXT_ORANGE, D_8012CFB4); + D_8012CFC4[5] = ((sDebugCamAnim.keyframe + 1) / 10) + '0'; + D_8012CFC4[6] = ((sDebugCamAnim.keyframe + 1) % 10) + '0'; + D_8012CFC4[8] = ((debugCam->sub.nPoints - 5) / 10) + '0'; + D_8012CFC4[9] = ((debugCam->sub.nPoints - 5) % 10) + '0'; + DebugCamera_ScreenTextColored(16, 24, DEBUG_CAM_TEXT_ORANGE, D_8012CFC4); + DebugCamera_ScreenTextColored(16, 26, DEBUG_CAM_TEXT_PEACH, D_8012CEF0); return; } - sDbCamAnim.unk_0A = 0; - DbCamera_ScreenTextColored(15, 26, DBCAMERA_TEXT_PEACH, D_8012CEEC); + sDebugCamAnim.unk_0A = 0; + DebugCamera_ScreenTextColored(15, 26, DEBUG_CAM_TEXT_PEACH, D_8012CEEC); } -void DbCamera_PrintPoints(const char* name, s16 count, CutsceneCameraPoint* points) { +void DebugCamera_PrintPoints(const char* name, s16 count, CutsceneCameraPoint* points) { s32 i; osSyncPrintf("@@@static SplinedatZ %s[] = {\n", name); @@ -427,14 +427,14 @@ void DbCamera_PrintPoints(const char* name, s16 count, CutsceneCameraPoint* poin osSyncPrintf("@@@};\n@@@\n"); } -void DbCamera_PrintF32Bytes(f32 value) { +void DebugCamera_PrintF32Bytes(f32 value) { f32 b = value; char* a = (char*)&b; osSyncPrintf("\n@@@%d,%d,%d,%d,", a[0], a[1], a[2], a[3]); } -void DbCamera_PrintU16Bytes(u16 value) { +void DebugCamera_PrintU16Bytes(u16 value) { u16 pad; u16 b = value; char* a = (char*)&b; @@ -442,7 +442,7 @@ void DbCamera_PrintU16Bytes(u16 value) { osSyncPrintf("\n@@@%d,%d,", a[0], a[1]); } -void DbCamera_PrintS16Bytes(s16 value) { +void DebugCamera_PrintS16Bytes(s16 value) { u16 pad; s16 b = value; char* a = (char*)&b; @@ -450,7 +450,7 @@ void DbCamera_PrintS16Bytes(s16 value) { osSyncPrintf("\n@@@%d,%d,", a[0], a[1]); } -void DbCamera_PrintCutBytes(DbCameraCut* cut) { +void DebugCamera_PrintCutBytes(DebugCamCut* cut) { CutsceneCameraPoint* point; CutsceneCameraPoint* points; s32 i; @@ -460,7 +460,7 @@ void DbCamera_PrintCutBytes(DbCameraCut* cut) { osSyncPrintf("\n@@@ 0,1,\t/* dousa\t*/"); osSyncPrintf("\n@@@ 0,0,\t/* Start Flame\t*/"); - DbCamera_PrintU16Bytes(cut->nFrames); + DebugCamera_PrintU16Bytes(cut->nFrames); osSyncPrintf("\t/* End Flame\t*/"); osSyncPrintf("\n@@@0,0,\t/* Dammy\t*/\n@@@ "); @@ -468,15 +468,15 @@ void DbCamera_PrintCutBytes(DbCameraCut* cut) { point = points + i; osSyncPrintf("\n@@@ %d, /* code */", point->continueFlag); osSyncPrintf("\n@@@ %d, /* z */", point->cameraRoll); - DbCamera_PrintU16Bytes(point->nextPointFrame); + DebugCamera_PrintU16Bytes(point->nextPointFrame); osSyncPrintf("\t/* sokudo\t*/"); - DbCamera_PrintF32Bytes(point->viewAngle); + DebugCamera_PrintF32Bytes(point->viewAngle); osSyncPrintf("\t/* zoom\t*/"); - DbCamera_PrintS16Bytes(point->pos.x); + DebugCamera_PrintS16Bytes(point->pos.x); osSyncPrintf("\t/* x pos\t*/"); - DbCamera_PrintS16Bytes(point->pos.y); + DebugCamera_PrintS16Bytes(point->pos.y); osSyncPrintf("\t/* y pos\t*/"); - DbCamera_PrintS16Bytes(point->pos.z); + DebugCamera_PrintS16Bytes(point->pos.z); osSyncPrintf("\t/* z pos\t*/\n"); osSyncPrintf("\n@@@0,0,\t/* Dammy\t*/\n@@@ "); } @@ -486,7 +486,7 @@ void DbCamera_PrintCutBytes(DbCameraCut* cut) { osSyncPrintf("\n@@@ 0,1,\t/* dousa\t*/"); osSyncPrintf("\n@@@ 0,0,\t/* Start Flame\t*/"); - DbCamera_PrintU16Bytes(cut->nFrames); + DebugCamera_PrintU16Bytes(cut->nFrames); osSyncPrintf("\t/* End Flame\t*/"); osSyncPrintf("\n@@@0,0,\t/* Dammy\t*/\n@@@ "); @@ -494,68 +494,68 @@ void DbCamera_PrintCutBytes(DbCameraCut* cut) { point = points + i; osSyncPrintf("\n@@@ %d, /* code */", point->continueFlag); osSyncPrintf("\n@@@ %d, /* z */", point->cameraRoll); - DbCamera_PrintU16Bytes(point->nextPointFrame); + DebugCamera_PrintU16Bytes(point->nextPointFrame); osSyncPrintf("\t/* sokudo\t*/"); - DbCamera_PrintF32Bytes(point->viewAngle); + DebugCamera_PrintF32Bytes(point->viewAngle); osSyncPrintf("\t/* zoom\t*/"); - DbCamera_PrintS16Bytes(point->pos.x); + DebugCamera_PrintS16Bytes(point->pos.x); osSyncPrintf("\t/* x pos\t*/"); - DbCamera_PrintS16Bytes(point->pos.y); + DebugCamera_PrintS16Bytes(point->pos.y); osSyncPrintf("\t/* y pos\t*/"); - DbCamera_PrintS16Bytes(point->pos.z); + DebugCamera_PrintS16Bytes(point->pos.z); osSyncPrintf("\t/* z pos\t*/"); osSyncPrintf("\n@@@0,0,\t/* Dammy\t*/\n@@@ "); } } -void DbCamera_Init(DbCamera* dbCamera, Camera* cameraPtr) { - dbCamera->sub.unk_104A.z = 0; - dbCamera->unk_44 = 0; - dbCamera->unk_00 = 0; - dbCamera->unk_34 = 0; - dbCamera->unk_3C = false; - dbCamera->unk_38 = -1; - dbCamera->unk_40 = -1; - dbCamera->roll = 0; - dbCamera->sub.unk_104A.y = dbCamera->sub.unk_104A.z; - dbCamera->sub.unk_104A.x = dbCamera->sub.unk_104A.z; - dbCamera->fov = 0.0f; - dbCamera->rollDegrees = 0.0f; +void DebugCamera_Init(DebugCam* debugCam, Camera* cameraPtr) { + debugCam->sub.unk_104A.z = 0; + debugCam->unk_44 = 0; + debugCam->unk_00 = 0; + debugCam->unk_34 = 0; + debugCam->unk_3C = false; + debugCam->unk_38 = -1; + debugCam->unk_40 = -1; + debugCam->roll = 0; + debugCam->sub.unk_104A.y = debugCam->sub.unk_104A.z; + debugCam->sub.unk_104A.x = debugCam->sub.unk_104A.z; + debugCam->fov = 0.0f; + debugCam->rollDegrees = 0.0f; sPlay = cameraPtr->play; - dbCamera->sub.mode = 0; - dbCamera->sub.nFrames = -1; - dbCamera->sub.nPoints = 1; - dbCamera->sub.unkIdx = 0; - dbCamera->sub.unk_08 = 0; - dbCamera->sub.unk_0A = 0; - dbCamera->unk_78 = 0; - dbCamera->unk_7A = 0; - dbCamera->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_INFO); - dbCamera->sub.demoCtrlActionIdx = ACTION_E; - dbCamera->sub.demoCtrlToggleSwitch = 0; - dbCamera->unk_6C.x = 0; - dbCamera->unk_6C.y = 0; - dbCamera->unk_6C.z = 0; + debugCam->sub.mode = 0; + debugCam->sub.nFrames = -1; + debugCam->sub.nPoints = 1; + debugCam->sub.unkIdx = 0; + debugCam->sub.unk_08 = 0; + debugCam->sub.unk_0A = 0; + debugCam->unk_78 = 0; + debugCam->unk_7A = 0; + debugCam->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_INFO); + debugCam->sub.demoCtrlActionIdx = ACTION_E; + debugCam->sub.demoCtrlToggleSwitch = 0; + debugCam->unk_6C.x = 0; + debugCam->unk_6C.y = 0; + debugCam->unk_6C.z = 0; } -void DbgCamera_Enable(DbCamera* dbCamera, Camera* cam) { - dbCamera->at = cam->at; - dbCamera->eye = cam->eye; - dbCamera->unk_1C = cam->up; - dbCamera->fov = cam->fov; - dbCamera->roll = 0; - dbCamera->sub.nPoints = 1; - dbCamera->sub.unkIdx = 0; - dbCamera->sub.unk_08 = 0; - dbCamera->sub.unk_0A = 1; - dbCamera->sub.unk_0C = true; - dbCamera->unk_78 = 0; - dbCamera->unk_7A = 0; - dbCamera->rollDegrees = 0.0f; - func_800B4088(dbCamera, cam); +void DebugCamera_Enable(DebugCam* debugCam, Camera* cam) { + debugCam->at = cam->at; + debugCam->eye = cam->eye; + debugCam->unk_1C = cam->up; + debugCam->fov = cam->fov; + debugCam->roll = 0; + debugCam->sub.nPoints = 1; + debugCam->sub.unkIdx = 0; + debugCam->sub.unk_08 = 0; + debugCam->sub.unk_0A = 1; + debugCam->sub.unk_0C = true; + debugCam->unk_78 = 0; + debugCam->unk_7A = 0; + debugCam->rollDegrees = 0.0f; + func_800B4088(debugCam, cam); } -void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { +void DebugCamera_Update(DebugCam* debugCam, Camera* cam) { static s32 D_8012D10C = 100; static s32 D_8012D110 = 0; static s32 D_80161140; // bool @@ -587,55 +587,55 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { s16 spAA; VecGeo spA0; - sp90 = &dbCamera->unk_54; + sp90 = &debugCam->unk_54; temp_s6 = &cam->playerPosRot; at = &cam->at; eye = &cam->eye; *sp90 = temp_s6->pos; - dbCamera->unk_60 = cam->at; - sp80 = &dbCamera->eye; - sp7C = &dbCamera->at; + debugCam->unk_60 = cam->at; + sp80 = &debugCam->eye; + sp7C = &debugCam->at; - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_Z)) { - dbCamera->unk_00++; - dbCamera->unk_00 %= 3; - dbCamera->unk_38 = 1; - dbCamera->unk_44 = 0; - dbCamera->unk_40 = -1; - dbCamera->sub.demoCtrlActionIdx = 0; - sDbCamAnim.unk_0A = 0; + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_Z)) { + debugCam->unk_00++; + debugCam->unk_00 %= 3; + debugCam->unk_38 = 1; + debugCam->unk_44 = 0; + debugCam->unk_40 = -1; + debugCam->sub.demoCtrlActionIdx = 0; + sDebugCamAnim.unk_0A = 0; Audio_PlaySfxGeneral(NA_SE_SY_LOCK_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - } else if (dbCamera->unk_38 == -1) { - dbCamera->unk_38 = 1; + } else if (debugCam->unk_38 == -1) { + debugCam->unk_38 = 1; } else { - dbCamera->unk_38 = 0; + debugCam->unk_38 = 0; } - switch (dbCamera->unk_00) { + switch (debugCam->unk_00) { case 0: - switch (dbCamera->unk_78) { + switch (debugCam->unk_78) { case 0: - sp124 = &dbCamera->unk_60; + sp124 = &debugCam->unk_60; D_80161144 = false; D_80161140 = false; break; case 1: - sp124 = &dbCamera->unk_6C; + sp124 = &debugCam->unk_6C; D_80161144 = false; D_80161140 = false; break; case 2: - sp124 = &dbCamera->unk_54; + sp124 = &debugCam->unk_54; D_80161144 = false; D_80161140 = true; break; } break; case 1: - switch (dbCamera->sub.unk_08) { + switch (debugCam->sub.unk_08) { case 0: - D_80161144 = dbCamera->sub.unk_0C; + D_80161144 = debugCam->sub.unk_0C; if (D_80161144) { sp124 = sp80; } else { @@ -644,7 +644,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { D_80161140 = false; break; case 1: - D_80161144 = dbCamera->sub.unk_0C; + D_80161144 = debugCam->sub.unk_0C; if (D_80161144) { sp124 = sp80; } else { @@ -660,7 +660,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { } break; case 2: - DbCamera_UpdateDemoControl(dbCamera, cam); + DebugCamera_UpdateDemoControl(debugCam, cam); return; default: break; @@ -673,655 +673,657 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { OLib_Vec3fDiffToVecGeo(&sp104, sp80, sp7C); } - if (dbCamera->unk_44 > 100) { - dbCamera->unk_44 = 100; + if (debugCam->unk_44 > 100) { + debugCam->unk_44 = 100; } - new_var2 = ((dbCamera->unk_44 * 0.15f) + 0.2f); + new_var2 = ((debugCam->unk_44 * 0.15f) + 0.2f); temp_f2 = new_var2 * (sp104.r / 100.0f); - if ((dbCamera->unk_38 != 0) || dbCamera->unk_3C) { + if ((debugCam->unk_38 != 0) || debugCam->unk_3C) { if (D_80161144) { *sp80 = *phi_s0; } else { *sp7C = *phi_s0; } - dbCamera->unk_3C = D_80161140; - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_B | BTN_L)) { + debugCam->unk_3C = D_80161140; + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_B | BTN_L)) { sp104.r += temp_f2; if (sp104.r > 30000.0f) { sp104.r = 30000.0f; } - if (dbCamera->unk_40 == 7) { - dbCamera->unk_44++; + if (debugCam->unk_40 == 7) { + debugCam->unk_44++; } else { - dbCamera->unk_44 = 0; + debugCam->unk_44 = 0; } - dbCamera->unk_40 = 7; - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_B)) { + debugCam->unk_40 = 7; + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_B)) { spFC = sp104; spFC.r = temp_f2; if (!D_80161144) { spFC.yaw = sp104.yaw; - DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); + DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); } else { spFC.pitch = -spFC.pitch; spFC.yaw = sp104.yaw - 0x7FFF; - DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); + DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); } - if (dbCamera->unk_40 == 0xB) { - dbCamera->unk_44++; + if (debugCam->unk_40 == 0xB) { + debugCam->unk_44++; } else { - dbCamera->unk_44 = 0; + debugCam->unk_44 = 0; } - dbCamera->unk_40 = 0xB; - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_A | BTN_L)) { + debugCam->unk_40 = 0xB; + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_A | BTN_L)) { sp104.r -= temp_f2; if (sp104.r < 10.0f) { sp104.r = 10.0f; } - if (dbCamera->unk_40 == 8) { - dbCamera->unk_44++; + if (debugCam->unk_40 == 8) { + debugCam->unk_44++; } else { - dbCamera->unk_44 = 0; + debugCam->unk_44 = 0; } - dbCamera->unk_40 = 8; - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_A)) { + debugCam->unk_40 = 8; + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_A)) { spFC = sp104; spFC.r = -temp_f2; if (!D_80161144) { spFC.yaw = sp104.yaw; - DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); + DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); } else { spFC.pitch = -spFC.pitch; spFC.yaw = sp104.yaw - 0x7FFF; - DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); + DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); } - if (dbCamera->unk_40 == 0xC) { - dbCamera->unk_44++; + if (debugCam->unk_40 == 0xC) { + debugCam->unk_44++; } else { - dbCamera->unk_44 = 0; + debugCam->unk_44 = 0; } - dbCamera->unk_40 = 0xC; + debugCam->unk_40 = 0xC; } else { - dbCamera->unk_44 = 0; - dbCamera->unk_40 = -1; + debugCam->unk_44 = 0; + debugCam->unk_40 = -1; } - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_DDOWN | BTN_L)) { + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_DDOWN | BTN_L)) { spFC = sp104; spFC.r = temp_f2; spFC.pitch = 0; if (!D_80161144) { spFC.yaw = sp104.yaw; - DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); + DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); } else { spFC.yaw = sp104.yaw - 0x7FFF; - DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); + DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); } - if (dbCamera->unk_40 == 1) { - dbCamera->unk_44++; + if (debugCam->unk_40 == 1) { + debugCam->unk_44++; } else { - dbCamera->unk_44 = 0; + debugCam->unk_44 = 0; } - dbCamera->unk_40 = 1; - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_DUP | BTN_L)) { + debugCam->unk_40 = 1; + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_DUP | BTN_L)) { spFC = sp104; spFC.r = -temp_f2; spFC.pitch = 0; if (!D_80161144) { spFC.yaw = sp104.yaw; - DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); + DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); } else { spFC.yaw = sp104.yaw - 0x7FFF; - DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); + DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); } - if (dbCamera->unk_40 == 2) { - dbCamera->unk_44++; + if (debugCam->unk_40 == 2) { + debugCam->unk_44++; } else { - dbCamera->unk_44 = 0; + debugCam->unk_44 = 0; } - dbCamera->unk_40 = 2; - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_DUP)) { + debugCam->unk_40 = 2; + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_DUP)) { spFC = sp104; spFC.r = temp_f2; spFC.pitch = 0x3FFF; spFC.yaw = sp104.yaw; if (!D_80161144) { - DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); + DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); } else { - DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); + DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); } - if (dbCamera->unk_40 == 3) { - dbCamera->unk_44++; + if (debugCam->unk_40 == 3) { + debugCam->unk_44++; } else { - dbCamera->unk_44 = 0; + debugCam->unk_44 = 0; } - dbCamera->unk_40 = 3; - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_DDOWN)) { + debugCam->unk_40 = 3; + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_DDOWN)) { spFC = sp104; spFC.r = temp_f2; spFC.pitch = -0x3FFF; spFC.yaw = sp104.yaw; if (!D_80161144) { - DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); + DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); } else { - DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); + DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); } - if (dbCamera->unk_40 == 4) { - dbCamera->unk_44++; + if (debugCam->unk_40 == 4) { + debugCam->unk_44++; } else { - dbCamera->unk_44 = 0; + debugCam->unk_44 = 0; } - dbCamera->unk_40 = 4; - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, (BTN_DRIGHT | BTN_L)) || - CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_DRIGHT)) { + debugCam->unk_40 = 4; + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, (BTN_DRIGHT | BTN_L)) || + CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_DRIGHT)) { spFC = sp104; spFC.r = temp_f2; spFC.pitch = 0; if (!D_80161144) { spFC.yaw = sp104.yaw + 0x3FFF; - DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); + DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); } else { spFC.yaw = sp104.yaw - 0x3FFF; - DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); + DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); } - if (dbCamera->unk_40 == 5) { - dbCamera->unk_44++; + if (debugCam->unk_40 == 5) { + debugCam->unk_44++; } else { - dbCamera->unk_44 = 0; + debugCam->unk_44 = 0; } - dbCamera->unk_40 = 5; - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, (BTN_DLEFT | BTN_L)) || - CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_DLEFT)) { + debugCam->unk_40 = 5; + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, (BTN_DLEFT | BTN_L)) || + CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_DLEFT)) { spFC = sp104; spFC.r = temp_f2; spFC.pitch = 0; if (!D_80161144) { spFC.yaw = sp104.yaw - 0x3FFF; - DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); + DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); } else { spFC.yaw = sp104.yaw + 0x3FFF; - DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); + DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); } - if (dbCamera->unk_40 == 6) { - dbCamera->unk_44++; + if (debugCam->unk_40 == 6) { + debugCam->unk_44++; } else { - dbCamera->unk_44 = 0; + debugCam->unk_44 = 0; } - dbCamera->unk_40 = 6; - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_B | BTN_L)) { + debugCam->unk_40 = 6; + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_B | BTN_L)) { sp104.r = sp104.r + temp_f2; if (sp104.r > 30000.0f) { sp104.r = 30000.0f; } - if (dbCamera->unk_40 == 7) { - dbCamera->unk_44++; + if (debugCam->unk_40 == 7) { + debugCam->unk_44++; } else { - dbCamera->unk_44 = 0; + debugCam->unk_44 = 0; } - dbCamera->unk_40 = 7; - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_B)) { + debugCam->unk_40 = 7; + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_B)) { spFC = sp104; spFC.r = temp_f2; if (!D_80161144) { spFC.yaw = sp104.yaw; - DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); + DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); } else { spFC.pitch = -spFC.pitch; spFC.yaw = sp104.yaw - 0x7FFF; - DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); + DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); } - if (dbCamera->unk_40 == 0xB) { - dbCamera->unk_44++; + if (debugCam->unk_40 == 0xB) { + debugCam->unk_44++; } else { - dbCamera->unk_44 = 0; + debugCam->unk_44 = 0; } - dbCamera->unk_40 = 0xB; - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_A | BTN_L)) { + debugCam->unk_40 = 0xB; + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_A | BTN_L)) { sp104.r -= temp_f2; if (sp104.r < 10.0f) { sp104.r = 10.0f; } - if (dbCamera->unk_40 == 8) { - dbCamera->unk_44++; + if (debugCam->unk_40 == 8) { + debugCam->unk_44++; } else { - dbCamera->unk_44 = 0; + debugCam->unk_44 = 0; } - dbCamera->unk_40 = 8; - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_A)) { + debugCam->unk_40 = 8; + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_A)) { spFC = sp104; spFC.r = -temp_f2; if (!D_80161144) { spFC.yaw = sp104.yaw; - DbCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); + DebugCamera_AddVecGeoToVec3f(sp7C, sp7C, &spFC); } else { spFC.pitch = -spFC.pitch; spFC.yaw = sp104.yaw - 0x7FFF; - DbCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); + DebugCamera_AddVecGeoToVec3f(sp80, sp80, &spFC); } - if (dbCamera->unk_40 == 0xC) { - dbCamera->unk_44++; + if (debugCam->unk_40 == 0xC) { + debugCam->unk_44++; } else { - dbCamera->unk_44 = 0; + debugCam->unk_44 = 0; } - dbCamera->unk_40 = 0xC; + debugCam->unk_40 = 0xC; } else { - dbCamera->unk_44 = 0; - dbCamera->unk_40 = -1; + debugCam->unk_44 = 0; + debugCam->unk_40 = -1; } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_R)) { - if (dbCamera->unk_00 == 0) { - dbCamera->sub.unk_104A = cam->inputDir; + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_R)) { + if (debugCam->unk_00 == 0) { + debugCam->sub.unk_104A = cam->inputDir; *sp7C = cam->at; *sp80 = cam->eye; - dbCamera->unk_1C.x = 0.0f; - dbCamera->unk_1C.z = 0.0f; - dbCamera->unk_1C.y = 1.0f; - } else if (dbCamera->sub.unk_08 == 2) { + debugCam->unk_1C.x = 0.0f; + debugCam->unk_1C.z = 0.0f; + debugCam->unk_1C.y = 1.0f; + } else if (debugCam->sub.unk_08 == 2) { Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - dbCamera->sub.unk_08 = 0; - func_800B41DC(dbCamera, dbCamera->sub.unkIdx, cam); + debugCam->sub.unk_08 = 0; + func_800B41DC(debugCam, debugCam->sub.unkIdx, cam); } else { - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_R) && - CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_L)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_R) && + CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L)) { Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - dbCamera->sub.nPoints = dbCamera->sub.unkIdx + 1; - func_800B4088(dbCamera, cam); - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_R)) { - if (dbCamera->sub.unkIdx == 0x80) { + debugCam->sub.nPoints = debugCam->sub.unkIdx + 1; + func_800B4088(debugCam, cam); + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_R)) { + if (debugCam->sub.unkIdx == 0x80) { Audio_PlaySfxGeneral(NA_SE_SY_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } else { Audio_PlaySfxGeneral(NA_SE_IT_SWORD_PUTAWAY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - func_800B42C0(dbCamera, cam); - if (dbCamera->sub.unkIdx == (dbCamera->sub.nPoints - 1)) { - dbCamera->sub.unkIdx++; - dbCamera->sub.nPoints++; - func_800B4088(dbCamera, cam); + func_800B42C0(debugCam, cam); + if (debugCam->sub.unkIdx == (debugCam->sub.nPoints - 1)) { + debugCam->sub.unkIdx++; + debugCam->sub.nPoints++; + func_800B4088(debugCam, cam); } } } } } else { - temp_f0_5 = sPlay->state.input[DBCAM_CONTROLLER_PORT].rel.stick_y; - temp_f2_2 = sPlay->state.input[DBCAM_CONTROLLER_PORT].rel.stick_x; + temp_f0_5 = sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].rel.stick_y; + temp_f2_2 = sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].rel.stick_x; pitch = CAM_DEG_TO_BINANG((SQ(temp_f0_5) / 600.0f) * 0.8f); yaw = CAM_DEG_TO_BINANG((SQ(temp_f2_2) / 600.0f) * 0.8f); if (!D_80161144) { sp104.pitch += (s16)((temp_f0_5 >= 0.0f) ? pitch : -pitch); sp104.yaw += (s16)((temp_f2_2 >= 0.0f) ? yaw : -yaw); - DbCamera_AddVecGeoToVec3f(sp80, sp7C, &sp104); - dbCamera->sub.unk_104A.x = -sp104.pitch; - dbCamera->sub.unk_104A.y = sp104.yaw - 0x7FFF; + DebugCamera_AddVecGeoToVec3f(sp80, sp7C, &sp104); + debugCam->sub.unk_104A.x = -sp104.pitch; + debugCam->sub.unk_104A.y = sp104.yaw - 0x7FFF; } else { sp104.pitch += (s16)((temp_f0_5 >= 0.0f) ? -pitch : pitch); sp104.yaw += (s16)((temp_f2_2 >= 0.0f) ? -yaw : yaw); - DbCamera_AddVecGeoToVec3f(sp7C, sp80, &sp104); - dbCamera->sub.unk_104A.x = sp104.pitch; - dbCamera->sub.unk_104A.y = sp104.yaw; + DebugCamera_AddVecGeoToVec3f(sp7C, sp80, &sp104); + debugCam->sub.unk_104A.x = sp104.pitch; + debugCam->sub.unk_104A.y = sp104.yaw; } OLib_Vec3fDiffToVecGeo(&spF4, sp80, sp7C); - DbCamera_CalcUpFromPitchYawRoll(&dbCamera->unk_1C, spF4.pitch, spF4.yaw, - CAM_DEG_TO_BINANG(dbCamera->rollDegrees)); - if (dbCamera->unk_00 == 1) { - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_CRIGHT)) { - cam->inputDir = dbCamera->sub.unk_104A; + DebugCamera_CalcUpFromPitchYawRoll(&debugCam->unk_1C, spF4.pitch, spF4.yaw, + CAM_DEG_TO_BINANG(debugCam->rollDegrees)); + if (debugCam->unk_00 == 1) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_CRIGHT)) { + cam->inputDir = debugCam->sub.unk_104A; new_var2 = OLib_Vec3fDist(&cam->at, &cam->eye); cam->at = *sp7C; spFC = sp104; spFC.r = new_var2; - DbCamera_AddVecGeoToVec3f(&cam->eye, &cam->at, &spFC); + DebugCamera_AddVecGeoToVec3f(&cam->eye, &cam->at, &spFC); } } } - if (dbCamera->unk_00 == 1) { + if (debugCam->unk_00 == 1) { OREG(0) = 8; - DbCamera_ScreenTextColored(12, 5, DBCAMERA_TEXT_YELLOW, D_8012CEF4); - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_CRIGHT) && - !CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_L)) { - func_800B44E0(dbCamera, cam); + DebugCamera_ScreenTextColored(12, 5, DEBUG_CAM_TEXT_YELLOW, D_8012CEF4); + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_CRIGHT) && + !CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L)) { + func_800B44E0(debugCam, cam); } else { - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_CRIGHT) && - CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_L)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CRIGHT) && + CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L)) { Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); osSyncPrintf("@@@\n@@@\n@@@/* *** spline point data ** start here *** */\n@@@\n"); - DbCamera_PrintPoints("Lookat", dbCamera->sub.nPoints, dbCamera->sub.lookAt); - DbCamera_PrintPoints("Position", dbCamera->sub.nPoints, dbCamera->sub.position); - osSyncPrintf("@@@static short nPoints = %d;\n@@@\n", dbCamera->sub.nPoints); - osSyncPrintf("@@@static short nFrames = %d;\n@@@\n", dbCamera->sub.nFrames); - osSyncPrintf("@@@static short Mode = %d;\n@@@\n", dbCamera->sub.mode); + DebugCamera_PrintPoints("Lookat", debugCam->sub.nPoints, debugCam->sub.lookAt); + DebugCamera_PrintPoints("Position", debugCam->sub.nPoints, debugCam->sub.position); + osSyncPrintf("@@@static short nPoints = %d;\n@@@\n", debugCam->sub.nPoints); + osSyncPrintf("@@@static short nFrames = %d;\n@@@\n", debugCam->sub.nFrames); + osSyncPrintf("@@@static short Mode = %d;\n@@@\n", debugCam->sub.mode); osSyncPrintf("@@@\n@@@\n@@@/* *** spline point data ** finish! *** */\n@@@\n"); - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_CLEFT)) { + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CLEFT)) { Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - dbCamera->sub.unk_08 = (dbCamera->sub.unk_08 + 1) % 3; + debugCam->sub.unk_08 = (debugCam->sub.unk_08 + 1) % 3; } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_CUP) && - CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_L)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CUP) && + CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L)) { Audio_PlaySfxGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - if (dbCamera->sub.unkIdx > 0) { - dbCamera->sub.unkIdx--; + if (debugCam->sub.unkIdx > 0) { + debugCam->sub.unkIdx--; } else { - dbCamera->sub.unkIdx = dbCamera->sub.nPoints - 1; + debugCam->sub.unkIdx = debugCam->sub.nPoints - 1; } } else { - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_CUP)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CUP)) { Audio_PlaySfxGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - if (dbCamera->sub.unkIdx > 0) { - dbCamera->sub.unkIdx--; + if (debugCam->sub.unkIdx > 0) { + debugCam->sub.unkIdx--; } else { - dbCamera->sub.unkIdx = dbCamera->sub.nPoints - 1; + debugCam->sub.unkIdx = debugCam->sub.nPoints - 1; } - if ((dbCamera->sub.unk_08 == 2) && (dbCamera->sub.unkIdx != (dbCamera->sub.nPoints - 1))) { - func_800B4370(dbCamera, dbCamera->sub.unkIdx, cam); - dbCamera->roll = 0; - dbCamera->fov = 60.0f; - dbCamera->rollDegrees = 0; + if ((debugCam->sub.unk_08 == 2) && (debugCam->sub.unkIdx != (debugCam->sub.nPoints - 1))) { + func_800B4370(debugCam, debugCam->sub.unkIdx, cam); + debugCam->roll = 0; + debugCam->fov = 60.0f; + debugCam->rollDegrees = 0; } else { - func_800B41DC(dbCamera, dbCamera->sub.unkIdx, cam); - dbCamera->fov = dbCamera->sub.lookAt[dbCamera->sub.unkIdx].viewAngle; - dbCamera->roll = dbCamera->sub.lookAt[dbCamera->sub.unkIdx].cameraRoll; - dbCamera->rollDegrees = dbCamera->roll * 1.40625f; + func_800B41DC(debugCam, debugCam->sub.unkIdx, cam); + debugCam->fov = debugCam->sub.lookAt[debugCam->sub.unkIdx].viewAngle; + debugCam->roll = debugCam->sub.lookAt[debugCam->sub.unkIdx].cameraRoll; + debugCam->rollDegrees = debugCam->roll * 1.40625f; } } } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_L) && - CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_CDOWN)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L) && + CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CDOWN)) { Audio_PlaySfxGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - if (dbCamera->sub.unkIdx < (dbCamera->sub.nPoints - 1)) { - dbCamera->sub.unkIdx++; + if (debugCam->sub.unkIdx < (debugCam->sub.nPoints - 1)) { + debugCam->sub.unkIdx++; } else { - dbCamera->sub.unkIdx = 0; + debugCam->sub.unkIdx = 0; } } else { - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_CDOWN)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CDOWN)) { Audio_PlaySfxGeneral(NA_SE_IT_SWORD_IMPACT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - if (dbCamera->sub.unkIdx < (dbCamera->sub.nPoints - 1)) { - dbCamera->sub.unkIdx++; + if (debugCam->sub.unkIdx < (debugCam->sub.nPoints - 1)) { + debugCam->sub.unkIdx++; } else { - dbCamera->sub.unkIdx = 0; + debugCam->sub.unkIdx = 0; } - if ((dbCamera->sub.unk_08 == 2) && (dbCamera->sub.unkIdx != (dbCamera->sub.nPoints - 1))) { - func_800B4370(dbCamera, dbCamera->sub.unkIdx, cam); - dbCamera->roll = 0; - dbCamera->fov = 60.0f; - dbCamera->rollDegrees = 0; + if ((debugCam->sub.unk_08 == 2) && (debugCam->sub.unkIdx != (debugCam->sub.nPoints - 1))) { + func_800B4370(debugCam, debugCam->sub.unkIdx, cam); + debugCam->roll = 0; + debugCam->fov = 60.0f; + debugCam->rollDegrees = 0; } else { - func_800B41DC(dbCamera, dbCamera->sub.unkIdx, cam); - dbCamera->fov = dbCamera->sub.lookAt[dbCamera->sub.unkIdx].viewAngle; - dbCamera->roll = dbCamera->sub.lookAt[dbCamera->sub.unkIdx].cameraRoll; - dbCamera->rollDegrees = dbCamera->roll * 1.40625f; + func_800B41DC(debugCam, debugCam->sub.unkIdx, cam); + debugCam->fov = debugCam->sub.lookAt[debugCam->sub.unkIdx].viewAngle; + debugCam->roll = debugCam->sub.lookAt[debugCam->sub.unkIdx].cameraRoll; + debugCam->rollDegrees = debugCam->roll * 1.40625f; } } } - DbCamera_ScreenTextColored(10, 6, (dbCamera->sub.unk_08 == 0) ? DBCAMERA_TEXT_GREEN : DBCAMERA_TEXT_GOLD, - D_8012D00C); - DbCamera_ScreenTextColored(17, 6, (dbCamera->sub.unk_08 == 1) ? DBCAMERA_TEXT_GREEN : DBCAMERA_TEXT_GOLD, - D_8012D020); - DbCamera_ScreenTextColored(23, 6, (dbCamera->sub.unk_08 == 2) ? DBCAMERA_TEXT_GREEN : DBCAMERA_TEXT_GOLD, - D_8012D034); - if (dbCamera->sub.unkIdx == 0x80) { - DbCamera_ScreenTextColored(16, 26, DBCAMERA_TEXT_PEACH, D_8012CEF8[0]); - } else if (dbCamera->sub.unkIdx == (dbCamera->sub.nPoints - 1)) { - D_8012CEE0[7][10] = (dbCamera->sub.nPoints / 10) + '0'; - D_8012CEE0[7][11] = (dbCamera->sub.nPoints % 10) + '0'; - DbCamera_ScreenTextColored(15, 26, DBCAMERA_TEXT_PEACH, D_8012CEE0[7]); + DebugCamera_ScreenTextColored( + 10, 6, (debugCam->sub.unk_08 == 0) ? DEBUG_CAM_TEXT_GREEN : DEBUG_CAM_TEXT_GOLD, D_8012D00C); + DebugCamera_ScreenTextColored( + 17, 6, (debugCam->sub.unk_08 == 1) ? DEBUG_CAM_TEXT_GREEN : DEBUG_CAM_TEXT_GOLD, D_8012D020); + DebugCamera_ScreenTextColored( + 23, 6, (debugCam->sub.unk_08 == 2) ? DEBUG_CAM_TEXT_GREEN : DEBUG_CAM_TEXT_GOLD, D_8012D034); + if (debugCam->sub.unkIdx == 0x80) { + DebugCamera_ScreenTextColored(16, 26, DEBUG_CAM_TEXT_PEACH, D_8012CEF8[0]); + } else if (debugCam->sub.unkIdx == (debugCam->sub.nPoints - 1)) { + D_8012CEE0[7][10] = (debugCam->sub.nPoints / 10) + '0'; + D_8012CEE0[7][11] = (debugCam->sub.nPoints % 10) + '0'; + DebugCamera_ScreenTextColored(15, 26, DEBUG_CAM_TEXT_PEACH, D_8012CEE0[7]); } else { - D_8012CEE0[8][10] = ((dbCamera->sub.unkIdx + 1) / 10) + '0'; - D_8012CEE0[8][11] = ((dbCamera->sub.unkIdx + 1) % 10) + '0'; - D_8012CEE0[8][13] = ((dbCamera->sub.nPoints - 1) / 10) + '0'; - D_8012CEE0[8][14] = ((dbCamera->sub.nPoints - 1) % 10) + '0'; - DbCamera_ScreenTextColored(15, 26, DBCAMERA_TEXT_PEACH, D_8012CEE0[8]); + D_8012CEE0[8][10] = ((debugCam->sub.unkIdx + 1) / 10) + '0'; + D_8012CEE0[8][11] = ((debugCam->sub.unkIdx + 1) % 10) + '0'; + D_8012CEE0[8][13] = ((debugCam->sub.nPoints - 1) / 10) + '0'; + D_8012CEE0[8][14] = ((debugCam->sub.nPoints - 1) % 10) + '0'; + DebugCamera_ScreenTextColored(15, 26, DEBUG_CAM_TEXT_PEACH, D_8012CEE0[8]); } - switch (dbCamera->sub.unk_08) { + switch (debugCam->sub.unk_08) { case 2: - dbCamera->unk_3C = false; + debugCam->unk_3C = false; break; case 0: - dbCamera->unk_3C = false; - if (dbCamera->sub.mode != 1) { - DbCamera_ScreenTextColored(13, 24, DBCAMERA_TEXT_ORANGE, !D_80161144 ? D_8012CF04 : D_8012CF08); - DbCamera_SetTextValue(CAM_BINANG_TO_DEG(sp104.pitch), &D_8012D0E4[11], 4); - DbCamera_ScreenTextColored(15, 23, DBCAMERA_TEXT_ORANGE, D_8012D0E4); - DbCamera_SetTextValue(CAM_BINANG_TO_DEG(sp104.yaw), &D_8012D0F8[11], 4); - DbCamera_ScreenTextColored(15, 24, DBCAMERA_TEXT_ORANGE, D_8012D0F8); - DbCamera_SetTextValue(sp104.r, &D_8012D0D4[8], 6); - DbCamera_ScreenTextColored(15, 25, DBCAMERA_TEXT_ORANGE, D_8012D0D4); + debugCam->unk_3C = false; + if (debugCam->sub.mode != 1) { + DebugCamera_ScreenTextColored(13, 24, DEBUG_CAM_TEXT_ORANGE, + !D_80161144 ? D_8012CF04 : D_8012CF08); + DebugCamera_SetTextValue(CAM_BINANG_TO_DEG(sp104.pitch), &D_8012D0E4[11], 4); + DebugCamera_ScreenTextColored(15, 23, DEBUG_CAM_TEXT_ORANGE, D_8012D0E4); + DebugCamera_SetTextValue(CAM_BINANG_TO_DEG(sp104.yaw), &D_8012D0F8[11], 4); + DebugCamera_ScreenTextColored(15, 24, DEBUG_CAM_TEXT_ORANGE, D_8012D0F8); + DebugCamera_SetTextValue(sp104.r, &D_8012D0D4[8], 6); + DebugCamera_ScreenTextColored(15, 25, DEBUG_CAM_TEXT_ORANGE, D_8012D0D4); } else { - DbCamera_ScreenTextColored(14, 24, DBCAMERA_TEXT_ORANGE, D_8012CF0C); - DbCamera_ScreenTextColored(16, 22, DBCAMERA_TEXT_ORANGE, D_8012CF10); + DebugCamera_ScreenTextColored(14, 24, DEBUG_CAM_TEXT_ORANGE, D_8012CF0C); + DebugCamera_ScreenTextColored(16, 22, DEBUG_CAM_TEXT_ORANGE, D_8012CF10); sp110 = 'X'; - DbCamera_SetTextValue(temp_s6->pos.x, &sp111, 7); - DbCamera_ScreenTextColored(16, 23, DBCAMERA_TEXT_ORANGE, &sp110); + DebugCamera_SetTextValue(temp_s6->pos.x, &sp111, 7); + DebugCamera_ScreenTextColored(16, 23, DEBUG_CAM_TEXT_ORANGE, &sp110); sp110 = 'Y'; - DbCamera_SetTextValue(temp_s6->pos.y, &sp111, 7); - DbCamera_ScreenTextColored(16, 24, DBCAMERA_TEXT_ORANGE, &sp110); + DebugCamera_SetTextValue(temp_s6->pos.y, &sp111, 7); + DebugCamera_ScreenTextColored(16, 24, DEBUG_CAM_TEXT_ORANGE, &sp110); sp110 = 'Z'; - DbCamera_SetTextValue(temp_s6->pos.z, &sp111, 7); - DbCamera_ScreenTextColored(16, 25, DBCAMERA_TEXT_ORANGE, &sp110); + DebugCamera_SetTextValue(temp_s6->pos.z, &sp111, 7); + DebugCamera_ScreenTextColored(16, 25, DEBUG_CAM_TEXT_ORANGE, &sp110); } break; case 1: - dbCamera->unk_3C = true; - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_DUP)) { + debugCam->unk_3C = true; + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DUP)) { Audio_PlaySfxGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - if (dbCamera->sub.unk_0A == 0) { - dbCamera->sub.unk_0A = 5; + if (debugCam->sub.unk_0A == 0) { + debugCam->sub.unk_0A = 5; } else { - dbCamera->sub.unk_0A--; + debugCam->sub.unk_0A--; } } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_DDOWN)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DDOWN)) { Audio_PlaySfxGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - if (dbCamera->sub.unk_0A == 5) { - dbCamera->sub.unk_0A = 0; + if (debugCam->sub.unk_0A == 5) { + debugCam->sub.unk_0A = 0; } else { - dbCamera->sub.unk_0A++; + debugCam->sub.unk_0A++; } } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_DLEFT)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DLEFT)) { Audio_PlaySfxGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - switch (dbCamera->sub.unk_0A) { + switch (debugCam->sub.unk_0A) { case 1: - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_L)) { - dbCamera->sub.lookAt[dbCamera->sub.unkIdx].nextPointFrame -= 5; + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L)) { + debugCam->sub.lookAt[debugCam->sub.unkIdx].nextPointFrame -= 5; } else { - dbCamera->sub.lookAt[dbCamera->sub.unkIdx].nextPointFrame--; + debugCam->sub.lookAt[debugCam->sub.unkIdx].nextPointFrame--; } break; case 3: - dbCamera->sub.mode--; - if (dbCamera->sub.mode == -1) { - dbCamera->sub.mode = 2; + debugCam->sub.mode--; + if (debugCam->sub.mode == -1) { + debugCam->sub.mode = 2; } - if (dbCamera->sub.mode == 1) { - dbCamera->unk_78 = 2; - for (i = 0; i < dbCamera->sub.nPoints; i++) { - DbCamera_Vec3SToF2(&dbCamera->sub.lookAt[i].pos, &spD8); - func_800B3F94(temp_s6, &spD8, &dbCamera->sub.lookAt[i].pos); - DbCamera_Vec3SToF2(&dbCamera->sub.position[i].pos, &spD8); - func_800B3F94(temp_s6, &spD8, &dbCamera->sub.position[i].pos); + if (debugCam->sub.mode == 1) { + debugCam->unk_78 = 2; + for (i = 0; i < debugCam->sub.nPoints; i++) { + DebugCamera_Vec3SToF2(&debugCam->sub.lookAt[i].pos, &spD8); + func_800B3F94(temp_s6, &spD8, &debugCam->sub.lookAt[i].pos); + DebugCamera_Vec3SToF2(&debugCam->sub.position[i].pos, &spD8); + func_800B3F94(temp_s6, &spD8, &debugCam->sub.position[i].pos); } } else { - for (i = 0; i < dbCamera->sub.nPoints; i++) { - func_800B404C(temp_s6, &dbCamera->sub.lookAt[i].pos, &spD8); - DbCamera_Vec3FToS(&spD8, &dbCamera->sub.lookAt[i].pos); - func_800B404C(temp_s6, &dbCamera->sub.position[i].pos, &spD8); - DbCamera_Vec3FToS(&spD8, &dbCamera->sub.position[i].pos); + for (i = 0; i < debugCam->sub.nPoints; i++) { + func_800B404C(temp_s6, &debugCam->sub.lookAt[i].pos, &spD8); + DebugCamera_Vec3FToS(&spD8, &debugCam->sub.lookAt[i].pos); + func_800B404C(temp_s6, &debugCam->sub.position[i].pos, &spD8); + DebugCamera_Vec3FToS(&spD8, &debugCam->sub.position[i].pos); } } break; case 4: - dbCamera->sub.unk_0C = false; + debugCam->sub.unk_0C = false; break; case 2: - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_L)) { - dbCamera->sub.lookAt[dbCamera->sub.unkIdx].cameraRoll -= 5; - dbCamera->roll = dbCamera->sub.lookAt[dbCamera->sub.unkIdx].cameraRoll; + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L)) { + debugCam->sub.lookAt[debugCam->sub.unkIdx].cameraRoll -= 5; + debugCam->roll = debugCam->sub.lookAt[debugCam->sub.unkIdx].cameraRoll; } else { - dbCamera->sub.lookAt[dbCamera->sub.unkIdx].cameraRoll--; - dbCamera->roll = dbCamera->sub.lookAt[dbCamera->sub.unkIdx].cameraRoll; + debugCam->sub.lookAt[debugCam->sub.unkIdx].cameraRoll--; + debugCam->roll = debugCam->sub.lookAt[debugCam->sub.unkIdx].cameraRoll; } - dbCamera->rollDegrees = dbCamera->roll * 1.40625f; + debugCam->rollDegrees = debugCam->roll * 1.40625f; break; } } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_DLEFT)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_DLEFT)) { if ((D_8012D10C++ % 5) == 0) { Audio_PlaySfxGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - switch (dbCamera->sub.unk_0A) { + switch (debugCam->sub.unk_0A) { case 0: - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_L)) { - dbCamera->sub.lookAt[dbCamera->sub.unkIdx].viewAngle -= 1.0f; - dbCamera->fov = dbCamera->sub.lookAt[dbCamera->sub.unkIdx].viewAngle; + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L)) { + debugCam->sub.lookAt[debugCam->sub.unkIdx].viewAngle -= 1.0f; + debugCam->fov = debugCam->sub.lookAt[debugCam->sub.unkIdx].viewAngle; } else { - dbCamera->sub.lookAt[dbCamera->sub.unkIdx].viewAngle -= 0.2f; - dbCamera->fov = dbCamera->sub.lookAt[dbCamera->sub.unkIdx].viewAngle; + debugCam->sub.lookAt[debugCam->sub.unkIdx].viewAngle -= 0.2f; + debugCam->fov = debugCam->sub.lookAt[debugCam->sub.unkIdx].viewAngle; } break; case 5: - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_L)) { - dbCamera->sub.nFrames -= 10; + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L)) { + debugCam->sub.nFrames -= 10; } else { - dbCamera->sub.nFrames--; + debugCam->sub.nFrames--; } - if (dbCamera->sub.nFrames < -1) { - if (dbCamera->sub.nPoints < 5) { - dbCamera->sub.nFrames = -1; + if (debugCam->sub.nFrames < -1) { + if (debugCam->sub.nPoints < 5) { + debugCam->sub.nFrames = -1; } else { - dbCamera->sub.nFrames = 0; - for (i = 0; i < dbCamera->sub.nPoints; i++) { - dbCamera->sub.nFrames += dbCamera->sub.lookAt[i].nextPointFrame; + debugCam->sub.nFrames = 0; + for (i = 0; i < debugCam->sub.nPoints; i++) { + debugCam->sub.nFrames += debugCam->sub.lookAt[i].nextPointFrame; } - i = dbCamera->sub.nFrames / dbCamera->sub.nPoints; - dbCamera->sub.nFrames -= (s16)(i * 5); + i = debugCam->sub.nFrames / debugCam->sub.nPoints; + debugCam->sub.nFrames -= (s16)(i * 5); } } break; } } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_DRIGHT)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DRIGHT)) { Audio_PlaySfxGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - switch (dbCamera->sub.unk_0A) { + switch (debugCam->sub.unk_0A) { case 1: - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_L)) { - dbCamera->sub.lookAt[dbCamera->sub.unkIdx].nextPointFrame += 5; + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L)) { + debugCam->sub.lookAt[debugCam->sub.unkIdx].nextPointFrame += 5; } else { - dbCamera->sub.lookAt[dbCamera->sub.unkIdx].nextPointFrame++; + debugCam->sub.lookAt[debugCam->sub.unkIdx].nextPointFrame++; } break; case 3: - dbCamera->sub.mode++; - if (dbCamera->sub.mode == 3) { - dbCamera->sub.mode = 0; + debugCam->sub.mode++; + if (debugCam->sub.mode == 3) { + debugCam->sub.mode = 0; } - if (dbCamera->sub.mode == 1) { - dbCamera->unk_78 = 2; - for (i = 0; i < dbCamera->sub.nPoints; i++) { - DbCamera_Vec3SToF2(&dbCamera->sub.lookAt[i].pos, &spD8); - func_800B3F94(temp_s6, &spD8, &dbCamera->sub.lookAt[i].pos); - DbCamera_Vec3SToF2(&dbCamera->sub.position[i].pos, &spD8); - func_800B3F94(temp_s6, &spD8, &dbCamera->sub.position[i].pos); + if (debugCam->sub.mode == 1) { + debugCam->unk_78 = 2; + for (i = 0; i < debugCam->sub.nPoints; i++) { + DebugCamera_Vec3SToF2(&debugCam->sub.lookAt[i].pos, &spD8); + func_800B3F94(temp_s6, &spD8, &debugCam->sub.lookAt[i].pos); + DebugCamera_Vec3SToF2(&debugCam->sub.position[i].pos, &spD8); + func_800B3F94(temp_s6, &spD8, &debugCam->sub.position[i].pos); } } else { - for (i = 0; i < dbCamera->sub.nPoints; i++) { - func_800B404C(temp_s6, &dbCamera->sub.lookAt[i].pos, &spD8); - DbCamera_Vec3FToS(&spD8, &dbCamera->sub.lookAt[i].pos); - func_800B404C(temp_s6, &dbCamera->sub.position[i].pos, &spD8); - DbCamera_Vec3FToS(&spD8, &dbCamera->sub.position[i].pos); + for (i = 0; i < debugCam->sub.nPoints; i++) { + func_800B404C(temp_s6, &debugCam->sub.lookAt[i].pos, &spD8); + DebugCamera_Vec3FToS(&spD8, &debugCam->sub.lookAt[i].pos); + func_800B404C(temp_s6, &debugCam->sub.position[i].pos, &spD8); + DebugCamera_Vec3FToS(&spD8, &debugCam->sub.position[i].pos); } } FALLTHROUGH; case 4: - dbCamera->sub.unk_0C = true; + debugCam->sub.unk_0C = true; break; case 2: - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_L)) { - dbCamera->sub.lookAt[dbCamera->sub.unkIdx].cameraRoll += 5; - dbCamera->roll = dbCamera->sub.lookAt[dbCamera->sub.unkIdx].cameraRoll; + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L)) { + debugCam->sub.lookAt[debugCam->sub.unkIdx].cameraRoll += 5; + debugCam->roll = debugCam->sub.lookAt[debugCam->sub.unkIdx].cameraRoll; } else { - dbCamera->sub.lookAt[dbCamera->sub.unkIdx].cameraRoll++; - dbCamera->roll = dbCamera->sub.lookAt[dbCamera->sub.unkIdx].cameraRoll; + debugCam->sub.lookAt[debugCam->sub.unkIdx].cameraRoll++; + debugCam->roll = debugCam->sub.lookAt[debugCam->sub.unkIdx].cameraRoll; } - dbCamera->rollDegrees = dbCamera->roll * 1.40625f; + debugCam->rollDegrees = debugCam->roll * 1.40625f; break; } } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_DRIGHT)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_DRIGHT)) { if ((D_8012D10C++ % 5) == 0) { Audio_PlaySfxGeneral(NA_SE_SY_ATTENTION_ON, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - switch (dbCamera->sub.unk_0A) { + switch (debugCam->sub.unk_0A) { case 0: - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_L)) { - dbCamera->sub.lookAt[dbCamera->sub.unkIdx].viewAngle += 1.0f; - dbCamera->fov = dbCamera->sub.lookAt[dbCamera->sub.unkIdx].viewAngle; + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L)) { + debugCam->sub.lookAt[debugCam->sub.unkIdx].viewAngle += 1.0f; + debugCam->fov = debugCam->sub.lookAt[debugCam->sub.unkIdx].viewAngle; } else { - dbCamera->sub.lookAt[dbCamera->sub.unkIdx].viewAngle += 0.2f; - dbCamera->fov = dbCamera->sub.lookAt[dbCamera->sub.unkIdx].viewAngle; + debugCam->sub.lookAt[debugCam->sub.unkIdx].viewAngle += 0.2f; + debugCam->fov = debugCam->sub.lookAt[debugCam->sub.unkIdx].viewAngle; } break; case 5: - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_L)) { - dbCamera->sub.nFrames += 10; + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L)) { + debugCam->sub.nFrames += 10; } else { - dbCamera->sub.nFrames++; + debugCam->sub.nFrames++; } - if (&dbCamera->at) {} + if (&debugCam->at) {} break; } } - DbCamera_SetTextValue(dbCamera->sub.lookAt[dbCamera->sub.unkIdx].viewAngle, &D_8012D05C[10], 3); - DbCamera_ScreenTextColored( - 16, 20, (dbCamera->sub.unk_0A == 0) ? DBCAMERA_TEXT_GREEN : DBCAMERA_TEXT_GOLD, D_8012D05C); - DbCamera_SetTextValue(dbCamera->sub.lookAt[dbCamera->sub.unkIdx].nextPointFrame, &D_8012D070[9], 3); - DbCamera_ScreenTextColored( - 16, 21, (dbCamera->sub.unk_0A == 1) ? DBCAMERA_TEXT_GREEN : DBCAMERA_TEXT_GOLD, D_8012D070); - DbCamera_SetTextValue(dbCamera->sub.lookAt[dbCamera->sub.unkIdx].cameraRoll, &D_8012D084[10], 3); - DbCamera_ScreenTextColored( - 16, 22, (dbCamera->sub.unk_0A == 2) ? DBCAMERA_TEXT_GREEN : DBCAMERA_TEXT_GOLD, D_8012D084); - DbCamera_ScreenTextColored(15, 23, - (dbCamera->sub.unk_0A == 3) ? DBCAMERA_TEXT_GREEN : DBCAMERA_TEXT_GOLD, - (dbCamera->sub.mode == 1) ? D_8012CF14 - : (dbCamera->sub.mode == 0) ? *D_8012CF18 - : D_8012CFB0); - if (dbCamera->sub.unk_0C) { + DebugCamera_SetTextValue(debugCam->sub.lookAt[debugCam->sub.unkIdx].viewAngle, &D_8012D05C[10], 3); + DebugCamera_ScreenTextColored( + 16, 20, (debugCam->sub.unk_0A == 0) ? DEBUG_CAM_TEXT_GREEN : DEBUG_CAM_TEXT_GOLD, D_8012D05C); + DebugCamera_SetTextValue(debugCam->sub.lookAt[debugCam->sub.unkIdx].nextPointFrame, &D_8012D070[9], + 3); + DebugCamera_ScreenTextColored( + 16, 21, (debugCam->sub.unk_0A == 1) ? DEBUG_CAM_TEXT_GREEN : DEBUG_CAM_TEXT_GOLD, D_8012D070); + DebugCamera_SetTextValue(debugCam->sub.lookAt[debugCam->sub.unkIdx].cameraRoll, &D_8012D084[10], 3); + DebugCamera_ScreenTextColored( + 16, 22, (debugCam->sub.unk_0A == 2) ? DEBUG_CAM_TEXT_GREEN : DEBUG_CAM_TEXT_GOLD, D_8012D084); + DebugCamera_ScreenTextColored( + 15, 23, (debugCam->sub.unk_0A == 3) ? DEBUG_CAM_TEXT_GREEN : DEBUG_CAM_TEXT_GOLD, + (debugCam->sub.mode == 1) ? D_8012CF14 + : (debugCam->sub.mode == 0) ? *D_8012CF18 + : D_8012CFB0); + if (debugCam->sub.unk_0C) { D_8012D05C[80] = '>'; } else { D_8012D05C[80] = '<'; @@ -1330,102 +1332,102 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { D_8012D05C[81] = ' '; D_8012D05C[94] = ' '; - if (dbCamera->sub.unk_0C) { + if (debugCam->sub.unk_0C) { D_8012D05C[95] = '>'; } else { D_8012D05C[95] = '<'; } D_8012D05C[96] = '\0'; - DbCamera_ScreenTextColored( - 15, 24, (dbCamera->sub.unk_0A == 4) ? DBCAMERA_TEXT_GREEN : DBCAMERA_TEXT_GOLD, D_8012D0AC); - DbCamera_SetTextValue(dbCamera->sub.nFrames, &D_8012D0C0[10], 5); - DbCamera_ScreenTextColored(15, 25, - (dbCamera->sub.unk_0A == 5) ? DBCAMERA_TEXT_GREEN : DBCAMERA_TEXT_GOLD, - (dbCamera->sub.nFrames == -1) ? *D_8012CF24 : D_8012D0C0); + DebugCamera_ScreenTextColored( + 15, 24, (debugCam->sub.unk_0A == 4) ? DEBUG_CAM_TEXT_GREEN : DEBUG_CAM_TEXT_GOLD, D_8012D0AC); + DebugCamera_SetTextValue(debugCam->sub.nFrames, &D_8012D0C0[10], 5); + DebugCamera_ScreenTextColored( + 15, 25, (debugCam->sub.unk_0A == 5) ? DEBUG_CAM_TEXT_GREEN : DEBUG_CAM_TEXT_GOLD, + (debugCam->sub.nFrames == -1) ? *D_8012CF24 : D_8012D0C0); break; } - if (dbCamera->sub.mode != 1) { - DbCamera_ScreenTextColored(3, 22, - ((dbCamera->sub.unk_08 == 1) && (dbCamera->sub.unk_0A == 4) && !D_80161144) - ? DBCAMERA_TEXT_GREEN - : !D_80161144 ? DBCAMERA_TEXT_GOLD - : DBCAMERA_TEXT_ORANGE, - D_8012CF30); + if (debugCam->sub.mode != 1) { + DebugCamera_ScreenTextColored( + 3, 22, + ((debugCam->sub.unk_08 == 1) && (debugCam->sub.unk_0A == 4) && !D_80161144) ? DEBUG_CAM_TEXT_GREEN + : !D_80161144 ? DEBUG_CAM_TEXT_GOLD + : DEBUG_CAM_TEXT_ORANGE, + D_8012CF30); sp110 = 'X'; - DbCamera_SetTextValue(dbCamera->at.x, &sp111, 6); - DbCamera_ScreenTextColored(3, 23, DBCAMERA_TEXT_BROWN, &sp110); + DebugCamera_SetTextValue(debugCam->at.x, &sp111, 6); + DebugCamera_ScreenTextColored(3, 23, DEBUG_CAM_TEXT_BROWN, &sp110); sp110 = 'Y'; - DbCamera_SetTextValue(dbCamera->at.y, &sp111, 6); - DbCamera_ScreenTextColored(3, 24, DBCAMERA_TEXT_BROWN, &sp110); + DebugCamera_SetTextValue(debugCam->at.y, &sp111, 6); + DebugCamera_ScreenTextColored(3, 24, DEBUG_CAM_TEXT_BROWN, &sp110); sp110 = 'Z'; - DbCamera_SetTextValue(dbCamera->at.z, &sp111, 6); - DbCamera_ScreenTextColored(3, 25, DBCAMERA_TEXT_BROWN, &sp110); - DbCamera_ScreenTextColored(30, 22, - ((dbCamera->sub.unk_08 == 1) && (dbCamera->sub.unk_0A == 4) && D_80161144) - ? DBCAMERA_TEXT_GREEN - : D_80161144 ? DBCAMERA_TEXT_GOLD - : DBCAMERA_TEXT_ORANGE, - D_8012CF34); + DebugCamera_SetTextValue(debugCam->at.z, &sp111, 6); + DebugCamera_ScreenTextColored(3, 25, DEBUG_CAM_TEXT_BROWN, &sp110); + DebugCamera_ScreenTextColored(30, 22, + ((debugCam->sub.unk_08 == 1) && (debugCam->sub.unk_0A == 4) && D_80161144) + ? DEBUG_CAM_TEXT_GREEN + : D_80161144 ? DEBUG_CAM_TEXT_GOLD + : DEBUG_CAM_TEXT_ORANGE, + D_8012CF34); sp110 = 'X'; - DbCamera_SetTextValue(dbCamera->eye.x, &sp111, 6); - DbCamera_ScreenTextColored(30, 23, DBCAMERA_TEXT_BROWN, &sp110); + DebugCamera_SetTextValue(debugCam->eye.x, &sp111, 6); + DebugCamera_ScreenTextColored(30, 23, DEBUG_CAM_TEXT_BROWN, &sp110); sp110 = 'Y'; - DbCamera_SetTextValue(dbCamera->eye.y, &sp111, 6); - DbCamera_ScreenTextColored(30, 24, DBCAMERA_TEXT_BROWN, &sp110); + DebugCamera_SetTextValue(debugCam->eye.y, &sp111, 6); + DebugCamera_ScreenTextColored(30, 24, DEBUG_CAM_TEXT_BROWN, &sp110); sp110 = 'Z'; - DbCamera_SetTextValue(dbCamera->eye.z, &sp111, 6); - DbCamera_ScreenTextColored(30, 25, DBCAMERA_TEXT_BROWN, &sp110); + DebugCamera_SetTextValue(debugCam->eye.z, &sp111, 6); + DebugCamera_ScreenTextColored(30, 25, DEBUG_CAM_TEXT_BROWN, &sp110); } else { if (D_8012CEE0[0]) {} OLib_Vec3fDiffToVecGeo(&spFC, sp90, sp7C); spFC.yaw -= cam->playerPosRot.rot.y; - DbCamera_ScreenTextColored(3, 22, - ((dbCamera->sub.unk_08 == 1) && (dbCamera->sub.unk_0A == 4) && !D_80161144) - ? DBCAMERA_TEXT_GREEN - : !D_80161144 ? DBCAMERA_TEXT_GOLD - : DBCAMERA_TEXT_ORANGE, - D_8012CF30); - DbCamera_SetTextValue(CAM_BINANG_TO_DEG(spFC.pitch), &D_8012D0E4[10], 4); - DbCamera_ScreenTextColored(3, 23, DBCAMERA_TEXT_ORANGE, D_8012D0E4); - DbCamera_SetTextValue(CAM_BINANG_TO_DEG(spFC.yaw), &D_8012D0F8[10], 4); - DbCamera_ScreenTextColored(3, 24, DBCAMERA_TEXT_ORANGE, D_8012D0F8); - DbCamera_SetTextValue(spFC.r, &D_8012D0D4[7], 6); - DbCamera_ScreenTextColored(3, 25, DBCAMERA_TEXT_ORANGE, D_8012D0D4); + DebugCamera_ScreenTextColored( + 3, 22, + ((debugCam->sub.unk_08 == 1) && (debugCam->sub.unk_0A == 4) && !D_80161144) ? DEBUG_CAM_TEXT_GREEN + : !D_80161144 ? DEBUG_CAM_TEXT_GOLD + : DEBUG_CAM_TEXT_ORANGE, + D_8012CF30); + DebugCamera_SetTextValue(CAM_BINANG_TO_DEG(spFC.pitch), &D_8012D0E4[10], 4); + DebugCamera_ScreenTextColored(3, 23, DEBUG_CAM_TEXT_ORANGE, D_8012D0E4); + DebugCamera_SetTextValue(CAM_BINANG_TO_DEG(spFC.yaw), &D_8012D0F8[10], 4); + DebugCamera_ScreenTextColored(3, 24, DEBUG_CAM_TEXT_ORANGE, D_8012D0F8); + DebugCamera_SetTextValue(spFC.r, &D_8012D0D4[7], 6); + DebugCamera_ScreenTextColored(3, 25, DEBUG_CAM_TEXT_ORANGE, D_8012D0D4); OLib_Vec3fDiffToVecGeo(&spFC, sp90, sp80); spFC.yaw -= cam->playerPosRot.rot.y; - DbCamera_ScreenTextColored(30, 22, - ((dbCamera->sub.unk_08 == 1) && (dbCamera->sub.unk_0A == 4) && D_80161144) - ? DBCAMERA_TEXT_GREEN - : D_80161144 ? DBCAMERA_TEXT_GOLD - : DBCAMERA_TEXT_ORANGE, - D_8012CF34); - DbCamera_SetTextValue(CAM_BINANG_TO_DEG(spFC.pitch), &D_8012D0E4[10], 4); - DbCamera_ScreenTextColored(28, 23, DBCAMERA_TEXT_ORANGE, D_8012D0E4); - DbCamera_SetTextValue(CAM_BINANG_TO_DEG(spFC.yaw), &D_8012D0F8[10], 4); - DbCamera_ScreenTextColored(28, 24, DBCAMERA_TEXT_ORANGE, D_8012D0F8); - DbCamera_SetTextValue(spFC.r, &D_8012D0D4[7], 6); - DbCamera_ScreenTextColored(28, 25, DBCAMERA_TEXT_ORANGE, D_8012D0D4); + DebugCamera_ScreenTextColored(30, 22, + ((debugCam->sub.unk_08 == 1) && (debugCam->sub.unk_0A == 4) && D_80161144) + ? DEBUG_CAM_TEXT_GREEN + : D_80161144 ? DEBUG_CAM_TEXT_GOLD + : DEBUG_CAM_TEXT_ORANGE, + D_8012CF34); + DebugCamera_SetTextValue(CAM_BINANG_TO_DEG(spFC.pitch), &D_8012D0E4[10], 4); + DebugCamera_ScreenTextColored(28, 23, DEBUG_CAM_TEXT_ORANGE, D_8012D0E4); + DebugCamera_SetTextValue(CAM_BINANG_TO_DEG(spFC.yaw), &D_8012D0F8[10], 4); + DebugCamera_ScreenTextColored(28, 24, DEBUG_CAM_TEXT_ORANGE, D_8012D0F8); + DebugCamera_SetTextValue(spFC.r, &D_8012D0D4[7], 6); + DebugCamera_ScreenTextColored(28, 25, DEBUG_CAM_TEXT_ORANGE, D_8012D0D4); } - DebugDisplay_AddObject(dbCamera->at.x, dbCamera->at.y + 1.0f, dbCamera->at.z, 0, 0, 0, 0.02f, 2.0f, 0.02f, + DebugDisplay_AddObject(debugCam->at.x, debugCam->at.y + 1.0f, debugCam->at.z, 0, 0, 0, 0.02f, 2.0f, 0.02f, 0xFF, 0xFF, 0x7F, 0x40, 0, cam->play->view.gfxCtx); - DebugDisplay_AddObject(dbCamera->at.x, dbCamera->at.y + 1.0f, dbCamera->at.z, 0, 0, 0, 2.0f, 0.02f, 0.02f, + DebugDisplay_AddObject(debugCam->at.x, debugCam->at.y + 1.0f, debugCam->at.z, 0, 0, 0, 2.0f, 0.02f, 0.02f, 0x7F, 0xFF, 0xFF, 0x40, 0, cam->play->view.gfxCtx); - DebugDisplay_AddObject(dbCamera->at.x, dbCamera->at.y + 1.0f, dbCamera->at.z, 0, 0, 0, 0.02f, 0.02f, 2.0f, + DebugDisplay_AddObject(debugCam->at.x, debugCam->at.y + 1.0f, debugCam->at.z, 0, 0, 0, 0.02f, 0.02f, 2.0f, 0xFF, 0x7F, 0xFF, 0x40, 0, cam->play->view.gfxCtx); - if (dbCamera->sub.unk_08 == 2) { - for (i = 0; i < (dbCamera->sub.nPoints - 1); i++) { - if (dbCamera->sub.mode != 1) { - DbCamera_Vec3SToF2(&(dbCamera->sub.position + i)->pos, &spAC); - DbCamera_Vec3SToF2(&(dbCamera->sub.lookAt + i)->pos, &spB8); + if (debugCam->sub.unk_08 == 2) { + for (i = 0; i < (debugCam->sub.nPoints - 1); i++) { + if (debugCam->sub.mode != 1) { + DebugCamera_Vec3SToF2(&(debugCam->sub.position + i)->pos, &spAC); + DebugCamera_Vec3SToF2(&(debugCam->sub.lookAt + i)->pos, &spB8); } else { - func_800B404C(temp_s6, &(dbCamera->sub.lookAt + i)->pos, &spB8); - func_800B404C(temp_s6, &(dbCamera->sub.position + i)->pos, &spAC); + func_800B404C(temp_s6, &(debugCam->sub.lookAt + i)->pos, &spB8); + func_800B404C(temp_s6, &(debugCam->sub.position + i)->pos, &spAC); } OLib_Vec3fDiffToVecGeo(&spFC, &spAC, &spB8); - spAA = dbCamera->sub.lookAt[i].cameraRoll * 0xB6; - if (i == dbCamera->sub.unkIdx) { + spAA = debugCam->sub.lookAt[i].cameraRoll * 0xB6; + if (i == debugCam->sub.unkIdx) { DebugDisplay_AddObject(spAC.x, spAC.y, spAC.z, spFC.pitch * -1, spFC.yaw, spAA, .5f, .5f, .5f, 0x7F, 0xFF, 0x7F, 0x80, 5, cam->play->view.gfxCtx); DebugDisplay_AddObject(spB8.x, spB8.y, spB8.z, spFC.pitch * -1, spFC.yaw, spAA, 1.5f, 2.0f, @@ -1441,65 +1443,65 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { } } else { OREG(0) = 8; - dbCamera->roll = 0; - dbCamera->fov = 60.0f; - dbCamera->rollDegrees = dbCamera->roll * 1.40625f; - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_CLEFT)) { + debugCam->roll = 0; + debugCam->fov = 60.0f; + debugCam->rollDegrees = debugCam->roll * 1.40625f; + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CLEFT)) { Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - dbCamera->unk_78 = (dbCamera->unk_78 + 1) % 3; - dbCamera->unk_38 = -1; + debugCam->unk_78 = (debugCam->unk_78 + 1) % 3; + debugCam->unk_38 = -1; } - DbCamera_ScreenTextColored(14, 5, DBCAMERA_TEXT_YELLOW, D_8012CF38); - DbCamera_ScreenTextColored(9, 6, (dbCamera->unk_78 == 0) ? DBCAMERA_TEXT_GREEN : DBCAMERA_TEXT_GOLD, - D_8012CFD0); - DbCamera_ScreenTextColored(17, 6, (dbCamera->unk_78 == 1) ? DBCAMERA_TEXT_GREEN : DBCAMERA_TEXT_GOLD, - D_8012CFE4); - DbCamera_ScreenTextColored(24, 6, (dbCamera->unk_78 == 2) ? DBCAMERA_TEXT_GREEN : DBCAMERA_TEXT_GOLD, - D_8012CFF8); - DbCamera_ScreenTextColored(3, 22, D_80161144 ? DBCAMERA_TEXT_ORANGE : DBCAMERA_TEXT_GOLD, D_8012CF30); + DebugCamera_ScreenTextColored(14, 5, DEBUG_CAM_TEXT_YELLOW, D_8012CF38); + DebugCamera_ScreenTextColored(9, 6, (debugCam->unk_78 == 0) ? DEBUG_CAM_TEXT_GREEN : DEBUG_CAM_TEXT_GOLD, + D_8012CFD0); + DebugCamera_ScreenTextColored(17, 6, (debugCam->unk_78 == 1) ? DEBUG_CAM_TEXT_GREEN : DEBUG_CAM_TEXT_GOLD, + D_8012CFE4); + DebugCamera_ScreenTextColored(24, 6, (debugCam->unk_78 == 2) ? DEBUG_CAM_TEXT_GREEN : DEBUG_CAM_TEXT_GOLD, + D_8012CFF8); + DebugCamera_ScreenTextColored(3, 22, D_80161144 ? DEBUG_CAM_TEXT_ORANGE : DEBUG_CAM_TEXT_GOLD, D_8012CF30); sp110 = 'X'; - DbCamera_SetTextValue(dbCamera->at.x, &sp111, 6); - DbCamera_ScreenTextColored(3, 23, DBCAMERA_TEXT_BROWN, &sp110); + DebugCamera_SetTextValue(debugCam->at.x, &sp111, 6); + DebugCamera_ScreenTextColored(3, 23, DEBUG_CAM_TEXT_BROWN, &sp110); sp110 = 'Y'; - DbCamera_SetTextValue(dbCamera->at.y, &sp111, 6); - DbCamera_ScreenTextColored(3, 24, DBCAMERA_TEXT_BROWN, &sp110); + DebugCamera_SetTextValue(debugCam->at.y, &sp111, 6); + DebugCamera_ScreenTextColored(3, 24, DEBUG_CAM_TEXT_BROWN, &sp110); sp110 = 'Z'; - DbCamera_SetTextValue(dbCamera->at.z, &sp111, 6); - DbCamera_ScreenTextColored(3, 25, DBCAMERA_TEXT_BROWN, &sp110); - DbCamera_ScreenTextColored(30, 22, D_80161144 ? DBCAMERA_TEXT_GOLD : DBCAMERA_TEXT_ORANGE, D_8012CF34); + DebugCamera_SetTextValue(debugCam->at.z, &sp111, 6); + DebugCamera_ScreenTextColored(3, 25, DEBUG_CAM_TEXT_BROWN, &sp110); + DebugCamera_ScreenTextColored(30, 22, D_80161144 ? DEBUG_CAM_TEXT_GOLD : DEBUG_CAM_TEXT_ORANGE, D_8012CF34); sp110 = 'X'; - DbCamera_SetTextValue(dbCamera->eye.x, &sp111, 6); - DbCamera_ScreenTextColored(30, 23, DBCAMERA_TEXT_BROWN, &sp110); + DebugCamera_SetTextValue(debugCam->eye.x, &sp111, 6); + DebugCamera_ScreenTextColored(30, 23, DEBUG_CAM_TEXT_BROWN, &sp110); sp110 = 'Y'; - DbCamera_SetTextValue(dbCamera->eye.y, &sp111, 6); - DbCamera_ScreenTextColored(30, 24, DBCAMERA_TEXT_BROWN, &sp110); + DebugCamera_SetTextValue(debugCam->eye.y, &sp111, 6); + DebugCamera_ScreenTextColored(30, 24, DEBUG_CAM_TEXT_BROWN, &sp110); sp110 = 'Z'; - DbCamera_SetTextValue(dbCamera->eye.z, &sp111, 6); - DbCamera_ScreenTextColored(30, 25, DBCAMERA_TEXT_BROWN, &sp110); - DbCamera_ScreenTextColored(13, 24, DBCAMERA_TEXT_ORANGE, !D_80161144 ? D_8012CF04 : D_8012CF08); - DbCamera_SetTextValue(CAM_BINANG_TO_DEG(sp104.pitch), &D_8012D0E4[11], 4); - DbCamera_ScreenTextColored(15, 23, DBCAMERA_TEXT_ORANGE, D_8012D0E4); - DbCamera_SetTextValue(CAM_BINANG_TO_DEG(sp104.yaw), &D_8012D0F8[11], 4); - DbCamera_ScreenTextColored(15, 24, DBCAMERA_TEXT_ORANGE, D_8012D0F8); - DbCamera_SetTextValue(sp104.r, &D_8012D0D4[8], 6); - DbCamera_ScreenTextColored(15, 25, DBCAMERA_TEXT_ORANGE, D_8012D0D4); - if (dbCamera->unk_3C) { - DbCamera_ScreenTextColored(16, 26, DBCAMERA_TEXT_PEACH, D_8012CF3C); + DebugCamera_SetTextValue(debugCam->eye.z, &sp111, 6); + DebugCamera_ScreenTextColored(30, 25, DEBUG_CAM_TEXT_BROWN, &sp110); + DebugCamera_ScreenTextColored(13, 24, DEBUG_CAM_TEXT_ORANGE, !D_80161144 ? D_8012CF04 : D_8012CF08); + DebugCamera_SetTextValue(CAM_BINANG_TO_DEG(sp104.pitch), &D_8012D0E4[11], 4); + DebugCamera_ScreenTextColored(15, 23, DEBUG_CAM_TEXT_ORANGE, D_8012D0E4); + DebugCamera_SetTextValue(CAM_BINANG_TO_DEG(sp104.yaw), &D_8012D0F8[11], 4); + DebugCamera_ScreenTextColored(15, 24, DEBUG_CAM_TEXT_ORANGE, D_8012D0F8); + DebugCamera_SetTextValue(sp104.r, &D_8012D0D4[8], 6); + DebugCamera_ScreenTextColored(15, 25, DEBUG_CAM_TEXT_ORANGE, D_8012D0D4); + if (debugCam->unk_3C) { + DebugCamera_ScreenTextColored(16, 26, DEBUG_CAM_TEXT_PEACH, D_8012CF3C); } else { - DbCamera_ScreenTextColored(16, 26, DBCAMERA_TEXT_PEACH, D_8012CF40); + DebugCamera_ScreenTextColored(16, 26, DEBUG_CAM_TEXT_PEACH, D_8012CF40); } D_8012D110++; D_8012D110 %= 50; OLib_Vec3fDiffToVecGeo(&spA0, &cam->eye, &cam->at); - DebugDisplay_AddObject(dbCamera->at.x, dbCamera->at.y + 1.0f, dbCamera->at.z, 0, 0, 0, 0.02f, 2.0f, 0.02f, 0xFF, + DebugDisplay_AddObject(debugCam->at.x, debugCam->at.y + 1.0f, debugCam->at.z, 0, 0, 0, 0.02f, 2.0f, 0.02f, 0xFF, 0xFF, 0x7F, 0x2D, 0, cam->play->view.gfxCtx); - DebugDisplay_AddObject(dbCamera->at.x, dbCamera->at.y + 1.0f, dbCamera->at.z, 0, 0, 0, 2.0f, 0.02f, 0.02f, 0x7F, + DebugDisplay_AddObject(debugCam->at.x, debugCam->at.y + 1.0f, debugCam->at.z, 0, 0, 0, 2.0f, 0.02f, 0.02f, 0x7F, 0xFF, 0xFF, 0x2D, 0, cam->play->view.gfxCtx); - DebugDisplay_AddObject(dbCamera->at.x, dbCamera->at.y + 1.0f, dbCamera->at.z, 0, 0, 0, 0.02f, 0.02f, 2.0f, 0xFF, + DebugDisplay_AddObject(debugCam->at.x, debugCam->at.y + 1.0f, debugCam->at.z, 0, 0, 0, 0.02f, 0.02f, 2.0f, 0xFF, 0x7F, 0xFF, 0x2D, 0, cam->play->view.gfxCtx); DebugDisplay_AddObject(cam->eye.x, cam->eye.y, cam->eye.z, spA0.pitch * -1, spA0.yaw, 0, .5f, .5f, .5f, 0xFF, 0x7F, 0x7F, 0x80, 5, cam->play->view.gfxCtx); @@ -1514,13 +1516,13 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { static s16 sCurFileIdx; static s16 sLastFileIdx; // holds the file index of the slot to move // is the size correct? todo: add ALIGN32 for sizeof in Mempak functions, replace 0xF with sizeof() -static DbCameraCut sDbCameraCuts[16]; +static DebugCamCut sDebugCamCuts[16]; static char D_80161250[0x80]; static char sLetters[26]; static char D_801612EA; static s32 sAllocSize; -s32 DbCamera_GetFirstAvailableLetter(void) { +s32 DebugCamera_GetFirstAvailableLetter(void) { s32 i; for (i = 0; i < ARRAY_COUNT(sLetters); i++) { @@ -1534,67 +1536,67 @@ s32 DbCamera_GetFirstAvailableLetter(void) { return '?'; } -char DbCamera_InitCut(s32 idx, DbCameraSub* sub) { +char DebugCamera_InitCut(s32 idx, DebugCamSub* sub) { s32 i; - sDbCameraCuts[idx].unk_01 = 0x61; - sDbCameraCuts[idx].letter = DbCamera_GetFirstAvailableLetter(); - D_80161250[0x3F + sDbCameraCuts[idx].letter] = 'O'; + sDebugCamCuts[idx].unk_01 = 0x61; + sDebugCamCuts[idx].letter = DebugCamera_GetFirstAvailableLetter(); + D_80161250[0x3F + sDebugCamCuts[idx].letter] = 'O'; i = sub->nPoints * sizeof(CutsceneCameraPoint); - sDbCameraCuts[idx].lookAt = DebugArena_MallocDebug(i, "../db_camera.c", 2748); - if (sDbCameraCuts[idx].lookAt == NULL) { + sDebugCamCuts[idx].lookAt = DebugArena_MallocDebug(i, "../db_camera.c", 2748); + if (sDebugCamCuts[idx].lookAt == NULL) { // "Debug camera memory allocation failure" osSyncPrintf("%s: %d: デバッグカメラ メモリ確保失敗!!\n", "../db_camera.c", 2751); return '?'; } - sDbCameraCuts[idx].position = DebugArena_MallocDebug(i, "../db_camera.c", 2754); - if (sDbCameraCuts[idx].position == NULL) { + sDebugCamCuts[idx].position = DebugArena_MallocDebug(i, "../db_camera.c", 2754); + if (sDebugCamCuts[idx].position == NULL) { // "Debug camera memory allocation failure" osSyncPrintf("%s: %d: デバッグカメラ メモリ確保失敗!!\n", "../db_camera.c", 2757); - DebugArena_FreeDebug(sDbCameraCuts[idx].lookAt, "../db_camera.c", 2758); - sDbCameraCuts[idx].lookAt = NULL; + DebugArena_FreeDebug(sDebugCamCuts[idx].lookAt, "../db_camera.c", 2758); + sDebugCamCuts[idx].lookAt = NULL; return '?'; } - sDbCameraCuts[idx].mode = sub->mode; - sDbCameraCuts[idx].nFrames = sub->nFrames; - sDbCameraCuts[idx].nPoints = sub->nPoints; + sDebugCamCuts[idx].mode = sub->mode; + sDebugCamCuts[idx].nFrames = sub->nFrames; + sDebugCamCuts[idx].nPoints = sub->nPoints; for (i = 0; i < sub->nPoints; i++) { - sDbCameraCuts[idx].lookAt[i] = sub->lookAt[i]; - sDbCameraCuts[idx].position[i] = sub->position[i]; + sDebugCamCuts[idx].lookAt[i] = sub->lookAt[i]; + sDebugCamCuts[idx].position[i] = sub->position[i]; } - return sDbCameraCuts[idx].letter; + return sDebugCamCuts[idx].letter; } -void DbCamera_ResetCut(s32 idx, s32 shouldFree) { - if (sDbCameraCuts[idx].letter != '?') { - D_80161250[0x3F + sDbCameraCuts[idx].letter] = 'X'; +void DebugCamera_ResetCut(s32 idx, s32 shouldFree) { + if (sDebugCamCuts[idx].letter != '?') { + D_80161250[0x3F + sDebugCamCuts[idx].letter] = 'X'; } if (shouldFree) { - DebugArena_FreeDebug(sDbCameraCuts[idx].lookAt, "../db_camera.c", 2784); - DebugArena_FreeDebug(sDbCameraCuts[idx].position, "../db_camera.c", 2785); + DebugArena_FreeDebug(sDebugCamCuts[idx].lookAt, "../db_camera.c", 2784); + DebugArena_FreeDebug(sDebugCamCuts[idx].position, "../db_camera.c", 2785); } - sDbCameraCuts[idx].letter = '?'; - sDbCameraCuts[idx].lookAt = NULL; - sDbCameraCuts[idx].position = NULL; - sDbCameraCuts[idx].mode = 0; - sDbCameraCuts[idx].nFrames = 0; - sDbCameraCuts[idx].nPoints = 0; + sDebugCamCuts[idx].letter = '?'; + sDebugCamCuts[idx].lookAt = NULL; + sDebugCamCuts[idx].position = NULL; + sDebugCamCuts[idx].mode = 0; + sDebugCamCuts[idx].nFrames = 0; + sDebugCamCuts[idx].nPoints = 0; } -s32 DbCamera_CalcMempakAllocSize(void) { +s32 DebugCamera_CalcMempakAllocSize(void) { s32 i; sAllocSize = 0; - for (i = 0; i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) { - if (sDbCameraCuts[i].letter != '?') { - sAllocSize += ALIGN32(sDbCameraCuts[i].nPoints * sizeof(CutsceneCameraPoint)) * 2; + for (i = 0; i < ARRAY_COUNT(sDebugCamCuts) - 1; i++) { + if (sDebugCamCuts[i].letter != '?') { + sAllocSize += ALIGN32(sDebugCamCuts[i].nPoints * sizeof(CutsceneCameraPoint)) * 2; } } sAllocSize += 0x100; @@ -1602,61 +1604,61 @@ s32 DbCamera_CalcMempakAllocSize(void) { return sAllocSize; } -s32 DbCamera_GetMempakAllocSize(void) { +s32 DebugCamera_GetMempakAllocSize(void) { return sAllocSize; } -s32 DbCamera_LoadCallback(char* c) { +s32 DebugCamera_LoadCallback(char* c) { s32 i; s32 size; s32 off; - for (i = 0; i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) { - if (sDbCameraCuts[i].letter != '?') { - DbCamera_ResetCut(i, true); + for (i = 0; i < ARRAY_COUNT(sDebugCamCuts) - 1; i++) { + if (sDebugCamCuts[i].letter != '?') { + DebugCamera_ResetCut(i, true); sLetters[i] = 'X'; } } - if (!Mempak_Read(DBCAM_CONTROLLER_PORT, *c, sDbCameraCuts, 0, sizeof(sDbCameraCuts))) { + if (!Mempak_Read(DEBUG_CAM_CONTROLLER_PORT, *c, sDebugCamCuts, 0, sizeof(sDebugCamCuts))) { return false; } - off = sizeof(sDbCameraCuts); - for (i = 0; i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) { - if (sDbCameraCuts[i].letter != '?') { - size = sDbCameraCuts[i].nPoints * sizeof(CutsceneCameraPoint); + off = sizeof(sDebugCamCuts); + for (i = 0; i < ARRAY_COUNT(sDebugCamCuts) - 1; i++) { + if (sDebugCamCuts[i].letter != '?') { + size = sDebugCamCuts[i].nPoints * sizeof(CutsceneCameraPoint); - sDbCameraCuts[i].lookAt = DebugArena_MallocDebug(ALIGN32(size), "../db_camera.c", 2844); - if (sDbCameraCuts[i].lookAt == NULL) { + sDebugCamCuts[i].lookAt = DebugArena_MallocDebug(ALIGN32(size), "../db_camera.c", 2844); + if (sDebugCamCuts[i].lookAt == NULL) { // "Debug camera memory allocation failure" osSyncPrintf("%s: %d: デバッグカメラ メモリ確保失敗!!\n", "../db_camera.c", 2847); return false; } - if (!Mempak_Read(DBCAM_CONTROLLER_PORT, *c, sDbCameraCuts[i].lookAt, off, ALIGN32(size))) { + if (!Mempak_Read(DEBUG_CAM_CONTROLLER_PORT, *c, sDebugCamCuts[i].lookAt, off, ALIGN32(size))) { return false; } off += ALIGN32(size); - sDbCameraCuts[i].position = DebugArena_MallocDebug(ALIGN32(size), "../db_camera.c", 2855); - if (sDbCameraCuts[i].position == NULL) { + sDebugCamCuts[i].position = DebugArena_MallocDebug(ALIGN32(size), "../db_camera.c", 2855); + if (sDebugCamCuts[i].position == NULL) { // "Debug camera memory allocation failure" osSyncPrintf("%s: %d: デバッグカメラ メモリ確保失敗!!\n", "../db_camera.c", 2858); return false; } - if (!Mempak_Read(DBCAM_CONTROLLER_PORT, *c, sDbCameraCuts[i].position, off, ALIGN32(size))) { + if (!Mempak_Read(DEBUG_CAM_CONTROLLER_PORT, *c, sDebugCamCuts[i].position, off, ALIGN32(size))) { return false; } off += ALIGN32(size); - D_80161250[0x3F + sDbCameraCuts[i].letter] = 'O'; + D_80161250[0x3F + sDebugCamCuts[i].letter] = 'O'; } } return true; } -s32 DbCamera_SaveCallback(char* c) { +s32 DebugCamera_SaveCallback(char* c) { s32 pad[2]; s32 ret; u32 freeSize; @@ -1664,31 +1666,31 @@ s32 DbCamera_SaveCallback(char* c) { s32 size; s32 i; - ret = Mempak_GetFileSize(DBCAM_CONTROLLER_PORT, *c); - freeSize = Mempak_GetFreeBytes(DBCAM_CONTROLLER_PORT); + ret = Mempak_GetFileSize(DEBUG_CAM_CONTROLLER_PORT, *c); + freeSize = Mempak_GetFreeBytes(DEBUG_CAM_CONTROLLER_PORT); if ((u32)sAllocSize < (freeSize + ret)) { - if (!Mempak_CreateFile(DBCAM_CONTROLLER_PORT, c, sAllocSize)) { + if (!Mempak_CreateFile(DEBUG_CAM_CONTROLLER_PORT, c, sAllocSize)) { return false; } - if (!Mempak_Write(DBCAM_CONTROLLER_PORT, *c, sDbCameraCuts, 0, sizeof(sDbCameraCuts))) { - Mempak_DeleteFile(DBCAM_CONTROLLER_PORT, *c); + if (!Mempak_Write(DEBUG_CAM_CONTROLLER_PORT, *c, sDebugCamCuts, 0, sizeof(sDebugCamCuts))) { + Mempak_DeleteFile(DEBUG_CAM_CONTROLLER_PORT, *c); return false; } - off = sizeof(sDbCameraCuts); - for (i = 0; i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) { - if (sDbCameraCuts[i].letter != '?') { - size = sDbCameraCuts[i].nPoints * sizeof(CutsceneCameraPoint); + off = sizeof(sDebugCamCuts); + for (i = 0; i < ARRAY_COUNT(sDebugCamCuts) - 1; i++) { + if (sDebugCamCuts[i].letter != '?') { + size = sDebugCamCuts[i].nPoints * sizeof(CutsceneCameraPoint); - ret = Mempak_Write(DBCAM_CONTROLLER_PORT, *c, sDbCameraCuts[i].lookAt, off, ALIGN32(size)); + ret = Mempak_Write(DEBUG_CAM_CONTROLLER_PORT, *c, sDebugCamCuts[i].lookAt, off, ALIGN32(size)); if (!ret) { break; } off += ALIGN32(size); - ret = Mempak_Write(DBCAM_CONTROLLER_PORT, *c, sDbCameraCuts[i].position, off, ALIGN32(size)); + ret = Mempak_Write(DEBUG_CAM_CONTROLLER_PORT, *c, sDebugCamCuts[i].position, off, ALIGN32(size)); if (!ret) { break; } @@ -1701,7 +1703,7 @@ s32 DbCamera_SaveCallback(char* c) { if (ret) { return *c; } else { - Mempak_DeleteFile(DBCAM_CONTROLLER_PORT, *c); + Mempak_DeleteFile(DEBUG_CAM_CONTROLLER_PORT, *c); return false; } } @@ -1709,40 +1711,40 @@ s32 DbCamera_SaveCallback(char* c) { return false; } -s32 DbCamera_ClearCallback(char* c) { - return Mempak_DeleteFile(DBCAM_CONTROLLER_PORT, *c); +s32 DebugCamera_ClearCallback(char* c) { + return Mempak_DeleteFile(DEBUG_CAM_CONTROLLER_PORT, *c); } -void DbCamera_DrawSlotLetters(char* str, s16 y, s16 x, s32 colorIndex) { +void DebugCamera_DrawSlotLetters(char* str, s16 y, s16 x, s32 colorIndex) { s32 i; - for (i = 0; i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) { - str[i * 2 + 1] = sDbCameraCuts[i].letter; + for (i = 0; i < ARRAY_COUNT(sDebugCamCuts) - 1; i++) { + str[i * 2 + 1] = sDebugCamCuts[i].letter; str[i * 2 + 0] = '-'; } str[0x14] = str[i * 2 + 1] = '\0'; - DbCamera_ScreenTextColored(x, y, colorIndex, str); + DebugCamera_ScreenTextColored(x, y, colorIndex, str); str[0x14] = str[i * 2 + 0] = '-'; - DbCamera_ScreenTextColored(20 + x, y, colorIndex, str + 0x14); + DebugCamera_ScreenTextColored(20 + x, y, colorIndex, str + 0x14); } -void DbCamera_PrintAllCuts(Camera* cam) { +void DebugCamera_PrintAllCuts(Camera* cam) { s32 i; Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); osSyncPrintf("@@@\n@@@\n@@@/* ****** spline point data ** start here ***** */\n@@@\n"); - for (i = 0; i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) { - DbCameraCut* cut = &sDbCameraCuts[i]; + for (i = 0; i < ARRAY_COUNT(sDebugCamCuts) - 1; i++) { + DebugCamCut* cut = &sDebugCamCuts[i]; if (cut->nPoints != 0) { if (i != 0) { osSyncPrintf("@@@\n@@@/* ** %d ** */\n@@@\n", i); } - DbCamera_PrintPoints("Lookat", cut->nPoints, cut->lookAt); - DbCamera_PrintPoints("Position", cut->nPoints, cut->position); + DebugCamera_PrintPoints("Lookat", cut->nPoints, cut->lookAt); + DebugCamera_PrintPoints("Position", cut->nPoints, cut->position); osSyncPrintf("@@@static short nPoints = %d;\n@@@\n", cut->nPoints); osSyncPrintf("@@@static short nFrames = %d;\n@@@\n", cut->nFrames); osSyncPrintf("@@@static short Mode = %d;\n@@@\n", cut->mode); @@ -1756,71 +1758,71 @@ char D_8012D114[] = GFXP_KATAKANA "フレ-ム "; char D_8012D128[] = GFXP_KATAKANA "ト-タル "; char D_8012D13C[] = GFXP_KATAKANA "キ- / "; -s32 func_800B91B0(Camera* cam, DbCamera* dbCamera) { +s32 func_800B91B0(Camera* cam, DebugCam* debugCam) { s32 pointCount; s32 curPoint; - while (sDbCameraCuts[D_8016110C].letter == '?') { + while (sDebugCamCuts[D_8016110C].letter == '?') { D_8016110C++; - if (D_8016110C >= ARRAY_COUNT(sDbCameraCuts) - 1) { - sDbCamAnim.curFrame = 0.0f; - sDbCamAnim.unk_04 = 0; - sDbCamAnim.keyframe = 0; - sDbCamAnim.unk_0A = 0; + if (D_8016110C >= ARRAY_COUNT(sDebugCamCuts) - 1) { + sDebugCamAnim.curFrame = 0.0f; + sDebugCamAnim.unk_04 = 0; + sDebugCamAnim.keyframe = 0; + sDebugCamAnim.unk_0A = 0; D_8016110C = 0; return 0; } } - if (!func_800BB2B4(&sDbCamAnim.positionPos, &sDbCamAnim.roll, &sDbCamAnim.fov, sDbCameraCuts[D_8016110C].position, - &sDbCamAnim.keyframe, &sDbCamAnim.curFrame) && - !func_800BB2B4(&sDbCamAnim.lookAtPos, &sDbCamAnim.roll, &sDbCamAnim.fov, sDbCameraCuts[D_8016110C].lookAt, - &sDbCamAnim.keyframe, &sDbCamAnim.curFrame)) { + if (!func_800BB2B4(&sDebugCamAnim.positionPos, &sDebugCamAnim.roll, &sDebugCamAnim.fov, + sDebugCamCuts[D_8016110C].position, &sDebugCamAnim.keyframe, &sDebugCamAnim.curFrame) && + !func_800BB2B4(&sDebugCamAnim.lookAtPos, &sDebugCamAnim.roll, &sDebugCamAnim.fov, + sDebugCamCuts[D_8016110C].lookAt, &sDebugCamAnim.keyframe, &sDebugCamAnim.curFrame)) { - D_8012D13C[7] = ((sDbCamAnim.keyframe + 1) / 10) + '0'; - D_8012D13C[8] = ((sDbCamAnim.keyframe + 1) % 10) + '0'; - D_8012D13C[10] = ((sDbCameraCuts[D_8016110C].nPoints - 5) / 10) + '0'; - D_8012D13C[11] = ((sDbCameraCuts[D_8016110C].nPoints - 5) % 10) + '0'; - DbCamera_SetTextValue(sDbCamAnim.unk_04, &D_8012D114[10], 4); - DbCamera_ScreenTextColored(15, 22, DBCAMERA_TEXT_ORANGE, D_8012D114); - DbCamera_SetTextValue(sDbCamAnim.unk_0C, &D_8012D128[10], 4); - DbCamera_ScreenTextColored(15, 23, DBCAMERA_TEXT_ORANGE, D_8012D128); - DbCamera_ScreenTextColored(15, 24, DBCAMERA_TEXT_ORANGE, D_8012D13C); - DbCamera_ScreenTextColored(16, 26, DBCAMERA_TEXT_PEACH, D_8012CEF0); + D_8012D13C[7] = ((sDebugCamAnim.keyframe + 1) / 10) + '0'; + D_8012D13C[8] = ((sDebugCamAnim.keyframe + 1) % 10) + '0'; + D_8012D13C[10] = ((sDebugCamCuts[D_8016110C].nPoints - 5) / 10) + '0'; + D_8012D13C[11] = ((sDebugCamCuts[D_8016110C].nPoints - 5) % 10) + '0'; + DebugCamera_SetTextValue(sDebugCamAnim.unk_04, &D_8012D114[10], 4); + DebugCamera_ScreenTextColored(15, 22, DEBUG_CAM_TEXT_ORANGE, D_8012D114); + DebugCamera_SetTextValue(sDebugCamAnim.unk_0C, &D_8012D128[10], 4); + DebugCamera_ScreenTextColored(15, 23, DEBUG_CAM_TEXT_ORANGE, D_8012D128); + DebugCamera_ScreenTextColored(15, 24, DEBUG_CAM_TEXT_ORANGE, D_8012D13C); + DebugCamera_ScreenTextColored(16, 26, DEBUG_CAM_TEXT_PEACH, D_8012CEF0); - sDbCamAnim.unk_04++; - sDbCamAnim.unk_0C++; + sDebugCamAnim.unk_04++; + sDebugCamAnim.unk_0C++; - if (sDbCameraCuts[D_8016110C].nFrames > 0 && sDbCameraCuts[D_8016110C].nFrames < sDbCamAnim.unk_04) { + if (sDebugCamCuts[D_8016110C].nFrames > 0 && sDebugCamCuts[D_8016110C].nFrames < sDebugCamAnim.unk_04) { D_8016110C++; - sDbCamAnim.curFrame = 0.0f; - sDbCamAnim.unk_04 = 0; - sDbCamAnim.keyframe = 0; + sDebugCamAnim.curFrame = 0.0f; + sDebugCamAnim.unk_04 = 0; + sDebugCamAnim.keyframe = 0; return D_8016110C | 0x8000; } - if (sDbCameraCuts[D_8016110C].mode != 1) { - DbCamera_CopyVec3f(&sDbCamAnim.positionPos, &dbCamera->eye); - DbCamera_CopyVec3f(&sDbCamAnim.lookAtPos, &dbCamera->at); + if (sDebugCamCuts[D_8016110C].mode != 1) { + DebugCamera_CopyVec3f(&sDebugCamAnim.positionPos, &debugCam->eye); + DebugCamera_CopyVec3f(&sDebugCamAnim.lookAtPos, &debugCam->at); } else { - func_800B3FF4(&cam->playerPosRot, &sDbCamAnim.lookAtPos, &dbCamera->at); - func_800B3FF4(&cam->playerPosRot, &sDbCamAnim.positionPos, &dbCamera->eye); + func_800B3FF4(&cam->playerPosRot, &sDebugCamAnim.lookAtPos, &debugCam->at); + func_800B3FF4(&cam->playerPosRot, &sDebugCamAnim.positionPos, &debugCam->eye); } - dbCamera->fov = sDbCamAnim.fov; - dbCamera->roll = sDbCamAnim.roll; - dbCamera->rollDegrees = sDbCamAnim.roll * (360.0f / 256.0f); + debugCam->fov = sDebugCamAnim.fov; + debugCam->roll = sDebugCamAnim.roll; + debugCam->rollDegrees = sDebugCamAnim.roll * (360.0f / 256.0f); } else { D_8016110C++; - sDbCamAnim.keyframe = 0; - sDbCamAnim.curFrame = 0.0f; - sDbCamAnim.unk_04 = 0; - if (D_8016110C == ARRAY_COUNT(sDbCameraCuts) - 1) { + sDebugCamAnim.keyframe = 0; + sDebugCamAnim.curFrame = 0.0f; + sDebugCamAnim.unk_04 = 0; + if (D_8016110C == ARRAY_COUNT(sDebugCamCuts) - 1) { D_8016110C = 0; - sDbCamAnim.curFrame = 0.0f; - sDbCamAnim.keyframe = 0; - sDbCamAnim.unk_0A = 0; + sDebugCamAnim.curFrame = 0.0f; + sDebugCamAnim.keyframe = 0; + sDebugCamAnim.unk_0A = 0; return -1; } } @@ -1828,7 +1830,7 @@ s32 func_800B91B0(Camera* cam, DbCamera* dbCamera) { return D_8016110C | 0x8000; } -void DbCamera_Reset(Camera* cam, DbCamera* dbCam) { +void DebugCamera_Reset(Camera* cam, DebugCam* debugCam) { s32 i; D_801612EA = '*'; @@ -1837,94 +1839,94 @@ void DbCamera_Reset(Camera* cam, DbCamera* dbCam) { } for (i = 0; i < 0xF; i++) { - DbCamera_ResetCut(i, false); + DebugCamera_ResetCut(i, false); } - sDbCamPtr = dbCam; + sDebugCamPtr = debugCam; D_8016110C = 0; sCurFileIdx = 0; sLastFileIdx = -1; - sDbCamAnim.unk_0A = 0; + sDebugCamAnim.unk_0A = 0; } -s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { +s32 DebugCamera_UpdateDemoControl(DebugCam* debugCam, Camera* cam) { static s32 sMempakFiles; - static u32 sDbCameraColors[] = { - DBCAMERA_TEXT_GOLD, DBCAMERA_TEXT_GOLD, DBCAMERA_TEXT_GOLD, - DBCAMERA_TEXT_GREEN, DBCAMERA_TEXT_GOLD, DBCAMERA_TEXT_GOLD, + static u32 sDebugCamColors[] = { + DEBUG_CAM_TEXT_GOLD, DEBUG_CAM_TEXT_GOLD, DEBUG_CAM_TEXT_GOLD, + DEBUG_CAM_TEXT_GREEN, DEBUG_CAM_TEXT_GOLD, DEBUG_CAM_TEXT_GOLD, }; static s32 sMempakFilesize = 0; s32 i; s32 idx1; s32 idx2; s16 idx3; - char sp74[(ARRAY_COUNT(sDbCameraCuts) - 1 + 4) * 2]; - DbCameraCut sp64; + char sp74[(ARRAY_COUNT(sDebugCamCuts) - 1 + 4) * 2]; + DebugCamCut sp64; VecGeo sp5C; - s32 (*callbacks[])(char*) = { DbCamera_SaveCallback, DbCamera_LoadCallback, DbCamera_ClearCallback }; + s32 (*callbacks[])(char*) = { DebugCamera_SaveCallback, DebugCamera_LoadCallback, DebugCamera_ClearCallback }; - DbCamera_ScreenTextColored(14, 5, DBCAMERA_TEXT_YELLOW, D_8012CF44); // DEMO CONTROL + DebugCamera_ScreenTextColored(14, 5, DEBUG_CAM_TEXT_YELLOW, D_8012CF44); // DEMO CONTROL idx1 = sCurFileIdx >> 1; idx2 = sLastFileIdx >> 1; - switch (dbCamera->sub.demoCtrlActionIdx) { + switch (debugCam->sub.demoCtrlActionIdx) { case ACTION_SAVE: case ACTION_LOAD: case ACTION_CLEAR: - switch (dbCamera->sub.demoCtrlMenu) { + switch (debugCam->sub.demoCtrlMenu) { case DEMO_CTRL_MENU(ACTION_SAVE, MENU_INFO): case DEMO_CTRL_MENU(ACTION_LOAD, MENU_INFO): case DEMO_CTRL_MENU(ACTION_CLEAR, MENU_INFO): { if ((1 << sCurFileIdx) & sMempakFiles) { - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_DLEFT) || - CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_DRIGHT)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DLEFT) || + CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DRIGHT)) { Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - dbCamera->sub.demoCtrlToggleSwitch ^= 1; + debugCam->sub.demoCtrlToggleSwitch ^= 1; } D_8012CEE0[41][9] = MEMPAK_INDEX_TO_LETTER(sCurFileIdx); - DbCamera_ScreenTextColored(10, 7, DBCAMERA_TEXT_WHITE, D_8012CEE0[41]); - DbCamera_ScreenTextColored(16, 7, DBCAMERA_TEXT_WHITE, - D_8012CF60[dbCamera->sub.demoCtrlActionIdx]); - DbCamera_ScreenTextColored(20, 7, DBCAMERA_TEXT_WHITE, D_8012CF88[0]); + DebugCamera_ScreenTextColored(10, 7, DEBUG_CAM_TEXT_WHITE, D_8012CEE0[41]); + DebugCamera_ScreenTextColored(16, 7, DEBUG_CAM_TEXT_WHITE, + D_8012CF60[debugCam->sub.demoCtrlActionIdx]); + DebugCamera_ScreenTextColored(20, 7, DEBUG_CAM_TEXT_WHITE, D_8012CF88[0]); - DbCamera_ScreenTextColored( - 17, 8, dbCamera->sub.demoCtrlToggleSwitch ? DBCAMERA_TEXT_GOLD : DBCAMERA_TEXT_GREEN, + DebugCamera_ScreenTextColored( + 17, 8, debugCam->sub.demoCtrlToggleSwitch ? DEBUG_CAM_TEXT_GOLD : DEBUG_CAM_TEXT_GREEN, D_8012CF94); - DbCamera_ScreenTextColored( - 21, 8, dbCamera->sub.demoCtrlToggleSwitch ? DBCAMERA_TEXT_GREEN : DBCAMERA_TEXT_GOLD, + DebugCamera_ScreenTextColored( + 21, 8, debugCam->sub.demoCtrlToggleSwitch ? DEBUG_CAM_TEXT_GREEN : DEBUG_CAM_TEXT_GOLD, D_8012CF98); - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_A)) { - if (dbCamera->sub.demoCtrlToggleSwitch == 0) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_A)) { + if (debugCam->sub.demoCtrlToggleSwitch == 0) { Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - dbCamera->sub.demoCtrlMenu++; + debugCam->sub.demoCtrlMenu++; } else { Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - dbCamera->sub.demoCtrlMenu = 0; + debugCam->sub.demoCtrlMenu = 0; } } } else { - if (dbCamera->sub.demoCtrlMenu == 100) { - dbCamera->sub.demoCtrlMenu++; + if (debugCam->sub.demoCtrlMenu == 100) { + debugCam->sub.demoCtrlMenu++; } else { - dbCamera->sub.demoCtrlToggleSwitch ^= 1; + debugCam->sub.demoCtrlToggleSwitch ^= 1; D_8012CF84[9] = MEMPAK_INDEX_TO_LETTER(sCurFileIdx); - DbCamera_ScreenTextColored(13, 7, DBCAMERA_TEXT_WHITE, - D_8012CF88[-1]); // todo: find something better - DbCamera_ScreenTextColored(18, 7, DBCAMERA_TEXT_WHITE, D_8012CF80); - DbCamera_ScreenTextColored( - 13, 9, dbCamera->sub.demoCtrlToggleSwitch ? DBCAMERA_TEXT_PEACH : DBCAMERA_TEXT_BLUE, + DebugCamera_ScreenTextColored(13, 7, DEBUG_CAM_TEXT_WHITE, + D_8012CF88[-1]); // todo: find something better + DebugCamera_ScreenTextColored(18, 7, DEBUG_CAM_TEXT_WHITE, D_8012CF80); + DebugCamera_ScreenTextColored( + 13, 9, debugCam->sub.demoCtrlToggleSwitch ? DEBUG_CAM_TEXT_PEACH : DEBUG_CAM_TEXT_BLUE, "PRESS B BUTTON"); } } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_B)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_B)) { Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - dbCamera->sub.demoCtrlMenu = 0; + debugCam->sub.demoCtrlMenu = 0; return 1; } goto block_2; @@ -1934,15 +1936,16 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { case DEMO_CTRL_MENU(ACTION_LOAD, MENU_CALLBACK): case DEMO_CTRL_MENU(ACTION_CLEAR, MENU_CALLBACK): { D_8012CEE0[41][9] = MEMPAK_INDEX_TO_LETTER(sCurFileIdx); - DbCamera_ScreenTextColored(12, 7, DBCAMERA_TEXT_WHITE, D_8012CEE0[41]); - DbCamera_ScreenTextColored(18, 7, DBCAMERA_TEXT_WHITE, D_8012CF60[dbCamera->sub.demoCtrlActionIdx]); - DbCamera_ScreenTextColored(22, 7, DBCAMERA_TEXT_WHITE, D_8012CF9C[0]); + DebugCamera_ScreenTextColored(12, 7, DEBUG_CAM_TEXT_WHITE, D_8012CEE0[41]); + DebugCamera_ScreenTextColored(18, 7, DEBUG_CAM_TEXT_WHITE, + D_8012CF60[debugCam->sub.demoCtrlActionIdx]); + DebugCamera_ScreenTextColored(22, 7, DEBUG_CAM_TEXT_WHITE, D_8012CF9C[0]); - if (callbacks[dbCamera->sub.demoCtrlActionIdx - 1](&D_8012CF84[9])) { - dbCamera->sub.demoCtrlMenu++; + if (callbacks[debugCam->sub.demoCtrlActionIdx - 1](&D_8012CF84[9])) { + debugCam->sub.demoCtrlMenu++; return 1; } else { - dbCamera->sub.demoCtrlMenu += 8; + debugCam->sub.demoCtrlMenu += 8; return 1; } } @@ -1950,24 +1953,24 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { case DEMO_CTRL_MENU(ACTION_SAVE, MENU_SUCCESS): case DEMO_CTRL_MENU(ACTION_LOAD, MENU_SUCCESS): case DEMO_CTRL_MENU(ACTION_CLEAR, MENU_SUCCESS): { - dbCamera->sub.demoCtrlToggleSwitch ^= 1; + debugCam->sub.demoCtrlToggleSwitch ^= 1; D_8012CEE0[41][9] = MEMPAK_INDEX_TO_LETTER(sCurFileIdx); - DbCamera_ScreenTextColored(13, 7, DBCAMERA_TEXT_WHITE, D_8012CEE0[41]); - DbCamera_ScreenTextColored(19, 7, DBCAMERA_TEXT_WHITE, - D_8012CF60[dbCamera->sub.demoCtrlMenu / 100]); - DbCamera_ScreenTextColored(23, 7, DBCAMERA_TEXT_WHITE, D_8012CFA4); - DbCamera_ScreenTextColored( - 13, 9, (dbCamera->sub.demoCtrlToggleSwitch != 0) ? DBCAMERA_TEXT_PEACH : DBCAMERA_TEXT_BLUE, + DebugCamera_ScreenTextColored(13, 7, DEBUG_CAM_TEXT_WHITE, D_8012CEE0[41]); + DebugCamera_ScreenTextColored(19, 7, DEBUG_CAM_TEXT_WHITE, + D_8012CF60[debugCam->sub.demoCtrlMenu / 100]); + DebugCamera_ScreenTextColored(23, 7, DEBUG_CAM_TEXT_WHITE, D_8012CFA4); + DebugCamera_ScreenTextColored( + 13, 9, (debugCam->sub.demoCtrlToggleSwitch != 0) ? DEBUG_CAM_TEXT_PEACH : DEBUG_CAM_TEXT_BLUE, "PRESS B BUTTON"); - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_A) || - CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_B)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_A) || + CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_B)) { Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - if (dbCamera->sub.demoCtrlMenu == DEMO_CTRL_MENU(ACTION_LOAD, MENU_SUCCESS)) { - dbCamera->sub.demoCtrlActionIdx = ACTION_E; + if (debugCam->sub.demoCtrlMenu == DEMO_CTRL_MENU(ACTION_LOAD, MENU_SUCCESS)) { + debugCam->sub.demoCtrlActionIdx = ACTION_E; } - dbCamera->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_INFO); + debugCam->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_INFO); return 1; } goto block_2; @@ -1976,21 +1979,21 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { case DEMO_CTRL_MENU(ACTION_SAVE, MENU_ERROR): case DEMO_CTRL_MENU(ACTION_LOAD, MENU_ERROR): case DEMO_CTRL_MENU(ACTION_CLEAR, MENU_ERROR): { - dbCamera->sub.demoCtrlToggleSwitch ^= 1; + debugCam->sub.demoCtrlToggleSwitch ^= 1; D_8012CEE0[41][9] = MEMPAK_INDEX_TO_LETTER(sCurFileIdx); - DbCamera_ScreenTextColored(13, 7, DBCAMERA_TEXT_WHITE, - D_8012CEE0[(dbCamera->sub.demoCtrlMenu / 100) + 32]); - DbCamera_ScreenTextColored(17, 7, DBCAMERA_TEXT_WHITE, D_8012CFAC); - DbCamera_ScreenTextColored(23, 7, DBCAMERA_TEXT_WHITE, D_8012CFA4); - DbCamera_ScreenTextColored( - 13, 9, (dbCamera->sub.demoCtrlToggleSwitch != 0) ? DBCAMERA_TEXT_PEACH : DBCAMERA_TEXT_BLUE, + DebugCamera_ScreenTextColored(13, 7, DEBUG_CAM_TEXT_WHITE, + D_8012CEE0[(debugCam->sub.demoCtrlMenu / 100) + 32]); + DebugCamera_ScreenTextColored(17, 7, DEBUG_CAM_TEXT_WHITE, D_8012CFAC); + DebugCamera_ScreenTextColored(23, 7, DEBUG_CAM_TEXT_WHITE, D_8012CFA4); + DebugCamera_ScreenTextColored( + 13, 9, (debugCam->sub.demoCtrlToggleSwitch != 0) ? DEBUG_CAM_TEXT_PEACH : DEBUG_CAM_TEXT_BLUE, "PRESS B BUTTON"); - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_A) || - CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_B)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_A) || + CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_B)) { Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - dbCamera->sub.demoCtrlMenu -= 9; + debugCam->sub.demoCtrlMenu -= 9; } block_2: return 1; @@ -2000,17 +2003,17 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { goto block_1; default: { - if (Mempak_Init(DBCAM_CONTROLLER_PORT)) { - sMempakFiles = Mempak_FindFiles(DBCAM_CONTROLLER_PORT, 'A', 'E'); - dbCamera->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_CALLBACK); - DbCamera_CalcMempakAllocSize(); + if (Mempak_Init(DEBUG_CAM_CONTROLLER_PORT)) { + sMempakFiles = Mempak_FindFiles(DEBUG_CAM_CONTROLLER_PORT, 'A', 'E'); + debugCam->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_CALLBACK); + DebugCamera_CalcMempakAllocSize(); if ((1 << sCurFileIdx) & sMempakFiles) { sMempakFilesize = - Mempak_GetFileSize(DBCAM_CONTROLLER_PORT, MEMPAK_INDEX_TO_LETTER(sCurFileIdx)); - dbCamera->sub.demoCtrlActionIdx = ACTION_LOAD; + Mempak_GetFileSize(DEBUG_CAM_CONTROLLER_PORT, MEMPAK_INDEX_TO_LETTER(sCurFileIdx)); + debugCam->sub.demoCtrlActionIdx = ACTION_LOAD; } else { sMempakFilesize = 0; - dbCamera->sub.demoCtrlActionIdx = ACTION_SAVE; + debugCam->sub.demoCtrlActionIdx = ACTION_SAVE; } block_1: idx2 = 1; @@ -2023,7 +2026,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { sp74[i * 2 + 0] = '-'; sp74[i * 2 + 1] = '\0'; - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_DRIGHT)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DRIGHT)) { Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (sCurFileIdx >= 4) { @@ -2034,14 +2037,14 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { if ((1 << sCurFileIdx) & sMempakFiles) { sMempakFilesize = - Mempak_GetFileSize(DBCAM_CONTROLLER_PORT, MEMPAK_INDEX_TO_LETTER(sCurFileIdx)); - dbCamera->sub.demoCtrlActionIdx = ACTION_LOAD; + Mempak_GetFileSize(DEBUG_CAM_CONTROLLER_PORT, MEMPAK_INDEX_TO_LETTER(sCurFileIdx)); + debugCam->sub.demoCtrlActionIdx = ACTION_LOAD; } else { sMempakFilesize = 0; - dbCamera->sub.demoCtrlActionIdx = ACTION_SAVE; + debugCam->sub.demoCtrlActionIdx = ACTION_SAVE; } } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_DLEFT)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DLEFT)) { Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (sCurFileIdx <= 0) { @@ -2052,74 +2055,74 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { if ((1 << sCurFileIdx) & sMempakFiles) { sMempakFilesize = - Mempak_GetFileSize(DBCAM_CONTROLLER_PORT, MEMPAK_INDEX_TO_LETTER(sCurFileIdx)); - dbCamera->sub.demoCtrlActionIdx = ACTION_LOAD; + Mempak_GetFileSize(DEBUG_CAM_CONTROLLER_PORT, MEMPAK_INDEX_TO_LETTER(sCurFileIdx)); + debugCam->sub.demoCtrlActionIdx = ACTION_LOAD; } else { sMempakFilesize = 0; - dbCamera->sub.demoCtrlActionIdx = ACTION_SAVE; + debugCam->sub.demoCtrlActionIdx = ACTION_SAVE; } } - idx3 = dbCamera->sub.demoCtrlActionIdx; - DbCamera_ScreenTextColored(14, 7, DBCAMERA_TEXT_WHITE, D_8012CF50[idx3]); - DbCamera_ScreenTextColored(15, 7, DBCAMERA_TEXT_GOLD, sp74); + idx3 = debugCam->sub.demoCtrlActionIdx; + DebugCamera_ScreenTextColored(14, 7, DEBUG_CAM_TEXT_WHITE, D_8012CF50[idx3]); + DebugCamera_ScreenTextColored(15, 7, DEBUG_CAM_TEXT_GOLD, sp74); - DbCamera_ScreenTextColored(16 + (sCurFileIdx * 2), 7, DBCAMERA_TEXT_GREEN, "_"); // cursor - DbCamera_SetTextValue(DbCamera_GetMempakAllocSize(), sp74, 6); - DbCamera_ScreenTextColored(13, 9, DBCAMERA_TEXT_BLUE, D_8012CF78); // NEED BYTE - DbCamera_ScreenTextColored(17, 9, DBCAMERA_TEXT_GOLD, sp74); - DbCamera_SetTextValue(Mempak_GetFreeBytes(DBCAM_CONTROLLER_PORT), sp74, 6); - DbCamera_ScreenTextColored(13, 10, DBCAMERA_TEXT_BLUE, D_8012CF74); // FREE BYTE - DbCamera_ScreenTextColored(17, 10, DBCAMERA_TEXT_GOLD, sp74); + DebugCamera_ScreenTextColored(16 + (sCurFileIdx * 2), 7, DEBUG_CAM_TEXT_GREEN, "_"); // cursor + DebugCamera_SetTextValue(DebugCamera_GetMempakAllocSize(), sp74, 6); + DebugCamera_ScreenTextColored(13, 9, DEBUG_CAM_TEXT_BLUE, D_8012CF78); // NEED BYTE + DebugCamera_ScreenTextColored(17, 9, DEBUG_CAM_TEXT_GOLD, sp74); + DebugCamera_SetTextValue(Mempak_GetFreeBytes(DEBUG_CAM_CONTROLLER_PORT), sp74, 6); + DebugCamera_ScreenTextColored(13, 10, DEBUG_CAM_TEXT_BLUE, D_8012CF74); // FREE BYTE + DebugCamera_ScreenTextColored(17, 10, DEBUG_CAM_TEXT_GOLD, sp74); if (sMempakFilesize != 0) { - DbCamera_SetTextValue(sMempakFilesize, sp74, 6); - DbCamera_ScreenTextColored(13, 11, DBCAMERA_TEXT_GREEN, D_8012CFA8); - DbCamera_ScreenTextColored(17, 11, DBCAMERA_TEXT_GOLD, sp74); + DebugCamera_SetTextValue(sMempakFilesize, sp74, 6); + DebugCamera_ScreenTextColored(13, 11, DEBUG_CAM_TEXT_GREEN, D_8012CFA8); + DebugCamera_ScreenTextColored(17, 11, DEBUG_CAM_TEXT_GOLD, sp74); } - idx1 = (dbCamera->sub.demoCtrlActionIdx + 2); - DbCamera_ScreenTextColored(15, 22, DBCAMERA_TEXT_PEACH, D_8012CF7C); - DbCamera_ScreenTextColored(18, 23, sDbCameraColors[idx1], D_8012CF64); - DbCamera_ScreenTextColored(18, 24, sDbCameraColors[idx1 - 1], D_8012CF68); - DbCamera_ScreenTextColored(18, 25, sDbCameraColors[idx1 - 2], D_8012CF6C); - DbCamera_ScreenTextColored(14, 22 + dbCamera->sub.demoCtrlActionIdx, DBCAMERA_TEXT_GREEN, - D_8012CF0C); // current selection - DbCamera_ScreenTextColored(13, 26, DBCAMERA_TEXT_WHITE, D_8012CF60[0]); - DbCamera_ScreenTextColored(20, 26, DBCAMERA_TEXT_WHITE, D_8012CF70); + idx1 = (debugCam->sub.demoCtrlActionIdx + 2); + DebugCamera_ScreenTextColored(15, 22, DEBUG_CAM_TEXT_PEACH, D_8012CF7C); + DebugCamera_ScreenTextColored(18, 23, sDebugCamColors[idx1], D_8012CF64); + DebugCamera_ScreenTextColored(18, 24, sDebugCamColors[idx1 - 1], D_8012CF68); + DebugCamera_ScreenTextColored(18, 25, sDebugCamColors[idx1 - 2], D_8012CF6C); + DebugCamera_ScreenTextColored(14, 22 + debugCam->sub.demoCtrlActionIdx, DEBUG_CAM_TEXT_GREEN, + D_8012CF0C); // current selection + DebugCamera_ScreenTextColored(13, 26, DEBUG_CAM_TEXT_WHITE, D_8012CF60[0]); + DebugCamera_ScreenTextColored(20, 26, DEBUG_CAM_TEXT_WHITE, D_8012CF70); - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_DUP)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DUP)) { Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx - 1) % 4u; + debugCam->sub.demoCtrlActionIdx = (debugCam->sub.demoCtrlActionIdx - 1) % 4u; } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_DDOWN)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DDOWN)) { Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx + 1) % 4u; + debugCam->sub.demoCtrlActionIdx = (debugCam->sub.demoCtrlActionIdx + 1) % 4u; } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_A)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_A)) { Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - dbCamera->sub.demoCtrlToggleSwitch = 0; - dbCamera->sub.demoCtrlMenu = DEMO_CTRL_MENU(dbCamera->sub.demoCtrlActionIdx, MENU_INFO); + debugCam->sub.demoCtrlToggleSwitch = 0; + debugCam->sub.demoCtrlMenu = DEMO_CTRL_MENU(debugCam->sub.demoCtrlActionIdx, MENU_INFO); } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_B)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_B)) { Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - dbCamera->sub.demoCtrlActionIdx = ACTION_E; + debugCam->sub.demoCtrlActionIdx = ACTION_E; return 1; } goto block_2; } else { - DbCamera_ScreenTextColored(12, 26, DBCAMERA_TEXT_GOLD, D_8012CF60[0]); - DbCamera_ScreenTextColored(19, 26, DBCAMERA_TEXT_GOLD, D_8012CF80); - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_B) || - CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_DUP) || - CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_DDOWN)) { + DebugCamera_ScreenTextColored(12, 26, DEBUG_CAM_TEXT_GOLD, D_8012CF60[0]); + DebugCamera_ScreenTextColored(19, 26, DEBUG_CAM_TEXT_GOLD, D_8012CF80); + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_B) || + CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DUP) || + CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DDOWN)) { Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - dbCamera->sub.demoCtrlActionIdx = ACTION_E; + debugCam->sub.demoCtrlActionIdx = ACTION_E; } return 2; } @@ -2129,60 +2132,60 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { break; default: { - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_DUP)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DUP)) { Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - dbCamera->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_INFO); - dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx - 1) % 4u; + debugCam->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_INFO); + debugCam->sub.demoCtrlActionIdx = (debugCam->sub.demoCtrlActionIdx - 1) % 4u; sCurFileIdx = 0; } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_DDOWN)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DDOWN)) { Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - dbCamera->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_INFO); - dbCamera->sub.demoCtrlActionIdx = (dbCamera->sub.demoCtrlActionIdx + 1) % 4u; + debugCam->sub.demoCtrlMenu = DEMO_CTRL_MENU(ACTION_E, MENU_INFO); + debugCam->sub.demoCtrlActionIdx = (debugCam->sub.demoCtrlActionIdx + 1) % 4u; sCurFileIdx = 0; } - DbCamera_DrawSlotLetters(sp74, 7, 5, DBCAMERA_TEXT_GOLD); + DebugCamera_DrawSlotLetters(sp74, 7, 5, DEBUG_CAM_TEXT_GOLD); - if (sDbCamAnim.unk_0A != 0) { - DbCamera_ScreenTextColored(4, 7, DBCAMERA_TEXT_WHITE, D_8012CF4C); - DbCamera_ScreenTextColored(6 + (D_8016110C * 2), 7, DBCAMERA_TEXT_GREEN, ">"); + if (sDebugCamAnim.unk_0A != 0) { + DebugCamera_ScreenTextColored(4, 7, DEBUG_CAM_TEXT_WHITE, D_8012CF4C); + DebugCamera_ScreenTextColored(6 + (D_8016110C * 2), 7, DEBUG_CAM_TEXT_GREEN, ">"); - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_CUP)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CUP)) { if (D_8016110C > 0) { D_8016110C--; } - sDbCamAnim.curFrame = 0.0f; - sDbCamAnim.keyframe = 0; - sDbCamAnim.unk_04 = 0; - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_CDOWN)) { + sDebugCamAnim.curFrame = 0.0f; + sDebugCamAnim.keyframe = 0; + sDebugCamAnim.unk_04 = 0; + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CDOWN)) { if (D_8016110C < 14) { D_8016110C++; } - sDbCamAnim.curFrame = 0.0f; - sDbCamAnim.keyframe = 0; - sDbCamAnim.unk_04 = 0; - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_CLEFT)) { - sDbCamAnim.unk_0A = 0; + sDebugCamAnim.curFrame = 0.0f; + sDebugCamAnim.keyframe = 0; + sDebugCamAnim.unk_04 = 0; + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CLEFT)) { + sDebugCamAnim.unk_0A = 0; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING_ALT); Letterbox_SetSizeTarget(0); D_8016110C = 0; return 2; } - if (func_800B91B0(cam, dbCamera) == 0) { + if (func_800B91B0(cam, debugCam) == 0) { Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING_ALT); Letterbox_SetSizeTarget(0); Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - OLib_Vec3fDiffToVecGeo(&sp5C, &dbCamera->eye, &dbCamera->at); - DbCamera_CalcUpFromPitchYawRoll(&dbCamera->unk_1C, sp5C.pitch, sp5C.yaw, - CAM_DEG_TO_BINANG(dbCamera->rollDegrees)); + OLib_Vec3fDiffToVecGeo(&sp5C, &debugCam->eye, &debugCam->at); + DebugCamera_CalcUpFromPitchYawRoll(&debugCam->unk_1C, sp5C.pitch, sp5C.yaw, + CAM_DEG_TO_BINANG(debugCam->rollDegrees)); return 2; } @@ -2190,56 +2193,56 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { gUseCutsceneCam = false; gSaveContext.cutsceneIndex = 0xFFFD; gSaveContext.cutsceneTrigger = 1; - sDbCamAnim.curFrame = 0.0f; - sDbCamAnim.keyframe = 0; - sDbCamAnim.unk_04 = 0; - sDbCamAnim.unk_0A = 1; - sDbCamAnim.unk_0C = 0; + sDebugCamAnim.curFrame = 0.0f; + sDebugCamAnim.keyframe = 0; + sDebugCamAnim.unk_04 = 0; + sDebugCamAnim.unk_0A = 1; + sDebugCamAnim.unk_0C = 0; D_8016110C = 0; Audio_PlaySfxGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_L)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_L)) { if (sp74[sCurFileIdx] == '?') { sLastFileIdx = -1; D_801612EA = '*'; } else { sLastFileIdx = sCurFileIdx; - D_801612EA = sDbCameraCuts[idx1].letter; + D_801612EA = sDebugCamCuts[idx1].letter; } if (1) {} - } else if (!CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_L)) { + } else if (!CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L)) { if (sLastFileIdx != -1) { switch (sp74[sCurFileIdx]) { case '?': Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - sDbCameraCuts[idx1] = sDbCameraCuts[idx2]; + sDebugCamCuts[idx1] = sDebugCamCuts[idx2]; sp74[sCurFileIdx] = '?'; // useless - DbCamera_ResetCut(idx2, false); + DebugCamera_ResetCut(idx2, false); break; case '-': Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - sp64 = sDbCameraCuts[idx2]; + sp64 = sDebugCamCuts[idx2]; if (sLastFileIdx < sCurFileIdx) { // rotate right - for (i = idx2; i < idx1 - 1 && i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) { - sDbCameraCuts[i] = sDbCameraCuts[i + 1]; + for (i = idx2; i < idx1 - 1 && i < ARRAY_COUNT(sDebugCamCuts) - 1; i++) { + sDebugCamCuts[i] = sDebugCamCuts[i + 1]; } - sDbCameraCuts[idx1 - 1] = sp64; + sDebugCamCuts[idx1 - 1] = sp64; } else if (sCurFileIdx < sLastFileIdx) { // rotate left for (i = idx2; idx1 < i && i > 0; i--) { - sDbCameraCuts[i] = sDbCameraCuts[i - 1]; + sDebugCamCuts[i] = sDebugCamCuts[i - 1]; } - sDbCameraCuts[idx1] = sp64; + sDebugCamCuts[idx1] = sp64; } - for (i = 0; i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) { - sp74[i * 2 + 1] = sDbCameraCuts[i].letter; + for (i = 0; i < ARRAY_COUNT(sDebugCamCuts) - 1; i++) { + sp74[i * 2 + 1] = sDebugCamCuts[i].letter; } break; default: @@ -2251,51 +2254,51 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { sLastFileIdx = -1; } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_A)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_A)) { if (sp74[sCurFileIdx] == '?') { Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - sp74[sCurFileIdx] = DbCamera_InitCut(idx1, &dbCamera->sub); + sp74[sCurFileIdx] = DebugCamera_InitCut(idx1, &debugCam->sub); if (sp74[sCurFileIdx] == '?') { - DbCamera_ScreenTextColored(15, 24, DBCAMERA_TEXT_GREEN, D_8012CF48); + DebugCamera_ScreenTextColored(15, 24, DEBUG_CAM_TEXT_GREEN, D_8012CF48); } } } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_B)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_B)) { if (sp74[sCurFileIdx] != '?' && sp74[sCurFileIdx] != '-') { Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); sp74[sCurFileIdx] = '?'; - DbCamera_ResetCut(idx1, true); + DebugCamera_ResetCut(idx1, true); } } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_R)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_R)) { if (sp74[sCurFileIdx] != '?' && sp74[sCurFileIdx] != '-') { Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - for (i = 0; i < sDbCameraCuts[idx1].nPoints; i++) { - dbCamera->sub.lookAt[i] = sDbCameraCuts[idx1].lookAt[i]; + for (i = 0; i < sDebugCamCuts[idx1].nPoints; i++) { + debugCam->sub.lookAt[i] = sDebugCamCuts[idx1].lookAt[i]; } // why use another loop for that... - for (i = 0; i < sDbCameraCuts[idx1].nPoints; i++) { - dbCamera->sub.position[i] = sDbCameraCuts[idx1].position[i]; + for (i = 0; i < sDebugCamCuts[idx1].nPoints; i++) { + debugCam->sub.position[i] = sDebugCamCuts[idx1].position[i]; } - dbCamera->sub.mode = sDbCameraCuts[idx1].mode; - dbCamera->sub.nFrames = sDbCameraCuts[idx1].nFrames; - dbCamera->sub.nPoints = sDbCameraCuts[idx1].nPoints; - dbCamera->sub.unkIdx = 0; - func_800B41DC(dbCamera, dbCamera->sub.unkIdx, cam); + debugCam->sub.mode = sDebugCamCuts[idx1].mode; + debugCam->sub.nFrames = sDebugCamCuts[idx1].nFrames; + debugCam->sub.nPoints = sDebugCamCuts[idx1].nPoints; + debugCam->sub.unkIdx = 0; + func_800B41DC(debugCam, debugCam->sub.unkIdx, cam); sp74[sCurFileIdx] = '?'; - DbCamera_ResetCut(idx1, true); - dbCamera->unk_00 = 1; + DebugCamera_ResetCut(idx1, true); + debugCam->unk_00 = 1; } } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_DRIGHT)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DRIGHT)) { Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); if (sCurFileIdx == 0x1E) { @@ -2304,36 +2307,36 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { sCurFileIdx++; } } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_DLEFT)) { + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_DLEFT)) { Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); sCurFileIdx = (sCurFileIdx == 0) ? 0x1E : sCurFileIdx - 1; } - if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_L) && - CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_CRIGHT)) { - for (i = 0; i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) { - osSyncPrintf("###%2d:(%c) (%d %d) %d %d %d\n", i, sDbCameraCuts[i].letter, - sDbCameraCuts[i].position, sDbCameraCuts[i].lookAt, sDbCameraCuts[i].nFrames, - sDbCameraCuts[i].nPoints, sDbCameraCuts[i].mode); + if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L) && + CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CRIGHT)) { + for (i = 0; i < ARRAY_COUNT(sDebugCamCuts) - 1; i++) { + osSyncPrintf("###%2d:(%c) (%d %d) %d %d %d\n", i, sDebugCamCuts[i].letter, + sDebugCamCuts[i].position, sDebugCamCuts[i].lookAt, sDebugCamCuts[i].nFrames, + sDebugCamCuts[i].nPoints, sDebugCamCuts[i].mode); } - DbCamera_PrintAllCuts(cam); - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].cur.button, BTN_L) && - CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_CLEFT)) { + DebugCamera_PrintAllCuts(cam); + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].cur.button, BTN_L) && + CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CLEFT)) { Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - for (i = 0; i < ARRAY_COUNT(sDbCameraCuts) - 1; i++) { - if (sDbCameraCuts[i].nPoints != 0) { + for (i = 0; i < ARRAY_COUNT(sDebugCamCuts) - 1; i++) { + if (sDebugCamCuts[i].nPoints != 0) { osSyncPrintf("\n@@@ /* CUT [%d]\t*/", i); - DbCamera_PrintCutBytes(&sDbCameraCuts[i]); + DebugCamera_PrintCutBytes(&sDebugCamCuts[i]); } } - } else if (CHECK_BTN_ALL(sPlay->state.input[DBCAM_CONTROLLER_PORT].press.button, BTN_CRIGHT)) { - sDbCamAnim.curFrame = 0.0f; - sDbCamAnim.keyframe = 0; - sDbCamAnim.unk_04 = 0.0f; - sDbCamAnim.unk_0A = 1; - sDbCamAnim.unk_0C = 0; + } else if (CHECK_BTN_ALL(sPlay->state.input[DEBUG_CAM_CONTROLLER_PORT].press.button, BTN_CRIGHT)) { + sDebugCamAnim.curFrame = 0.0f; + sDebugCamAnim.keyframe = 0; + sDebugCamAnim.unk_04 = 0.0f; + sDebugCamAnim.unk_0A = 1; + sDebugCamAnim.unk_0C = 0; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); Letterbox_SetSizeTarget(32); D_8016110C = 0; @@ -2341,15 +2344,15 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - DbCamera_ScreenTextColored(4, 7, DBCAMERA_TEXT_WHITE, D_8012CF50[0]); + DebugCamera_ScreenTextColored(4, 7, DEBUG_CAM_TEXT_WHITE, D_8012CF50[0]); sp74[1] = 0; if (sLastFileIdx != -1) { sp74[0] = D_801612EA; - DbCamera_ScreenTextColored(5 + sLastFileIdx, 7, DBCAMERA_TEXT_BROWN, sp74); + DebugCamera_ScreenTextColored(5 + sLastFileIdx, 7, DEBUG_CAM_TEXT_BROWN, sp74); } else { sp74[0] = '_'; } - DbCamera_ScreenTextColored(5 + sCurFileIdx, 7, DBCAMERA_TEXT_GREEN, sp74); + DebugCamera_ScreenTextColored(5 + sCurFileIdx, 7, DEBUG_CAM_TEXT_GREEN, sp74); break; } @@ -2359,13 +2362,13 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { } void func_800BB03C(Camera* cam) { - func_800B91B0(cam, sDbCamPtr); + func_800B91B0(cam, sDebugCamPtr); } void func_800BB060(void) { - sDbCamAnim.unk_0A = 0; + sDebugCamAnim.unk_0A = 0; } s32 func_800BB06C(void) { - return sDbCamPtr->unk_00 == 2 && sDbCamAnim.unk_0A != 0; + return sDebugCamPtr->unk_00 == 2 && sDebugCamAnim.unk_0A != 0; } diff --git a/src/code/z_actor.c b/src/code/z_actor.c index ca7ca7ebf2..637f7fceec 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -4062,7 +4062,7 @@ s16 func_80034DD4(Actor* actor, PlayState* play, s16 arg2, f32 arg3) { Player* player = GET_PLAYER(play); f32 var; - if ((play->csCtx.state != CS_STATE_IDLE) || gDbgCamEnabled) { + if ((play->csCtx.state != CS_STATE_IDLE) || gDebugCamEnabled) { var = Math_Vec3f_DistXYZ(&actor->world.pos, &play->view.eye) * 0.25f; } else { var = Math_Vec3f_DistXYZ(&actor->world.pos, &player->actor.world.pos); @@ -5736,7 +5736,7 @@ s32 Actor_TrackPlayerSetFocusHeight(PlayState* play, Actor* actor, Vec3s* headRo actor->focus.pos = actor->world.pos; actor->focus.pos.y += focusHeight; - if (!(((play->csCtx.state != CS_STATE_IDLE) || gDbgCamEnabled) && + if (!(((play->csCtx.state != CS_STATE_IDLE) || gDebugCamEnabled) && (gSaveContext.entranceIndex == ENTR_KOKIRI_FOREST_0))) { yaw = ABS((s16)(actor->yawTowardsPlayer - actor->shape.rot.y)); if (yaw >= 0x4300) { @@ -5745,7 +5745,7 @@ s32 Actor_TrackPlayerSetFocusHeight(PlayState* play, Actor* actor, Vec3s* headRo } } - if (((play->csCtx.state != CS_STATE_IDLE) || gDbgCamEnabled) && + if (((play->csCtx.state != CS_STATE_IDLE) || gDebugCamEnabled) && (gSaveContext.entranceIndex == ENTR_KOKIRI_FOREST_0)) { target = play->view.eye; } else { @@ -5780,7 +5780,7 @@ s32 Actor_TrackPlayer(PlayState* play, Actor* actor, Vec3s* headRot, Vec3s* tors actor->focus.pos = focusPos; - if (!(((play->csCtx.state != CS_STATE_IDLE) || gDbgCamEnabled) && + if (!(((play->csCtx.state != CS_STATE_IDLE) || gDebugCamEnabled) && (gSaveContext.entranceIndex == ENTR_KOKIRI_FOREST_0))) { yaw = ABS((s16)(actor->yawTowardsPlayer - actor->shape.rot.y)); if (yaw >= 0x4300) { @@ -5789,7 +5789,7 @@ s32 Actor_TrackPlayer(PlayState* play, Actor* actor, Vec3s* headRot, Vec3s* tors } } - if (((play->csCtx.state != CS_STATE_IDLE) || gDbgCamEnabled) && + if (((play->csCtx.state != CS_STATE_IDLE) || gDebugCamEnabled) && (gSaveContext.entranceIndex == ENTR_KOKIRI_FOREST_0)) { target = play->view.eye; } else { diff --git a/src/code/z_camera.c b/src/code/z_camera.c index e83a0e9183..bc32d58711 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -7049,12 +7049,12 @@ void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, PlayState R_CAM_DATA(i) = sCamDataRegsInit[i]; } - DbCamera_Reset(camera, &D_8015BD80); + DebugCamera_Reset(camera, &D_8015BD80); sInitRegs = false; PREG(88) = -1; } camera->play = D_8015BD7C = play; - DbCamera_Init(&D_8015BD80, camera); + DebugCamera_Init(&D_8015BD80, camera); curUID = sNextUID; sNextUID++; while (curUID != 0) { @@ -7245,7 +7245,7 @@ void Camera_PrintSettings(Camera* camera) { char sp48[8]; s32 i; - if ((OREG(0) & 1) && (camera->play->activeCamId == camera->camId) && !gDbgCamEnabled) { + if ((OREG(0) & 1) && (camera->play->activeCamId == camera->camId) && !gDebugCamEnabled) { for (i = 0; i < NUM_CAMS; i++) { if (camera->play->cameraPtrs[i] == NULL) { sp58[i] = '-'; @@ -7278,15 +7278,15 @@ void Camera_PrintSettings(Camera* camera) { sp48[i] = '\0'; sp48[camera->play->activeCamId] = 'a'; - DbCamera_ScreenTextColored(3, 22, DBCAMERA_TEXT_WHITE, sp58); - DbCamera_ScreenTextColored(3, 22, DBCAMERA_TEXT_PEACH, sp48); - DbCamera_ScreenTextColored(3, 23, DBCAMERA_TEXT_WHITE, "S:"); - DbCamera_ScreenTextColored(5, 23, DBCAMERA_TEXT_GOLD, sCameraSettingNames[camera->setting]); - DbCamera_ScreenTextColored(3, 24, DBCAMERA_TEXT_WHITE, "M:"); - DbCamera_ScreenTextColored(5, 24, DBCAMERA_TEXT_GOLD, sCameraModeNames[camera->mode]); - DbCamera_ScreenTextColored(3, 25, DBCAMERA_TEXT_WHITE, "F:"); - DbCamera_ScreenTextColored( - 5, 25, DBCAMERA_TEXT_GOLD, + DebugCamera_ScreenTextColored(3, 22, DEBUG_CAM_TEXT_WHITE, sp58); + DebugCamera_ScreenTextColored(3, 22, DEBUG_CAM_TEXT_PEACH, sp48); + DebugCamera_ScreenTextColored(3, 23, DEBUG_CAM_TEXT_WHITE, "S:"); + DebugCamera_ScreenTextColored(5, 23, DEBUG_CAM_TEXT_GOLD, sCameraSettingNames[camera->setting]); + DebugCamera_ScreenTextColored(3, 24, DEBUG_CAM_TEXT_WHITE, "M:"); + DebugCamera_ScreenTextColored(5, 24, DEBUG_CAM_TEXT_GOLD, sCameraModeNames[camera->mode]); + DebugCamera_ScreenTextColored(3, 25, DEBUG_CAM_TEXT_WHITE, "F:"); + DebugCamera_ScreenTextColored( + 5, 25, DEBUG_CAM_TEXT_GOLD, sCameraFunctionNames[sCameraSettings[camera->setting].cameraModes[camera->mode].funcIdx]); i = 0; @@ -7311,8 +7311,8 @@ void Camera_PrintSettings(Camera* camera) { sp50[i++] = ' '; sp50[i++] = ' '; sp50[i] = '\0'; - DbCamera_ScreenTextColored(3, 26, DBCAMERA_TEXT_WHITE, "I:"); - DbCamera_ScreenTextColored(5, 26, DBCAMERA_TEXT_GOLD, sp50); + DebugCamera_ScreenTextColored(3, 26, DEBUG_CAM_TEXT_WHITE, "I:"); + DebugCamera_ScreenTextColored(5, 26, DEBUG_CAM_TEXT_GOLD, sp50); } } @@ -7451,7 +7451,7 @@ s32 Camera_UpdateHotRoom(Camera* camera) { s32 Camera_DbgChangeMode(Camera* camera) { s32 changeDir = 0; - if (!gDbgCamEnabled && camera->play->activeCamId == CAM_ID_MAIN) { + if (!gDebugCamEnabled && camera->play->activeCamId == CAM_ID_MAIN) { if (CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_CUP)) { osSyncPrintf("attention sound URGENCY\n"); func_80078884(NA_SE_SY_ATTENTION_URGENCY); @@ -7581,12 +7581,12 @@ Vec3s Camera_Update(Camera* camera) { player = camera->play->cameraPtrs[CAM_ID_MAIN]->player; - if (R_DBG_CAM_UPDATE) { + if (R_DEBUG_CAM_UPDATE) { osSyncPrintf("camera: in %x\n", camera); } if (camera->status == CAM_STAT_CUT) { - if (R_DBG_CAM_UPDATE) { + if (R_DEBUG_CAM_UPDATE) { osSyncPrintf("camera: cut out %x\n", camera); } return camera->inputDir; @@ -7661,7 +7661,7 @@ Vec3s Camera_Update(Camera* camera) { Camera_DbgChangeMode(camera); if (camera->status == CAM_STAT_WAIT) { - if (R_DBG_CAM_UPDATE) { + if (R_DEBUG_CAM_UPDATE) { osSyncPrintf("camera: wait out %x\n", camera); } return camera->inputDir; @@ -7671,7 +7671,7 @@ Vec3s Camera_Update(Camera* camera) { camera->stateFlags &= ~(CAM_STATE_10 | CAM_STATE_5); camera->stateFlags |= CAM_STATE_4; - if (R_DBG_CAM_UPDATE) { + if (R_DEBUG_CAM_UPDATE) { osSyncPrintf("camera: engine (%d %d %d) %04x \n", camera->setting, camera->mode, sCameraSettings[camera->setting].cameraModes[camera->mode].funcIdx, camera->stateFlags); } @@ -7702,11 +7702,11 @@ Vec3s Camera_Update(Camera* camera) { } } - if (R_DBG_CAM_UPDATE) { + if (R_DEBUG_CAM_UPDATE) { osSyncPrintf("camera: shrink_and_bitem %x(%d)\n", sCameraInterfaceField, camera->play->transitionMode); } - if (R_DBG_CAM_UPDATE) { + if (R_DEBUG_CAM_UPDATE) { osSyncPrintf("camera: engine (%s(%d) %s(%d) %s(%d)) ok!\n", &sCameraSettingNames[camera->setting], camera->setting, &sCameraModeNames[camera->mode], camera->mode, &sCameraFunctionNames[sCameraSettings[camera->setting].cameraModes[camera->mode].funcIdx], @@ -7715,20 +7715,20 @@ Vec3s Camera_Update(Camera* camera) { // enable/disable debug cam if (CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_START)) { - gDbgCamEnabled ^= 1; - if (gDbgCamEnabled) { - DbgCamera_Enable(&D_8015BD80, camera); + gDebugCamEnabled ^= 1; + if (gDebugCamEnabled) { + DebugCamera_Enable(&D_8015BD80, camera); } else if (camera->play->csCtx.state != CS_STATE_IDLE) { Cutscene_StopManual(camera->play, &camera->play->csCtx); } } // Debug cam update - if (gDbgCamEnabled) { + if (gDebugCamEnabled) { camera->play->view.fovy = D_8015BD80.fov; - DbCamera_Update(&D_8015BD80, camera); + DebugCamera_Update(&D_8015BD80, camera); View_LookAt(&camera->play->view, &D_8015BD80.eye, &D_8015BD80.at, &D_8015BD80.unk_1C); - if (R_DBG_CAM_UPDATE) { + if (R_DEBUG_CAM_UPDATE) { osSyncPrintf("camera: debug out\n"); } return D_8015BD80.sub.unk_104A; @@ -7804,7 +7804,7 @@ Vec3s Camera_Update(Camera* camera) { camera->timer = 0; } - if (R_DBG_CAM_UPDATE) { + if (R_DEBUG_CAM_UPDATE) { osSyncPrintf("camera: out (%f %f %f) (%f %f %f)\n", camera->at.x, camera->at.y, camera->at.z, camera->eye.x, camera->eye.y, camera->eye.z); osSyncPrintf("camera: dir (%f %d(%f) %d(%f)) (%f)\n", eyeAtAngle.r, eyeAtAngle.pitch, @@ -8105,7 +8105,7 @@ s32 Camera_ChangeBgCamIndex(Camera* camera, s32 bgCamIndex) { } Vec3s* Camera_GetInputDir(Vec3s* dst, Camera* camera) { - if (gDbgCamEnabled) { + if (gDebugCamEnabled) { *dst = D_8015BD80.sub.unk_104A; return dst; } else { @@ -8129,7 +8129,7 @@ s16 Camera_GetInputDirYaw(Camera* camera) { } Vec3s* Camera_GetCamDir(Vec3s* dst, Camera* camera) { - if (gDbgCamEnabled) { + if (gDebugCamEnabled) { *dst = D_8015BD80.sub.unk_104A; return dst; } else { @@ -8331,8 +8331,8 @@ s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera) { return true; } -s32 Camera_GetDbgCamEnabled(void) { - return gDbgCamEnabled; +s32 Camera_IsDebugCamEnabled(void) { + return gDebugCamEnabled; } Vec3f* Camera_GetQuakeOffset(Vec3f* quakeOffset, Camera* camera) { diff --git a/src/code/z_camera_data.inc.c b/src/code/z_camera_data.inc.c index 9bea7df638..d22f9914f8 100644 --- a/src/code/z_camera_data.inc.c +++ b/src/code/z_camera_data.inc.c @@ -2555,7 +2555,7 @@ s32 (*sCameraFunctions[])(Camera*) = { s32 sInitRegs = 1; -s32 gDbgCamEnabled = 0; +s32 gDebugCamEnabled = false; s32 sDbgModeIdx = -1; s16 sNextUID = 0; @@ -3034,5 +3034,5 @@ s16 D_8011DAFC[] = { }; PlayState* D_8015BD7C; -DbCamera D_8015BD80; +DebugCam D_8015BD80; CollisionPoly* playerFloorPoly; diff --git a/src/code/z_debug.c b/src/code/z_debug.c index 63f2eb432e..bc46c5a728 100644 --- a/src/code/z_debug.c +++ b/src/code/z_debug.c @@ -1,32 +1,32 @@ #include "global.h" typedef struct { - u8 x; - u8 y; - u8 colorIndex; - char text[21]; -} DbCameraTextBufferEntry; // size = 0x18 + /* 0x0 */ u8 x; + /* 0x1 */ u8 y; + /* 0x2 */ u8 colorIndex; + /* 0x3 */ char text[21]; +} DebugCamTextBufferEntry; // size = 0x18 typedef struct { - u16 hold; - u16 press; + /* 0x0 */ u16 hold; + /* 0x2 */ u16 press; } InputCombo; // size = 0x4 RegEditor* gRegEditor; -DbCameraTextBufferEntry sDbCameraTextBuffer[22]; +DebugCamTextBufferEntry sDebugCamTextBuffer[22]; -s16 sDbCameraTextEntryCount = 0; +s16 sDebugCamTextEntryCount = 0; -Color_RGBA8 sDbCameraTextColors[] = { - { 255, 255, 32, 192 }, // DBCAMERA_TEXT_YELLOW - { 255, 150, 128, 192 }, // DBCAMERA_TEXT_PEACH - { 128, 96, 0, 64 }, // DBCAMERA_TEXT_BROWN - { 192, 128, 16, 128 }, // DBCAMERA_TEXT_ORANGE - { 255, 192, 32, 128 }, // DBCAMERA_TEXT_GOLD - { 230, 230, 220, 64 }, // DBCAMERA_TEXT_WHITE - { 128, 150, 255, 128 }, // DBCAMERA_TEXT_BLUE - { 128, 255, 32, 128 }, // DBCAMERA_TEXT_GREEN +Color_RGBA8 sDebugCamTextColors[] = { + { 255, 255, 32, 192 }, // DEBUG_CAM_TEXT_YELLOW + { 255, 150, 128, 192 }, // DEBUG_CAM_TEXT_PEACH + { 128, 96, 0, 64 }, // DEBUG_CAM_TEXT_BROWN + { 192, 128, 16, 128 }, // DEBUG_CAM_TEXT_ORANGE + { 255, 192, 32, 128 }, // DEBUG_CAM_TEXT_GOLD + { 230, 230, 220, 64 }, // DEBUG_CAM_TEXT_WHITE + { 128, 150, 255, 128 }, // DEBUG_CAM_TEXT_BLUE + { 128, 255, 32, 128 }, // DEBUG_CAM_TEXT_GREEN }; InputCombo sRegGroupInputCombos[REG_GROUPS] = { @@ -108,16 +108,16 @@ void Regs_Init(void) { } } -// Function is stubbed. Name is assumed by similarities in signature to `DbCamera_ScreenTextColored` and usage. -void DbCamera_ScreenText(u8 x, u8 y, const char* text) { +// Function is stubbed. Name is assumed by similarities in signature to `DebugCamera_ScreenTextColored` and usage. +void DebugCamera_ScreenText(u8 x, u8 y, const char* text) { } -void DbCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text) { - DbCameraTextBufferEntry* entry = &sDbCameraTextBuffer[sDbCameraTextEntryCount]; +void DebugCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text) { + DebugCamTextBufferEntry* entry = &sDebugCamTextBuffer[sDebugCamTextEntryCount]; char* textDest; s16 charCount; - if (sDbCameraTextEntryCount < ARRAY_COUNT(sDbCameraTextBuffer)) { + if (sDebugCamTextEntryCount < ARRAY_COUNT(sDebugCamTextBuffer)) { entry->x = x; entry->y = y; entry->colorIndex = colorIndex; @@ -134,18 +134,18 @@ void DbCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text) { *textDest = '\0'; - sDbCameraTextEntryCount++; + sDebugCamTextEntryCount++; } } -void DbCamera_DrawScreenText(GfxPrint* printer) { +void DebugCamera_DrawScreenText(GfxPrint* printer) { s32 i; Color_RGBA8* color; - DbCameraTextBufferEntry* entry; + DebugCamTextBufferEntry* entry; - for (i = 0; i < sDbCameraTextEntryCount; i++) { - entry = &sDbCameraTextBuffer[i]; - color = &sDbCameraTextColors[entry->colorIndex]; + for (i = 0; i < sDebugCamTextEntryCount; i++) { + entry = &sDebugCamTextBuffer[i]; + color = &sDebugCamTextColors[entry->colorIndex]; GfxPrint_SetColor(printer, color->r, color->g, color->b, color->a); GfxPrint_SetPos(printer, entry->x, entry->y); @@ -288,14 +288,14 @@ void Debug_DrawText(GraphicsContext* gfxCtx) { GfxPrint_Open(&printer, gfx); if ((OREG(0) == 1) || (OREG(0) == 8)) { - DbCamera_DrawScreenText(&printer); + DebugCamera_DrawScreenText(&printer); } if (gRegEditor->regPage != 0) { Regs_DrawEditor(&printer); } - sDbCameraTextEntryCount = 0; + sDebugCamTextEntryCount = 0; gfx = GfxPrint_Close(&printer); gSPEndDisplayList(gfx++); diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 5fd51a5bdf..e30c088ac2 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -182,7 +182,7 @@ void Cutscene_UpdateScripted(PlayState* play, CutsceneContext* csCtx) { } if (CHECK_BTN_ALL(input->press.button, BTN_DUP) && (csCtx->state == CS_STATE_IDLE) && IS_CUTSCENE_LAYER && - !gDbgCamEnabled) { + !gDebugCamEnabled) { gUseCutsceneCam = true; gSaveContext.cutsceneIndex = 0xFFFD; gSaveContext.cutsceneTrigger = 1; diff --git a/src/code/z_play.c b/src/code/z_play.c index 69d647fa2f..8381d6a828 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -988,7 +988,7 @@ void Play_Update(PlayState* this) { skip: PLAY_LOG(3801); - if ((sp80 == 0) || gDbgCamEnabled) { + if ((sp80 == 0) || gDebugCamEnabled) { s32 pad3[5]; s32 i; diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.c b/src/overlays/actors/ovl_En_Holl/z_en_holl.c index f7f2c135f9..613cf80a3a 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c @@ -155,7 +155,7 @@ void func_80A58DD4(EnHoll* this, PlayState* play) { // Horizontal Planes void func_80A59014(EnHoll* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 useViewEye = gDbgCamEnabled || play->csCtx.state != CS_STATE_IDLE; + s32 useViewEye = gDebugCamEnabled || play->csCtx.state != CS_STATE_IDLE; Vec3f vec; s32 temp; f32 planeHalfWidth; diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c index a7d1e09c6e..83e3d6547f 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -957,7 +957,7 @@ s32 EnKo_AdultSaved(EnKo* this, PlayState* play) { void func_80A9877C(EnKo* this, PlayState* play) { Player* player = GET_PLAYER(play); - if ((play->csCtx.state != 0) || (gDbgCamEnabled != 0)) { + if ((play->csCtx.state != 0) || gDebugCamEnabled) { this->interactInfo.trackPos = play->view.eye; this->interactInfo.yOffset = 40.0f; if (ENKO_TYPE != ENKO_TYPE_CHILD_0) { @@ -1097,7 +1097,7 @@ void func_80A98DB4(EnKo* this, PlayState* play) { this->modelAlpha = 255.0f; return; } - if (play->csCtx.state != 0 || gDbgCamEnabled != 0) { + if ((play->csCtx.state != CS_STATE_IDLE) || gDebugCamEnabled) { dist = Math_Vec3f_DistXYZ(&this->actor.world.pos, &play->view.eye) * 0.25f; } else { dist = this->actor.xzDistToPlayer; diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c index ba1a1d03ee..66623b87b4 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -568,7 +568,7 @@ void func_80AAB158(EnMd* this, PlayState* play) { temp2 = 1; } - if ((play->csCtx.state != CS_STATE_IDLE) || gDbgCamEnabled) { + if ((play->csCtx.state != CS_STATE_IDLE) || gDebugCamEnabled) { this->interactInfo.trackPos = play->view.eye; this->interactInfo.yOffset = 40.0f; trackingMode = NPC_TRACKING_HEAD_AND_TORSO; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 5a3510a295..544f45eb91 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -13195,7 +13195,7 @@ s32 func_8084FCAC(Player* this, PlayState* play) { speed = 20.0f; } - DbCamera_ScreenText(3, 2, "DEBUG MODE"); + DebugCamera_ScreenText(3, 2, "DEBUG MODE"); if (!CHECK_BTN_ALL(sControlInput->cur.button, BTN_L)) { if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_B)) {