diff --git a/data/fault.bss.s b/data/fault.bss.s index b66f9cf837..d8d76a0518 100644 --- a/data/fault.bss.s +++ b/data/fault.bss.s @@ -7,6 +7,8 @@ .section .bss +# Note: This file is only included in the MATCHING build, the data is imported for non-matching + .balign 16 glabel sFaultInstance diff --git a/data/fault_drawer.bss.s b/data/fault_drawer.bss.s index 8642064c48..0c64984b33 100644 --- a/data/fault_drawer.bss.s +++ b/data/fault_drawer.bss.s @@ -7,10 +7,12 @@ .section .bss +# Note: This file is only included in the MATCHING build, the data is imported for non-matching + .balign 16 glabel sFaultDrawer .space 0x3C -glabel D_8016B6C0 - .space 0x20 +glabel D_8016B6BC + .space 0x24 diff --git a/include/functions.h b/include/functions.h index f7272f9037..c55b947330 100644 --- a/include/functions.h +++ b/include/functions.h @@ -358,12 +358,12 @@ void Actor_Kill(Actor* actor); void Actor_SetFocus(Actor* actor, f32 yOffset); void Actor_SetScale(Actor* actor, f32 scale); void Actor_SetObjectDependency(PlayState* play, Actor* actor); -void func_8002D7EC(Actor* actor); -void func_8002D868(Actor* actor); -void Actor_MoveForward(Actor* actor); -void func_8002D908(Actor* actor); -void func_8002D97C(Actor* actor); -void func_8002D9A4(Actor* actor, f32 arg1); +void Actor_UpdatePos(Actor* actor); +void Actor_UpdateVelocityXZGravity(Actor* actor); +void Actor_MoveXZGravity(Actor* actor); +void Actor_UpdateVelocityXYZ(Actor* actor); +void Actor_MoveXYZ(Actor* actor); +void Actor_SetProjectileSpeed(Actor* actor, f32 speedXYZ); s16 Actor_WorldYawTowardActor(Actor* actorA, Actor* actorB); s16 Actor_WorldYawTowardPoint(Actor* actor, Vec3f* refPoint); f32 Actor_WorldDistXYZToActor(Actor* actorA, Actor* actorB); @@ -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 77d0cd43aa..a8f5bd18bc 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/ultra64/gbi.h b/include/ultra64/gbi.h index 442b68bc97..35f68a60ce 100644 --- a/include/ultra64/gbi.h +++ b/include/ultra64/gbi.h @@ -3336,8 +3336,8 @@ _DW({ \ Gfx *_g = (Gfx *)(pkt); \ \ _g->words.w0 = (_SHIFTL(cmd, 24, 8) | \ - _SHIFTL(32 - (sft)- ( len), 8, 8)| \ - _SHIFTL((len) - 1, 0, 8)); \ + _SHIFTL(32 - (sft) - (len), 8, 8) | \ + _SHIFTL((len) - 1, 0, 8)); \ _g->words.w1 = (unsigned int)(data); \ }) @@ -4082,7 +4082,7 @@ _DW({ 0, cmt, maskt,shiftt, cms, masks, shifts), \ gsDPLoadSync(), \ gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \ - (((width) * (height) + siz##_INCR) >> siz##_SHIFT) - 1, 0 ), \ + (((width) * (height) + siz##_INCR) >> siz##_SHIFT) - 1, 0), \ gsDPPipeSync(), \ gsDPSetTile(fmt, siz, \ ((((width) * siz##_LINE_BYTES) + 7) >> 3), 0, \ @@ -4445,7 +4445,7 @@ _DW({ \ gDPSetTextureImage(pkt, fmt, siz, width, timg); \ gDPSetTile(pkt, fmt, siz, \ (((((lrs) - (uls) + 1) * siz##_TILE_BYTES) + 7) >> 3), tmem, \ - G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, shifts); \ + G_TX_LOADTILE, 0, cmt, maskt, shiftt, cms, masks, shifts); \ gDPLoadSync(pkt); \ gDPLoadTile(pkt, G_TX_LOADTILE, \ (uls) << G_TEXTURE_IMAGE_FRAC, \ @@ -4470,9 +4470,9 @@ _DW({ \ gsDPSetTextureImage(fmt, siz, width, timg), \ gsDPSetTile(fmt, siz, \ (((((lrs) - (uls) + 1) * siz##_TILE_BYTES) + 7) >> 3), 0, \ - G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, shifts), \ + G_TX_LOADTILE, 0, cmt, maskt, shiftt, cms, masks, shifts), \ gsDPLoadSync(), \ - gsDPLoadTile( G_TX_LOADTILE, \ + gsDPLoadTile(G_TX_LOADTILE, \ (uls) << G_TEXTURE_IMAGE_FRAC, \ (ult) << G_TEXTURE_IMAGE_FRAC, \ (lrs) << G_TEXTURE_IMAGE_FRAC, \ @@ -4497,7 +4497,7 @@ _DW({ \ gsDPSetTextureImage(fmt, siz, width, timg), \ gsDPSetTile(fmt, siz, \ (((((lrs) - (uls) + 1) * siz##_TILE_BYTES) + 7) >> 3), tmem, \ - G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, shifts), \ + G_TX_LOADTILE, 0, cmt, maskt, shiftt, cms, masks, shifts), \ gsDPLoadSync(), \ gsDPLoadTile(G_TX_LOADTILE, \ (uls) << G_TEXTURE_IMAGE_FRAC, \ @@ -4521,7 +4521,7 @@ _DW({ \ gDPSetTextureImage(pkt, fmt, G_IM_SIZ_8b, ((width) >> 1), timg); \ gDPSetTile(pkt, fmt, G_IM_SIZ_8b, \ (((((lrs) - (uls) + 1) >> 1) + 7) >> 3), 0, \ - G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, shifts); \ + G_TX_LOADTILE, 0, cmt, maskt, shiftt, cms, masks, shifts); \ gDPLoadSync(pkt); \ gDPLoadTile(pkt, G_TX_LOADTILE, \ (uls) << (G_TEXTURE_IMAGE_FRAC - 1), \ @@ -4550,7 +4550,7 @@ _DW({ \ gDPSetTextureImage(pkt, fmt, G_IM_SIZ_8b, ((width) >> 1), timg); \ gDPSetTile(pkt, fmt, G_IM_SIZ_8b, \ (((((lrs) - (uls) + 1) >> 1) + 7) >> 3), tmem, \ - G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, shifts); \ + G_TX_LOADTILE, 0, cmt, maskt, shiftt, cms, masks, shifts); \ gDPLoadSync(pkt); \ gDPLoadTile(pkt, G_TX_LOADTILE, \ (uls) << (G_TEXTURE_IMAGE_FRAC - 1), \ @@ -4574,7 +4574,7 @@ _DW({ \ gsDPSetTextureImage(fmt, G_IM_SIZ_8b, ((width) >> 1), timg), \ gsDPSetTile(fmt, G_IM_SIZ_8b, \ (((((lrs) - (uls) + 1) >> 1) + 7) >> 3), 0, \ - G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, shifts), \ + G_TX_LOADTILE, 0, cmt, maskt, shiftt, cms, masks, shifts), \ gsDPLoadSync(), \ gsDPLoadTile(G_TX_LOADTILE, \ (uls) << (G_TEXTURE_IMAGE_FRAC - 1), \ @@ -4604,7 +4604,7 @@ _DW({ \ (((((lrs) - (uls) + 1) >> 1) + 7) >> 3), tmem, \ G_TX_LOADTILE, 0, cmt, maskt, shiftt, cms, masks, shifts), \ gsDPLoadSync(), \ - gsDPLoadTile( G_TX_LOADTILE, \ + gsDPLoadTile(G_TX_LOADTILE, \ (uls) << (G_TEXTURE_IMAGE_FRAC - 1), \ (ult) << (G_TEXTURE_IMAGE_FRAC), \ (lrs) << (G_TEXTURE_IMAGE_FRAC - 1), \ @@ -4630,7 +4630,7 @@ _DW({ \ gDPSetTextureImage(pkt, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, dram); \ gDPTileSync(pkt); \ gDPSetTile(pkt, 0, 0, 0, (256 + (((pal) & 0xF) * 16)), \ - G_TX_LOADTILE, 0 , 0, 0, 0, 0, 0, 0); \ + G_TX_LOADTILE, 0, 0, 0, 0, 0, 0, 0); \ gDPLoadSync(pkt); \ gDPLoadTLUTCmd(pkt, G_TX_LOADTILE, 15); \ gDPPipeSync(pkt); \ @@ -4656,7 +4656,7 @@ _DW({ \ gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, dram), \ gsDPTileSync(), \ gsDPSetTile(0, 0, 0, (256 + (((pal) & 0xF) * 16)), \ - G_TX_LOADTILE, 0 , 0, 0, 0, 0, 0, 0), \ + G_TX_LOADTILE, 0, 0, 0, 0, 0, 0, 0), \ gsDPLoadSync(), \ gsDPLoadTLUTCmd(G_TX_LOADTILE, 15), \ gsDPPipeSync() @@ -4681,7 +4681,7 @@ _DW({ \ gDPSetTextureImage(pkt, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, dram); \ gDPTileSync(pkt); \ gDPSetTile(pkt, 0, 0, 0, 256, \ - G_TX_LOADTILE, 0 , 0, 0, 0, 0, 0, 0); \ + G_TX_LOADTILE, 0, 0, 0, 0, 0, 0, 0); \ gDPLoadSync(pkt); \ gDPLoadTLUTCmd(pkt, G_TX_LOADTILE, 255); \ gDPPipeSync(pkt); \ @@ -4748,7 +4748,7 @@ _DW({ \ gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, dram), \ gsDPTileSync(), \ gsDPSetTile(0, 0, 0, tmemaddr, \ - G_TX_LOADTILE, 0 , 0, 0, 0, 0, 0, 0), \ + G_TX_LOADTILE, 0, 0, 0, 0, 0, 0, 0), \ gsDPLoadSync(), \ gsDPLoadTLUTCmd(G_TX_LOADTILE, ((count) - 1)), \ gsDPPipeSync() 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/z64.h b/include/z64.h index e4d3fa9f5c..3896b5f764 100644 --- a/include/z64.h +++ b/include/z64.h @@ -796,7 +796,7 @@ typedef enum { /* 1 */ TRANS_TILE_SETUP, // Save the necessary buffers /* 2 */ TRANS_TILE_PROCESS, // Initialize the transition /* 3 */ TRANS_TILE_READY // The transition is ready, so will update and draw each frame -} TransitionTileStatus; +} TransitionTileState; typedef struct PlayState { /* 0x00000 */ GameState state; @@ -858,7 +858,7 @@ typedef struct PlayState { /* 0x11E14 */ u8 skyboxId; /* 0x11E15 */ s8 transitionTrigger; // "fade_direction" /* 0x11E16 */ s16 unk_11E16; - /* 0x11E18 */ s16 unk_11E18; + /* 0x11E18 */ s16 bgCoverAlpha; /* 0x11E1A */ s16 nextEntranceIndex; /* 0x11E1C */ char unk_11E1C[0x40]; /* 0x11E5C */ s8 shootingGalleryStatus; diff --git a/include/z64actor.h b/include/z64actor.h index 8e20143a04..4c1d0ec68c 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -209,7 +209,7 @@ typedef struct Actor { /* 0x05C */ Vec3f velocity; // Velocity of the actor in each axis /* 0x068 */ f32 speed; // Context dependent speed value. Can be used for XZ or XYZ depending on which move function is used /* 0x06C */ f32 gravity; // Acceleration due to gravity. Value is added to Y velocity every frame - /* 0x070 */ f32 minVelocityY; // Sets the lower bounds cap on velocity along the Y axis + /* 0x070 */ f32 minVelocityY; // Sets the lower bounds cap for velocity along the Y axis. Only relevant when moved with gravity. /* 0x074 */ CollisionPoly* wallPoly; // Wall polygon the actor is touching /* 0x078 */ CollisionPoly* floorPoly; // Floor polygon directly below the actor /* 0x07C */ u8 wallBgId; // Bg ID of the wall polygon the actor is touching diff --git a/include/z64camera.h b/include/z64camera.h index 82fe5c5d72..c85500cf49 100644 --- a/include/z64camera.h +++ b/include/z64camera.h @@ -50,26 +50,28 @@ #define CAM_HUD_VISIBILITY_MASK (0xF << CAM_HUD_VISIBILITY_SHIFT) #define CAM_HUD_VISIBILITY(hudVisibility) (((hudVisibility) & 0xF) << CAM_HUD_VISIBILITY_SHIFT) -//! @note: since `interfaceField` can only have `0 - 0xF` values, -//! there is no cam value mapped to `HUD_VISIBILITY_NOTHING_INSTANT`. -//! @note: since 0 means `HUD_VISIBILITY_ALL`, -//! there is no cam value mapped to `HUD_VISIBILITY_NO_CHANGE`. -#define CAM_HUD_VISIBILITY_ALL CAM_HUD_VISIBILITY(0) // HUD_VISIBILITY_ALL -#define CAM_HUD_VISIBILITY_NOTHING CAM_HUD_VISIBILITY(HUD_VISIBILITY_NOTHING) -#define CAM_HUD_VISIBILITY_NOTHING_ALT CAM_HUD_VISIBILITY(HUD_VISIBILITY_NOTHING_ALT) -#define CAM_HUD_VISIBILITY_HEARTS_FORCE CAM_HUD_VISIBILITY(HUD_VISIBILITY_HEARTS_FORCE) -#define CAM_HUD_VISIBILITY_A CAM_HUD_VISIBILITY(HUD_VISIBILITY_A) -#define CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE CAM_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE) -#define CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_FORCE CAM_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_FORCE) -#define CAM_HUD_VISIBILITY_ALL_NO_MINIMAP_BY_BTN_STATUS CAM_HUD_VISIBILITY(HUD_VISIBILITY_ALL_NO_MINIMAP_BY_BTN_STATUS) -#define CAM_HUD_VISIBILITY_B CAM_HUD_VISIBILITY(HUD_VISIBILITY_B) -#define CAM_HUD_VISIBILITY_HEARTS_MAGIC CAM_HUD_VISIBILITY(HUD_VISIBILITY_HEARTS_MAGIC) -#define CAM_HUD_VISIBILITY_B_ALT CAM_HUD_VISIBILITY(HUD_VISIBILITY_B_ALT) -#define CAM_HUD_VISIBILITY_HEARTS CAM_HUD_VISIBILITY(HUD_VISIBILITY_HEARTS) -#define CAM_HUD_VISIBILITY_A_B_MINIMAP CAM_HUD_VISIBILITY(HUD_VISIBILITY_A_B_MINIMAP) -#define CAM_HUD_VISIBILITY_HEARTS_MAGIC_FORCE CAM_HUD_VISIBILITY(HUD_VISIBILITY_HEARTS_MAGIC_FORCE) +// These defines exist to clarify exactly which HUD visibility modes are supported by the camera system. While most of +// them map 1 to 1 with their HUD visibility counterparts, not all HUD visibility mode values will work as expected if +// used directly. Notably: +// - CAM_HUD_VISIBILITY_ALL (0) maps to HUD_VISIBILITY_ALL (50), not HUD_VISIBILITY_NO_CHANGE (0) +// - HUD_VISIBILITY_NOTHING_INSTANT (52) has no CAM_HUD_VISIBILITY_* mapping, +// because camera HUD visibility values are restricted to the 0-0xF range +#define CAM_HUD_VISIBILITY_ALL (0) // HUD_VISIBILITY_ALL +#define CAM_HUD_VISIBILITY_NOTHING (HUD_VISIBILITY_NOTHING) +#define CAM_HUD_VISIBILITY_NOTHING_ALT (HUD_VISIBILITY_NOTHING_ALT) +#define CAM_HUD_VISIBILITY_HEARTS_FORCE (HUD_VISIBILITY_HEARTS_FORCE) +#define CAM_HUD_VISIBILITY_A (HUD_VISIBILITY_A) +#define CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE (HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE) +#define CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_FORCE (HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_FORCE) +#define CAM_HUD_VISIBILITY_ALL_NO_MINIMAP_BY_BTN_STATUS (HUD_VISIBILITY_ALL_NO_MINIMAP_BY_BTN_STATUS) +#define CAM_HUD_VISIBILITY_B (HUD_VISIBILITY_B) +#define CAM_HUD_VISIBILITY_HEARTS_MAGIC (HUD_VISIBILITY_HEARTS_MAGIC) +#define CAM_HUD_VISIBILITY_B_ALT (HUD_VISIBILITY_B_ALT) +#define CAM_HUD_VISIBILITY_HEARTS (HUD_VISIBILITY_HEARTS) +#define CAM_HUD_VISIBILITY_A_B_MINIMAP (HUD_VISIBILITY_A_B_MINIMAP) +#define CAM_HUD_VISIBILITY_HEARTS_MAGIC_FORCE (HUD_VISIBILITY_HEARTS_MAGIC_FORCE) // Unique to camera, does not change hud visibility mode (similar effect as HUD_VISIBILITY_NO_CHANGE) -#define CAM_HUD_VISIBILITY_IGNORE CAM_HUD_VISIBILITY(0xF) +#define CAM_HUD_VISIBILITY_IGNORE (0xF) /** * letterboxFlag: Determines the size of the letter-box window. See CAM_LETTERBOX_* defines. @@ -80,7 +82,7 @@ * funcFlags: Custom flags for functions */ #define CAM_INTERFACE_FIELD(letterboxFlag, hudVisibilityMode, funcFlags) \ - (((letterboxFlag) & CAM_LETTERBOX_MASK) | (hudVisibilityMode) | ((funcFlags) & 0xFF)) + (((letterboxFlag) & CAM_LETTERBOX_MASK) | CAM_HUD_VISIBILITY(hudVisibilityMode) | ((funcFlags) & 0xFF)) // Camera behaviorFlags. Flags specifically for settings, modes, and bgCam // Used to store current state, only CAM_BEHAVIOR_SETTING_1 and CAM_BEHAVIOR_BG_2 are read from and used in logic @@ -1249,13 +1251,22 @@ typedef enum { #define ONEPOINT_CS_GET_ACTION(onePointCsFull) ((onePointCsFull)->actionFlags & 0x1F) -/** initFlags - * & 0x00FF = atInitFlags - * & 0xFF00 = eyeInitFlags +#define ONEPOINT_CS_INIT_FIELD_NONE 0xFF +#define ONEPOINT_CS_INIT_FIELD_ACTORCAT(actorCat) (0x80 | ((actorCat) & 0x0F)) +#define ONEPOINT_CS_INIT_FIELD_HUD_VISIBILITY(camHudVisibility) (0xC0 | ((camHudVisibility) & 0x0F)) +#define ONEPOINT_CS_INIT_FIELD_PLAYER_CS(csMode) ((csMode) & 0x7F) + +#define ONEPOINT_CS_INIT_FIELD_IS_TYPE_ACTORCAT(field) ((field & 0xF0) == 0x80) +#define ONEPOINT_CS_INIT_FIELD_IS_TYPE_HUD_VISIBILITY(field) ((field & 0xF0) == 0xC0) +#define ONEPOINT_CS_INIT_FIELD_IS_TYPE_PLAYER_CS(field) !(field & 0x80) + +/** viewFlags + * & 0x00FF = atFlags + * & 0xFF00 = eyeFlags * 0x1: Direct Copy of atTargetInit - * if initFlags & 0x6060: use head for focus point + * if viewFlags & 0x6060: use head for focus point * 0x2: Add atTargetInit to view's lookAt - * if initFlags & 0x6060: use world for focus point + * if viewFlags & 0x6060: use world for focus point * 0x3: Add atTargetInit to camera's at * 0x4: Don't update targets? * 0x8: flag to use atTagetInit as f32 pitch, yaw, r @@ -1264,8 +1275,8 @@ typedef enum { */ typedef struct { /* 0x00 */ u8 actionFlags; - /* 0x01 */ u8 unk_01; - /* 0x02 */ s16 initFlags; + /* 0x01 */ u8 initField; + /* 0x02 */ s16 viewFlags; /* 0x04 */ s16 timerInit; /* 0x06 */ s16 rollTargetInit; /* 0x08 */ f32 fovTargetInit; @@ -1628,7 +1639,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 +1661,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 +1672,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 +1684,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/include/z64item.h b/include/z64item.h index dbd87481af..5991723993 100644 --- a/include/z64item.h +++ b/include/z64item.h @@ -20,7 +20,7 @@ typedef enum { typedef enum { /* 0 */ EQUIP_INV_SWORD_KOKIRI, /* 1 */ EQUIP_INV_SWORD_MASTER, - /* 2 */ EQUIP_INV_SWORD_BGS, + /* 2 */ EQUIP_INV_SWORD_BIGGORON, /* 3 */ EQUIP_INV_SWORD_BROKENGIANTKNIFE } EquipInvSword; @@ -48,7 +48,7 @@ typedef enum { /* 0 */ EQUIP_VALUE_SWORD_NONE, /* 1 */ EQUIP_VALUE_SWORD_KOKIRI, /* 2 */ EQUIP_VALUE_SWORD_MASTER, - /* 3 */ EQUIP_VALUE_SWORD_BGS, + /* 3 */ EQUIP_VALUE_SWORD_BIGGORON, /* 4 */ EQUIP_VALUE_SWORD_MAX } EquipValueSword; diff --git a/include/z64player.h b/include/z64player.h index f08f0719b5..a231544879 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -10,7 +10,7 @@ typedef enum { /* 0 */ PLAYER_SWORD_NONE, /* 1 */ PLAYER_SWORD_KOKIRI, /* 2 */ PLAYER_SWORD_MASTER, - /* 3 */ PLAYER_SWORD_BGS, + /* 3 */ PLAYER_SWORD_BIGGORON, /* 4 */ PLAYER_SWORD_MAX } PlayerSword; @@ -75,7 +75,7 @@ typedef enum { /* 0x02 */ PLAYER_IA_FISHING_POLE, /* 0x03 */ PLAYER_IA_SWORD_MASTER, /* 0x04 */ PLAYER_IA_SWORD_KOKIRI, - /* 0x05 */ PLAYER_IA_SWORD_BGS, + /* 0x05 */ PLAYER_IA_SWORD_BIGGORON, /* 0x06 */ PLAYER_IA_DEKU_STICK, /* 0x07 */ PLAYER_IA_HAMMER, /* 0x08 */ PLAYER_IA_BOW, @@ -686,9 +686,9 @@ typedef struct Player { /* 0x0834 */ s16 unk_834; /* 0x0836 */ s8 unk_836; /* 0x0837 */ u8 unk_837; - /* 0x0838 */ f32 linearVelocity; - /* 0x083C */ s16 currentYaw; - /* 0x083E */ s16 targetYaw; + /* 0x0838 */ f32 speedXZ; // Controls horizontal speed, used for `actor.speed`. Current or target value depending on context. + /* 0x083C */ s16 yaw; // General yaw value, used both for world and shape rotation. Current or target value depending on context. + /* 0x083E */ s16 zTargetYaw; // yaw relating to Z targeting/"parallel" mode /* 0x0840 */ u16 underwaterTimer; /* 0x0842 */ s8 meleeWeaponAnimation; /* 0x0843 */ s8 meleeWeaponState; diff --git a/spec b/spec index 5ab17d2ee1..c515af7e92 100644 --- a/spec +++ b/spec @@ -409,9 +409,11 @@ beginseg include "build/src/code/irqmgr.o" include "build/src/code/debug_malloc.o" include "build/src/code/fault.o" - include "build/data/fault.bss.o" include "build/src/code/fault_drawer.o" +#ifndef NON_MATCHING + include "build/data/fault.bss.o" include "build/data/fault_drawer.bss.o" +#endif include "build/src/code/kanread.o" include "build/src/code/ucode_disas.o" pad_text // audio library aligned to 32 bytes? diff --git a/src/code/code_800430A0.c b/src/code/code_800430A0.c index 5ca844a126..98068012f6 100644 --- a/src/code/code_800430A0.c +++ b/src/code/code_800430A0.c @@ -59,7 +59,7 @@ void DynaPolyActor_UpdateCarriedActorRotY(CollisionContext* colCtx, s32 bgId, Ac s16 rotY = colCtx->dyna.bgActors[bgId].curTransform.rot.y - colCtx->dyna.bgActors[bgId].prevTransform.rot.y; if (carriedActor->id == ACTOR_PLAYER) { - ((Player*)carriedActor)->currentYaw += rotY; + ((Player*)carriedActor)->yaw += rotY; } carriedActor->shape.rot.y += rotY; diff --git a/src/code/code_800BB0A0.c b/src/code/code_800BB0A0.c index 8dfd375e1c..e525a00694 100644 --- a/src/code/code_800BB0A0.c +++ b/src/code/code_800BB0A0.c @@ -61,7 +61,7 @@ s32 func_800BB2B4(Vec3f* pos, f32* roll, f32* fov, CutsceneCameraPoint* point, s } *curFrame += advance; if (*curFrame >= 1) { - if (point[++*keyFrame + 3].continueFlag == -1) { + if (point[++*keyFrame + 3].continueFlag == CS_CMD_STOP) { *keyFrame = 0; ret = true; } 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/fault.c b/src/code/fault.c index 4a302d9f3b..97aeaa75dc 100644 --- a/src/code/fault.c +++ b/src/code/fault.c @@ -76,12 +76,21 @@ const char* sFpExceptionNames[] = { "Unimplemented operation", "Invalid operation", "Division by zero", "Overflow", "Underflow", "Inexact operation", }; -// TODO: import .bss (has reordering issues) +#ifndef NON_MATCHING +// TODO: match .bss (has reordering issues) extern FaultMgr* sFaultInstance; extern u8 sFaultAwaitingInput; extern STACK(sFaultStack, 0x600); extern StackEntry sFaultThreadInfo; extern FaultMgr gFaultMgr; +#else +// Non-matching version for struct shiftability +FaultMgr* sFaultInstance; +u8 sFaultAwaitingInput; +STACK(sFaultStack, 0x600); +StackEntry sFaultThreadInfo; +FaultMgr gFaultMgr; +#endif typedef struct { /* 0x00 */ s32 (*callback)(void*, void*); diff --git a/src/code/fault_drawer.c b/src/code/fault_drawer.c index 49bcdd6898..121b7d29b0 100644 --- a/src/code/fault_drawer.c +++ b/src/code/fault_drawer.c @@ -99,7 +99,15 @@ FaultDrawer sFaultDrawerDefault = { NULL, }; +#ifndef NON_MATCHING +// TODO: match .bss (has reordering issues) extern FaultDrawer sFaultDrawer; +extern char D_8016B6BC[0x24]; +#else +// Non-matching version for struct shiftability +FaultDrawer sFaultDrawer; +char D_8016B6BC[0x24]; +#endif void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled) { sFaultDrawer.osSyncPrintfEnabled = enabled; diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 964d434b4e..637f7fceec 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -841,7 +841,10 @@ void Actor_Destroy(Actor* actor, PlayState* play) { } } -void func_8002D7EC(Actor* actor) { +/** + * Update actor's position factoring in velocity and collider displacement + */ +void Actor_UpdatePos(Actor* actor) { f32 speedRate = R_UPDATE_RATE * 0.5f; actor->world.pos.x += (actor->velocity.x * speedRate) + actor->colChkInfo.displacement.x; @@ -849,22 +852,34 @@ void func_8002D7EC(Actor* actor) { actor->world.pos.z += (actor->velocity.z * speedRate) + actor->colChkInfo.displacement.z; } -void func_8002D868(Actor* actor) { +/** + * Update actor's velocity accounting for gravity (without dropping below minimum y velocity) + */ +void Actor_UpdateVelocityXZGravity(Actor* actor) { actor->velocity.x = Math_SinS(actor->world.rot.y) * actor->speed; actor->velocity.z = Math_CosS(actor->world.rot.y) * actor->speed; actor->velocity.y += actor->gravity; + if (actor->velocity.y < actor->minVelocityY) { actor->velocity.y = actor->minVelocityY; } } -void Actor_MoveForward(Actor* actor) { - func_8002D868(actor); - func_8002D7EC(actor); +/** + * Move actor while accounting for its current velocity and gravity. + * `actor.speed` is used as the XZ velocity. + * The actor will move in the direction of its world yaw. + */ +void Actor_MoveXZGravity(Actor* actor) { + Actor_UpdateVelocityXZGravity(actor); + Actor_UpdatePos(actor); } -void func_8002D908(Actor* actor) { +/** + * Update actor's velocity without gravity. + */ +void Actor_UpdateVelocityXYZ(Actor* actor) { f32 speedXZ = Math_CosS(actor->world.rot.x) * actor->speed; actor->velocity.x = Math_SinS(actor->world.rot.y) * speedXZ; @@ -872,23 +887,33 @@ void func_8002D908(Actor* actor) { actor->velocity.z = Math_CosS(actor->world.rot.y) * speedXZ; } -void func_8002D97C(Actor* actor) { - func_8002D908(actor); - func_8002D7EC(actor); +/** + * Move actor while accounting for its current velocity. + * `actor.speed` is used as the XYZ velocity. + * The actor will move in the direction of its world yaw and pitch, with positive pitch moving upwards. + */ +void Actor_MoveXYZ(Actor* actor) { + Actor_UpdateVelocityXYZ(actor); + Actor_UpdatePos(actor); } -void func_8002D9A4(Actor* actor, f32 arg1) { - actor->speed = Math_CosS(actor->world.rot.x) * arg1; - actor->velocity.y = -Math_SinS(actor->world.rot.x) * arg1; +/** + * From a given XYZ speed value, set the corresponding XZ speed as `actor.speed`, and Y speed as Y velocity. + * Only the actor's world pitch is factored in, with positive pitch moving downwards. + */ +void Actor_SetProjectileSpeed(Actor* actor, f32 speedXYZ) { + actor->speed = Math_CosS(actor->world.rot.x) * speedXYZ; + actor->velocity.y = -Math_SinS(actor->world.rot.x) * speedXYZ; } -void func_8002D9F8(Actor* actor, SkelAnime* skelAnime) { - Vec3f sp1C; +void Actor_UpdatePosByAnimation(Actor* actor, SkelAnime* skelAnime) { + Vec3f posDiff; - SkelAnime_UpdateTranslation(skelAnime, &sp1C, actor->shape.rot.y); - actor->world.pos.x += sp1C.x * actor->scale.x; - actor->world.pos.y += sp1C.y * actor->scale.y; - actor->world.pos.z += sp1C.z * actor->scale.z; + SkelAnime_UpdateTranslation(skelAnime, &posDiff, actor->shape.rot.y); + + actor->world.pos.x += posDiff.x * actor->scale.x; + actor->world.pos.y += posDiff.y * actor->scale.y; + actor->world.pos.z += posDiff.z * actor->scale.z; } s16 Actor_WorldYawTowardActor(Actor* actorA, Actor* actorB) { @@ -4037,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); @@ -4090,7 +4115,7 @@ s32 func_80035124(Actor* actor, PlayState* play) { if (Actor_HasParent(actor, play)) { actor->params = 1; } else if (!(actor->bgCheckFlags & BGCHECKFLAG_GROUND)) { - Actor_MoveForward(actor); + Actor_MoveXZGravity(actor); Math_SmoothStepToF(&actor->speed, 0.0f, 1.0f, 0.1f, 0.0f); } else if ((actor->bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (actor->velocity.y < -4.0f)) { ret = 1; @@ -5711,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) { @@ -5720,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 { @@ -5755,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) { @@ -5764,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 f7641f471f..deb9597d9f 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -487,12 +487,12 @@ Vec3s* Camera_GetBgCamFuncDataUnderPlayer(Camera* camera, u16* bgCamCount) { CollisionPoly* floorPoly; s32 pad; s32 bgId; - PosRot playerPosShape; + PosRot playerPosRot; - Actor_GetWorldPosShapeRot(&playerPosShape, &camera->player->actor); - playerPosShape.pos.y += Player_GetHeight(camera->player); + Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor); + playerPosRot.pos.y += Player_GetHeight(camera->player); - if (BgCheck_EntityRaycastDown3(&camera->play->colCtx, &floorPoly, &bgId, &playerPosShape.pos) == BGCHECK_Y_MIN) { + if (BgCheck_EntityRaycastDown3(&camera->play->colCtx, &floorPoly, &bgId, &playerPosRot.pos) == BGCHECK_Y_MIN) { // no floor return NULL; } @@ -508,14 +508,14 @@ Vec3s* Camera_GetBgCamFuncDataUnderPlayer(Camera* camera, u16* bgCamCount) { * Returns the camera data index otherwise. */ s32 Camera_GetWaterBoxBgCamIndex(Camera* camera, f32* waterY) { - PosRot playerPosShape; + PosRot playerPosRot; WaterBox* waterBox; s32 bgCamIndex; - Actor_GetWorldPosShapeRot(&playerPosShape, &camera->player->actor); - *waterY = playerPosShape.pos.y; + Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor); + *waterY = playerPosRot.pos.y; - if (!WaterBox_GetSurface1(camera->play, &camera->play->colCtx, playerPosShape.pos.x, playerPosShape.pos.z, waterY, + if (!WaterBox_GetSurface1(camera->play, &camera->play->colCtx, playerPosRot.pos.x, playerPosRot.pos.z, waterY, &waterBox)) { // player's position is not in a water box. *waterY = BGCHECK_Y_MIN; @@ -783,9 +783,9 @@ void Camera_UpdateInterface(s16 interfaceField) { } } - if ((interfaceField & CAM_HUD_VISIBILITY_MASK) != CAM_HUD_VISIBILITY_IGNORE) { + if ((interfaceField & CAM_HUD_VISIBILITY_MASK) != CAM_HUD_VISIBILITY(CAM_HUD_VISIBILITY_IGNORE)) { hudVisibilityMode = (interfaceField & CAM_HUD_VISIBILITY_MASK) >> CAM_HUD_VISIBILITY_SHIFT; - if (hudVisibilityMode == (CAM_HUD_VISIBILITY_ALL >> CAM_HUD_VISIBILITY_SHIFT)) { + if (hudVisibilityMode == CAM_HUD_VISIBILITY_ALL) { hudVisibilityMode = HUD_VISIBILITY_ALL; } if (sCameraHudVisibilityMode != hudVisibilityMode) { @@ -5204,8 +5204,8 @@ s32 Camera_Unique9(Camera* camera) { VecGeo scratchGeo; VecGeo playerTargetOffset; s16 action; - s16 atInitFlags; - s16 eyeInitFlags; + s16 atFlags; + s16 eyeFlags; s16 pad2; PosRot targethead; PosRot playerhead; @@ -5257,19 +5257,21 @@ s32 Camera_Unique9(Camera* camera) { rwData->curKeyFrame = &ONEPOINT_CS_INFO(camera)->keyFrames[rwData->curKeyFrameIdx]; rwData->keyFrameTimer = rwData->curKeyFrame->timerInit; - if (rwData->curKeyFrame->unk_01 != 0xFF) { - if ((rwData->curKeyFrame->unk_01 & 0xF0) == 0x80) { - D_8011D3AC = rwData->curKeyFrame->unk_01 & 0xF; - } else if ((rwData->curKeyFrame->unk_01 & 0xF0) == 0xC0) { + if (rwData->curKeyFrame->initField != ONEPOINT_CS_INIT_FIELD_NONE) { + if (ONEPOINT_CS_INIT_FIELD_IS_TYPE_ACTORCAT(rwData->curKeyFrame->initField)) { + D_8011D3AC = rwData->curKeyFrame->initField & 0xF; + } else if (ONEPOINT_CS_INIT_FIELD_IS_TYPE_HUD_VISIBILITY(rwData->curKeyFrame->initField)) { Camera_UpdateInterface( - CAM_INTERFACE_FIELD(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY(rwData->curKeyFrame->unk_01), 0)); - } else if (camera->player->stateFlags1 & PLAYER_STATE1_27 && - player->currentBoots != PLAYER_BOOTS_IRON) { - func_8002DF38(camera->play, camera->target, PLAYER_CSMODE_8); - osSyncPrintf("camera: demo: player demo set WAIT\n"); - } else { - osSyncPrintf("camera: demo: player demo set %d\n", rwData->curKeyFrame->unk_01); - func_8002DF38(camera->play, camera->target, rwData->curKeyFrame->unk_01); + CAM_INTERFACE_FIELD(CAM_LETTERBOX_IGNORE, rwData->curKeyFrame->initField, 0)); + } else { // initField is of type PlayerCsMode + if ((camera->player->stateFlags1 & PLAYER_STATE1_27) && + (player->currentBoots != PLAYER_BOOTS_IRON)) { + func_8002DF38(camera->play, camera->target, PLAYER_CSMODE_8); + osSyncPrintf("camera: demo: player demo set WAIT\n"); + } else { + osSyncPrintf("camera: demo: player demo set %d\n", rwData->curKeyFrame->initField); + func_8002DF38(camera->play, camera->target, rwData->curKeyFrame->initField); + } } } } else { @@ -5283,29 +5285,29 @@ s32 Camera_Unique9(Camera* camera) { rwData->isNewKeyFrame = false; } - atInitFlags = rwData->curKeyFrame->initFlags & 0xFF; - if (atInitFlags == 1) { + atFlags = rwData->curKeyFrame->viewFlags & 0xFF; + if (atFlags == 1) { rwData->atTarget = rwData->curKeyFrame->atTargetInit; - } else if (atInitFlags == 2) { + } else if (atFlags == 2) { if (rwData->isNewKeyFrame) { rwData->atTarget.x = camera->play->view.at.x + rwData->curKeyFrame->atTargetInit.x; rwData->atTarget.y = camera->play->view.at.y + rwData->curKeyFrame->atTargetInit.y; rwData->atTarget.z = camera->play->view.at.z + rwData->curKeyFrame->atTargetInit.z; } - } else if (atInitFlags == 3) { + } else if (atFlags == 3) { if (rwData->isNewKeyFrame) { rwData->atTarget.x = camera->at.x + rwData->curKeyFrame->atTargetInit.x; rwData->atTarget.y = camera->at.y + rwData->curKeyFrame->atTargetInit.y; rwData->atTarget.z = camera->at.z + rwData->curKeyFrame->atTargetInit.z; } - } else if (atInitFlags == 4 || atInitFlags == 0x84) { + } else if (atFlags == 4 || atFlags == 0x84) { if (camera->target != NULL && camera->target->update != NULL) { Actor_GetFocus(&targethead, camera->target); Actor_GetFocus(&playerhead, &camera->player->actor); playerhead.pos.x = playerPosRot.pos.x; playerhead.pos.z = playerPosRot.pos.z; OLib_Vec3fDiffToVecGeo(&playerTargetOffset, &targethead.pos, &playerhead.pos); - if (atInitFlags & (s16)0x8080) { + if (atFlags & (s16)0x8080) { scratchGeo.pitch = CAM_DEG_TO_BINANG(rwData->curKeyFrame->atTargetInit.x); scratchGeo.yaw = CAM_DEG_TO_BINANG(rwData->curKeyFrame->atTargetInit.y); scratchGeo.r = rwData->curKeyFrame->atTargetInit.z; @@ -5323,9 +5325,9 @@ s32 Camera_Unique9(Camera* camera) { camera->target = NULL; rwData->atTarget = camera->at; } - } else if (atInitFlags & 0x6060) { - if (!(atInitFlags & 4) || rwData->isNewKeyFrame) { - if (atInitFlags & 0x2020) { + } else if (atFlags & 0x6060) { + if (!(atFlags & 4) || rwData->isNewKeyFrame) { + if (atFlags & 0x2020) { focusActor = &camera->player->actor; } else if (camera->target != NULL && camera->target->update != NULL) { focusActor = camera->target; @@ -5335,15 +5337,15 @@ s32 Camera_Unique9(Camera* camera) { } if (focusActor != NULL) { - if ((atInitFlags & 0xF) == 1) { + if ((atFlags & 0xF) == 1) { Actor_GetFocus(&atFocusPosRot, focusActor); - } else if ((atInitFlags & 0xF) == 2) { + } else if ((atFlags & 0xF) == 2) { Actor_GetWorld(&atFocusPosRot, focusActor); } else { Actor_GetWorldPosShapeRot(&atFocusPosRot, focusActor); } - if (atInitFlags & (s16)0x8080) { + if (atFlags & (s16)0x8080) { scratchGeo.pitch = CAM_DEG_TO_BINANG(rwData->curKeyFrame->atTargetInit.x); scratchGeo.yaw = CAM_DEG_TO_BINANG(rwData->curKeyFrame->atTargetInit.y); scratchGeo.r = rwData->curKeyFrame->atTargetInit.z; @@ -5365,36 +5367,35 @@ s32 Camera_Unique9(Camera* camera) { rwData->atTarget = *at; } - eyeInitFlags = rwData->curKeyFrame->initFlags & 0xFF00; - if (eyeInitFlags == 0x100) { + eyeFlags = rwData->curKeyFrame->viewFlags & 0xFF00; + if (eyeFlags == 0x100) { rwData->eyeTarget = rwData->curKeyFrame->eyeTargetInit; - } else if (eyeInitFlags == 0x200) { + } else if (eyeFlags == 0x200) { if (rwData->isNewKeyFrame) { rwData->eyeTarget.x = camera->play->view.eye.x + rwData->curKeyFrame->eyeTargetInit.x; rwData->eyeTarget.y = camera->play->view.eye.y + rwData->curKeyFrame->eyeTargetInit.y; rwData->eyeTarget.z = camera->play->view.eye.z + rwData->curKeyFrame->eyeTargetInit.z; } - } else if (eyeInitFlags == 0x300) { + } else if (eyeFlags == 0x300) { if (rwData->isNewKeyFrame) { rwData->eyeTarget.x = camera->eyeNext.x + rwData->curKeyFrame->eyeTargetInit.x; rwData->eyeTarget.y = camera->eyeNext.y + rwData->curKeyFrame->eyeTargetInit.y; rwData->eyeTarget.z = camera->eyeNext.z + rwData->curKeyFrame->eyeTargetInit.z; } - } else if (eyeInitFlags == 0x400 || eyeInitFlags == (s16)0x8400 || eyeInitFlags == 0x500 || - eyeInitFlags == (s16)0x8500) { + } else if (eyeFlags == 0x400 || eyeFlags == (s16)0x8400 || eyeFlags == 0x500 || eyeFlags == (s16)0x8500) { if (camera->target != NULL && camera->target->update != NULL) { Actor_GetFocus(&targethead, camera->target); Actor_GetFocus(&playerhead, &camera->player->actor); playerhead.pos.x = playerPosRot.pos.x; playerhead.pos.z = playerPosRot.pos.z; OLib_Vec3fDiffToVecGeo(&playerTargetOffset, &targethead.pos, &playerhead.pos); - if (eyeInitFlags == 0x400 || eyeInitFlags == (s16)0x8400) { + if (eyeFlags == 0x400 || eyeFlags == (s16)0x8400) { eyeLookAtPos = targethead.pos; } else { eyeLookAtPos = rwData->atTarget; } - if (eyeInitFlags & (s16)0x8080) { + if (eyeFlags & (s16)0x8080) { scratchGeo.pitch = CAM_DEG_TO_BINANG(rwData->curKeyFrame->eyeTargetInit.x); scratchGeo.yaw = CAM_DEG_TO_BINANG(rwData->curKeyFrame->eyeTargetInit.y); scratchGeo.r = rwData->curKeyFrame->eyeTargetInit.z; @@ -5412,9 +5413,9 @@ s32 Camera_Unique9(Camera* camera) { camera->target = NULL; rwData->eyeTarget = *eyeNext; } - } else if (eyeInitFlags & 0x6060) { - if (!(eyeInitFlags & 0x400) || rwData->isNewKeyFrame) { - if (eyeInitFlags & 0x2020) { + } else if (eyeFlags & 0x6060) { + if (!(eyeFlags & 0x400) || rwData->isNewKeyFrame) { + if (eyeFlags & 0x2020) { focusActor = &camera->player->actor; } else if (camera->target != NULL && camera->target->update != NULL) { focusActor = camera->target; @@ -5424,10 +5425,10 @@ s32 Camera_Unique9(Camera* camera) { } if (focusActor != NULL) { - if ((eyeInitFlags & 0xF00) == 0x100) { + if ((eyeFlags & 0xF00) == 0x100) { // head Actor_GetFocus(&eyeFocusPosRot, focusActor); - } else if ((eyeInitFlags & 0xF00) == 0x200) { + } else if ((eyeFlags & 0xF00) == 0x200) { // world Actor_GetWorld(&eyeFocusPosRot, focusActor); } else { @@ -5435,7 +5436,7 @@ s32 Camera_Unique9(Camera* camera) { Actor_GetWorldPosShapeRot(&eyeFocusPosRot, focusActor); } - if (eyeInitFlags & (s16)0x8080) { + if (eyeFlags & (s16)0x8080) { scratchGeo.pitch = CAM_DEG_TO_BINANG(rwData->curKeyFrame->eyeTargetInit.x); scratchGeo.yaw = CAM_DEG_TO_BINANG(rwData->curKeyFrame->eyeTargetInit.y); scratchGeo.r = rwData->curKeyFrame->eyeTargetInit.z; @@ -5458,10 +5459,10 @@ s32 Camera_Unique9(Camera* camera) { rwData->eyeTarget = *eyeNext; } - if (rwData->curKeyFrame->initFlags == 2) { + if (rwData->curKeyFrame->viewFlags == 2) { rwData->fovTarget = camera->play->view.fovy; rwData->rollTarget = 0; - } else if (rwData->curKeyFrame->initFlags == 0) { + } else if (rwData->curKeyFrame->viewFlags == 0) { rwData->fovTarget = camera->fov; rwData->rollTarget = camera->roll; } else { @@ -6805,8 +6806,8 @@ s32 Camera_Special6(Camera* camera) { // Change "screens" camera->player->actor.freezeTimer = 12; // Overwrite hud visibility to CAM_HUD_VISIBILITY_HEARTS_FORCE - sCameraInterfaceField = - (sCameraInterfaceField & (u16)~CAM_HUD_VISIBILITY_MASK) | CAM_HUD_VISIBILITY_HEARTS_FORCE; + sCameraInterfaceField = (sCameraInterfaceField & (u16)~CAM_HUD_VISIBILITY_MASK) | + CAM_HUD_VISIBILITY(CAM_HUD_VISIBILITY_HEARTS_FORCE); rwData->initalPlayerY = playerPosRot->pos.y; rwData->animTimer = 12; *eyeNext = bgCamPos; @@ -6842,7 +6843,8 @@ s32 Camera_Special6(Camera* camera) { } else { // Camera following player on the x axis. // Overwrite hud visibility to CAM_HUD_VISIBILITY_ALL - sCameraInterfaceField = (sCameraInterfaceField & (u16)~CAM_HUD_VISIBILITY_MASK) | CAM_HUD_VISIBILITY_ALL; + sCameraInterfaceField = + (sCameraInterfaceField & (u16)~CAM_HUD_VISIBILITY_MASK) | CAM_HUD_VISIBILITY(CAM_HUD_VISIBILITY_ALL); eyePosCalc = *eyeNext; eyePosCalc.x += (playerPosRot->pos.x - eyePosCalc.x) * 0.5f; eyePosCalc.y += (playerPosRot->pos.y - rwData->initalPlayerY) * 0.2f; @@ -7049,12 +7051,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) { @@ -7144,29 +7146,29 @@ void Camera_Stub80058140(Camera* camera) { } void Camera_InitDataUsingPlayer(Camera* camera, Player* player) { - PosRot playerPosShape; + PosRot playerPosRot; VecGeo eyeNextAtOffset; s32 bgId; - Vec3f floorPos; + Vec3f floorNorm; s32 upXZ; f32 playerToAtOffsetY; Vec3f* eye = &camera->eye; Vec3f* at = &camera->at; Vec3f* eyeNext = &camera->eyeNext; - Actor_GetWorldPosShapeRot(&playerPosShape, &player->actor); + Actor_GetWorldPosShapeRot(&playerPosRot, &player->actor); playerToAtOffsetY = Player_GetHeight(player); camera->player = player; - camera->playerPosRot = playerPosShape; + camera->playerPosRot = playerPosRot; camera->dist = eyeNextAtOffset.r = 180.0f; - camera->inputDir.y = playerPosShape.rot.y; + camera->inputDir.y = playerPosRot.rot.y; eyeNextAtOffset.yaw = camera->inputDir.y - 0x7FFF; camera->inputDir.x = eyeNextAtOffset.pitch = 0x71C; camera->inputDir.z = 0; camera->camDir = camera->inputDir; camera->xzSpeed = 0.0f; camera->playerPosDelta.y = 0.0f; - camera->at = playerPosShape.pos; + camera->at = playerPosRot.pos; camera->at.y += playerToAtOffsetY; camera->playerToAtOffset.x = 0; @@ -7182,7 +7184,7 @@ void Camera_InitDataUsingPlayer(Camera* camera, Player* player) { camera->up.y = 1.0f; camera->up.x = upXZ; - if (Camera_GetFloorYNorm(camera, &floorPos, at, &bgId) != BGCHECK_Y_MIN) { + if (Camera_GetFloorYNorm(camera, &floorNorm, at, &bgId) != BGCHECK_Y_MIN) { camera->bgId = bgId; } @@ -7245,7 +7247,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 +7280,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 +7313,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 +7453,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 +7583,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 +7663,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 +7673,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 +7704,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 +7717,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 +7806,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 +8107,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 +8131,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 +8333,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 b4360ffeba..4a4c828e2d 100644 --- a/src/code/z_camera_data.inc.c +++ b/src/code/z_camera_data.inc.c @@ -874,7 +874,7 @@ CameraModeValue sDataOnlyNullFlags[] = { *===================================================================== */ -CameraModeValue sSetPrerendFixedModeZTargetFriendlyData[] = { +CameraModeValue sSetPreRendFixedModeZTargetFriendlyData[] = { CAM_FUNCDATA_INTERFACE_FIELD(CAM_INTERFACE_FIELD(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, 0)), }; @@ -884,15 +884,15 @@ CameraModeValue sSetPrerendFixedModeZTargetFriendlyData[] = { *===================================================================== */ -CameraModeValue sSetPrerendPivotModeNormalData[] = { +CameraModeValue sSetPreRendPivotModeNormalData[] = { CAM_FUNCDATA_UNIQ7(60, CAM_INTERFACE_FIELD(CAM_LETTERBOX_NONE, CAM_HUD_VISIBILITY_ALL, 0)), }; -CameraModeValue sSetPrerendPivotModeZTargetFriendlyData[] = { +CameraModeValue sSetPreRendPivotModeZTargetFriendlyData[] = { CAM_FUNCDATA_UNIQ7(60, CAM_INTERFACE_FIELD(CAM_LETTERBOX_MEDIUM, CAM_HUD_VISIBILITY_ALL, 0)), }; -CameraModeValue sSetPrerendPivotModeTalkData[] = { +CameraModeValue sSetPreRendPivotModeTalkData[] = { CAM_FUNCDATA_KEEP0(30, 0, 4, CAM_INTERFACE_FIELD(CAM_LETTERBOX_LARGE, CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE, 0)), }; @@ -957,11 +957,11 @@ CameraModeValue sSetFree0ModeNormalData[] = { /** *===================================================================== - * Custom Data: FREE1 Setting + * Custom Data: FREE2 Setting *===================================================================== */ -CameraModeValue sSetFree1ModeNormalData[] = { +CameraModeValue sSetFree2ModeNormalData[] = { CAM_FUNCDATA_INTERFACE_FIELD(CAM_INTERFACE_FIELD(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, UNIQUE6_FLAG_0)), }; @@ -1459,7 +1459,7 @@ CameraModeValue sSetDirectedYawModeTalkData[] = { *===================================================================== */ -CameraModeValue sNormal4ModeTalkData[] = { +CameraModeValue sSetNormal4ModeTalkData[] = { CAM_FUNCDATA_KEEP3(-30, 70, 200, 40, 10, 0, 5, 70, 45, 50, 10, CAM_INTERFACE_FIELD(CAM_LETTERBOX_LARGE, CAM_HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE, KEEPON3_FLAG_7 | KEEPON3_FLAG_5)), @@ -1965,15 +1965,15 @@ CameraMode sCamSetPivotInFrontModes[] = { CameraMode sCamSetPreRendFixedModes[] = { CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXD3, sDataOnlyNullFlags), // CAM_MODE_NORMAL { CAM_FUNC_NONE, 0, NULL }, // CAM_MODE_Z_PARALLEL - CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXD3, sSetPrerendFixedModeZTargetFriendlyData), // CAM_MODE_Z_TARGET_FRIENDLY - CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXD3, sSetPrerendFixedModeZTargetFriendlyData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXD3, sSetPreRendFixedModeZTargetFriendlyData), // CAM_MODE_Z_TARGET_FRIENDLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXD3, sSetPreRendFixedModeZTargetFriendlyData), // CAM_MODE_TALK }; CameraMode sCamSetPreRendPivotModes[] = { - CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQ7, sSetPrerendPivotModeNormalData), // CAM_MODE_NORMAL + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQ7, sSetPreRendPivotModeNormalData), // CAM_MODE_NORMAL { CAM_FUNC_NONE, 0, NULL }, // CAM_MODE_Z_PARALLEL - CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQ7, sSetPrerendPivotModeZTargetFriendlyData), // CAM_MODE_Z_TARGET_FRIENDLY - CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEP0, sSetPrerendPivotModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQ7, sSetPreRendPivotModeZTargetFriendlyData), // CAM_MODE_Z_TARGET_FRIENDLY + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEP0, sSetPreRendPivotModeTalkData), // CAM_MODE_TALK }; CameraMode sCamSetPreRendSideScrollModes[] = { @@ -2005,15 +2005,15 @@ CameraMode sCamSetFree0Modes[] = { CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQ6, sSetFree0ModeNormalData), // CAM_MODE_NORMAL }; -CameraMode sCamSetFree1Modes[] = { - CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQ6, sSetFree1ModeNormalData), // CAM_MODE_NORMAL +CameraMode sCamSetFree2Modes[] = { + CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQ6, sSetFree2ModeNormalData), // CAM_MODE_NORMAL }; CameraMode sCamSetPivotCornerModes[] = { CAM_SETTING_MODE_ENTRY(CAM_FUNC_FIXD2, sSetPivotCornerModeNormalData), // CAM_MODE_NORMAL }; -CameraMode sCamSetPivotDivingModes[] = { +CameraMode sCamSetPivotWaterSurfaceModes[] = { CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQ2, sSetPivotWaterSurfaceModeNormalData), // CAM_MODE_NORMAL CAM_SETTING_MODE_ENTRY(CAM_FUNC_UNIQ2, sSetPivotWaterSurfaceModeZParallelData), // CAM_MODE_Z_PARALLEL }; @@ -2319,7 +2319,7 @@ CameraMode sCamSetNormal4Modes[] = { CAM_SETTING_MODE_ENTRY(CAM_FUNC_NORM1, sSetNormal2and4ModeNormalData), // CAM_MODE_NORMAL CAM_SETTING_MODE_ENTRY(CAM_FUNC_PARA1, sSetNormal0ModeZParallelData), // CAM_MODE_Z_PARALLEL CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEP1, sSetNormal0ModeZTargetFriendlyData), // CAM_MODE_Z_TARGET_FRIENDLY - CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEP3, sNormal4ModeTalkData), // CAM_MODE_TALK + CAM_SETTING_MODE_ENTRY(CAM_FUNC_KEEP3, sSetNormal4ModeTalkData), // CAM_MODE_TALK CAM_SETTING_MODE_ENTRY(CAM_FUNC_BATT1, sSetNormal1ModeZTargetUnfriendlyData), // CAM_MODE_Z_TARGET_UNFRIENDLY CAM_SETTING_MODE_ENTRY(CAM_FUNC_JUMP2, sSetNormal0ModeWallClimbData), // CAM_MODE_WALL_CLIMB CAM_SETTING_MODE_ENTRY(CAM_FUNC_SUBJ3, sSetNormal0ModeFirstPersonData), // CAM_MODE_FIRST_PERSON @@ -2374,9 +2374,9 @@ CameraSetting sCameraSettings[] = { { { 0xC5000001 }, sCamSetStart0Modes }, // CAM_SET_START0 { { 0xC5000001 }, sCamSetStart1Modes }, // CAM_SET_START1 { { 0x05000001 }, sCamSetFree0Modes }, // CAM_SET_FREE0 - { { 0x05000001 }, sCamSetFree1Modes }, // CAM_SET_FREE2 + { { 0x05000001 }, sCamSetFree2Modes }, // CAM_SET_FREE2 { { 0x85000001 }, sCamSetPivotCornerModes }, // CAM_SET_PIVOT_CORNER - { { 0x05000003 }, sCamSetPivotDivingModes }, // CAM_SET_PIVOT_WATER_SURFACE + { { 0x05000003 }, sCamSetPivotWaterSurfaceModes }, // CAM_SET_PIVOT_WATER_SURFACE { { 0xCE000001 }, sCamSetCs0Modes }, // CAM_SET_CS_0 { { 0x4E000001 }, sCamSetCsTwistedHallwayModes }, // CAM_SET_CS_TWISTED_HALLWAY { { 0x05000009 }, sCamSetForestBirdsEyeModes }, // CAM_SET_FOREST_BIRDS_EYE @@ -2555,7 +2555,7 @@ s32 (*sCameraFunctions[])(Camera*) = { s32 sInitRegs = 1; -s32 gDbgCamEnabled = 0; +s32 gDebugCamEnabled = false; s32 sDbgModeIdx = -1; s16 sNextUID = 0; @@ -2676,12 +2676,12 @@ s32 sDemo5PrevSfxFrame = -200; // target is player, far from eye OnePointCsFull D_8011D6AC[] = { { - // initflags & 0x00FF (at): 2, atTarget is view lookAt + atInit - // initFlags & 0xFF00 (eye): none + // viewFlags & 0x00FF (at): 2, atTarget is view lookAt + atInit + // viewFlags & 0xFF00 (eye): none // action: 15, copy at, eye, roll, fov to camera // result: eye remains in the same location, at is View's lookAt ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0002, 1, 0, @@ -2691,12 +2691,12 @@ OnePointCsFull D_8011D6AC[] = { { 0.0f, 0.0f, 0.0f }, }, { - // initFlags & 0x00FF (at): 3, atTarget is camera's current at + atInit - // initFlags & 0xFF00 (eye): 3, eyeTarget is the camera's current eye + eyeInit + // viewFlags & 0x00FF (at): 3, atTarget is camera's current at + atInit + // viewFlags & 0xFF00 (eye): 3, eyeTarget is the camera's current eye + eyeInit // action: interpolate eye and at. // result: eye and at's y interpolate to become +20 from their current location. ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0303, 19, 0, @@ -2706,11 +2706,11 @@ OnePointCsFull D_8011D6AC[] = { { 0.0f, 20.0f, 0.0f }, }, { - // initFlags & 0x00FF (at): 0 none - // initFlags & 0xFF00 (eye): 0 none + // viewFlags & 0x00FF (at): 0 none + // viewFlags & 0xFF00 (eye): 0 none // action: 18, copy this camera to default camera. ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2725,7 +2725,7 @@ OnePointCsFull D_8011D6AC[] = { OnePointCsFull D_8011D724[] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2424, 1, 0, @@ -2736,7 +2736,7 @@ OnePointCsFull D_8011D724[] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2121, 19, 0, @@ -2747,7 +2747,7 @@ OnePointCsFull D_8011D724[] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2762,7 +2762,7 @@ OnePointCsFull D_8011D724[] = { OnePointCsFull D_8011D79C[] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0002, 1, 0, @@ -2773,7 +2773,7 @@ OnePointCsFull D_8011D79C[] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, true, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0303, 19, 0, @@ -2784,7 +2784,7 @@ OnePointCsFull D_8011D79C[] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, true, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0303, 9, 0, @@ -2795,7 +2795,7 @@ OnePointCsFull D_8011D79C[] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2810,7 +2810,7 @@ OnePointCsFull D_8011D79C[] = { OnePointCsFull D_8011D83C[] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2141, 20, 0, @@ -2821,7 +2821,7 @@ OnePointCsFull D_8011D83C[] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2838,7 +2838,7 @@ OnePointCsFull D_8011D83C[] = { OnePointCsFull D_8011D88C[] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0303, 20, 0, @@ -2849,7 +2849,7 @@ OnePointCsFull D_8011D88C[] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2864,7 +2864,7 @@ OnePointCsFull D_8011D88C[] = { OnePointCsFull D_8011D8DC[] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0404, 20, 1, @@ -2875,7 +2875,7 @@ OnePointCsFull D_8011D8DC[] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2121, 5, 0, @@ -2886,7 +2886,7 @@ OnePointCsFull D_8011D8DC[] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2901,7 +2901,7 @@ OnePointCsFull D_8011D8DC[] = { OnePointCsFull D_8011D954[] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0xC1C1, 20, 0, @@ -2912,7 +2912,7 @@ OnePointCsFull D_8011D954[] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x05B1, 5, 0, @@ -2923,7 +2923,7 @@ OnePointCsFull D_8011D954[] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2121, 5, 2, @@ -2934,7 +2934,7 @@ OnePointCsFull D_8011D954[] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2949,7 +2949,7 @@ OnePointCsFull D_8011D954[] = { OnePointCsFull D_8011D9F4[] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0504, 20, 2, @@ -2960,7 +2960,7 @@ OnePointCsFull D_8011D9F4[] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2121, 5, 2, @@ -2971,7 +2971,7 @@ OnePointCsFull D_8011D9F4[] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 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 630cfc1ba7..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); @@ -156,7 +156,7 @@ void DbCamera_DrawScreenText(GfxPrint* printer) { /** * Updates the state of the Reg Editor according to user input. * Also contains a controller rumble test that can be interfaced with via related REGs. -*/ + */ void Regs_UpdateEditor(Input* input) { s32 dPadInputCur; s32 pageDataStart = ((gRegEditor->regGroup * REG_PAGES) + gRegEditor->regPage - 1) * REGS_PER_PAGE; @@ -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_en_a_keep.c b/src/code/z_en_a_keep.c index b58e813cd4..572479dc71 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -312,7 +312,7 @@ void EnAObj_Update(Actor* thisx, PlayState* play) { EnAObj* this = (EnAObj*)thisx; this->actionFunc(this, play); - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); if (this->dyna.actor.gravity != 0.0f) { if (this->dyna.actor.params != A_OBJ_BOULDER_FRAGMENT) { diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 18e8ef1117..3d336e5bca 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -576,7 +576,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { } else { sp3A = 1; - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } if (sp3A || D_80157D94[0]) { diff --git a/src/code/z_message_PAL.c b/src/code/z_message_PAL.c index 656073a9cd..9a04dcee2c 100644 --- a/src/code/z_message_PAL.c +++ b/src/code/z_message_PAL.c @@ -1609,7 +1609,7 @@ void Message_OpenText(PlayState* play, u16 textId) { // Increments text id based on piece of heart count, assumes the piece of heart text is all // in order and that you don't have more than the intended amount of heart pieces. textId += (gSaveContext.inventory.questItems & 0xF0000000 & 0xF0000000) >> QUEST_HEART_PIECE_COUNT; - } else if (msgCtx->textId == 0xC && CHECK_OWNED_EQUIP(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BGS)) { + } else if (msgCtx->textId == 0xC && CHECK_OWNED_EQUIP(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BIGGORON)) { textId = 0xB; // Traded Giant's Knife for Biggoron Sword } else if (msgCtx->textId == 0xB4 && GET_EVENTCHKINF(EVENTCHKINF_96)) { textId = 0xB5; // Destroyed Gold Skulltula diff --git a/src/code/z_onepointdemo.c b/src/code/z_onepointdemo.c index bf1a2a7521..cfe61236f1 100644 --- a/src/code/z_onepointdemo.c +++ b/src/code/z_onepointdemo.c @@ -664,7 +664,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act Play_SetCameraAtEye(play, subCamId, &spC0, &spB4); subCam->roll = 0; subCam->fov = 75.0f; - player->actor.shape.rot.y = player->actor.world.rot.y = player->currentYaw = spD0.yaw + 0x7FFF; + player->actor.shape.rot.y = player->actor.world.rot.y = player->yaw = spD0.yaw + 0x7FFF; func_8002DF54(play, NULL, PLAYER_CSMODE_8); break; @@ -708,7 +708,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act break; case 3390: - player->actor.shape.rot.y = player->actor.world.rot.y = player->currentYaw = -0x3FD9; + player->actor.shape.rot.y = player->actor.world.rot.y = player->yaw = -0x3FD9; csInfo->keyFrames = D_80121DB4; csInfo->keyFrameCount = ARRAY_COUNT(D_80121DB4); @@ -733,7 +733,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act D_80121F1C[0].eyeTargetInit = play->view.eye; D_80121F1C[0].fovTargetInit = play->view.fovy; Actor_GetFocus(&spA0, actor); - player->actor.shape.rot.y = player->actor.world.rot.y = player->currentYaw = spA0.rot.y; + player->actor.shape.rot.y = player->actor.world.rot.y = player->yaw = spA0.rot.y; csInfo->keyFrames = D_80121F1C; csInfo->keyFrameCount = ARRAY_COUNT(D_80121F1C); @@ -857,7 +857,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act csInfo->keyFrames = D_801225D4; csInfo->keyFrameCount = ARRAY_COUNT(D_801225D4); - player->actor.shape.rot.y = player->actor.world.rot.y = player->currentYaw = 0x3FFC; + player->actor.shape.rot.y = player->actor.world.rot.y = player->yaw = 0x3FFC; Play_InitCameraDataUsingPlayer(play, subCamId, player, CAM_SET_CS_C); func_8002DF54(play, NULL, PLAYER_CSMODE_8); break; diff --git a/src/code/z_onepointdemo_data.inc.c b/src/code/z_onepointdemo_data.inc.c index ca8b2ad2ab..f88e9e39b8 100644 --- a/src/code/z_onepointdemo_data.inc.c +++ b/src/code/z_onepointdemo_data.inc.c @@ -121,7 +121,7 @@ static s16 D_801208E8 = 8; static OnePointCsFull D_801208EC[3] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x08, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_8), 0x0101, 1, 0, @@ -132,7 +132,7 @@ static OnePointCsFull D_801208EC[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 1, 0, @@ -143,7 +143,7 @@ static OnePointCsFull D_801208EC[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -157,7 +157,7 @@ static OnePointCsFull D_801208EC[3] = { static OnePointCsFull D_80120964[2] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 1, 0, @@ -168,7 +168,7 @@ static OnePointCsFull D_80120964[2] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0xA121, 1, 0, @@ -182,7 +182,7 @@ static OnePointCsFull D_80120964[2] = { static OnePointCsFull D_801209B4[4] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0x08, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_8), 0x0101, 1, 0, @@ -193,7 +193,7 @@ static OnePointCsFull D_801209B4[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x0100, 29, 0, @@ -204,7 +204,7 @@ static OnePointCsFull D_801209B4[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 10, 0, @@ -215,7 +215,7 @@ static OnePointCsFull D_801209B4[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -229,7 +229,7 @@ static OnePointCsFull D_801209B4[4] = { static OnePointCsFull D_80120A54[3] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2525, 1, 0, @@ -240,7 +240,7 @@ static OnePointCsFull D_80120A54[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 9, 0, @@ -251,7 +251,7 @@ static OnePointCsFull D_80120A54[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0022, 5000, 0, @@ -265,7 +265,7 @@ static OnePointCsFull D_80120A54[3] = { static OnePointCsFull D_80120ACC[5] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0442, 10, 0, @@ -276,7 +276,7 @@ static OnePointCsFull D_80120ACC[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -287,7 +287,7 @@ static OnePointCsFull D_80120ACC[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x0442, 10, 0, @@ -298,7 +298,7 @@ static OnePointCsFull D_80120ACC[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -309,7 +309,7 @@ static OnePointCsFull D_80120ACC[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -323,7 +323,7 @@ static OnePointCsFull D_80120ACC[5] = { static OnePointCsFull D_80120B94[11] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x2142, 1, 0, @@ -334,7 +334,7 @@ static OnePointCsFull D_80120B94[11] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0404, 19, 5, @@ -345,7 +345,7 @@ static OnePointCsFull D_80120B94[11] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0404, 20, 0, @@ -356,7 +356,7 @@ static OnePointCsFull D_80120B94[11] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0404, 40, -10, @@ -367,7 +367,7 @@ static OnePointCsFull D_80120B94[11] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4141, 1, 0, @@ -378,7 +378,7 @@ static OnePointCsFull D_80120B94[11] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0404, 19, 0, @@ -389,7 +389,7 @@ static OnePointCsFull D_80120B94[11] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0404, 40, 10, @@ -400,7 +400,7 @@ static OnePointCsFull D_80120B94[11] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0404, 70, 0, @@ -411,7 +411,7 @@ static OnePointCsFull D_80120B94[11] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4141, 1, 0, @@ -422,7 +422,7 @@ static OnePointCsFull D_80120B94[11] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_13, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4141, 150, 0, @@ -433,7 +433,7 @@ static OnePointCsFull D_80120B94[11] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_24, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -447,7 +447,7 @@ static OnePointCsFull D_80120B94[11] = { static OnePointCsFull D_80120D4C[7] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x2142, 1, 0, @@ -458,7 +458,7 @@ static OnePointCsFull D_80120D4C[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0404, 19, 5, @@ -469,7 +469,7 @@ static OnePointCsFull D_80120D4C[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0404, 20, 0, @@ -480,7 +480,7 @@ static OnePointCsFull D_80120D4C[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0404, 40, -10, @@ -491,7 +491,7 @@ static OnePointCsFull D_80120D4C[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4141, 1, 0, @@ -502,7 +502,7 @@ static OnePointCsFull D_80120D4C[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_13, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4141, 150, 0, @@ -513,7 +513,7 @@ static OnePointCsFull D_80120D4C[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_24, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -527,7 +527,7 @@ static OnePointCsFull D_80120D4C[7] = { static OnePointCsFull D_80120E64[8] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, true, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x2142, 20, 0, @@ -538,7 +538,7 @@ static OnePointCsFull D_80120E64[8] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 80, 0, @@ -549,7 +549,7 @@ static OnePointCsFull D_80120E64[8] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, true, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 8, 0, @@ -560,7 +560,7 @@ static OnePointCsFull D_80120E64[8] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, true, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 15, 4, @@ -571,7 +571,7 @@ static OnePointCsFull D_80120E64[8] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, true, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 15, -4, @@ -582,7 +582,7 @@ static OnePointCsFull D_80120E64[8] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, true, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 15, 0, @@ -593,7 +593,7 @@ static OnePointCsFull D_80120E64[8] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 40, 0, @@ -604,7 +604,7 @@ static OnePointCsFull D_80120E64[8] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -618,7 +618,7 @@ static OnePointCsFull D_80120E64[8] = { static OnePointCsFull D_80120FA4[6] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x2143, 30, 0, @@ -629,7 +629,7 @@ static OnePointCsFull D_80120FA4[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -640,7 +640,7 @@ static OnePointCsFull D_80120FA4[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2222, 10, 0, @@ -651,7 +651,7 @@ static OnePointCsFull D_80120FA4[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -662,7 +662,7 @@ static OnePointCsFull D_80120FA4[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2121, 10, 0, @@ -673,7 +673,7 @@ static OnePointCsFull D_80120FA4[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -687,7 +687,7 @@ static OnePointCsFull D_80120FA4[6] = { static OnePointCsFull D_80121094[3] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x08, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_8), 0x2101, 20, 0, @@ -698,7 +698,7 @@ static OnePointCsFull D_80121094[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x2101, 50, 0, @@ -709,7 +709,7 @@ static OnePointCsFull D_80121094[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -723,7 +723,7 @@ static OnePointCsFull D_80121094[3] = { static OnePointCsFull D_8012110C[3] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), - 0x05, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_5), 0x2142, 1, 0, @@ -734,7 +734,7 @@ static OnePointCsFull D_8012110C[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, true, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2121, 10, 0, @@ -745,7 +745,7 @@ static OnePointCsFull D_8012110C[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -759,7 +759,7 @@ static OnePointCsFull D_8012110C[3] = { static OnePointCsFull D_80121184[2] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x0101, 40, 0, @@ -770,7 +770,7 @@ static OnePointCsFull D_80121184[2] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -784,7 +784,7 @@ static OnePointCsFull D_80121184[2] = { static OnePointCsFull D_801211D4[2] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0x08, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_8), 0x0101, 50, 0, @@ -795,7 +795,7 @@ static OnePointCsFull D_801211D4[2] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -809,7 +809,7 @@ static OnePointCsFull D_801211D4[2] = { static OnePointCsFull D_80121224[6] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x4141, 2, 0, @@ -820,7 +820,7 @@ static OnePointCsFull D_80121224[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4141, 18, 0, @@ -831,7 +831,7 @@ static OnePointCsFull D_80121224[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - 0x34, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_52), 0x4104, 80, 0, @@ -842,7 +842,7 @@ static OnePointCsFull D_80121224[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x0000, 20, 0, @@ -853,7 +853,7 @@ static OnePointCsFull D_80121224[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0421, 60, 0, @@ -864,7 +864,7 @@ static OnePointCsFull D_80121224[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -878,7 +878,7 @@ static OnePointCsFull D_80121224[6] = { static OnePointCsFull D_80121314[1] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0x08, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_8), 0x4141, 1000, 0, @@ -892,7 +892,7 @@ static OnePointCsFull D_80121314[1] = { static OnePointCsFull D_8012133C[3] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x0141, 40, 0, @@ -903,7 +903,7 @@ static OnePointCsFull D_8012133C[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2121, 20, 0, @@ -914,7 +914,7 @@ static OnePointCsFull D_8012133C[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -928,7 +928,7 @@ static OnePointCsFull D_8012133C[3] = { static OnePointCsFull D_801213B4[5] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0x08, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_8), 0xC2C2, 40, 0, @@ -939,7 +939,7 @@ static OnePointCsFull D_801213B4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, true), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0xC2C2, 120, 0, @@ -950,7 +950,7 @@ static OnePointCsFull D_801213B4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0x53, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_83), 0xC2C2, 30, 0, @@ -961,7 +961,7 @@ static OnePointCsFull D_801213B4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, true), - 0x45, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_69), 0x4222, 30, 0, @@ -972,7 +972,7 @@ static OnePointCsFull D_801213B4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -986,7 +986,7 @@ static OnePointCsFull D_801213B4[5] = { static OnePointCsFull D_8012147C[4] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x0101, 40, 0, @@ -997,7 +997,7 @@ static OnePointCsFull D_8012147C[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x0142, 1, 0, @@ -1008,7 +1008,7 @@ static OnePointCsFull D_8012147C[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), - 0x08, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_8), 0x0142, 89, -4, @@ -1019,7 +1019,7 @@ static OnePointCsFull D_8012147C[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -1033,7 +1033,7 @@ static OnePointCsFull D_8012147C[4] = { static OnePointCsFull D_8012151C[2] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x0101, 29, 0, @@ -1044,7 +1044,7 @@ static OnePointCsFull D_8012151C[2] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -1058,7 +1058,7 @@ static OnePointCsFull D_8012151C[2] = { static OnePointCsFull D_8012156C[2] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0x4D, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_77), 0x4242, 1, 0, @@ -1069,7 +1069,7 @@ static OnePointCsFull D_8012156C[2] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, -1, 0, @@ -1083,7 +1083,7 @@ static OnePointCsFull D_8012156C[2] = { static OnePointCsFull D_801215BC[1] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 5, 0, @@ -1097,7 +1097,7 @@ static OnePointCsFull D_801215BC[1] = { static OnePointCsFull D_801215E4[10] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x08, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_8), 0x4141, 20, 0, @@ -1108,7 +1108,7 @@ static OnePointCsFull D_801215E4[10] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x0101, 1, 4, @@ -1119,7 +1119,7 @@ static OnePointCsFull D_801215E4[10] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4141, 129, 0, @@ -1130,7 +1130,7 @@ static OnePointCsFull D_801215E4[10] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0303, 30, 0, @@ -1141,7 +1141,7 @@ static OnePointCsFull D_801215E4[10] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x09, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_9), 0x0101, 40, -5, @@ -1152,7 +1152,7 @@ static OnePointCsFull D_801215E4[10] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x0101, 1, 0, @@ -1163,7 +1163,7 @@ static OnePointCsFull D_801215E4[10] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 60, 0, @@ -1174,7 +1174,7 @@ static OnePointCsFull D_801215E4[10] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 10, 0, @@ -1185,7 +1185,7 @@ static OnePointCsFull D_801215E4[10] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 20, 0, @@ -1196,7 +1196,7 @@ static OnePointCsFull D_801215E4[10] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -1210,7 +1210,7 @@ static OnePointCsFull D_801215E4[10] = { static OnePointCsFull D_80121774[4] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x08, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_8), 0x0101, 1, -2, @@ -1221,7 +1221,7 @@ static OnePointCsFull D_80121774[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x0142, 39, 2, @@ -1232,7 +1232,7 @@ static OnePointCsFull D_80121774[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0x05, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_5), 0x0121, 20, 0, @@ -1243,7 +1243,7 @@ static OnePointCsFull D_80121774[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -1257,7 +1257,7 @@ static OnePointCsFull D_80121774[4] = { static OnePointCsFull D_80121814[4] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x4C, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_76), 0x0101, 5, 0, @@ -1268,7 +1268,7 @@ static OnePointCsFull D_80121814[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 70, 0, @@ -1279,7 +1279,7 @@ static OnePointCsFull D_80121814[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2121, 10, 0, @@ -1290,7 +1290,7 @@ static OnePointCsFull D_80121814[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -1304,7 +1304,7 @@ static OnePointCsFull D_80121814[4] = { static OnePointCsFull D_801218B4[2] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 60, 0, @@ -1315,7 +1315,7 @@ static OnePointCsFull D_801218B4[2] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 100, 0, @@ -1329,7 +1329,7 @@ static OnePointCsFull D_801218B4[2] = { static OnePointCsFull D_80121904[2] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 50, 10, @@ -1340,7 +1340,7 @@ static OnePointCsFull D_80121904[2] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, -1, @@ -1355,7 +1355,7 @@ static OnePointCsFull D_80121954[3][2] = { { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 20, 5, @@ -1366,7 +1366,7 @@ static OnePointCsFull D_80121954[3][2] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 80, -10, @@ -1379,7 +1379,7 @@ static OnePointCsFull D_80121954[3][2] = { { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 40, -30, @@ -1390,7 +1390,7 @@ static OnePointCsFull D_80121954[3][2] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 60, 20, @@ -1403,7 +1403,7 @@ static OnePointCsFull D_80121954[3][2] = { { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 80, 5, @@ -1414,7 +1414,7 @@ static OnePointCsFull D_80121954[3][2] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 20, 5, @@ -1429,7 +1429,7 @@ static OnePointCsFull D_80121954[3][2] = { static OnePointCsFull D_80121A44[12] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), - 0x05, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_5), 0x2121, 10, 0, @@ -1440,7 +1440,7 @@ static OnePointCsFull D_80121A44[12] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, true, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x4242, 30, 0, @@ -1451,7 +1451,7 @@ static OnePointCsFull D_80121A44[12] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, true, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -1462,7 +1462,7 @@ static OnePointCsFull D_80121A44[12] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), - 0x05, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_5), 0x2222, 40, 5, @@ -1473,7 +1473,7 @@ static OnePointCsFull D_80121A44[12] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x4242, 40, 5, @@ -1484,7 +1484,7 @@ static OnePointCsFull D_80121A44[12] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, true, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -1495,7 +1495,7 @@ static OnePointCsFull D_80121A44[12] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 30, -5, @@ -1506,7 +1506,7 @@ static OnePointCsFull D_80121A44[12] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, true, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -1517,7 +1517,7 @@ static OnePointCsFull D_80121A44[12] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, true, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x2242, 40, 0, @@ -1528,7 +1528,7 @@ static OnePointCsFull D_80121A44[12] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, true, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x22C2, 140, 0, @@ -1539,7 +1539,7 @@ static OnePointCsFull D_80121A44[12] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_9, true, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2222, 20, 0, @@ -1550,7 +1550,7 @@ static OnePointCsFull D_80121A44[12] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -1564,7 +1564,7 @@ static OnePointCsFull D_80121A44[12] = { static OnePointCsFull D_80121C24[7] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x05, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_5), 0x0101, 1, 0, @@ -1575,7 +1575,7 @@ static OnePointCsFull D_80121C24[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 89, 0, @@ -1586,7 +1586,7 @@ static OnePointCsFull D_80121C24[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x08, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_8), 0x0101, 40, 4, @@ -1597,7 +1597,7 @@ static OnePointCsFull D_80121C24[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 40, -4, @@ -1608,7 +1608,7 @@ static OnePointCsFull D_80121C24[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 100, 0, @@ -1619,7 +1619,7 @@ static OnePointCsFull D_80121C24[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 100, 0, @@ -1630,7 +1630,7 @@ static OnePointCsFull D_80121C24[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -1644,7 +1644,7 @@ static OnePointCsFull D_80121C24[7] = { static OnePointCsFull D_80121D3C[3] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 1, 0, @@ -1655,7 +1655,7 @@ static OnePointCsFull D_80121D3C[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 4, 0, @@ -1666,7 +1666,7 @@ static OnePointCsFull D_80121D3C[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, -1, 0, @@ -1680,7 +1680,7 @@ static OnePointCsFull D_80121D3C[3] = { static OnePointCsFull D_80121DB4[9] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 40, 0, @@ -1691,7 +1691,7 @@ static OnePointCsFull D_80121DB4[9] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 60, 0, @@ -1702,7 +1702,7 @@ static OnePointCsFull D_80121DB4[9] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 5, 0, @@ -1713,7 +1713,7 @@ static OnePointCsFull D_80121DB4[9] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 80, 8, @@ -1724,7 +1724,7 @@ static OnePointCsFull D_80121DB4[9] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x39, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_57), 0x2121, 1, 8, @@ -1735,7 +1735,7 @@ static OnePointCsFull D_80121DB4[9] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2121, 99, 2, @@ -1746,7 +1746,7 @@ static OnePointCsFull D_80121DB4[9] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_9, false, false), - 0x38, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_56), 0x2121, 149, -20, @@ -1757,7 +1757,7 @@ static OnePointCsFull D_80121DB4[9] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2121, 1, 0, @@ -1768,7 +1768,7 @@ static OnePointCsFull D_80121DB4[9] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, -1, @@ -1782,7 +1782,7 @@ static OnePointCsFull D_80121DB4[9] = { static OnePointCsFull D_80121F1C[4] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x08, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_8), 0x0101, 10, 0, @@ -1793,7 +1793,7 @@ static OnePointCsFull D_80121F1C[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2121, 10, 0, @@ -1804,7 +1804,7 @@ static OnePointCsFull D_80121F1C[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0x02, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_2), 0x2121, 23, 0, @@ -1815,7 +1815,7 @@ static OnePointCsFull D_80121F1C[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, -1, @@ -1829,7 +1829,7 @@ static OnePointCsFull D_80121F1C[4] = { static OnePointCsFull D_80121FBC[4] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 5, 0, @@ -1840,7 +1840,7 @@ static OnePointCsFull D_80121FBC[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 10, 0, @@ -1851,7 +1851,7 @@ static OnePointCsFull D_80121FBC[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 30, 0, @@ -1862,7 +1862,7 @@ static OnePointCsFull D_80121FBC[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, -1, @@ -1876,7 +1876,7 @@ static OnePointCsFull D_80121FBC[4] = { static OnePointCsFull D_8012205C[3] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x42C2, 1, 0, @@ -1887,7 +1887,7 @@ static OnePointCsFull D_8012205C[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0080, 29, 0, @@ -1898,7 +1898,7 @@ static OnePointCsFull D_8012205C[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x21A1, 10, 0, @@ -1912,7 +1912,7 @@ static OnePointCsFull D_8012205C[3] = { static OnePointCsFull D_801220D4[5] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x0101, 5, 0, @@ -1923,7 +1923,7 @@ static OnePointCsFull D_801220D4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4141, 10, 5, @@ -1934,7 +1934,7 @@ static OnePointCsFull D_801220D4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4141, 15, 10, @@ -1945,7 +1945,7 @@ static OnePointCsFull D_801220D4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 25, 0, @@ -1956,7 +1956,7 @@ static OnePointCsFull D_801220D4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, -1, @@ -1970,7 +1970,7 @@ static OnePointCsFull D_801220D4[5] = { static OnePointCsFull D_8012219C[7] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2121, 5, 0, @@ -1981,7 +1981,7 @@ static OnePointCsFull D_8012219C[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 15, 0, @@ -1992,7 +1992,7 @@ static OnePointCsFull D_8012219C[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 20, 0, @@ -2003,7 +2003,7 @@ static OnePointCsFull D_8012219C[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 20, 0, @@ -2014,7 +2014,7 @@ static OnePointCsFull D_8012219C[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2025,7 +2025,7 @@ static OnePointCsFull D_8012219C[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 90, 0, @@ -2036,7 +2036,7 @@ static OnePointCsFull D_8012219C[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, -1, @@ -2050,7 +2050,7 @@ static OnePointCsFull D_8012219C[7] = { static OnePointCsFull D_801222B4[5] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 20, 10, @@ -2061,7 +2061,7 @@ static OnePointCsFull D_801222B4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 20, 10, @@ -2072,7 +2072,7 @@ static OnePointCsFull D_801222B4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), - 0x81, + ONEPOINT_CS_INIT_FIELD_ACTORCAT(ACTORCAT_BG), 0x0101, 20, 10, @@ -2083,7 +2083,7 @@ static OnePointCsFull D_801222B4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), - 0x8A, + ONEPOINT_CS_INIT_FIELD_ACTORCAT(ACTORCAT_DOOR), 0x0101, 5, 10, @@ -2094,7 +2094,7 @@ static OnePointCsFull D_801222B4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, -1, @@ -2108,7 +2108,7 @@ static OnePointCsFull D_801222B4[5] = { static OnePointCsFull D_8012237C[2] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 20, -2, @@ -2119,7 +2119,7 @@ static OnePointCsFull D_8012237C[2] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, -1, @@ -2133,7 +2133,7 @@ static OnePointCsFull D_8012237C[2] = { static OnePointCsFull D_801223CC[6] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 20, 0, @@ -2144,7 +2144,7 @@ static OnePointCsFull D_801223CC[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 18, -13, @@ -2155,7 +2155,7 @@ static OnePointCsFull D_801223CC[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 16, 18, @@ -2166,7 +2166,7 @@ static OnePointCsFull D_801223CC[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 4, 0, @@ -2177,7 +2177,7 @@ static OnePointCsFull D_801223CC[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 32, 0, @@ -2188,7 +2188,7 @@ static OnePointCsFull D_801223CC[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, -1, @@ -2202,7 +2202,7 @@ static OnePointCsFull D_801223CC[6] = { static OnePointCsFull D_801224BC[7] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 5, 0, @@ -2213,7 +2213,7 @@ static OnePointCsFull D_801224BC[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 20, 0, @@ -2224,7 +2224,7 @@ static OnePointCsFull D_801224BC[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2235,7 +2235,7 @@ static OnePointCsFull D_801224BC[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0142, 1, 0, @@ -2246,7 +2246,7 @@ static OnePointCsFull D_801224BC[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0142, 119, 0, @@ -2257,7 +2257,7 @@ static OnePointCsFull D_801224BC[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 20, 0, @@ -2268,7 +2268,7 @@ static OnePointCsFull D_801224BC[7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, -1, @@ -2282,7 +2282,7 @@ static OnePointCsFull D_801224BC[7] = { static OnePointCsFull D_801225D4[5] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x08, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_8), 0x0101, 1, 0, @@ -2293,7 +2293,7 @@ static OnePointCsFull D_801225D4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0x3B, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_59), 0x0101, 60, 4, @@ -2304,7 +2304,7 @@ static OnePointCsFull D_801225D4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 90, -5, @@ -2315,7 +2315,7 @@ static OnePointCsFull D_801225D4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x08, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_8), 0x2323, 2, 0, @@ -2326,7 +2326,7 @@ static OnePointCsFull D_801225D4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2340,7 +2340,7 @@ static OnePointCsFull D_801225D4[5] = { static OnePointCsFull D_8012269C[3] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 20, 2, @@ -2351,7 +2351,7 @@ static OnePointCsFull D_8012269C[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2362,7 +2362,7 @@ static OnePointCsFull D_8012269C[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, -1, @@ -2376,7 +2376,7 @@ static OnePointCsFull D_8012269C[3] = { static OnePointCsFull D_80122714[4] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 20, 0, @@ -2387,7 +2387,7 @@ static OnePointCsFull D_80122714[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, -1, 0, @@ -2398,7 +2398,7 @@ static OnePointCsFull D_80122714[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 20, 0, @@ -2409,7 +2409,7 @@ static OnePointCsFull D_80122714[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, -1, @@ -2423,7 +2423,7 @@ static OnePointCsFull D_80122714[4] = { static OnePointCsFull D_801227B4[6] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 30, 0, @@ -2434,7 +2434,7 @@ static OnePointCsFull D_801227B4[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 130, 0, @@ -2445,7 +2445,7 @@ static OnePointCsFull D_801227B4[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2456,7 +2456,7 @@ static OnePointCsFull D_801227B4[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0303, 69, 0, @@ -2467,7 +2467,7 @@ static OnePointCsFull D_801227B4[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0303, 20, 0, @@ -2478,7 +2478,7 @@ static OnePointCsFull D_801227B4[6] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, -1, @@ -2492,7 +2492,7 @@ static OnePointCsFull D_801227B4[6] = { static OnePointCsFull D_801228A4[5] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x0101, 20, 5, @@ -2503,7 +2503,7 @@ static OnePointCsFull D_801228A4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 20, -2, @@ -2514,7 +2514,7 @@ static OnePointCsFull D_801228A4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x08, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_8), 0x0101, 90, 2, @@ -2525,7 +2525,7 @@ static OnePointCsFull D_801228A4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2121, 10, 0, @@ -2536,7 +2536,7 @@ static OnePointCsFull D_801228A4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2550,7 +2550,7 @@ static OnePointCsFull D_801228A4[5] = { static OnePointCsFull D_8012296C[4] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 20, -10, @@ -2561,7 +2561,7 @@ static OnePointCsFull D_8012296C[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 80, -10, @@ -2572,7 +2572,7 @@ static OnePointCsFull D_8012296C[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 120, 0, @@ -2583,7 +2583,7 @@ static OnePointCsFull D_8012296C[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2597,7 +2597,7 @@ static OnePointCsFull D_8012296C[4] = { static OnePointCsFull D_80122A0C[2] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 60, 4, @@ -2608,7 +2608,7 @@ static OnePointCsFull D_80122A0C[2] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2622,7 +2622,7 @@ static OnePointCsFull D_80122A0C[2] = { static OnePointCsFull D_80122A5C[8] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 1, -15, @@ -2633,7 +2633,7 @@ static OnePointCsFull D_80122A5C[8] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2644,7 +2644,7 @@ static OnePointCsFull D_80122A5C[8] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 1, 0, @@ -2655,7 +2655,7 @@ static OnePointCsFull D_80122A5C[8] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_21, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2666,7 +2666,7 @@ static OnePointCsFull D_80122A5C[8] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 55, 0, @@ -2677,7 +2677,7 @@ static OnePointCsFull D_80122A5C[8] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 1, -15, @@ -2688,7 +2688,7 @@ static OnePointCsFull D_80122A5C[8] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2699,7 +2699,7 @@ static OnePointCsFull D_80122A5C[8] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2713,7 +2713,7 @@ static OnePointCsFull D_80122A5C[8] = { static OnePointCsFull D_80122B9C[3] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 60, 0, @@ -2724,7 +2724,7 @@ static OnePointCsFull D_80122B9C[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 60, 15, @@ -2735,7 +2735,7 @@ static OnePointCsFull D_80122B9C[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2749,7 +2749,7 @@ static OnePointCsFull D_80122B9C[3] = { static OnePointCsFull D_80122C14[1] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 999, 0, @@ -2763,7 +2763,7 @@ static OnePointCsFull D_80122C14[1] = { static OnePointCsFull D_80122C3C[1] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 999, -2, @@ -2777,7 +2777,7 @@ static OnePointCsFull D_80122C3C[1] = { static OnePointCsFull D_80122C64[1] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 999, 3, @@ -2791,7 +2791,7 @@ static OnePointCsFull D_80122C64[1] = { static OnePointCsFull D_80122C8C[1] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 999, 5, @@ -2805,7 +2805,7 @@ static OnePointCsFull D_80122C8C[1] = { static OnePointCsFull D_80122CB4[2] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 5, 0, @@ -2816,7 +2816,7 @@ static OnePointCsFull D_80122CB4[2] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, -1, 0, @@ -2830,7 +2830,7 @@ static OnePointCsFull D_80122CB4[2] = { static OnePointCsFull D_80122D04[2] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 10, 0, @@ -2841,7 +2841,7 @@ static OnePointCsFull D_80122D04[2] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, -1, 0, @@ -2855,7 +2855,7 @@ static OnePointCsFull D_80122D04[2] = { static OnePointCsFull D_80122D54[3] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 1, -4, @@ -2866,7 +2866,7 @@ static OnePointCsFull D_80122D54[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2877,7 +2877,7 @@ static OnePointCsFull D_80122D54[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, -1, @@ -2891,7 +2891,7 @@ static OnePointCsFull D_80122D54[3] = { static OnePointCsFull D_80122DCC[3] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 1, 0, @@ -2902,7 +2902,7 @@ static OnePointCsFull D_80122DCC[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -2913,7 +2913,7 @@ static OnePointCsFull D_80122DCC[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_17, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, -1, @@ -2928,7 +2928,7 @@ static OnePointCsFull D_80122E44[2][7] = { { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2222, 10, 5, @@ -2939,7 +2939,7 @@ static OnePointCsFull D_80122E44[2][7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 20, 0, @@ -2950,7 +2950,7 @@ static OnePointCsFull D_80122E44[2][7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4343, 30, -5, @@ -2961,7 +2961,7 @@ static OnePointCsFull D_80122E44[2][7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, -5, @@ -2972,7 +2972,7 @@ static OnePointCsFull D_80122E44[2][7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x4343, 160, 10, @@ -2983,7 +2983,7 @@ static OnePointCsFull D_80122E44[2][7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0501, 50, 0, @@ -2994,7 +2994,7 @@ static OnePointCsFull D_80122E44[2][7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_19, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, -1, @@ -3007,7 +3007,7 @@ static OnePointCsFull D_80122E44[2][7] = { { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2222, 10, -5, @@ -3018,7 +3018,7 @@ static OnePointCsFull D_80122E44[2][7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 20, 0, @@ -3029,7 +3029,7 @@ static OnePointCsFull D_80122E44[2][7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4343, 30, 5, @@ -3040,7 +3040,7 @@ static OnePointCsFull D_80122E44[2][7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 5, @@ -3051,7 +3051,7 @@ static OnePointCsFull D_80122E44[2][7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x4343, 160, -10, @@ -3062,7 +3062,7 @@ static OnePointCsFull D_80122E44[2][7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0501, 50, 0, @@ -3073,7 +3073,7 @@ static OnePointCsFull D_80122E44[2][7] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_19, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, -1, @@ -3088,7 +3088,7 @@ static OnePointCsFull D_80122E44[2][7] = { static OnePointCsFull D_80123074[5] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0xA2A2, 2, 8, @@ -3099,7 +3099,7 @@ static OnePointCsFull D_80123074[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0xA2A2, 38, 4, @@ -3110,7 +3110,7 @@ static OnePointCsFull D_80123074[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0xA2A2, 2, 8, @@ -3121,7 +3121,7 @@ static OnePointCsFull D_80123074[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0xA2A2, 58, 4, @@ -3132,7 +3132,7 @@ static OnePointCsFull D_80123074[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -3146,7 +3146,7 @@ static OnePointCsFull D_80123074[5] = { static OnePointCsFull D_8012313C[3] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0xA2A2, 20, 8, @@ -3157,7 +3157,7 @@ static OnePointCsFull D_8012313C[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0xA2A2, 100, 0, @@ -3168,7 +3168,7 @@ static OnePointCsFull D_8012313C[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -3182,7 +3182,7 @@ static OnePointCsFull D_8012313C[3] = { static OnePointCsFull D_801231B4[4] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xC5, + ONEPOINT_CS_INIT_FIELD_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE), 0x4343, 1, 0, @@ -3193,7 +3193,7 @@ static OnePointCsFull D_801231B4[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - 0xC5, + ONEPOINT_CS_INIT_FIELD_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE), 0x4343, 48, 0, @@ -3204,7 +3204,7 @@ static OnePointCsFull D_801231B4[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xC5, + ONEPOINT_CS_INIT_FIELD_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE), 0x4343, 1, 5, @@ -3215,7 +3215,7 @@ static OnePointCsFull D_801231B4[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, true), - 0xC5, + ONEPOINT_CS_INIT_FIELD_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE), 0x4343, -1, 0, @@ -3229,7 +3229,7 @@ static OnePointCsFull D_801231B4[4] = { static OnePointCsFull D_80123254[2] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 1, 0, @@ -3240,7 +3240,7 @@ static OnePointCsFull D_80123254[2] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - 0xC5, + ONEPOINT_CS_INIT_FIELD_HUD_VISIBILITY(HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE), 0x0101, 49, 0, @@ -3254,7 +3254,7 @@ static OnePointCsFull D_80123254[2] = { static OnePointCsFull D_801232A4[1] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x45, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_69), 0x0101, 9999, 0, @@ -3268,7 +3268,7 @@ static OnePointCsFull D_801232A4[1] = { static OnePointCsFull D_801232CC[5] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 45, -3, @@ -3279,7 +3279,7 @@ static OnePointCsFull D_801232CC[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -3290,7 +3290,7 @@ static OnePointCsFull D_801232CC[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 10, 0, @@ -3301,7 +3301,7 @@ static OnePointCsFull D_801232CC[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2121, 15, 0, @@ -3312,7 +3312,7 @@ static OnePointCsFull D_801232CC[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -3326,7 +3326,7 @@ static OnePointCsFull D_801232CC[5] = { static OnePointCsFull D_80123394[5] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 45, 3, @@ -3337,7 +3337,7 @@ static OnePointCsFull D_80123394[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -3348,7 +3348,7 @@ static OnePointCsFull D_80123394[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 10, 0, @@ -3359,7 +3359,7 @@ static OnePointCsFull D_80123394[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2121, 15, 0, @@ -3370,7 +3370,7 @@ static OnePointCsFull D_80123394[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -3384,7 +3384,7 @@ static OnePointCsFull D_80123394[5] = { static OnePointCsFull D_8012345C[4] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x4242, 40, 0, @@ -3395,7 +3395,7 @@ static OnePointCsFull D_8012345C[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, false), - 0x4D, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_77), 0x4242, 40, 0, @@ -3406,7 +3406,7 @@ static OnePointCsFull D_8012345C[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_4, false, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x2121, 10, 0, @@ -3417,7 +3417,7 @@ static OnePointCsFull D_8012345C[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -3431,7 +3431,7 @@ static OnePointCsFull D_8012345C[4] = { static OnePointCsFull D_801234FC[5] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_1, false, false), - 0x05, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_5), 0x0441, 10, 0, @@ -3442,7 +3442,7 @@ static OnePointCsFull D_801234FC[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4141, 30, 0, @@ -3453,7 +3453,7 @@ static OnePointCsFull D_801234FC[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x0000, 1, 0, @@ -3464,7 +3464,7 @@ static OnePointCsFull D_801234FC[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2121, 10, 0, @@ -3475,7 +3475,7 @@ static OnePointCsFull D_801234FC[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -3489,7 +3489,7 @@ static OnePointCsFull D_801234FC[5] = { static OnePointCsFull D_801235C4[5] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0x01, + ONEPOINT_CS_INIT_FIELD_PLAYER_CS(PLAYER_CSMODE_1), 0x4141, 1, 0, @@ -3500,7 +3500,7 @@ static OnePointCsFull D_801235C4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0441, 39, 0, @@ -3511,7 +3511,7 @@ static OnePointCsFull D_801235C4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_16, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -3522,7 +3522,7 @@ static OnePointCsFull D_801235C4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x2121, 15, 0, @@ -3533,7 +3533,7 @@ static OnePointCsFull D_801235C4[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, @@ -3547,7 +3547,7 @@ static OnePointCsFull D_801235C4[5] = { static OnePointCsFull D_8012368C[4] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 10, 0, @@ -3558,7 +3558,7 @@ static OnePointCsFull D_8012368C[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 70, -45, @@ -3569,7 +3569,7 @@ static OnePointCsFull D_8012368C[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 10, -45, @@ -3580,7 +3580,7 @@ static OnePointCsFull D_8012368C[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 180, 9, @@ -3594,7 +3594,7 @@ static OnePointCsFull D_8012368C[4] = { static OnePointCsFull D_8012372C[4] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0142, 10, 0, @@ -3605,7 +3605,7 @@ static OnePointCsFull D_8012372C[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0142, 110, -2, @@ -3616,7 +3616,7 @@ static OnePointCsFull D_8012372C[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_11, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 100, 2, @@ -3627,7 +3627,7 @@ static OnePointCsFull D_8012372C[4] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_3, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 60, 2, @@ -3641,7 +3641,7 @@ static OnePointCsFull D_8012372C[4] = { static OnePointCsFull D_801237CC[5] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, true), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 20, 0, @@ -3652,7 +3652,7 @@ static OnePointCsFull D_801237CC[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_10, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 80, 0, @@ -3663,7 +3663,7 @@ static OnePointCsFull D_801237CC[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 10, 0, @@ -3674,7 +3674,7 @@ static OnePointCsFull D_801237CC[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_2, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 55, 0, @@ -3685,7 +3685,7 @@ static OnePointCsFull D_801237CC[5] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 100, -45, @@ -3699,7 +3699,7 @@ static OnePointCsFull D_801237CC[5] = { static OnePointCsFull D_80123894[3] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 60, 0, @@ -3710,7 +3710,7 @@ static OnePointCsFull D_80123894[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 30, 0, @@ -3721,7 +3721,7 @@ static OnePointCsFull D_80123894[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_13, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 120, 0, @@ -3735,7 +3735,7 @@ static OnePointCsFull D_80123894[3] = { static OnePointCsFull D_8012390C[2] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 30, 0, @@ -3746,7 +3746,7 @@ static OnePointCsFull D_8012390C[2] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 180, 0, @@ -3760,7 +3760,7 @@ static OnePointCsFull D_8012390C[2] = { static OnePointCsFull D_8012395C[3] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0101, 60, 0, @@ -3771,7 +3771,7 @@ static OnePointCsFull D_8012395C[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 30, 0, @@ -3782,7 +3782,7 @@ static OnePointCsFull D_8012395C[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_13, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 120, 0, @@ -3796,7 +3796,7 @@ static OnePointCsFull D_8012395C[3] = { static OnePointCsFull D_801239D4[3] = { { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_15, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 5, 0, @@ -3807,7 +3807,7 @@ static OnePointCsFull D_801239D4[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_9, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x4242, 0, 0, @@ -3818,7 +3818,7 @@ static OnePointCsFull D_801239D4[3] = { }, { ONEPOINT_CS_ACTION(ONEPOINT_CS_ACTION_ID_18, false, false), - 0xFF, + ONEPOINT_CS_INIT_FIELD_NONE, 0x0000, 1, 0, diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 81d2b7ff0c..e0df66385f 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -1282,7 +1282,7 @@ void Interface_InitHorsebackArchery(PlayState* play) { } void func_800849EC(PlayState* play) { - gSaveContext.inventory.equipment |= OWNED_EQUIP_FLAG(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BGS); + gSaveContext.inventory.equipment |= OWNED_EQUIP_FLAG(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BIGGORON); gSaveContext.inventory.equipment ^= OWNED_EQUIP_FLAG_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE); if (CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE)) { @@ -1419,7 +1419,7 @@ u8 Item_Give(PlayState* play, u8 item) { gSaveContext.swordHealth = 8; if (ALL_EQUIP_VALUE(EQUIP_TYPE_SWORD) == - ((1 << EQUIP_INV_SWORD_KOKIRI) | (1 << EQUIP_INV_SWORD_MASTER) | (1 << EQUIP_INV_SWORD_BGS) | + ((1 << EQUIP_INV_SWORD_KOKIRI) | (1 << EQUIP_INV_SWORD_MASTER) | (1 << EQUIP_INV_SWORD_BIGGORON) | (1 << EQUIP_INV_SWORD_BROKENGIANTKNIFE))) { gSaveContext.inventory.equipment ^= OWNED_EQUIP_FLAG_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE); diff --git a/src/code/z_play.c b/src/code/z_play.c index 28651de8ab..925f150afd 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -370,7 +370,7 @@ void Play_Init(GameState* thisx) { this->state.destroy = Play_Destroy; this->transitionTrigger = TRANS_TRIGGER_END; this->unk_11E16 = 0xFF; - this->unk_11E18 = 0; + this->bgCoverAlpha = 0; this->haltAllActors = false; if (gSaveContext.gameMode != GAMEMODE_TITLE_SCREEN) { @@ -988,7 +988,7 @@ void Play_Update(PlayState* this) { skip: PLAY_LOG(3801); - if (!isPaused || gDbgCamEnabled) { + if (!isPaused || gDebugCamEnabled) { s32 pad3[5]; s32 i; @@ -1207,7 +1207,7 @@ void Play_Draw(PlayState* this) { } if ((R_HREG_MODE != HREG_MODE_PLAY) || (R_PLAY_DRAW_ROOM_FLAGS != 0)) { - Environment_FillScreen(gfxCtx, 0, 0, 0, this->unk_11E18, FILL_SCREEN_OPA); + Environment_FillScreen(gfxCtx, 0, 0, 0, this->bgCoverAlpha, FILL_SCREEN_OPA); } if ((R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_ACTORS) { diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 1b83098de9..513a1a5aa1 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -26,7 +26,7 @@ u8 sActionModelGroups[PLAYER_IA_MAX] = { PLAYER_MODELGROUP_10, // PLAYER_IA_FISHING_POLE PLAYER_MODELGROUP_SWORD, // PLAYER_IA_SWORD_MASTER PLAYER_MODELGROUP_SWORD, // PLAYER_IA_SWORD_KOKIRI - PLAYER_MODELGROUP_BGS, // PLAYER_IA_SWORD_BGS + PLAYER_MODELGROUP_BGS, // PLAYER_IA_SWORD_BIGGORON PLAYER_MODELGROUP_10, // PLAYER_IA_DEKU_STICK PLAYER_MODELGROUP_HAMMER, // PLAYER_IA_HAMMER PLAYER_MODELGROUP_BOW_SLINGSHOT, // PLAYER_IA_BOW @@ -723,7 +723,7 @@ s32 Player_GetMeleeWeaponHeld(Player* this) { } s32 Player_HoldsTwoHandedWeapon(Player* this) { - if ((this->heldItemAction >= PLAYER_IA_SWORD_BGS) && (this->heldItemAction <= PLAYER_IA_HAMMER)) { + if ((this->heldItemAction >= PLAYER_IA_SWORD_BIGGORON) && (this->heldItemAction <= PLAYER_IA_HAMMER)) { return 1; } else { return 0; @@ -731,7 +731,7 @@ s32 Player_HoldsTwoHandedWeapon(Player* this) { } s32 Player_HoldsBrokenKnife(Player* this) { - return (this->heldItemAction == PLAYER_IA_SWORD_BGS) && (gSaveContext.swordHealth <= 0.0f); + return (this->heldItemAction == PLAYER_IA_SWORD_BIGGORON) && (gSaveContext.swordHealth <= 0.0f); } s32 Player_ActionToBottle(Player* this, s32 itemAction) { @@ -1666,7 +1666,7 @@ u32 Player_InitDrawPause(PlayState* play, u8* segment, SkelAnime* skelAnime) { u8 sPauseModelGroupBySword[] = { PLAYER_MODELGROUP_SWORD, // PLAYER_SWORD_KOKIRI PLAYER_MODELGROUP_SWORD, // PLAYER_SWORD_MASTER - PLAYER_MODELGROUP_BGS, // PLAYER_SWORD_BGS + PLAYER_MODELGROUP_BGS, // PLAYER_SWORD_BIGGORON }; s32 Player_OverrideLimbDrawPause(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* arg) { @@ -1836,7 +1836,7 @@ void Player_DrawPause(PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f* srcTable = gLinkPauseChildJointTable; } } else { - if (sword == PLAYER_SWORD_BGS) { + if (sword == PLAYER_SWORD_BIGGORON) { srcTable = gLinkPauseAdultBgsJointTable; } else if (shield != PLAYER_SHIELD_NONE) { srcTable = gLinkPauseAdultShieldJointTable; diff --git a/src/code/z_room.c b/src/code/z_room.c index e775acfd1a..d636080b19 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -607,10 +607,10 @@ s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum) { &roomCtx->loadQueue, NULL, "../z_room.c", 1036); roomCtx->unk_30 ^= 1; - return 1; + return true; } - return 0; + return false; } s32 func_800973FC(PlayState* play, RoomContext* roomCtx) { diff --git a/src/code/z_sram.c b/src/code/z_sram.c index 0e87d045c4..7f9eea58ea 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -315,7 +315,7 @@ static Inventory sDebugSaveInventory = { // equipment ((((1 << EQUIP_INV_SWORD_KOKIRI) << (EQUIP_TYPE_SWORD * 4)) | ((1 << EQUIP_INV_SWORD_MASTER) << (EQUIP_TYPE_SWORD * 4)) | - ((1 << EQUIP_INV_SWORD_BGS) << (EQUIP_TYPE_SWORD * 4))) | + ((1 << EQUIP_INV_SWORD_BIGGORON) << (EQUIP_TYPE_SWORD * 4))) | (((1 << EQUIP_INV_SHIELD_DEKU) << (EQUIP_TYPE_SHIELD * 4)) | ((1 << EQUIP_INV_SHIELD_HYLIAN) << (EQUIP_TYPE_SHIELD * 4)) | ((1 << EQUIP_INV_SHIELD_MIRROR) << (EQUIP_TYPE_SHIELD * 4))) | diff --git a/src/libultra/io/sptask.c b/src/libultra/io/sptask.c index 8b3286a453..be805ab5ce 100644 --- a/src/libultra/io/sptask.c +++ b/src/libultra/io/sptask.c @@ -41,7 +41,7 @@ void osSpTaskLoad(OSTask* intp) { while (__osSpSetPc((void*)SP_IMEM_START) == -1) { ; } - while (__osSpRawStartDma(OS_WRITE, (void*)(SP_IMEM_START - sizeof(*tp)), tp, sizeof(OSTask)) == -1) { + while (__osSpRawStartDma(OS_WRITE, (void*)(SP_DMEM_END + 1 - sizeof(OSTask)), tp, sizeof(OSTask)) == -1) { ; } while (__osSpDeviceBusy()) { diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index 665e5f04a4..a26f027ca6 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -87,7 +87,7 @@ void ArmsHook_Wait(ArmsHook* this, PlayState* play) { s32 length = (player->heldItemAction == PLAYER_IA_HOOKSHOT) ? 13 : 26; ArmsHook_SetupAction(this, ArmsHook_Shoot); - func_8002D9A4(&this->actor, 20.0f); + Actor_SetProjectileSpeed(&this->actor, 20.0f); this->actor.parent = &GET_PLAYER(play)->actor; this->timer = length; } @@ -250,7 +250,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { } } } else { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Math_Vec3f_Diff(&this->actor.world.pos, &this->actor.prevPos, &prevFrameDiff); Math_Vec3f_Sum(&this->unk_1E8, &prevFrameDiff, &this->unk_1E8); this->actor.shape.rot.x = Math_Atan2S(this->actor.speed, -this->actor.velocity.y); diff --git a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index 078bbe770e..1e11e696df 100644 --- a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -855,7 +855,7 @@ void BgDyYoseizo_Update(Actor* thisx, PlayState* play2) { } } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); this->heightOffset = this->scale * 7500.0f; Actor_SetFocus(&this->actor, this->heightOffset); this->actor.focus.pos.y = this->heightOffset; diff --git a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c index 7cbd185afd..810f28cde4 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c +++ b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c @@ -190,7 +190,7 @@ void BgHakaShip_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (this->dyna.actor.params == 0) { - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c index 7b05c1383a..4286c35b35 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c @@ -395,7 +395,7 @@ void BgHakaZou_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (this->dyna.actor.params == 3) { - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c index 3d450e61a8..100f842337 100644 --- a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c +++ b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c @@ -172,7 +172,7 @@ void BgHeavyBlock_MovePiece(BgHeavyBlock* this, PlayState* play) { thisx->velocity.x *= 0.98f; thisx->velocity.z *= 0.98f; - func_8002D7EC(thisx); + Actor_UpdatePos(thisx); thisx->shape.rot.x += thisx->world.rot.x; thisx->shape.rot.y += thisx->world.rot.y; thisx->shape.rot.z += thisx->world.rot.z; @@ -382,7 +382,7 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) { Vec3f checkPos; f32 yIntersect; - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); checkPos.x = this->dyna.actor.home.pos.x; checkPos.y = this->dyna.actor.home.pos.y + 1000.0f; checkPos.z = this->dyna.actor.home.pos.z; @@ -455,7 +455,7 @@ void BgHeavyBlock_Land(BgHeavyBlock* this, PlayState* play) { Math_StepToF(&this->dyna.actor.velocity.y, 0.0f, 3.0f); this->dyna.actor.gravity = 0.0f; this->dyna.actor.world.pos = this->dyna.actor.home.pos; - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); this->dyna.actor.home.pos = this->dyna.actor.world.pos; switch (this->dyna.actor.params & 0xFF) { case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE: diff --git a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c index 11d22ce334..b1367ae251 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c @@ -181,7 +181,7 @@ void BgHidanDalm_Update(Actor* thisx, PlayState* play) { BgHidanDalm* this = (BgHidanDalm*)thisx; this->actionFunc(this, play); - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 10.0f, 15.0f, 32.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index bb54fdbcf0..df428affbe 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -294,7 +294,7 @@ void func_80888860(BgHidanHamstep* this, PlayState* play) { s32 pad2; s32 quakeIndex; - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); if (((this->dyna.actor.world.pos.y - this->dyna.actor.home.pos.y) < (-20.0f - this->dyna.actor.minVelocityY)) && (this->dyna.actor.velocity.y <= 0.0f)) { @@ -344,7 +344,7 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) { s32 pad2; s32 quakeIndex; - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); func_80888694(this, (BgHidanHamstep*)this->dyna.actor.parent); if (((this->dyna.actor.params & 0xFF) <= 0) || ((this->dyna.actor.params & 0xFF) >= 6)) { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c index 7bb5a9ae6d..ef2738418e 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c @@ -124,12 +124,12 @@ void func_80889C18(BgHidanKousi* this, PlayState* play) { this->dyna.actor.speed = 2.0f; BgHidanKousi_SetupAction(this, func_80889C90); } - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); } void func_80889C90(BgHidanKousi* this, PlayState* play) { - func_8002D7EC(&this->dyna.actor); + Actor_UpdatePos(&this->dyna.actor); if (D_80889E40[this->dyna.actor.params & 0xFF] < Math_Vec3f_DistXYZ(&this->dyna.actor.home.pos, &this->dyna.actor.world.pos)) { func_80889ACC(this); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c index bc3878b066..3f2662597c 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c @@ -332,7 +332,7 @@ void BgHidanRock_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (this->actionFunc == func_8088B79C) { - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); } diff --git a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c index 2fbce3088b..150e4a2466 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c +++ b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c @@ -173,7 +173,7 @@ void BgIceTurara_Fall(BgIceTurara* this, PlayState* play) { return; } } else { - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); this->dyna.actor.world.pos.y += 40.0f; Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); this->dyna.actor.world.pos.y -= 40.0f; diff --git a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c index a6bf3d20da..e426e77db9 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c +++ b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c @@ -148,7 +148,7 @@ void BgJyaHaheniron_SetupChairCrumble(BgJyaHaheniron* this) { void BgJyaHaheniron_ChairCrumble(BgJyaHaheniron* this, PlayState* play) { Vec3f vec; - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 5.0f, 8.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_7); if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL)) || @@ -174,7 +174,7 @@ void BgJyaHaheniron_SetupPillarCrumble(BgJyaHaheniron* this) { void BgJyaHaheniron_PillarCrumble(BgJyaHaheniron* this, PlayState* play) { if (this->timer >= 8) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } else if (this->timer >= 17) { BgJyaHaheniron_SpawnFragments(play, &this->actor.world.pos, D_808987A0); Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c index a6d1b7d55a..52591f4122 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c @@ -329,7 +329,7 @@ void func_8089E650(BgMizuMovebg* this, PlayState* play) { this->dyna.actor.speed = dist; } func_80035844(&this->dyna.actor.world.pos, &waypoint, &this->dyna.actor.world.rot, 1); - func_8002D97C(&this->dyna.actor); + Actor_MoveXYZ(&this->dyna.actor); dx = waypoint.x - this->dyna.actor.world.pos.x; dy = waypoint.y - this->dyna.actor.world.pos.y; dz = waypoint.z - this->dyna.actor.world.pos.z; diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c index 10d73afe28..9f10928f17 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c +++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c @@ -158,7 +158,7 @@ void BgMoriBigst_SetupFall(BgMoriBigst* this, PlayState* play) { } void BgMoriBigst_Fall(BgMoriBigst* this, PlayState* play) { - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) { this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; BgMoriBigst_SetupLanding(this, play); diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c index aab9286b2d..aecc6935ee 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c @@ -243,7 +243,7 @@ void BgMoriHashigo_LadderFall(BgMoriHashigo* this, PlayState* play) { static f32 bounceSpeed[3] = { 4.0f, 2.7f, 1.7f }; Actor* thisx = &this->dyna.actor; - Actor_MoveForward(thisx); + Actor_MoveXZGravity(thisx); if ((thisx->bgCheckFlags & BGCHECKFLAG_GROUND) && (thisx->velocity.y < 0.0f)) { if (this->bounceCounter >= ARRAY_COUNT(bounceSpeed)) { BgMoriHashigo_SetupLadderRest(this); diff --git a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c index e25fb4386f..8b3bdab9e8 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c @@ -149,7 +149,7 @@ void BgMoriRakkatenjo_Fall(BgMoriRakkatenjo* this, PlayState* play) { Actor* thisx = &this->dyna.actor; s32 quakeIndex; - Actor_MoveForward(thisx); + Actor_MoveXZGravity(thisx); if ((thisx->velocity.y < 0.0f) && (thisx->world.pos.y <= 403.0f)) { if (this->bounceCount >= ARRAY_COUNT(bounceVel)) { BgMoriRakkatenjo_SetupRest(this); diff --git a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c index 22635a0009..0370b72ff5 100644 --- a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c +++ b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c @@ -62,7 +62,7 @@ void BgPushbox_UpdateImpl(BgPushbox* this, PlayState* play) { this->dyna.actor.speed = CLAMP(this->dyna.actor.speed, -1.0f, 1.0f); Math_StepToF(&this->dyna.actor.speed, 0.0f, 0.2f); this->dyna.actor.world.rot.y = this->dyna.unk_158; - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 40.0f, 40.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index 303ac2a366..1ccc86fdc4 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -319,7 +319,7 @@ void func_808B43D0(BgSpot15Rrbox* this, PlayState* play) { player->stateFlags2 &= ~PLAYER_STATE2_4; } - Actor_MoveForward(actor); + Actor_MoveXZGravity(actor); if (actor->world.pos.y <= BGCHECK_Y_MIN + 10.0f) { // "Lon Lon wooden crate fell too much" diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index 6a6e3cec9f..e27736f9b5 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -500,7 +500,7 @@ void func_808B5B58(BgSpot16Bombstone* this) { void func_808B5B6C(BgSpot16Bombstone* this, PlayState* play) { Actor* actor = &this->actor; - Actor_MoveForward(actor); + Actor_MoveXZGravity(actor); actor->shape.rot.x += this->unk_210; actor->shape.rot.z += this->unk_212; diff --git a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c index 5abbca1114..a054896a0e 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c @@ -247,7 +247,7 @@ void func_808B8F08(BgSpot18Obj* this, PlayState* play) { Player* player = GET_PLAYER(play); Math_StepToF(&this->dyna.actor.speed, 1.2f, 0.1f); - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); func_808B8DDC(this, play); if (Math3D_Dist2DSq(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.z, this->dyna.actor.home.pos.x, diff --git a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index 61decd6c45..a32b7967e5 100644 --- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -868,7 +868,7 @@ void BossDodongo_Update(Actor* thisx, PlayState* play2) { thisx->shape.rot.y = thisx->world.rot.y; Math_SmoothStepToF(&thisx->shape.yOffset, this->unk_228, 1.0f, 100.0f, 0.0f); - Actor_MoveForward(thisx); + Actor_MoveXZGravity(thisx); BossDodongo_UpdateDamage(this, play); Actor_UpdateBgCheckInfo(play, thisx, 10.0f, 10.0f, 20.0f, UPDBGCHECKINFO_FLAG_2); Math_SmoothStepToF(&this->unk_208, 0, 1, 0.001f, 0.0); diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index b361e05887..2940b79a26 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -939,9 +939,9 @@ void BossFd_Fly(BossFd* this, PlayState* play) { Math_ApproachF(&this->fwork[BFD_TURN_RATE], this->fwork[BFD_TURN_RATE_MAX], 1.0f, 20000.0f); Math_ApproachF(&this->actor.speed, this->fwork[BFD_FLY_SPEED], 1.0f, 0.1f); if (this->work[BFD_ACTION_STATE] < BOSSFD_SKULL_FALL) { - func_8002D908(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); } - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); this->work[BFD_LEAD_BODY_SEG]++; if (this->work[BFD_LEAD_BODY_SEG] >= 100) { diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index 54fad19091..cc1362cd8b 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -3921,8 +3921,8 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) { yDistFromLink = (player->actor.world.pos.y + 40.0f) - this->actor.world.pos.y; zDistFromLink = player->actor.world.pos.z - this->actor.world.pos.z; - func_8002D908(&this->actor); - func_8002D7EC(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); + Actor_UpdatePos(&this->actor); switch (this->unk_1C2) { case 0: @@ -4195,8 +4195,8 @@ void func_808E1EB4(Actor* thisx, PlayState* play2) { } } - func_8002D908(&this->actor); - func_8002D7EC(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); + Actor_UpdatePos(&this->actor); this->unk_1A6++; @@ -4322,8 +4322,8 @@ void func_808E2544(Actor* thisx, PlayState* play) { } } - func_8002D908(&this->actor); - func_8002D7EC(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); + Actor_UpdatePos(&this->actor); this->unk_1A6++; @@ -4412,8 +4412,8 @@ void func_808E2544(Actor* thisx, PlayState* play) { (this->actor.xzDistToPlayer < 80.0f)) { this->unk_1C2 = 0xC; this->actor.speed = -30.0f; - func_8002D908(&this->actor); - func_8002D7EC(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); + Actor_UpdatePos(&this->actor); this->unk_1F0 = dorf->unk_1FC; numEffects = 10; break; @@ -4429,8 +4429,8 @@ void func_808E2544(Actor* thisx, PlayState* play) { this->unk_1C2 = 0xC; this->actor.speed = -30.0f; - func_8002D908(&this->actor); - func_8002D7EC(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); + Actor_UpdatePos(&this->actor); this->unk_1F0.x = Rand_CenteredFloat(700.0f) + dorf->unk_1FC.x; this->unk_1F0.y = Rand_CenteredFloat(200.0f) + dorf->unk_1FC.y; diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index c9bd4d88c0..d62fbae4c8 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -1997,7 +1997,7 @@ void BossGanon2_Update(Actor* thisx, PlayState* play) { if (this->unk_392 != 0) { this->unk_392--; } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); this->actor.shape.rot = this->actor.world.rot; if (this->unk_335 != 0) { Actor_UpdateBgCheckInfo(play, &this->actor, 60.0f, 60.0f, 100.0f, diff --git a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index 034b74563d..48d49b5f43 100644 --- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -761,7 +761,7 @@ void BossGanondrof_Stunned(BossGanondrof* this, PlayState* play) { this->actor.gravity = 0.0f; } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } void BossGanondrof_SetupBlock(BossGanondrof* this, PlayState* play) { @@ -847,8 +847,8 @@ void BossGanondrof_Charge(BossGanondrof* this, PlayState* play) { thisx->world.rot.x = RAD_TO_BINANG(Math_FAtan2F(vecToLink.y, sqrtf(SQ(vecToLink.x) + SQ(vecToLink.z)))); } - func_8002D908(thisx); - func_8002D7EC(thisx); + Actor_UpdateVelocityXYZ(thisx); + Actor_UpdatePos(thisx); Math_ApproachF(&thisx->speed, 10.0f, 1.0f, 0.5f); if ((sqrtf(SQ(dxCenter) + SQ(dzCenter)) > 280.0f) || (thisx->xyzDistToPlayerSq < SQ(100.0f))) { this->work[GND_ACTION_STATE] = CHARGE_FINISH; @@ -857,7 +857,7 @@ void BossGanondrof_Charge(BossGanondrof* this, PlayState* play) { break; case CHARGE_FINISH: thisx->gravity = 0.2f; - Actor_MoveForward(thisx); + Actor_MoveXZGravity(thisx); osSyncPrintf("YP %f @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n", thisx->world.pos.y); if (thisx->world.pos.y < 5.0f) { thisx->world.pos.y = 5.0f; diff --git a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index 733292fe42..11c191dec3 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -1921,7 +1921,7 @@ void BossGoma_Update(Actor* thisx, PlayState* play) { this->actor.shape.rot.y = this->actor.world.rot.y; if (!this->doNotMoveThisFrame) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } else { this->doNotMoveThisFrame = false; } diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index 47b24f855f..8f9aad30f6 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -1473,7 +1473,7 @@ void BossMo_IntroCs(BossMo* this, PlayState* play) { this->subCamAtVel.z * this->subCamVelFactor); Math_ApproachF(&this->subCamVelFactor, 1.0f, 1.0f, this->subCamAccel); } else if (this->csState < MO_INTRO_REVEAL) { - func_8002D908(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); this->subCamEye.x += this->actor.velocity.x; this->subCamEye.y += this->actor.velocity.y; this->subCamEye.z += this->actor.velocity.z; @@ -2139,12 +2139,12 @@ void BossMo_Core(BossMo* this, PlayState* play) { spD0 = RAD_TO_BINANG(Math_FAtan2F(spD8, sqrtf(SQ(spDC) + SQ(spD4)))); Math_ApproachS(&this->actor.world.rot.y, spCC, this->tentMaxAngle, this->tentSpeed); Math_ApproachS(&this->actor.world.rot.x, spD0, this->tentMaxAngle, this->tentSpeed); - func_8002D908(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); } else { this->actor.world.pos.y += this->actor.velocity.y; this->actor.velocity.y -= 1.0f; } - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); temp = (this->actor.world.pos.y < -200.0f) ? UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 : UPDBGCHECKINFO_FLAG_0; this->actor.world.pos.y -= 20.0f; @@ -2321,7 +2321,7 @@ void BossMo_UpdateTent(Actor* thisx, PlayState* play) { } } Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0xA, 0xC8); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Math_ApproachF(&this->actor.speed, 0.0, 1.0f, 0.02f); if (BossMo_NearLand(&this->actor.world.pos, 40)) { diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 7706990392..fe2d9cdabe 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -363,10 +363,10 @@ void BossSst_HeadSetupIntro(BossSst* this, PlayState* play) { player->actor.world.pos.x = sRoomCenter.x; player->actor.world.pos.y = ROOM_CENTER_Y + 1000.0f; player->actor.world.pos.z = sRoomCenter.z; - player->linearVelocity = player->actor.velocity.y = 0.0f; + player->speedXZ = player->actor.velocity.y = 0.0f; player->actor.shape.rot.y = -0x8000; - player->targetYaw = -0x8000; - player->currentYaw = -0x8000; + player->zTargetYaw = -0x8000; + player->yaw = -0x8000; player->fallStartHeight = 0; player->stateFlags1 |= PLAYER_STATE1_5; @@ -422,10 +422,10 @@ void BossSst_HeadIntro(BossSst* this, PlayState* play) { if (player->actor.world.pos.y > 100.0f) { player->actor.world.pos.x = sRoomCenter.x; player->actor.world.pos.z = sRoomCenter.z; - player->linearVelocity = 0; + player->speedXZ = 0; player->actor.shape.rot.y = -0x8000; - player->targetYaw = -0x8000; - player->currentYaw = -0x8000; + player->zTargetYaw = -0x8000; + player->yaw = -0x8000; } Math_Vec3f_Copy(&sSubCamAt, &player->actor.world.pos); diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index 3407a7be24..939495375a 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -626,8 +626,8 @@ void BossTw_TurnToPlayer(BossTw* this, PlayState* play) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, this->rotateSpeed); Math_ApproachS(&this->actor.shape.rot.x, 0, 5, this->rotateSpeed); Math_ApproachF(&this->rotateSpeed, 4096.0f, 1.0f, 200.0f); - func_8002D908(&this->actor); - func_8002D7EC(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); + Actor_UpdatePos(&this->actor); if (this->timers[0] == 0) { if ((otherTw->actionFunc != BossTw_ShootBeam) && this->work[CAN_SHOOT]) { this->work[CAN_SHOOT] = false; @@ -698,8 +698,8 @@ void BossTw_FlyTo(BossTw* this, PlayState* play) { Math_ApproachS(&this->actor.shape.rot.x, pitchTarget, 0xA, this->rotateSpeed); Math_ApproachF(&this->rotateSpeed, 4096.0f, 1.0f, 100.0f); Math_ApproachF(&this->actor.speed, 10.0f, 1.0f, 1.0f); - func_8002D908(&this->actor); - func_8002D7EC(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); + Actor_UpdatePos(&this->actor); if ((this->timers[0] == 0) || (xzDist < 70.0f)) { BossTw_SetupTurnToPlayer(this, play); @@ -2363,8 +2363,8 @@ void BossTw_DeathBall(BossTw* this, PlayState* play) { Math_ApproachS(&this->actor.world.rot.x, RAD_TO_BINANG(Math_FAtan2F(yDiff, sqrtf(SQ(xDiff) + SQ(zDiff)))), 5, this->rotateSpeed); Math_ApproachS(&this->actor.world.rot.y, yaw, 5, this->rotateSpeed); - func_8002D908(&this->actor); - func_8002D7EC(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); + Actor_UpdatePos(&this->actor); } void BossTw_TwinrovaSetupDeathCS(BossTw* this, PlayState* play) { @@ -3936,8 +3936,8 @@ void BossTw_BlastFire(BossTw* this, PlayState* play) { case 10: this->blastActive = true; if (this->timers[0] == 0) { - func_8002D908(&this->actor); - func_8002D7EC(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); + Actor_UpdatePos(&this->actor); Actor_PlaySfx(&this->actor, NA_SE_EN_TWINROBA_SHOOT_FIRE & ~SFX_FLAG); } else { Vec3f velocity; @@ -4125,8 +4125,8 @@ void BossTw_BlastIce(BossTw* this, PlayState* play) { this->blastActive = true; if (this->timers[0] == 0) { - func_8002D908(&this->actor); - func_8002D7EC(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); + Actor_UpdatePos(&this->actor); Actor_PlaySfx(&this->actor, NA_SE_EN_TWINROBA_SHOOT_FREEZE - SFX_FLAG); } else { Vec3f velocity; @@ -5404,7 +5404,7 @@ void BossTw_TwinrovaFly(BossTw* this, PlayState* play) { Math_ApproachS(&this->actor.shape.rot.y, yaw, 0xA, this->rotateSpeed); Math_ApproachF(&this->rotateSpeed, 2000.0f, 1.0f, 100.0f); Math_ApproachF(&this->actor.speed, 30.0f, 1.0f, 2.0f); - func_8002D908(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); Math_ApproachF(&this->actor.world.pos.x, this->targetPos.x, 0.1f, fabsf(this->actor.velocity.x) * 1.5f); Math_ApproachF(&this->actor.world.pos.y, this->targetPos.y, 0.1f, fabsf(this->actor.velocity.y) * 1.5f); Math_ApproachF(&this->targetPos.y, 380.0f, 1.0f, 2.0f); diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index d56c49ee72..8448bf2260 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -1283,7 +1283,7 @@ void BossVa_BodyPhase3(BossVa* this, PlayState* play) { this->actor.speed = 0.0f; } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (SkelAnime_Update(&this->skelAnime) && (sFightPhase >= PHASE_4)) { BossVa_SetupBodyPhase4(this, play); } @@ -1482,7 +1482,7 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) { } } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); this->actor.focus.pos = this->actor.world.pos; this->actor.focus.pos.y += 60.0f; if (((play->gameplayFrames % 2) == 0) && (this->timer == 0)) { diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index cf75a5c300..0fa6c24dc6 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -918,7 +918,7 @@ void DemoEffect_UpdateLightRingTriforce(DemoEffect* this, PlayState* play) { void DemoEffect_UpdateCreationFireball(DemoEffect* this, PlayState* play) { DemoEffect* effect; - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); this->actor.speed += this->actor.gravity * 0.5f; if (this->fireBall.timer != 0) { diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c index b62455f733..e0a3f97def 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c @@ -568,7 +568,7 @@ void DemoGj_InitRubblePile1(DemoGj* this, PlayState* play) { } void func_8097A000(DemoGj* this, PlayState* play) { - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); this->rotationVec.x += (s16)(kREG(18)); this->rotationVec.y += (s16)(kREG(19) + 1000); @@ -633,7 +633,7 @@ void DemoGj_InitRubblePile2(DemoGj* this, PlayState* play) { } void func_8097A238(DemoGj* this, PlayState* play) { - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); this->rotationVec.x += (s16)(kREG(31)); this->rotationVec.y += (s16)(kREG(32) + 1000); @@ -698,7 +698,7 @@ void DemoGj_InitRubblePile3(DemoGj* this, PlayState* play) { } void func_8097A474(DemoGj* this, PlayState* play) { - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); this->rotationVec.x += (s16)(kREG(44)); this->rotationVec.y += (s16)(kREG(45) + 1000); @@ -746,7 +746,7 @@ void DemoGj_InitRubblePile4(DemoGj* this, PlayState* play) { } void func_8097A644(DemoGj* this, PlayState* play) { - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); this->rotationVec.x += (s16)(kREG(57)); this->rotationVec.y += (s16)(kREG(58) + 1000); @@ -794,7 +794,7 @@ void DemoGj_InitRubblePile5(DemoGj* this, PlayState* play) { } void func_8097A814(DemoGj* this, PlayState* play) { - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); this->rotationVec.x += (s16)(kREG(70)); this->rotationVec.y += (s16)(kREG(71) + 1000); @@ -842,7 +842,7 @@ void DemoGj_InitRubblePile6(DemoGj* this, PlayState* play) { } void func_8097A9E4(DemoGj* this, PlayState* play) { - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); this->rotationVec.x += (s16)(kREG(83)); this->rotationVec.y += (s16)(kREG(84) + 1000); @@ -890,7 +890,7 @@ void DemoGj_InitRubblePile7(DemoGj* this, PlayState* play) { } void func_8097ABB4(DemoGj* this, PlayState* play) { - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); this->rotationVec.x += (s16)(kREG(15)); this->rotationVec.y += (s16)(kREG(14) + 1000); diff --git a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c index b02f14d801..be4f4d36f8 100644 --- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c +++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c @@ -166,11 +166,11 @@ void func_8097CC08(DemoGo* this) { } else { this->actor.speed = (kREG(15) * 0.01f) + 1.2f; } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } void func_8097CCC0(DemoGo* this) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } void func_8097CCE0(DemoGo* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index 8768f9deaa..bff036cc7a 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -222,7 +222,7 @@ void DoorKiller_FallAsRubble(DoorKiller* this, PlayState* play) { } else { Actor_Kill(&this->actor); } - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); } s32 DoorKiller_IsHit(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index 8f6492c6e5..f9c3e5132e 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -866,7 +866,7 @@ void DoorShutter_WaitPlayerSurprised(DoorShutter* this, PlayState* play) { } void DoorShutter_GohmaBlockFall(DoorShutter* this, PlayState* play) { - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND) { DoorShutter_SetupAction(this, DoorShutter_GohmaBlockBounce); diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index c7d068cfbe..2c70ef18bb 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -186,7 +186,7 @@ void DoorWarp1_SetupWarp(DoorWarp1* this, PlayState* play) { void DoorWarp1_SetupAdultDungeonWarp(DoorWarp1* this, PlayState* play) { SkelAnime_Init(play, &this->skelAnime, &gWarpCrystalSkel, &gWarpCrystalAnim, NULL, NULL, 0); - Animation_ChangeImpl(&this->skelAnime, &gWarpCrystalAnim, 1.0f, 1.0f, 1.0f, ANIMMODE_ONCE, 40.0f, 1); + Animation_ChangeImpl(&this->skelAnime, &gWarpCrystalAnim, 1.0f, 1.0f, 1.0f, ANIMMODE_ONCE, 40.0f, ANIMTAPER_ACCEL); this->scale = 0; this->unk_1AE = -140; @@ -215,7 +215,7 @@ void DoorWarp1_SetupBlueCrystal(DoorWarp1* this, PlayState* play) { SkelAnime_Init(play, &this->skelAnime, &gWarpCrystalSkel, &gWarpCrystalAnim, NULL, NULL, 0); Animation_ChangeImpl(&this->skelAnime, &gWarpCrystalAnim, 0, Animation_GetLastFrame(&gWarpCrystalAnim), - Animation_GetLastFrame(&gWarpCrystalAnim), ANIMMODE_ONCE, 0.0f, 1); + Animation_GetLastFrame(&gWarpCrystalAnim), ANIMMODE_ONCE, 0.0f, ANIMTAPER_ACCEL); this->skelAnime.curFrame = Animation_GetLastFrame(&gWarpCrystalAnim); this->scale = 10; @@ -244,7 +244,7 @@ void DoorWarp1_SetupBlueCrystal(DoorWarp1* this, PlayState* play) { void DoorWarp1_SetupPurpleCrystal(DoorWarp1* this, PlayState* play) { SkelAnime_Init(play, &this->skelAnime, &gWarpCrystalSkel, &gWarpCrystalAnim, NULL, NULL, 0); Animation_ChangeImpl(&this->skelAnime, &gWarpCrystalAnim, 0, Animation_GetLastFrame(&gWarpCrystalAnim), - Animation_GetLastFrame(&gWarpCrystalAnim), ANIMMODE_ONCE, 0.0f, 1); + Animation_GetLastFrame(&gWarpCrystalAnim), ANIMMODE_ONCE, 0.0f, ANIMTAPER_ACCEL); this->skelAnime.curFrame = Animation_GetLastFrame(&gWarpCrystalAnim); this->unk_1AE = 120; @@ -668,7 +668,7 @@ void func_8099A508(DoorWarp1* this, PlayState* play) { Audio_PlaySfxGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Animation_ChangeImpl(&this->skelAnime, &gWarpCrystalAnim, 1.0f, Animation_GetLastFrame(&gWarpCrystalAnim), - Animation_GetLastFrame(&gWarpCrystalAnim), ANIMMODE_ONCE, 40.0f, 1); + Animation_GetLastFrame(&gWarpCrystalAnim), ANIMMODE_ONCE, 40.0f, ANIMTAPER_ACCEL); this->unk_1B2 = 0x32; DoorWarp1_SetupAction(this, DoorWarp1_AdultWarpOut); diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index 16e87eac37..e40bf546d0 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -112,9 +112,9 @@ static ColliderQuadInit sQuadInit = { }; typedef enum { - /* 00 */ AM_DMGEFF_NONE, // used by anything that cant kill the armos - /* 01 */ AM_DMGEFF_NUT, - /* 06 */ AM_DMGEFF_STUN = 6, // doesn't include deku nuts + /* 0 */ AM_DMGEFF_NONE, // used by anything that cant kill the armos + /* 1 */ AM_DMGEFF_NUT, + /* 6 */ AM_DMGEFF_STUN = 6, // doesn't include deku nuts /* 13 */ AM_DMGEFF_ICE = 13, /* 14 */ AM_DMGEFF_MAGIC_FIRE_LIGHT, /* 15 */ AM_DMGEFF_KILL // any damage source that can kill the armos (and isn't a special case) @@ -532,7 +532,7 @@ void EnAm_MoveToHome(EnAm* this, PlayState* play) { // turn away from a wall if touching one if ((this->dyna.actor.speed != 0.0f) && (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_WALL)) { this->dyna.actor.world.rot.y = this->dyna.actor.wallYaw; - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); } SkelAnime_Update(&this->skelAnime); @@ -640,7 +640,7 @@ void EnAm_Lunge(EnAm* this, PlayState* play) { if ((this->dyna.actor.speed != 0.0f) && (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_WALL)) { this->dyna.actor.world.rot.y = (this->dyna.actor.wallYaw - this->dyna.actor.world.rot.y) + this->dyna.actor.wallYaw; - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); this->dyna.actor.bgCheckFlags &= ~BGCHECKFLAG_WALL; } @@ -885,7 +885,7 @@ void EnAm_Update(Actor* thisx, PlayState* play) { } } - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 28.0f, 80.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 47f64792d3..dd5ab1f454 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -238,7 +238,7 @@ void EnAni_Update(Actor* thisx, PlayState* play) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); if ((play->csCtx.state != CS_STATE_IDLE) && (play->csCtx.actorCues[0] != NULL)) { switch (this->unk_2AA) { diff --git a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c index 549bd0d251..fde25a0f38 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -445,7 +445,7 @@ void EnAnubice_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); this->actor.velocity.y += this->actor.gravity; - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); if (!this->isPlayerOutOfRange) { Actor_UpdateBgCheckInfo(play, &this->actor, 5.0f, 5.0f, 10.0f, diff --git a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c index 85a0f7416d..288bf4d771 100644 --- a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c +++ b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c @@ -176,7 +176,7 @@ void EnAnubiceFire_Update(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, this->scale); this->actionFunc(this, play); - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); this->unk_160[0] = this->actor.world.pos; for (i = 4; i >= 0; i--) { diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index 5cdfd2731b..4a7310377c 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -183,11 +183,11 @@ void EnArrow_Shoot(EnArrow* this, PlayState* play) { Math_Vec3f_Copy(&this->unk_210, &this->actor.world.pos); if (this->actor.params >= ARROW_SEED) { - func_8002D9A4(&this->actor, 80.0f); + Actor_SetProjectileSpeed(&this->actor, 80.0f); this->timer = 15; this->actor.shape.rot.x = this->actor.shape.rot.y = this->actor.shape.rot.z = 0; } else { - func_8002D9A4(&this->actor, 150.0f); + Actor_SetProjectileSpeed(&this->actor, 150.0f); this->timer = 12; } } @@ -325,7 +325,7 @@ void EnArrow_Fly(EnArrow* this, PlayState* play) { } } else { Math_Vec3f_Copy(&this->unk_210, &this->actor.world.pos); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if ((this->touchedPoly = BgCheck_ProjectileLineTest(&play->colCtx, &this->actor.prevPos, &this->actor.world.pos, &hitPoint, @@ -377,7 +377,7 @@ void func_809B45E0(EnArrow* this, PlayState* play) { void func_809B4640(EnArrow* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (DECR(this->timer) == 0) { Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c index 3e889445b0..78df59cff2 100644 --- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c +++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c @@ -332,9 +332,9 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) { UPDBGCHECKINFO_FLAG_4); if (this->actionFunc == func_809B5670) { - func_8002D97C(&this->actor); + Actor_MoveXYZ(&this->actor); } else { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } if (this->actor.floorHeight <= BGCHECK_Y_MIN) { diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/src/overlays/actors/ovl_En_Ba/z_en_ba.c index 0ec920bab4..dd52141fd2 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -212,7 +212,7 @@ void EnBa_FallAsBlob(EnBa* this, PlayState* play) { Actor_Kill(&this->actor); } } else { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 28.0f, 80.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); } } diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index c44ff5e978..b7bafb238f 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -1237,7 +1237,7 @@ void EnBb_Update(Actor* thisx, PlayState* play2) { this->actionFunc(this, play); if ((this->actor.params <= ENBB_BLUE) && (this->actor.speed >= -6.0f) && ((this->actor.flags & ACTOR_FLAG_15) == 0)) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } if (this->moveMode == BBMOVE_NORMAL) { if ((this->actor.world.pos.y - 20.0f) <= this->actor.floorHeight) { diff --git a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c index 04f650d852..6ff70278dd 100644 --- a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c +++ b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c @@ -181,7 +181,7 @@ void EnBdfire_Update(Actor* thisx, PlayState* play) { this->unk_156++; this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } void EnBdfire_DrawFire(EnBdfire* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/src/overlays/actors/ovl_En_Bili/z_en_bili.c index 3d6cf0dc05..c17222b966 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -619,9 +619,9 @@ void EnBili_Update(Actor* thisx, PlayState* play2) { } } if (this->actionFunc == EnBili_Recoil) { - func_8002D97C(&this->actor); + Actor_MoveXYZ(&this->actor); } else { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } Actor_UpdateBgCheckInfo(play, &this->actor, 5.0f, this->collider.dim.radius, this->collider.dim.height, diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/src/overlays/actors/ovl_En_Bom/z_en_bom.c index 508c9f233e..83ed079505 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -136,7 +136,7 @@ void EnBom_Move(EnBom* this, PlayState* play) { this->actor.world.rot.y = ((this->actor.wallYaw - this->actor.world.rot.y) + this->actor.wallYaw) - 0x8000; } Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_BOUND); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); this->actor.speed *= 0.7f; this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL; } @@ -154,7 +154,7 @@ void EnBom_Move(EnBom* this, PlayState* play) { } } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } void EnBom_WaitForRelease(EnBom* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c index 3ecb6151fe..07fd4e75b5 100644 --- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c +++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c @@ -191,7 +191,7 @@ void EnBomChu_UpdateFloorPoly(EnBomChu* this, CollisionPoly* floorPoly, PlayStat // A hack for preventing bombchus from sticking to ledges. // The visual rotation reverts the sign inversion (shape.rot.x = -world.rot.x). - // The better fix would be making func_8002D908 compute XYZ velocity better, + // The better fix would be making Actor_UpdateVelocityXYZ compute XYZ velocity better, // or not using it and make the bombchu compute its own velocity. this->actor.world.rot.x = -this->actor.world.rot.x; } @@ -422,7 +422,7 @@ void EnBomChu_Update(Actor* thisx, PlayState* play2) { } this->actionFunc(this, play); - func_8002D97C(&this->actor); + Actor_MoveXYZ(&this->actor); this->collider.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x; this->collider.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y; diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c index f0469b7419..01b5434580 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -332,7 +332,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (thisx->params == BOMBFLOWER_BODY) { - Actor_MoveForward(thisx); + Actor_MoveXZGravity(thisx); } if (thisx->gravity != 0.0f) { @@ -357,7 +357,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) { thisx->world.rot.y = ((thisx->wallYaw - thisx->world.rot.y) + thisx->wallYaw) - 0x8000; } Actor_PlaySfx(thisx, NA_SE_EV_BOMB_BOUND); - Actor_MoveForward(thisx); + Actor_MoveXZGravity(thisx); DREG(6) = 1; Actor_UpdateBgCheckInfo(play, thisx, 5.0f, 10.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_2 | diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c index fff44153d8..4f406212ea 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -148,8 +148,8 @@ void EnBoom_Fly(EnBoom* this, PlayState* play) { } // Set xyz speed, move forward, and play the boomerang sound effect - func_8002D9A4(&this->actor, 12.0f); - Actor_MoveForward(&this->actor); + Actor_SetProjectileSpeed(&this->actor, 12.0f); + Actor_MoveXZGravity(&this->actor); func_8002F974(&this->actor, NA_SE_IT_BOOMERANG_FLY - SFX_FLAG); // If the boomerang collides with EnItem00 or a Skulltula token, set grabbed pointer to pick it up diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c index 0cfd270c63..c8225e081d 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -8,7 +8,7 @@ /* set on init unless treasure flag is set -if clear, chest moves (Actor_MoveForward) (falls, likely) +if clear, chest moves (Actor_MoveXZGravity) (falls, likely) ends up cleared from SWITCH_FLAG_FALL types when switch flag is set */ #define ENBOX_MOVE_IMMOBILE (1 << 0) @@ -521,7 +521,7 @@ void EnBox_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (!(this->movementFlags & ENBOX_MOVE_IMMOBILE)) { - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); } diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c index 932ea4d30a..ebadc0f29a 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -398,7 +398,7 @@ void EnBubble_Regrow(EnBubble* this, PlayState* play) { void EnBubble_Update(Actor* thisx, PlayState* play) { EnBubble* this = (EnBubble*)thisx; - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 16.0f, 16.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_2); this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/src/overlays/actors/ovl_En_Butte/z_en_butte.c index c26640f094..01fa059c3c 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -409,7 +409,7 @@ void EnButte_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (this->actor.update != NULL) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Math_StepToF(&this->actor.world.pos.y, this->posYTarget, 0.6f); if (this->actor.xyzDistToPlayerSq < 5000.0f) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/src/overlays/actors/ovl_En_Bw/z_en_bw.c index 299915e86a..75965618eb 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -792,7 +792,7 @@ void EnBw_Update(Actor* thisx, PlayState* play2) { this->unk_234 = Actor_TestFloorInDirection(thisx, play, 50.0f, thisx->world.rot.y); if ((this->unk_220 == 4) || (this->unk_220 == 6) || (this->unk_220 == 5) || (this->unk_220 == 1) || (this->unk_234 != 0)) { - Actor_MoveForward(thisx); + Actor_MoveXZGravity(thisx); } Actor_UpdateBgCheckInfo(play, thisx, 20.0f, 30.0f, 21.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_2 | diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index ba323790ce..b6636d63d0 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -236,9 +236,9 @@ void EnClearTag_Init(Actor* thisx, PlayState* play) { this->state = CLEAR_TAG_STATE_LASER; this->timers[CLEAR_TAG_TIMER_LASER_DEATH] = 70; this->actor.speed = 35.0f; - func_8002D908(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); for (j = 0; j <= 0; j++) { - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); } this->actor.scale.x = 0.4f; this->actor.scale.y = 0.4f; @@ -246,7 +246,7 @@ void EnClearTag_Init(Actor* thisx, PlayState* play) { this->actor.speed = 70.0f; this->actor.shape.rot.x = -this->actor.shape.rot.x; - func_8002D908(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); Collider_SetCylinder(play, &this->collider, &this->actor, &sLaserCylinderInit); Actor_PlaySfx(&this->actor, NA_SE_IT_SWORD_REFLECT_MG); } else { // Initialize the Arwing. @@ -473,7 +473,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play2) { this->actor.shape.rot.x = -this->actor.shape.rot.x; // Update the Arwing's velocity. - func_8002D908(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); this->actor.velocity.x += this->acceleration.x; this->actor.velocity.y += this->acceleration.y; this->actor.velocity.z += this->acceleration.z; @@ -496,7 +496,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play2) { this->crashingTimer--; } - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); Actor_SetFocus(&this->actor, 0.0f); @@ -542,7 +542,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play2) { break; case CLEAR_TAG_STATE_LASER: - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); // Check if the laser has hit a target. if (this->collider.base.atFlags & AT_HIT) { diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/src/overlays/actors/ovl_En_Cow/z_en_cow.c index d92a5d0a79..0b7484a02d 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -301,7 +301,7 @@ void EnCow_Update(Actor* thisx, PlayState* play2) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliders[0].base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliders[1].base); - Actor_MoveForward(thisx); + Actor_MoveXZGravity(thisx); Actor_UpdateBgCheckInfo(play, thisx, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); if (SkelAnime_Update(&this->skelAnime)) { if (this->skelAnime.animation == &gCowBodyChewAnim) { diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index 77b51ec62b..76644f9358 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -440,10 +440,10 @@ void EnCrow_Update(Actor* thisx, PlayState* play) { if (this->actionFunc != EnCrow_Respawn) { if (this->actor.colChkInfo.health != 0) { height = 20.0f * scale; - func_8002D97C(&this->actor); + Actor_MoveXYZ(&this->actor); } else { height = 0.0f; - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } Actor_UpdateBgCheckInfo(play, &this->actor, 12.0f * scale, 25.0f * scale, 50.0f * scale, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_2); diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/src/overlays/actors/ovl_En_Cs/z_en_cs.c index aecba25927..bf871fe14b 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -313,7 +313,7 @@ s32 EnCs_HandleWalking(EnCs* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->walkAngle, 1, 2500, 0); this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.speed = this->walkSpeed; - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); return 0; diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index 80005d1f0a..2a9a0588cd 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -542,7 +542,7 @@ void EnDaiku_EscapeRun(EnDaiku* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, ry, 1, 0xFA0, 0); this->actor.world.rot.y = this->actor.shape.rot.y; Math_SmoothStepToF(&this->actor.speed, this->runSpeed, 0.6f, dxz, 0.0f); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); if (this->subCamActive) { diff --git a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c index 2a65b25589..88416d60aa 100644 --- a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c +++ b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c @@ -428,7 +428,7 @@ void EnDaikuKakariko_Run(EnDaikuKakariko* this, PlayState* play) { Math_SmoothStepToF(&this->actor.speed, this->runSpeed, 0.8f, runDist, 0.0f); } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (this->flags & 0x40) { Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index 3f30706b99..8759a244c3 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -1121,7 +1121,7 @@ void EnDekubaba_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (this->actionFunc == EnDekubaba_PrunedSomersault) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, this->size * 15.0f, 10.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); } else if (this->actionFunc != EnDekubaba_DeadStickDrop) { diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index 5151ef6995..dfb8eafa7b 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -475,7 +475,7 @@ void EnDekunuts_Update(Actor* thisx, PlayState* play) { if (this->actor.params != DEKUNUTS_FLOWER) { EnDekunuts_ColliderCheck(this, play); this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, this->collider.dim.radius, this->collider.dim.height, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/src/overlays/actors/ovl_En_Dh/z_en_dh.c index 4704269577..9c8ba1ab0f 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -508,7 +508,7 @@ void EnDh_Update(Actor* thisx, PlayState* play) { EnDh_CollisionCheck(this, play); this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 45.0f, 45.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 0047d50faa..9d09d930f4 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -480,7 +480,7 @@ void EnDns_Update(Actor* thisx, PlayState* play) { Actor_SetFocus(&this->actor, 60.0f); Actor_SetScale(&this->actor, 0.01f); SkelAnime_Update(&this->skelAnime); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); this->actionFunc(this, play); if (this->standOnGround) { Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 20.0f, UPDBGCHECKINFO_FLAG_2); diff --git a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index b567242a95..f4286012c0 100644 --- a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -417,7 +417,7 @@ void EnDntJiji_Update(Actor* thisx, PlayState* play) { } } this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 60.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index ff5c6b23bd..4b98ea66b9 100644 --- a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -804,7 +804,7 @@ void EnDntNomal_Update(Actor* thisx, PlayState* play) { } } this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 60.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c index d41f67c1dc..852941ec7d 100644 --- a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c +++ b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c @@ -429,7 +429,7 @@ void EnDodojr_EmergeFromGround(EnDodojr* this, PlayState* play) { } void EnDodojr_CrawlTowardsTarget(EnDodojr* this, PlayState* play) { - func_8002D868(&this->actor); + Actor_UpdateVelocityXZGravity(&this->actor); EnDodojr_SpawnSmallDust(this, play, &this->actor.world.pos); if (DECR(this->crawlSfxTimer) == 0) { @@ -487,7 +487,7 @@ void EnDodojr_SwallowedBombDeathBounce(EnDodojr* this, PlayState* play) { // Scale up briefly to expand from the swallowed bomb exploding. this->rootScale = 1.2f; this->rootScale *= ((f32)this->actor.colorFilterTimer / 8); - func_8002D868(&this->actor); + Actor_UpdateVelocityXZGravity(&this->actor); if (EnDodojr_UpdateBounces(this, play)) { this->timer = 60; @@ -502,7 +502,7 @@ void EnDodojr_SwallowedBombDeathSequence(EnDodojr* this, PlayState* play) { } void EnDodojr_StunnedBounce(EnDodojr* this, PlayState* play) { - func_8002D868(&this->actor); + Actor_UpdateVelocityXZGravity(&this->actor); if (EnDodojr_UpdateBounces(this, play)) { EnDodojr_SetupSwallowedBombDeathSequence(this); @@ -536,7 +536,7 @@ void EnDodojr_Stunned(EnDodojr* this, PlayState* play) { void EnDodojr_JumpAttackBounce(EnDodojr* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_24; - func_8002D868(&this->actor); + Actor_UpdateVelocityXZGravity(&this->actor); if (EnDodojr_UpdateBounces(this, play)) { EnDodojr_SetupCrawlTowardsTarget(this); @@ -560,7 +560,7 @@ void EnDodojr_Despawn(EnDodojr* this, PlayState* play) { } void EnDodojr_StandardDeathBounce(EnDodojr* this, PlayState* play) { - func_8002D868(&this->actor); + Actor_UpdateVelocityXZGravity(&this->actor); Math_SmoothStepToS(&this->actor.shape.rot.y, 0, 4, 1000, 10); this->actor.world.rot.x = this->actor.shape.rot.x; @@ -610,7 +610,7 @@ void EnDodojr_Update(Actor* thisx, PlayState* play) { EnDodojr* this = (EnDodojr*)thisx; SkelAnime_Update(&this->skelAnime); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); EnDodojr_CheckDamaged(this, play); if (this->actionFunc != EnDodojr_WaitUnderground) { diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index 42a2bb7f0a..7c6a067441 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -769,7 +769,7 @@ void EnDodongo_Update(Actor* thisx, PlayState* play) { EnDodongo_CollisionCheck(this, play); if (this->actor.colChkInfo.damageEffect != 0xE) { this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 60.0f, 70.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/src/overlays/actors/ovl_En_Dog/z_en_dog.c index 56bc85c38e..fd3c3e70bc 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -455,7 +455,7 @@ void EnDog_Update(Actor* thisx, PlayState* play) { SkelAnime_Update(&this->skelAnime); Actor_UpdateBgCheckInfo(play, &this->actor, this->collider.dim.radius, this->collider.dim.height * 0.5f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); this->actionFunc(this, play); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Du/z_en_du.c b/src/overlays/actors/ovl_En_Du/z_en_du.c index 5273e84dd9..244876f15f 100644 --- a/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -567,7 +567,7 @@ void EnDu_Update(Actor* thisx, PlayState* play) { this->actor.world.pos.y += this->actor.velocity.y; this->actor.world.pos.z += this->actor.velocity.z; } else { - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); } Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); diff --git a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c index 00b347cd6b..75898ff6cb 100644 --- a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c +++ b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c @@ -84,7 +84,7 @@ void EnDyExtra_Update(Actor* thisx, PlayState* play) { this->actor.scale.z = this->scale.z; Actor_PlaySfx(&this->actor, NA_SE_PL_SPIRAL_HEAL_BEAM - SFX_FLAG); this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } void EnDyExtra_Draw(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index 3aa1dfbf0e..197a4a22e4 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -641,9 +641,9 @@ void EnEiyer_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (this->actor.world.rot.x == 0 || this->actionFunc == EnEiyer_Stunned) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } else { - func_8002D97C(&this->actor); + Actor_MoveXYZ(&this->actor); } if (this->actionFunc == EnEiyer_Glide || this->actionFunc == EnEiyer_DiveAttack || diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index 72ed3cd8f6..b616f88a1d 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -504,14 +504,14 @@ void func_80A02C98(EnElf* this, Vec3f* targetPos, f32 arg2) { func_80A02BD8(this, targetPos, arg2); Math_StepToF(&this->actor.velocity.x, xVelTarget, 1.5f); Math_StepToF(&this->actor.velocity.z, zVelTarget, 1.5f); - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); } void func_80A02E30(EnElf* this, Vec3f* targetPos) { func_80A02BD8(this, targetPos, 0.2f); this->actor.velocity.x = (targetPos->x + this->unk_28C.x) - this->actor.world.pos.x; this->actor.velocity.z = (targetPos->z + this->unk_28C.z) - this->actor.world.pos.z; - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); this->actor.world.pos.x = targetPos->x + this->unk_28C.x; this->actor.world.pos.z = targetPos->z + this->unk_28C.z; } @@ -519,7 +519,7 @@ void func_80A02E30(EnElf* this, Vec3f* targetPos) { void func_80A02EC0(EnElf* this, Vec3f* targetPos) { func_80A02BD8(this, targetPos, 0.2f); this->actor.velocity.x = this->actor.velocity.z = 0.0f; - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); this->actor.world.pos.x = targetPos->x + this->unk_28C.x; this->actor.world.pos.z = targetPos->z + this->unk_28C.z; } @@ -566,7 +566,7 @@ void func_80A03018(EnElf* this, PlayState* play) { Math_SmoothStepToS(&this->unk_2BC, targetYaw, 10, this->unk_2AC, 0x20); this->actor.world.rot.y = this->unk_2BC; - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } void func_80A03148(EnElf* this, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4) { @@ -594,7 +594,7 @@ void func_80A03148(EnElf* this, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4) { Math_StepToF(&this->actor.velocity.x, xVelTarget, 5.0f); Math_StepToF(&this->actor.velocity.z, zVelTarget, 5.0f); - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); } void func_80A0329C(EnElf* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c index d74ca19aee..d8a342d425 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -203,7 +203,7 @@ void EnEncount2_SpawnRocks(EnEncount2* this, PlayState* play) { tempVec2X = Rand_CenteredFloat(10.0f) + player->actor.world.pos.x; tempVec2Z = Rand_CenteredFloat(10.0f) + player->actor.world.pos.z; } else { - if (player->linearVelocity != 0.0f) { + if (player->speedXZ != 0.0f) { // rock spawn pos is between 300 and 600 units from the camera depending on the camera yaw. // Rocks will generally spawn closer to the camera in the X axis than in the Z axis. tempVec2X = Rand_CenteredFloat(200.0f) + (play->view.eye.x + (tempVec2X * 300.0f)); diff --git a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index d376158508..7a43b9c7bc 100644 --- a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -337,7 +337,7 @@ void EnExItem_ExitChest(EnExItem* this, PlayState* play) { Actor_Kill(&this->actor); } } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } void EnExItem_FairyMagic(EnExItem* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c index 7435dd4567..f24274e4c1 100644 --- a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c +++ b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c @@ -369,7 +369,7 @@ void EnExRuppy_Update(Actor* thisx, PlayState* play) { if (this->timer != 0) { this->timer--; } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 50.0f, UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); } diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/src/overlays/actors/ovl_En_Fd/z_en_fd.c index badc148135..7f5acb8439 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -673,7 +673,7 @@ void EnFd_Update(Actor* thisx, PlayState* play) { } else if (this->actionFunc != EnFd_WaitForCore) { EnFd_ColliderCheck(this, play); } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); EnFd_Fade(this, play); this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c index 7b4da578d6..e0227c1bfc 100644 --- a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c +++ b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c @@ -192,13 +192,13 @@ void EnFdFire_DanceTowardsPlayer(EnFdFire* this, PlayState* play) { if (this->actor.speed < 0.1f) { this->actor.speed = 5.0f; } - func_8002D868(&this->actor); + Actor_UpdateVelocityXZGravity(&this->actor); } } void EnFdFire_Disappear(EnFdFire* this, PlayState* play) { Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.6f, 9.0f, 0.0f); - func_8002D868(&this->actor); + Actor_UpdateVelocityXZGravity(&this->actor); Math_SmoothStepToF(&this->scale, 0.0f, 0.3f, 0.1f, 0.0f); this->actor.shape.shadowScale = 20.0f; this->actor.shape.shadowScale *= (this->scale / 3.0f); @@ -217,7 +217,7 @@ void EnFdFire_Update(Actor* thisx, PlayState* play) { } } - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); this->actionFunc(this, play); Actor_UpdateBgCheckInfo(play, &this->actor, 12.0f, 10.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); diff --git a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c index bac81e0b4d..c196eca9b8 100644 --- a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c +++ b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c @@ -296,7 +296,7 @@ void EnFhgFire_LightningShock(EnFhgFire* this, PlayState* play) { EffectSsFhgFlash_SpawnShock(play, &this->actor, &pos, 200, FHGFLASH_SHOCK_NO_ACTOR); } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Collider_UpdateCylinder(&this->actor, &this->collider); if (player->invincibilityTimer == 0) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); @@ -439,8 +439,8 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) { dxL = player->actor.world.pos.x - this->actor.world.pos.x; dyL = player->actor.world.pos.y + 40.0f - this->actor.world.pos.y; dzL = player->actor.world.pos.z - this->actor.world.pos.z; - func_8002D908(&this->actor); - func_8002D7EC(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); + Actor_UpdatePos(&this->actor); if (this->work[FHGFIRE_VARIANCE_TIMER] & 1) { Actor_SetScale(&this->actor, 6.0f); } else { diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c index 6a64528898..420b09ce68 100644 --- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c +++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c @@ -339,7 +339,7 @@ void EnFireRock_Update(Actor* thisx, PlayState* play) { thisx->gravity = -0.3f - (this->scale * 7.0f); } if (this->type != FIRE_ROCK_ON_FLOOR) { - Actor_MoveForward(thisx); + Actor_MoveXZGravity(thisx); Actor_UpdateBgCheckInfo(play, thisx, 50.0f, 50.0f, 100.0f, UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); } diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index 546d563a25..8b7ea195cf 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -683,12 +683,12 @@ void EnFirefly_Update(Actor* thisx, PlayState* play2) { if (!(this->actor.flags & ACTOR_FLAG_15)) { if ((this->actor.colChkInfo.health == 0) || (this->actionFunc == EnFirefly_Stunned)) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } else { if (this->actionFunc != EnFirefly_Rebound) { this->actor.world.rot.x = 0x1554 - this->actor.shape.rot.x; } - func_8002D97C(&this->actor); + Actor_MoveXYZ(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/src/overlays/actors/ovl_En_Fish/z_en_fish.c index 2e9da9ba75..52f27d2f36 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -688,7 +688,7 @@ void EnFish_OrdinaryUpdate(EnFish* this, PlayState* play) { } if ((this->actionFunc == NULL) || (this->actionFunc(this, play), (this->actor.update != NULL))) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (this->unk_250 != 0) { Actor_UpdateBgCheckInfo(play, &this->actor, 17.5f, 4.0f, 0.0f, this->unk_250); @@ -727,7 +727,7 @@ void EnFish_RespawningUpdate(EnFish* this, PlayState* play) { } if ((this->actionFunc == NULL) || (this->actionFunc(this, play), (this->actor.update != NULL))) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (this->respawnTimer == 20) { this->actor.draw = EnFish_Draw; diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index b37c612b3c..2f4b418cda 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -12,8 +12,8 @@ #define SPAWN_INVISIBLE 0x8000 #define SPAWN_SMALL 0x10 -#define MERGE_MASTER 0x40 -#define MERGE_SLAVE 0x20 +#define MERGE_LEADER 0x40 +#define MERGE_FOLLOWER 0x20 void EnFloormas_Init(Actor* thisx, PlayState* play2); void EnFloormas_Destroy(Actor* thisx, PlayState* play); @@ -24,16 +24,16 @@ void EnFloormas_GrabLink(EnFloormas* this, PlayState* play); void EnFloormas_Split(EnFloormas* this, PlayState* play); void EnFloormas_Recover(EnFloormas* this, PlayState* play); void EnFloormas_DrawHighlighted(Actor* thisx, PlayState* play); -void EnFloormas_SmWait(EnFloormas* this, PlayState* play); +void EnFloormas_SmallWait(EnFloormas* this, PlayState* play); void EnFloormas_SetupBigDecideAction(EnFloormas* this); void EnFloormas_Freeze(EnFloormas* this, PlayState* play); void EnFloormas_TakeDamage(EnFloormas* this, PlayState* play); void EnFloormas_Merge(EnFloormas* this, PlayState* play); void EnFloormas_JumpAtLink(EnFloormas* this, PlayState* play); -void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, PlayState* play); -void EnFloormas_SmShrink(EnFloormas* this, PlayState* play); -void EnFloormas_SmDecideAction(EnFloormas* this, PlayState* play); -void EnFloormas_SmWalk(EnFloormas* this, PlayState* play); +void EnFloormas_SmallFollowerJumpAtLeader(EnFloormas* this, PlayState* play); +void EnFloormas_SmallShrink(EnFloormas* this, PlayState* play); +void EnFloormas_SmallDecideAction(EnFloormas* this, PlayState* play); +void EnFloormas_SmallWalk(EnFloormas* this, PlayState* play); void EnFloormas_Land(EnFloormas* this, PlayState* play); void EnFloormas_Hover(EnFloormas* this, PlayState* play); void EnFloormas_Turn(EnFloormas* this, PlayState* play); @@ -145,7 +145,7 @@ void EnFloormas_Init(Actor* thisx, PlayState* play2) { if (this->actor.params == SPAWN_SMALL) { this->actor.draw = NULL; this->actor.flags &= ~ACTOR_FLAG_0; - this->actionFunc = EnFloormas_SmWait; + this->actionFunc = EnFloormas_SmallWait; } else { // spawn first small floormaster this->actor.parent = @@ -278,7 +278,6 @@ void EnFloormas_SetupLand(EnFloormas* this) { } void EnFloormas_SetupSplit(EnFloormas* this) { - Actor_SetScale(&this->actor, 0.004f); this->actor.flags |= ACTOR_FLAG_4; if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_7)) { @@ -301,21 +300,21 @@ void EnFloormas_SetupSplit(EnFloormas* this) { this->actionFunc = EnFloormas_Split; } -void EnFloormas_SetupSmWalk(EnFloormas* this) { +void EnFloormas_SetupSmallWalk(EnFloormas* this) { Animation_PlayLoopSetSpeed(&this->skelAnime, &gWallmasterWalkAnim, 4.5f); - this->actionFunc = EnFloormas_SmWalk; + this->actionFunc = EnFloormas_SmallWalk; this->actor.speed = 5.0f; } -void EnFloormas_SetupSmDecideAction(EnFloormas* this) { - if (this->actionFunc != EnFloormas_SmWalk) { +void EnFloormas_SetupSmallDecideAction(EnFloormas* this) { + if (this->actionFunc != EnFloormas_SmallWalk) { Animation_PlayLoopSetSpeed(&this->skelAnime, &gWallmasterWalkAnim, 4.5f); } - this->actionFunc = EnFloormas_SmDecideAction; + this->actionFunc = EnFloormas_SmallDecideAction; this->actor.speed = 5.0f; } -void EnFloormas_SetupSmShrink(EnFloormas* this, PlayState* play) { +void EnFloormas_SetupSmallShrink(EnFloormas* this, PlayState* play) { static Vec3f velocity = { 0.0f, 0.0f, 0.0f }; static Vec3f accel = { 0.0f, 0.0f, 0.0f }; Vec3f pos; @@ -326,12 +325,12 @@ void EnFloormas_SetupSmShrink(EnFloormas* this, PlayState* play) { pos.y = this->actor.world.pos.y + 15.0f; pos.z = this->actor.world.pos.z; EffectSsDeadDb_Spawn(play, &pos, &velocity, &accel, 150, -10, 255, 255, 255, 255, 0, 0, 255, 1, 9, true); - this->actionFunc = EnFloormas_SmShrink; + this->actionFunc = EnFloormas_SmallShrink; } -void EnFloormas_SetupSlaveJumpAtMaster(EnFloormas* this) { +void EnFloormas_SetupSmallFollowerJumpAtLeader(EnFloormas* this) { Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 2.0f, 0.0f, 41.0f, ANIMMODE_ONCE, 0.0f); - this->actionFunc = EnFloormas_SmSlaveJumpAtMaster; + this->actionFunc = EnFloormas_SmallFollowerJumpAtLeader; this->actor.speed = 0.0f; } @@ -367,24 +366,24 @@ void EnFloormas_SetupGrabLink(EnFloormas* this, Player* player) { void EnFloormas_SetupMerge(EnFloormas* this) { Animation_PlayOnce(&this->skelAnime, &gWallmasterWaitAnim); this->actionTimer = 0; - this->smActionTimer += 1500; + this->smallActionTimer += 1500; EnFloormas_MakeInvulnerable(this); this->actionFunc = EnFloormas_Merge; } -void EnFloormas_SetupSmWait(EnFloormas* this) { +void EnFloormas_SetupSmallWait(EnFloormas* this) { EnFloormas* parent = (EnFloormas*)this->actor.parent; EnFloormas* child = (EnFloormas*)this->actor.child; // if this is the last remaining small floor master, kill all. - if ((parent->actionFunc == EnFloormas_SmWait) && (child->actionFunc == EnFloormas_SmWait)) { + if ((parent->actionFunc == EnFloormas_SmallWait) && (child->actionFunc == EnFloormas_SmallWait)) { Actor_Kill(&parent->actor); Actor_Kill(&child->actor); Actor_Kill(&this->actor); return; } this->actor.draw = NULL; - this->actionFunc = EnFloormas_SmWait; + this->actionFunc = EnFloormas_SmallWait; this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_4); } @@ -436,7 +435,7 @@ void EnFloormas_Die(EnFloormas* this, PlayState* play) { } else { // Die Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x90); - EnFloormas_SetupSmShrink(this, play); + EnFloormas_SetupSmallShrink(this, play); } } @@ -459,10 +458,10 @@ void EnFloormas_Stand(EnFloormas* this, PlayState* play) { if (SkelAnime_Update(&this->skelAnime)) { if (this->actor.scale.x > 0.004f) { EnFloormas_SetupBigWalk(this); - } else if (this->actor.params == MERGE_SLAVE) { - EnFloormas_SetupSmDecideAction(this); + } else if (this->actor.params == MERGE_FOLLOWER) { + EnFloormas_SetupSmallDecideAction(this); } else { - EnFloormas_SetupSmWalk(this); + EnFloormas_SetupSmallWalk(this); } } } @@ -615,7 +614,7 @@ void EnFloormas_Land(EnFloormas* this, PlayState* play) { isOnGround = this->actor.bgCheckFlags & BGCHECKFLAG_GROUND; if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { - if (this->actor.params != MERGE_MASTER) { + if (this->actor.params != MERGE_LEADER) { EnFloormas_MakeVulnerable(this); } @@ -647,11 +646,11 @@ void EnFloormas_Land(EnFloormas* this, PlayState* play) { if (this->actionTimer == 0 && isOnGround) { if (this->skelAnime.endFrame < 45.0f) { this->skelAnime.endFrame = Animation_GetLastFrame(&gWallmasterJumpAnim); - } else if (this->actor.params == MERGE_MASTER) { + } else if (this->actor.params == MERGE_LEADER) { EnFloormas_SetupMerge(this); } else { EnFloormas_SetupStand(this); - this->smActionTimer = 50; + this->smallActionTimer = 50; } } } @@ -664,7 +663,7 @@ void EnFloormas_Split(EnFloormas* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (SkelAnime_Update(&this->skelAnime)) { this->actor.flags |= ACTOR_FLAG_0; - this->smActionTimer = 50; + this->smallActionTimer = 50; EnFloormas_SetupStand(this); } Math_StepToF(&this->actor.speed, 0.0f, 1.0f); @@ -675,16 +674,16 @@ void EnFloormas_Split(EnFloormas* this, PlayState* play) { } } -void EnFloormas_SmWalk(EnFloormas* this, PlayState* play) { +void EnFloormas_SmallWalk(EnFloormas* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - DECR(this->smActionTimer); + DECR(this->smallActionTimer); if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 18.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_WALK); } - if (this->smActionTimer == 0) { - EnFloormas_SetupSmDecideAction(this); + if (this->smallActionTimer == 0) { + EnFloormas_SetupSmallDecideAction(this); } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actionTarget = this->actor.wallYaw; EnFloormas_SetupTurn(this); @@ -693,7 +692,7 @@ void EnFloormas_SmWalk(EnFloormas* this, PlayState* play) { } } -void EnFloormas_SmDecideAction(EnFloormas* this, PlayState* play) { +void EnFloormas_SmallDecideAction(EnFloormas* this, PlayState* play) { Actor* primaryFloormas; s32 isAgainstWall; @@ -708,10 +707,10 @@ void EnFloormas_SmDecideAction(EnFloormas* this, PlayState* play) { return; } - if (this->actor.params == MERGE_SLAVE) { - if (this->actor.parent->params == MERGE_MASTER) { + if (this->actor.params == MERGE_FOLLOWER) { + if (this->actor.parent->params == MERGE_LEADER) { primaryFloormas = this->actor.parent; - } else if (this->actor.child->params == MERGE_MASTER) { + } else if (this->actor.child->params == MERGE_LEADER) { primaryFloormas = this->actor.child; } else { this->actor.params = 0x10; @@ -720,7 +719,7 @@ void EnFloormas_SmDecideAction(EnFloormas* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, primaryFloormas), 0x38E); if (Actor_WorldDistXZToActor(&this->actor, primaryFloormas) < 80.0f) { - EnFloormas_SetupSlaveJumpAtMaster(this); + EnFloormas_SetupSmallFollowerJumpAtLeader(this); } } else { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x71C); @@ -730,9 +729,9 @@ void EnFloormas_SmDecideAction(EnFloormas* this, PlayState* play) { } } -void EnFloormas_SmShrink(EnFloormas* this, PlayState* play) { +void EnFloormas_SmallShrink(EnFloormas* this, PlayState* play) { if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.0015f)) { - EnFloormas_SetupSmWait(this); + EnFloormas_SetupSmallWait(this); } this->actor.scale.z = this->actor.scale.x; this->actor.scale.y = this->actor.scale.x; @@ -795,12 +794,12 @@ void EnFloormas_GrabLink(EnFloormas* this, PlayState* play) { parent = (EnFloormas*)this->actor.parent; child = (EnFloormas*)this->actor.child; - if (((parent->actionFunc == EnFloormas_GrabLink) || parent->actionFunc == EnFloormas_SmWait) && - (child->actionFunc == EnFloormas_GrabLink || child->actionFunc == EnFloormas_SmWait)) { + if (((parent->actionFunc == EnFloormas_GrabLink) || parent->actionFunc == EnFloormas_SmallWait) && + (child->actionFunc == EnFloormas_GrabLink || child->actionFunc == EnFloormas_SmallWait)) { - parent->actor.params = MERGE_SLAVE; - child->actor.params = MERGE_SLAVE; - this->actor.params = MERGE_MASTER; + parent->actor.params = MERGE_FOLLOWER; + child->actor.params = MERGE_FOLLOWER; + this->actor.params = MERGE_LEADER; } this->actor.shape.rot.x = 0; @@ -823,13 +822,13 @@ void EnFloormas_GrabLink(EnFloormas* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_STICK - SFX_FLAG); } -void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, PlayState* play) { +void EnFloormas_SmallFollowerJumpAtLeader(EnFloormas* this, PlayState* play) { Actor* primFloormas; SkelAnime_Update(&this->skelAnime); - if (this->actor.parent->params == MERGE_MASTER) { + if (this->actor.parent->params == MERGE_LEADER) { primFloormas = this->actor.parent; - } else if (this->actor.child->params == MERGE_MASTER) { + } else if (this->actor.child->params == MERGE_LEADER) { primFloormas = this->actor.child; } else { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { @@ -846,7 +845,7 @@ void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, PlayState* play) { } else if ((((primFloormas->world.pos.y - this->actor.world.pos.y) < -10.0f) && (fabsf(this->actor.world.pos.x - primFloormas->world.pos.x) < 10.0f)) && (fabsf(this->actor.world.pos.z - primFloormas->world.pos.z) < 10.0f)) { - EnFloormas_SetupSmWait(this); + EnFloormas_SetupSmallWait(this); this->collider.base.ocFlags1 |= OC1_ON; } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speed = 0.0f; @@ -869,25 +868,25 @@ void EnFloormas_Merge(EnFloormas* this, PlayState* play) { mergeCnt = 0; - DECR(this->smActionTimer); + DECR(this->smallActionTimer); parent = (EnFloormas*)this->actor.parent; child = (EnFloormas*)this->actor.child; - if (this->smActionTimer == 0) { - if (parent->actionFunc != EnFloormas_SmWait) { - EnFloormas_SetupSmShrink(parent, play); + if (this->smallActionTimer == 0) { + if (parent->actionFunc != EnFloormas_SmallWait) { + EnFloormas_SetupSmallShrink(parent, play); } - if (child->actionFunc != EnFloormas_SmWait) { - EnFloormas_SetupSmShrink(child, play); + if (child->actionFunc != EnFloormas_SmallWait) { + EnFloormas_SetupSmallShrink(child, play); } } else { - if ((parent->actionFunc != EnFloormas_SmWait) && (parent->actionFunc != EnFloormas_SmShrink)) { + if ((parent->actionFunc != EnFloormas_SmallWait) && (parent->actionFunc != EnFloormas_SmallShrink)) { mergeCnt++; } - if ((child->actionFunc != EnFloormas_SmWait) && (child->actionFunc != EnFloormas_SmShrink)) { + if ((child->actionFunc != EnFloormas_SmallWait) && (child->actionFunc != EnFloormas_SmallShrink)) { mergeCnt++; } } @@ -931,7 +930,7 @@ void EnFloormas_Merge(EnFloormas* this, PlayState* play) { func_8002F974(&this->actor, NA_SE_EN_FLOORMASTER_RESTORE - SFX_FLAG); } -void EnFloormas_SmWait(EnFloormas* this, PlayState* play) { +void EnFloormas_SmallWait(EnFloormas* this, PlayState* play) { } void EnFloormas_TakeDamage(EnFloormas* this, PlayState* play) { @@ -982,9 +981,9 @@ void EnFloormas_ColliderCheck(EnFloormas* this, PlayState* play) { Actor_SetDropFlag(&this->actor, &this->collider.info, true); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { if (this->collider.base.colType != COLTYPE_HARD) { - isSmall = 0; + isSmall = false; if (this->actor.scale.x < 0.01f) { - isSmall = 1; + isSmall = true; } if (isSmall && this->collider.info.acHitInfo->toucher.dmgFlags & DMG_HOOKSHOT) { this->actor.colChkInfo.damage = 2; @@ -1022,17 +1021,12 @@ void EnFloormas_Update(Actor* thisx, PlayState* play) { EnFloormas* this = (EnFloormas*)thisx; s32 pad; - if (this->actionFunc != EnFloormas_SmWait) { + if (this->actionFunc != EnFloormas_SmallWait) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; this->actor.speed *= -0.5f; - if (-5.0f < this->actor.speed) { - this->actor.speed = -5.0f; - } else { - this->actor.speed = this->actor.speed; - } - + this->actor.speed = CLAMP_MAX(this->actor.speed, -5.0f); this->actor.velocity.y = 5.0f; EnFloormas_SetupLand(this); @@ -1045,7 +1039,7 @@ void EnFloormas_Update(Actor* thisx, PlayState* play) { } if (this->actionFunc != EnFloormas_GrabLink) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, this->actor.scale.x * 3000.0f, 0.0f, @@ -1062,7 +1056,7 @@ void EnFloormas_Update(Actor* thisx, PlayState* play) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } - if ((this->actionFunc != EnFloormas_SmSlaveJumpAtMaster) || (this->skelAnime.curFrame < 20.0f)) { + if ((this->actionFunc != EnFloormas_SmallFollowerJumpAtLeader) || (this->skelAnime.curFrame < 20.0f)) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h index c4233bf2ac..4c30b8773b 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h @@ -15,7 +15,7 @@ struct EnFloormas{ /* 0x0194 */ s16 actionTimer; /* 0x0196 */ s16 actionTarget; /* 0x0198 */ s16 zOffset; - /* 0x019A */ s16 smActionTimer; + /* 0x019A */ s16 smallActionTimer; /* 0x019C */ Vec3s jointTable[25]; /* 0x0232 */ Vec3s morphTable[25]; /* 0x02C8 */ ColliderCylinder collider; diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 3945e7f168..0fe3dc394c 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -586,7 +586,7 @@ void EnFr_UpdateActive(Actor* thisx, PlayState* play) { SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnimeButterfly); EnFr_ButterflyPath(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } } @@ -620,7 +620,7 @@ void EnFr_Idle(EnFr* this, PlayState* play) { player->actor.world.pos.x = this->actor.world.pos.x; // x = 990.0f player->actor.world.pos.y = this->actor.world.pos.y; // y = 205.0f player->actor.world.pos.z = this->actor.world.pos.z; // z = -1220.0f - player->currentYaw = player->actor.world.rot.y = player->actor.shape.rot.y = this->actor.world.rot.y; + player->yaw = player->actor.world.rot.y = player->actor.shape.rot.y = this->actor.world.rot.y; this->reward = GI_NONE; this->actionFunc = EnFr_Activate; } else if (EnFr_IsAboveAndWithin30DistXZ(player, this)) { diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 8670093c88..e643723c31 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -239,7 +239,7 @@ void EnFu_Update(Actor* thisx, PlayState* play) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); if (!(this->behaviorFlags & FU_WAIT) && SkelAnime_Update(&this->skelanime)) { Animation_Change(&this->skelanime, this->skelanime.animation, 1.0f, 0.0f, diff --git a/src/overlays/actors/ovl_En_Fw/z_en_fw.c b/src/overlays/actors/ovl_En_Fw/z_en_fw.c index 75c02acd50..d85580457f 100644 --- a/src/overlays/actors/ovl_En_Fw/z_en_fw.c +++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.c @@ -363,7 +363,7 @@ void EnFw_Update(Actor* thisx, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_13)) { // not attached to hookshot. - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 20.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); this->actionFunc(this, play); if (this->damageTimer == 0 && this->explosionTimer == 0 && this->actionFunc == EnFw_Run) { diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c index 4abe2425c6..a7789dfbb0 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -698,7 +698,7 @@ void EnFz_Update(Actor* thisx, PlayState* play) { } Math_StepToF(&this->actor.speed, this->speedXZ, 0.2f); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (this->updateBgInfo) { Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 20.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index 4e5452cf11..4f03b2fd91 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -275,7 +275,7 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, PlayState* play) { if (this->delayTimer == 0) { switch (this->moveMode) { case GSWITCH_THROW: - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if ((this->actor.velocity.y < 0.0f) && (this->actor.world.pos.y < (this->actor.home.pos.y - 50.0f))) { gallery = ((EnSyatekiItm*)this->actor.parent); this->actor.velocity.y = 0.0f; @@ -287,7 +287,7 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, PlayState* play) { } break; case GSWITCH_LEFT: - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); if ((this->actor.velocity.x < 0.0f) && (this->actor.world.pos.x < this->targetPos.x)) { gallery = ((EnSyatekiItm*)this->actor.parent); if (gallery->actor.update != NULL) { @@ -297,7 +297,7 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, PlayState* play) { } break; case GSWITCH_RIGHT: - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); if (this->actor.world.pos.x > this->targetPos.x) { gallery = ((EnSyatekiItm*)this->actor.parent); if (gallery->actor.update != NULL) { @@ -430,7 +430,7 @@ void EnGSwitch_Update(Actor* thisx, PlayState* play) { } if ((this->type != ENGSWITCH_SILVER_TRACKER) && (this->type != ENGSWITCH_SILVER_RUPEE) && (this->type != ENGSWITCH_TARGET_RUPEE)) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 50.0f, 100.0f, UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); } diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index 7cfb972331..3c2d3f3036 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -722,7 +722,7 @@ void EnGe1_Update(Actor* thisx, PlayState* play) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 40.0f, 25.0f, 40.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); this->animFunc(this); this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index b75c31dba5..3b2ff09850 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -499,7 +499,7 @@ void EnGe2_MaintainColliderAndSetAnimState(EnGe2* this, PlayState* play) { } void EnGe2_MoveAndBlink(EnGe2* this, PlayState* play) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (DECR(this->blinkTimer) == 0) { this->blinkTimer = Rand_S16Offset(60, 60); diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index 7bf34f737e..c1dab44435 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -184,7 +184,7 @@ void EnGe3_UpdateCollision(EnGe3* this, PlayState* play) { void EnGe3_MoveAndBlink(EnGe3* this, PlayState* play) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (DECR(this->blinkTimer) == 0) { this->blinkTimer = Rand_S16Offset(60, 60); diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index b75442d636..96a7ad999f 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -1406,7 +1406,7 @@ void EnGeldB_Update(Actor* thisx, PlayState* play) { EnGeldB_CollisionCheck(this, play); if (this->actor.colChkInfo.damageEffect != GELDB_DMG_UNK_6) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 15.0f, 30.0f, 60.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index 955fe12320..27ab2a012a 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -523,7 +523,7 @@ s32 EnGirlA_CanBuy_BluePotion(PlayState* play, EnGirlA* this) { } s32 EnGirlA_CanBuy_Longsword(PlayState* play, EnGirlA* this) { - if (CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BGS) && + if (CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BIGGORON) && !CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE)) { return CANBUY_RESULT_CANT_GET_NOW; } diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index 0183b0b10b..8f9be4e38c 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -92,7 +92,7 @@ void EnGm_Destroy(Actor* thisx, PlayState* play) { s32 func_80A3D7C8(void) { if (LINK_AGE_IN_YEARS == YEARS_CHILD) { return 0; - } else if (!CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BGS)) { + } else if (!CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BIGGORON)) { return 1; } else if (CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE)) { return 2; diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index f02542e69a..689dc6670f 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -1032,7 +1032,7 @@ void EnGo_Update(Actor* thisx, PlayState* play) { EnGo_UpdateShadow(this); if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index cb2eef101d..ac2d152a07 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -1117,7 +1117,7 @@ void EnGo2_RollForward(EnGo2* this) { } if (this->actionFunc != EnGo2_ContinueRolling) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } this->actor.speed = speedXZ; @@ -1353,7 +1353,7 @@ void EnGo2_SetupRolling(EnGo2* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_24; this->animTimer = 10; this->actor.shape.yOffset = 1800.0f; - this->actor.speed += this->actor.speed; // Speeding up + this->actor.speed *= 2.0f; // Speeding up this->actionFunc = EnGo2_ContinueRolling; } @@ -1933,7 +1933,7 @@ void EnGo2_GoronFireGenericAction(EnGo2* this, PlayState* play) { if (!(this->animTimer % 8)) { Actor_PlaySfx(&this->actor, NA_SE_EN_MORIBLIN_WALK); } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } else { this->animTimer = 0; this->actor.speed = 0.0f; diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/src/overlays/actors/ovl_En_Goma/z_en_goma.c index 8978b05c2d..5fdff0eac8 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -709,7 +709,7 @@ void EnGoma_Update(Actor* thisx, PlayState* play) { } this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); this->actor.world.pos.x = this->actor.world.pos.x + this->shieldKnockbackVel.x; this->actor.world.pos.z = this->actor.world.pos.z + this->shieldKnockbackVel.z; Math_ApproachZeroF(&this->shieldKnockbackVel.x, 1.0f, 3.0f); diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index c16309d464..710261e28b 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -300,7 +300,7 @@ s32 EnGoroiwa_MoveAndFall(EnGoroiwa* this, PlayState* play) { Vec3s* nextPointPos; Math_StepToF(&this->actor.speed, R_EN_GOROIWA_SPEED * 0.01f, 0.3f); - func_8002D868(&this->actor); + Actor_UpdateVelocityXZGravity(&this->actor); path = &play->pathList[this->actor.params & 0xFF]; nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; result = true; diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index 81bfaedd74..26c221408a 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -374,7 +374,7 @@ void func_80A4ED34(EnGs* this, PlayState* play) { func_8002F974(&this->actor, NA_SE_EV_STONE_LAUNCH - SFX_FLAG); } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (this->actor.yDistToPlayer < -12000.0f) { Actor_Kill(&this->actor); } diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index 5226060919..5231564140 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -780,7 +780,7 @@ void EnHeishi2_Update(Actor* thisx, PlayState* play) { } } this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); switch (this->type) { case 6: break; diff --git a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c index 2002263601..8f03ea0943 100644 --- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -221,7 +221,7 @@ void EnHeishi3_Update(Actor* thisx, PlayState* play) { } this->actionFunc(this, play); this->actor.shape.rot = this->actor.world.rot; - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 50.0f, UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); Collider_UpdateCylinder(&this->actor, &this->collider); diff --git a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index 851d4f9fd3..6d9269d403 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -357,7 +357,7 @@ void EnHeishi4_Update(Actor* thisx, PlayState* play) { } this->unk_27E += 1; this->actionFunc(this, play); - Actor_MoveForward(thisx); + Actor_MoveXZGravity(thisx); Actor_UpdateBgCheckInfo(play, thisx, 10.0f, 10.0f, 30.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index 789cbdf4ca..1248c11802 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -482,7 +482,7 @@ void EnHintnuts_Update(Actor* thisx, PlayState* play) { EnHintnuts_ColliderCheck(this, play); this->actionFunc(this, play); if (this->actionFunc != EnHintnuts_Freeze && this->actionFunc != EnHintnuts_BeginFreeze) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, this->collider.dim.radius, this->collider.dim.height, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); 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..1dc2dd138b 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c @@ -2,26 +2,79 @@ #define FLAGS ACTOR_FLAG_4 -// Horizontal Plane parameters +/* + * Horizontal holls parameters (`ENHOLL_H_*`) + * All horizontal holls are cuboids which react to how far (depth) and in which direction (side) the player is from the + * actor, in the actor's local z direction. + */ -#define PLANE_Y_MIN -50.0f -#define PLANE_Y_MAX 200.0f +// Defines the height of horizontal holls (all kinds) with a Y range relative to the actor position. +#define ENHOLL_H_Y_MIN -50.0f +#define ENHOLL_H_Y_MAX 200.0f -#define PLANE_HALFWIDTH 100.0f -#define PLANE_HALFWIDTH_2 200.0f +// Defines the width of horizontal holls (all kinds), +// with a half-width extending on both lateral sides (towards local +x and -x). +#define ENHOLL_H_HALFWIDTH_NARROW 100.0f +#define ENHOLL_H_HALFWIDTH 200.0f + +// Defines the depth range from horizontal invisible holls (`ENHOLL_H_INVISIBLE`, `ENHOLL_H_INVISIBLE_NARROW`), +// at which rooms get loaded. +// i.e. when the player's distance from the actor (along local z) is within this range, the corresponding room is loaded +// Note: This means there is a depth range in the middle of `2 * ENHOLL_H_INVISIBLE_LOAD_DEPTH_MIN` where nothing +// happens. That range where nothing happens is useful to avoid quickly repeated room swaps. +// Note: This means the player is expected to be inside the depth range at some point. +// i.e. this range needs to be deep enough so that the player cannot move past it in a single frame. +#define ENHOLL_H_INVISIBLE_LOAD_DEPTH_MAX 100.0f +#define ENHOLL_H_INVISIBLE_LOAD_DEPTH_MIN 50.0f + +// Defines the depth from horizontal switch flag holls (`ENHOLL_H_BGCOVER_SWITCHFLAG`), +// - at which the background geometry starts fading black; +#define ENHOLL_H_SWITCHFLAG_BGCOVER_DEPTH 100.0f +// - at which the background geometry is fully faded black, +// and rooms are loaded if needed according to the side the player is on (along local z). +#define ENHOLL_H_SWITCHFLAG_LOAD_DEPTH 50.0f + +/* + * Vertical holls parameters (`ENHOLL_V_*`) + * All vertical holls are cylinders which react to how far (y dist) and in which direction (side) the player is from the + * actor, along the vertical y axis. + */ + +// Vertical down holls parameters (`ENHOLL_V_DOWN_BGCOVER_LARGE`) +#define ENHOLL_V_DOWN_RADIUS 500.0f +// Y dist at which the background geometry starts fading black. +#define ENHOLL_V_DOWN_BGCOVER_YDIST 605.0f +// Y dist at which the background geometry is fully faded black, and the room down is loaded. +#define ENHOLL_V_DOWN_LOAD_YDIST 95.0f + +// Radius for other vertical holls (`ENHOLL_V_BGCOVER`, `ENHOLL_V_INVISIBLE`) +#define ENHOLL_V_RADIUS 120.0f + +// Vertical bg cover holls parameters (`ENHOLL_V_BGCOVER`) +// Y dist at which the background geometry starts fading black. +#define ENHOLL_V_BGCOVER_BGCOVER_YDIST 200.0f +// Y dist at which the background geometry is fully faded black, +// and rooms are loaded if needed according to the side the player is on (along y). +#define ENHOLL_V_BGCOVER_LOAD_YDIST 50.0f + +// Vertical invisible holls parameters (`ENHOLL_V_INVISIBLE`) +// Similar to the range defined by `ENHOLL_H_INVISIBLE_LOAD_DEPTH_MAX` and min above for horizontal planes, +// but vertically (along y). +#define ENHOLL_V_INVISIBLE_LOAD_YDIST_MAX 200.0f +#define ENHOLL_V_INVISIBLE_LOAD_YDIST_MIN 50.0f void EnHoll_Init(Actor* thisx, PlayState* play); void EnHoll_Destroy(Actor* thisx, PlayState* play); void EnHoll_Update(Actor* thisx, PlayState* play); void EnHoll_Draw(Actor* thisx, PlayState* play); -void EnHoll_NextAction(EnHoll* this, PlayState* play); -void func_80A58DD4(EnHoll* this, PlayState* play); -void func_80A59014(EnHoll* this, PlayState* play); -void func_80A591C0(EnHoll* this, PlayState* play); -void func_80A593A4(EnHoll* this, PlayState* play); -void func_80A59520(EnHoll* this, PlayState* play); -void func_80A59618(EnHoll* this, PlayState* play); +void EnHoll_WaitRoomLoaded(EnHoll* this, PlayState* play); +void EnHoll_HorizontalVisibleNarrow(EnHoll* this, PlayState* play); +void EnHoll_HorizontalInvisible(EnHoll* this, PlayState* play); +void EnHoll_VerticalDownBgCoverLarge(EnHoll* this, PlayState* play); +void EnHoll_VerticalBgCover(EnHoll* this, PlayState* play); +void EnHoll_VerticalInvisible(EnHoll* this, PlayState* play); +void EnHoll_HorizontalBgCoverSwitchFlag(EnHoll* this, PlayState* play); ActorInit En_Holl_InitVars = { ACTOR_EN_HOLL, @@ -36,7 +89,13 @@ ActorInit En_Holl_InitVars = { }; static EnHollActionFunc sActionFuncs[] = { - func_80A58DD4, func_80A591C0, func_80A59520, func_80A59618, func_80A59014, func_80A593A4, func_80A59014, + EnHoll_HorizontalVisibleNarrow, // ENHOLL_H_VISIBLE_NARROW + EnHoll_VerticalDownBgCoverLarge, // ENHOLL_V_DOWN_BGCOVER_LARGE + EnHoll_VerticalInvisible, // ENHOLL_V_INVISIBLE + EnHoll_HorizontalBgCoverSwitchFlag, // ENHOLL_H_BGCOVER_SWITCHFLAG + EnHoll_HorizontalInvisible, // ENHOLL_H_INVISIBLE + EnHoll_VerticalBgCover, // ENHOLL_V_BGCOVER + EnHoll_HorizontalInvisible, // ENHOLL_H_INVISIBLE_NARROW }; static InitChainEntry sInitChain[] = { @@ -45,32 +104,6 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneDownward, 400, ICHAIN_STOP), }; -/** - * These are all absolute distances in the relative z direction. That is, moving - * towards or away from the "face" of the loading plane regardless of orientation. - * Moving within these distances of the load plane have the following effects: - * [0] : Load the room on this side of the loading plane if not already loaded - * [1] : Load the room on the other side of the loading plane - * [2] : Fade Region (opaque -> transparent if approaching, transparent -> opaque if receding) - * [3] : Transparent Region - * - * When traversing a loading plane of this kind, it attempts to: - * Load Current Room (fails as it is already loaded) - * Load Next Room - * Load Previous Room - * Load Next Room - * - * @bug The striped nature of loading planes can cause some actors to unload due to - * conflicting Object Lists between the two rooms - * - * @bug If you can get around to the other side of the loading plane without triggering it, - * you can load the room on the other side multiple times - */ -static f32 sHorizTriggerDists[2][4] = { - { 200.0f, 150.0f, 100.0f, 50.0f }, - { 100.0f, 75.0f, 50.0f, 25.0f }, -}; - void EnHoll_SetupAction(EnHoll* this, EnHollActionFunc func) { this->actionFunc = func; } @@ -80,11 +113,10 @@ s32 EnHoll_IsKokiriLayer8(void) { } void EnHoll_ChooseAction(EnHoll* this) { - s32 action; + s32 type = ENHOLL_GET_TYPE(&this->actor); - action = (this->actor.params >> 6) & 7; - EnHoll_SetupAction(this, sActionFuncs[action]); - if (action != 0) { + EnHoll_SetupAction(this, sActionFuncs[type]); + if (type != ENHOLL_H_VISIBLE_NARROW) { this->actor.draw = NULL; } else { this->planeAlpha = 255; @@ -96,12 +128,12 @@ void EnHoll_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); EnHoll_ChooseAction(this); - this->unk_14F = 0; + this->resetBgCoverAlpha = false; } void EnHoll_Destroy(Actor* thisx, PlayState* play) { - s32 transitionActorIdx = GET_TRANSITION_ACTOR_INDEX(thisx); - TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[transitionActorIdx]; + s32 transitionActorIndex = GET_TRANSITION_ACTOR_INDEX(thisx); + TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[transitionActorIndex]; transitionEntry->id = -transitionEntry->id; } @@ -116,34 +148,69 @@ void EnHoll_SwapRooms(PlayState* play) { play->roomCtx.unk_30 ^= 1; } -// Horizontal Planes -void func_80A58DD4(EnHoll* this, PlayState* play) { - Player* player = GET_PLAYER(play); - s32 phi_t0 = ((play->sceneId == SCENE_SPIRIT_TEMPLE) ? 1 : 0) & 0xFFFFFFFF; - Vec3f vec; - f32 absZ; - s32 transitionActorIdx; +/** + * These are all absolute distances in the relative z direction. That is, moving + * towards or away from the "face" of the holl regardless of orientation. + * Moving within these distances of the holl have the following effects: + * [0] : Load the room on this side of the holl if not already loaded + * [1] : Load the room on the other side of the holl + * [2] : Start of fade region, where the plane is fully opaque + * [3] : End of fade region region, where the plane is fully transparent + * + * Within the fade region, the plane goes: + * opaque -> transparent if approaching, + * transparent -> opaque if receding + */ +static f32 sHorizontalVisibleNarrowTriggerDists[2][4] = { + { 200.0f, 150.0f, 100.0f, 50.0f }, // default + { 100.0f, 75.0f, 50.0f, 25.0f }, // SCENE_SPIRIT_TEMPLE +}; - func_8002DBD0(&this->actor, &vec, &player->actor.world.pos); - this->side = (vec.z < 0.0f) ? 0 : 1; - absZ = fabsf(vec.z); - if (vec.y > PLANE_Y_MIN && vec.y < PLANE_Y_MAX && fabsf(vec.x) < PLANE_HALFWIDTH && - absZ < sHorizTriggerDists[phi_t0][0]) { - transitionActorIdx = GET_TRANSITION_ACTOR_INDEX(&this->actor); - if (absZ > sHorizTriggerDists[phi_t0][1]) { +/** + * When traversing a holl of this kind, it attempts to: + * Load Current Room (fails as it is already loaded) + * Load Next Room + * Load Previous Room + * Load Next Room + * + * @bug The striped nature of holls can cause some actors to unload due to + * conflicting Object Lists between the two rooms + * + * @bug If you can get around to the other side of the holl without triggering it, + * you can load the room on the other side multiple times + */ +void EnHoll_HorizontalVisibleNarrow(EnHoll* this, PlayState* play) { + Player* player = GET_PLAYER(play); + s32 triggerDistsIndex = (u32)((play->sceneId == SCENE_SPIRIT_TEMPLE) ? 1 : 0); + Vec3f relPlayerPos; + f32 orthogonalDistToPlayer; + s32 transitionActorIndex; + + func_8002DBD0(&this->actor, &relPlayerPos, &player->actor.world.pos); + this->side = (relPlayerPos.z < 0.0f) ? 0 : 1; + orthogonalDistToPlayer = fabsf(relPlayerPos.z); + if (relPlayerPos.y > ENHOLL_H_Y_MIN && relPlayerPos.y < ENHOLL_H_Y_MAX && + fabsf(relPlayerPos.x) < ENHOLL_H_HALFWIDTH_NARROW && + orthogonalDistToPlayer < sHorizontalVisibleNarrowTriggerDists[triggerDistsIndex][0]) { + + transitionActorIndex = GET_TRANSITION_ACTOR_INDEX(&this->actor); + if (orthogonalDistToPlayer > sHorizontalVisibleNarrowTriggerDists[triggerDistsIndex][1]) { if (play->roomCtx.prevRoom.num >= 0 && play->roomCtx.status == 0) { - this->actor.room = play->transiActorCtx.list[transitionActorIdx].sides[this->side].room; + this->actor.room = play->transiActorCtx.list[transitionActorIndex].sides[this->side].room; EnHoll_SwapRooms(play); func_80097534(play, &play->roomCtx); } } else { - this->actor.room = play->transiActorCtx.list[transitionActorIdx].sides[this->side ^ 1].room; + this->actor.room = play->transiActorCtx.list[transitionActorIndex].sides[this->side ^ 1].room; if (play->roomCtx.prevRoom.num < 0) { func_8009728C(play, &play->roomCtx, this->actor.room); } else { - this->planeAlpha = (255.0f / (sHorizTriggerDists[phi_t0][2] - sHorizTriggerDists[phi_t0][3])) * - (absZ - sHorizTriggerDists[phi_t0][3]); + this->planeAlpha = + (255.0f / (sHorizontalVisibleNarrowTriggerDists[triggerDistsIndex][2] - + sHorizontalVisibleNarrowTriggerDists[triggerDistsIndex][3])) * + (orthogonalDistToPlayer - sHorizontalVisibleNarrowTriggerDists[triggerDistsIndex][3]); this->planeAlpha = CLAMP(this->planeAlpha, 0, 255); + if (play->roomCtx.curRoom.num != this->actor.room) { EnHoll_SwapRooms(play); } @@ -152,162 +219,186 @@ void func_80A58DD4(EnHoll* this, PlayState* play) { } } -// Horizontal Planes -void func_80A59014(EnHoll* this, PlayState* play) { +void EnHoll_HorizontalInvisible(EnHoll* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 useViewEye = gDbgCamEnabled || play->csCtx.state != CS_STATE_IDLE; - Vec3f vec; - s32 temp; - f32 planeHalfWidth; - f32 absZ; + s32 useViewEye = gDebugCamEnabled || play->csCtx.state != CS_STATE_IDLE; + Vec3f relSubjectPos; + s32 isKokiriLayer8; + f32 hollHalfWidth; + f32 orthogonalDistToSubject; - func_8002DBD0(&this->actor, &vec, (useViewEye) ? &play->view.eye : &player->actor.world.pos); - planeHalfWidth = (((this->actor.params >> 6) & 7) == 6) ? PLANE_HALFWIDTH : PLANE_HALFWIDTH_2; + func_8002DBD0(&this->actor, &relSubjectPos, useViewEye ? &play->view.eye : &player->actor.world.pos); + hollHalfWidth = + (ENHOLL_GET_TYPE(&this->actor) == ENHOLL_H_INVISIBLE_NARROW) ? ENHOLL_H_HALFWIDTH_NARROW : ENHOLL_H_HALFWIDTH; - temp = EnHoll_IsKokiriLayer8(); - if (temp || (PLANE_Y_MIN < vec.y && vec.y < PLANE_Y_MAX && fabsf(vec.x) < planeHalfWidth && - (absZ = fabsf(vec.z), 100.0f > absZ && absZ > 50.0f))) { - s32 transitionActorIdx = GET_TRANSITION_ACTOR_INDEX(&this->actor); - s32 side = (vec.z < 0.0f) ? 0 : 1; - TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[transitionActorIdx]; + isKokiriLayer8 = EnHoll_IsKokiriLayer8(); + if (isKokiriLayer8 || (relSubjectPos.y > ENHOLL_H_Y_MIN && relSubjectPos.y < ENHOLL_H_Y_MAX && + fabsf(relSubjectPos.x) < hollHalfWidth && + (orthogonalDistToSubject = fabsf(relSubjectPos.z), + orthogonalDistToSubject < ENHOLL_H_INVISIBLE_LOAD_DEPTH_MAX && + orthogonalDistToSubject > ENHOLL_H_INVISIBLE_LOAD_DEPTH_MIN))) { + s32 transitionActorIndex = GET_TRANSITION_ACTOR_INDEX(&this->actor); + s32 side = (relSubjectPos.z < 0.0f) ? 0 : 1; + TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[transitionActorIndex]; s32 room = transitionEntry->sides[side].room; this->actor.room = room; - if (temp) {} + if (isKokiriLayer8) {} if (this->actor.room != play->roomCtx.curRoom.num) { if (room) {} if (func_8009728C(play, &play->roomCtx, this->actor.room)) { - EnHoll_SetupAction(this, EnHoll_NextAction); + EnHoll_SetupAction(this, EnHoll_WaitRoomLoaded); } } } } -// Vertical Planes -void func_80A591C0(EnHoll* this, PlayState* play) { +void EnHoll_VerticalDownBgCoverLarge(EnHoll* this, PlayState* play) { Player* player = GET_PLAYER(play); - f32 absY = fabsf(this->actor.yDistToPlayer); - s32 transitionActorIdx; + f32 absYDistToPlayer = fabsf(this->actor.yDistToPlayer); + s32 transitionActorIndex; - if (this->actor.xzDistToPlayer < 500.0f && absY < 700.0f) { - transitionActorIdx = GET_TRANSITION_ACTOR_INDEX(&this->actor); - if (absY < 95.0f) { - play->unk_11E18 = 0xFF; - } else if (absY > 605.0f) { - play->unk_11E18 = 0; + if (this->actor.xzDistToPlayer < ENHOLL_V_DOWN_RADIUS && + // Nothing happens if `absYDistToPlayer > ENHOLL_V_DOWN_BGCOVER_YDIST`, + // so this check may as well compare to ENHOLL_V_DOWN_BGCOVER_YDIST + absYDistToPlayer < (ENHOLL_V_DOWN_BGCOVER_YDIST + 95.0f)) { + + transitionActorIndex = GET_TRANSITION_ACTOR_INDEX(&this->actor); + + if (absYDistToPlayer < ENHOLL_V_DOWN_LOAD_YDIST) { + play->bgCoverAlpha = 255; + } else if (absYDistToPlayer > ENHOLL_V_DOWN_BGCOVER_YDIST) { + play->bgCoverAlpha = 0; } else { - play->unk_11E18 = (s16)(605.0f - absY) * 0.5f; + play->bgCoverAlpha = (s16)(ENHOLL_V_DOWN_BGCOVER_YDIST - absYDistToPlayer) * + (255 / (ENHOLL_V_DOWN_BGCOVER_YDIST - ENHOLL_V_DOWN_LOAD_YDIST)); } - if (absY < 95.0f) { - this->actor.room = play->transiActorCtx.list[transitionActorIdx].sides[1].room; + + if (absYDistToPlayer < ENHOLL_V_DOWN_LOAD_YDIST) { + this->actor.room = play->transiActorCtx.list[transitionActorIndex].sides[1].room; Math_SmoothStepToF(&player->actor.world.pos.x, this->actor.world.pos.x, 1.0f, 50.0f, 10.0f); Math_SmoothStepToF(&player->actor.world.pos.z, this->actor.world.pos.z, 1.0f, 50.0f, 10.0f); if (this->actor.room != play->roomCtx.curRoom.num && - func_8009728C(play, &play->roomCtx, this->actor.room) != 0) { - EnHoll_SetupAction(this, EnHoll_NextAction); - this->unk_14F = 1; + func_8009728C(play, &play->roomCtx, this->actor.room)) { + EnHoll_SetupAction(this, EnHoll_WaitRoomLoaded); + this->resetBgCoverAlpha = true; player->actor.speed = 0.0f; } } - } else if (this->unk_14F != 0) { - play->unk_11E18 = 0; - this->unk_14F = 0; + } else { + if (this->resetBgCoverAlpha) { + play->bgCoverAlpha = 0; + this->resetBgCoverAlpha = false; + } } } -// Vertical Planes -void func_80A593A4(EnHoll* this, PlayState* play) { - f32 absY; +void EnHoll_VerticalBgCover(EnHoll* this, PlayState* play) { + f32 absYDistToPlayer; s32 side; - s32 transitionActorIdx; + s32 transitionActorIndex; - if ((this->actor.xzDistToPlayer < 120.0f) && (absY = fabsf(this->actor.yDistToPlayer), absY < 200.0f)) { - if (absY < 50.0f) { - play->unk_11E18 = 0xFF; + if ((this->actor.xzDistToPlayer < ENHOLL_V_RADIUS) && + (absYDistToPlayer = fabsf(this->actor.yDistToPlayer), absYDistToPlayer < ENHOLL_V_BGCOVER_BGCOVER_YDIST)) { + + if (absYDistToPlayer < ENHOLL_V_BGCOVER_LOAD_YDIST) { + play->bgCoverAlpha = 255; } else { - play->unk_11E18 = (200.0f - absY) * 1.7f; + play->bgCoverAlpha = (ENHOLL_V_BGCOVER_BGCOVER_YDIST - absYDistToPlayer) * + (255 / (ENHOLL_V_BGCOVER_BGCOVER_YDIST - ENHOLL_V_BGCOVER_LOAD_YDIST)); } - if (absY > 50.0f) { - transitionActorIdx = GET_TRANSITION_ACTOR_INDEX(&this->actor); - side = (0.0f < this->actor.yDistToPlayer) ? 0 : 1; - this->actor.room = play->transiActorCtx.list[transitionActorIdx].sides[side].room; + + if (absYDistToPlayer > ENHOLL_V_BGCOVER_LOAD_YDIST) { + transitionActorIndex = GET_TRANSITION_ACTOR_INDEX(&this->actor); + side = (this->actor.yDistToPlayer > 0.0f) ? 0 : 1; + this->actor.room = play->transiActorCtx.list[transitionActorIndex].sides[side].room; if (this->actor.room != play->roomCtx.curRoom.num && - func_8009728C(play, &play->roomCtx, this->actor.room) != 0) { - EnHoll_SetupAction(this, EnHoll_NextAction); - this->unk_14F = 1; + func_8009728C(play, &play->roomCtx, this->actor.room)) { + EnHoll_SetupAction(this, EnHoll_WaitRoomLoaded); + this->resetBgCoverAlpha = true; } } - } else if (this->unk_14F != 0) { - this->unk_14F = 0; - play->unk_11E18 = 0; - } -} - -// Vertical Planes -void func_80A59520(EnHoll* this, PlayState* play) { - f32 absY; - s8 side; - s32 transitionActorIdx; - - if (this->actor.xzDistToPlayer < 120.0f) { - absY = fabsf(this->actor.yDistToPlayer); - if (absY < 200.0f && absY > 50.0f) { - transitionActorIdx = GET_TRANSITION_ACTOR_INDEX(&this->actor); - side = (0.0f < this->actor.yDistToPlayer) ? 0 : 1; - this->actor.room = play->transiActorCtx.list[transitionActorIdx].sides[side].room; - if (this->actor.room != play->roomCtx.curRoom.num && - func_8009728C(play, &play->roomCtx, this->actor.room) != 0) { - EnHoll_SetupAction(this, EnHoll_NextAction); - } - } - } -} - -// Horizontal Planes -void func_80A59618(EnHoll* this, PlayState* play) { - Player* player = GET_PLAYER(play); - Vec3f vec; - f32 absZ; - s32 side; - s32 transitionActorIdx; - - if (!Flags_GetSwitch(play, this->actor.params & 0x3F)) { - if (this->unk_14F != 0) { - play->unk_11E18 = 0; - this->unk_14F = 0; - } } else { - func_8002DBD0(&this->actor, &vec, &player->actor.world.pos); - absZ = fabsf(vec.z); - if (PLANE_Y_MIN < vec.y && vec.y < PLANE_Y_MAX && fabsf(vec.x) < PLANE_HALFWIDTH_2 && absZ < 100.0f) { - this->unk_14F = 1; - transitionActorIdx = GET_TRANSITION_ACTOR_INDEX(&this->actor); - play->unk_11E18 = 0xFF - (s32)((absZ - 50.0f) * 5.9f); - if (play->unk_11E18 >= 0x100) { - play->unk_11E18 = 0xFF; - } else if (play->unk_11E18 < 0) { - play->unk_11E18 = 0; - } - if (absZ < 50.0f) { - side = (vec.z < 0.0f) ? 0 : 1; - this->actor.room = play->transiActorCtx.list[transitionActorIdx].sides[side].room; - if (this->actor.room != play->roomCtx.curRoom.num && - func_8009728C(play, &play->roomCtx, this->actor.room) != 0) { - EnHoll_SetupAction(this, EnHoll_NextAction); - } - } - } else if (this->unk_14F != 0) { - play->unk_11E18 = 0; - this->unk_14F = 0; + if (this->resetBgCoverAlpha) { + this->resetBgCoverAlpha = false; + play->bgCoverAlpha = 0; } } } -void EnHoll_NextAction(EnHoll* this, PlayState* play) { +void EnHoll_VerticalInvisible(EnHoll* this, PlayState* play) { + f32 absYDistToPlayer; + s8 side; + s32 transitionActorIndex; + + if (this->actor.xzDistToPlayer < ENHOLL_V_RADIUS) { + absYDistToPlayer = fabsf(this->actor.yDistToPlayer); + if (absYDistToPlayer < ENHOLL_V_INVISIBLE_LOAD_YDIST_MAX && + absYDistToPlayer > ENHOLL_V_INVISIBLE_LOAD_YDIST_MIN) { + transitionActorIndex = GET_TRANSITION_ACTOR_INDEX(&this->actor); + side = (this->actor.yDistToPlayer > 0.0f) ? 0 : 1; + this->actor.room = play->transiActorCtx.list[transitionActorIndex].sides[side].room; + if (this->actor.room != play->roomCtx.curRoom.num && + func_8009728C(play, &play->roomCtx, this->actor.room)) { + EnHoll_SetupAction(this, EnHoll_WaitRoomLoaded); + } + } + } +} + +void EnHoll_HorizontalBgCoverSwitchFlag(EnHoll* this, PlayState* play) { + Player* player = GET_PLAYER(play); + Vec3f relPlayerPos; + f32 orthogonalDistToPlayer; + s32 side; + s32 transitionActorIndex; + + if (!Flags_GetSwitch(play, ENHOLL_GET_SWITCH_FLAG(&this->actor))) { + if (this->resetBgCoverAlpha) { + play->bgCoverAlpha = 0; + this->resetBgCoverAlpha = false; + } + } else { + func_8002DBD0(&this->actor, &relPlayerPos, &player->actor.world.pos); + orthogonalDistToPlayer = fabsf(relPlayerPos.z); + + if (ENHOLL_H_Y_MIN < relPlayerPos.y && relPlayerPos.y < ENHOLL_H_Y_MAX && + fabsf(relPlayerPos.x) < ENHOLL_H_HALFWIDTH && orthogonalDistToPlayer < ENHOLL_H_SWITCHFLAG_BGCOVER_DEPTH) { + + this->resetBgCoverAlpha = true; + transitionActorIndex = GET_TRANSITION_ACTOR_INDEX(&this->actor); + + play->bgCoverAlpha = + 255 - (s32)((orthogonalDistToPlayer - ENHOLL_H_SWITCHFLAG_LOAD_DEPTH) * + (255 / (ENHOLL_H_SWITCHFLAG_BGCOVER_DEPTH - ENHOLL_H_SWITCHFLAG_LOAD_DEPTH) + 0.8f)); + if (play->bgCoverAlpha > 255) { + play->bgCoverAlpha = 255; + } else if (play->bgCoverAlpha < 0) { + play->bgCoverAlpha = 0; + } + + if (orthogonalDistToPlayer < ENHOLL_H_SWITCHFLAG_LOAD_DEPTH) { + side = (relPlayerPos.z < 0.0f) ? 0 : 1; + this->actor.room = play->transiActorCtx.list[transitionActorIndex].sides[side].room; + if (this->actor.room != play->roomCtx.curRoom.num && + func_8009728C(play, &play->roomCtx, this->actor.room)) { + EnHoll_SetupAction(this, EnHoll_WaitRoomLoaded); + } + } + } else { + if (this->resetBgCoverAlpha) { + play->bgCoverAlpha = 0; + this->resetBgCoverAlpha = false; + } + } + } +} + +void EnHoll_WaitRoomLoaded(EnHoll* this, PlayState* play) { if (!EnHoll_IsKokiriLayer8() && play->roomCtx.status == 0) { func_80097534(play, &play->roomCtx); - if (play->unk_11E18 == 0) { - this->unk_14F = 0; + if (play->bgCoverAlpha == 0) { + this->resetBgCoverAlpha = false; } EnHoll_ChooseAction(this); } @@ -324,7 +415,7 @@ void EnHoll_Update(Actor* thisx, PlayState* play) { void EnHoll_Draw(Actor* thisx, PlayState* play) { EnHoll* this = (EnHoll*)thisx; Gfx* gfxP; - u32 setupDlIdx; + u32 setupDLIndex; // Only draw the plane if not invisible if (this->planeAlpha != 0) { @@ -332,12 +423,12 @@ void EnHoll_Draw(Actor* thisx, PlayState* play) { if (this->planeAlpha == 255) { gfxP = POLY_OPA_DISP; - setupDlIdx = SETUPDL_37; + setupDLIndex = SETUPDL_37; } else { gfxP = POLY_XLU_DISP; - setupDlIdx = SETUPDL_0; + setupDLIndex = SETUPDL_0; } - gfxP = Gfx_SetupDL(gfxP, setupDlIdx); + gfxP = Gfx_SetupDL(gfxP, setupDLIndex); if (this->side == 0) { Matrix_RotateY(M_PI, MTXMODE_APPLY); } diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.h b/src/overlays/actors/ovl_En_Holl/z_en_holl.h index 452de700a0..cbc4ddb39e 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.h +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.h @@ -4,6 +4,35 @@ #include "ultra64.h" #include "global.h" +#define ENHOLL_GET_TYPE(thisx) (((thisx)->params >> 6) & 7) +#define ENHOLL_GET_SWITCH_FLAG(thisx) ((thisx)->params & 0x3F) + +/** + * Two kinds of holls: + * Horizontal (H): + * For the player to move horizontally between rooms. + * Cuboid-shaped: + * - height: 200 units high plus 50 units into the ground + * - width: 400 units wide or, if narrow, 200 units wide + * Vertical (V): + * For the player to move vertically between rooms. + * Cylinder-shaped, radius of 120 units. + * + * Three kinds of visual effects: + * Visible: A plane is drawn at the holl location, and fades away as the player approaches. + * Bg Cover: The background geometry (e.g. room geometry but not actors) fades black as the player approaches. + * Invisible: Approaching the holl does not cause any particular visual effect. + */ +typedef enum { + /* 0 */ ENHOLL_H_VISIBLE_NARROW, + /* 1 */ ENHOLL_V_DOWN_BGCOVER_LARGE, // Only allows downwards transitions. 500 units radius. Used in fire temple drops. + /* 2 */ ENHOLL_V_INVISIBLE, + /* 3 */ ENHOLL_H_BGCOVER_SWITCHFLAG, // Enabled if a switch flag is set. Used in Dampe's race. + /* 4 */ ENHOLL_H_INVISIBLE, + /* 5 */ ENHOLL_V_BGCOVER, + /* 6 */ ENHOLL_H_INVISIBLE_NARROW +} EnHollType; + struct EnHoll; typedef void (*EnHollActionFunc)(struct EnHoll*, PlayState*); @@ -12,7 +41,7 @@ typedef struct EnHoll { /* 0x0000 */ Actor actor; /* 0x014C */ s16 planeAlpha; /* 0x014E */ u8 side; - /* 0x014F */ u8 unk_14F; + /* 0x014F */ u8 resetBgCoverAlpha; /* 0x0150 */ EnHollActionFunc actionFunc; } EnHoll; // size = 0x0154 diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c index f476612c3f..2f16239d83 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c @@ -415,12 +415,12 @@ void EnHonotrap_FlameChase(EnHonotrap* this, PlayState* play) { Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x300); Math_StepToF(&this->actor.speed, 3.0f, 0.1f); this->actor.gravity = (-this->actor.yDistToPlayer < 10.0f) ? 0.08f : -0.08f; - func_8002D868(&this->actor); + Actor_UpdateVelocityXZGravity(&this->actor); if (this->actor.velocity.y > 1.0f) { this->actor.velocity.y = 1.0f; } this->actor.velocity.y *= 0.95f; - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 7.0f, 10.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); @@ -451,7 +451,7 @@ void EnHonotrap_FlameVanish(EnHonotrap* this, PlayState* play) { s32 ready = Math_StepToF(&this->actor.scale.x, 0.0001f, 0.00015f); this->actor.scale.z = this->actor.scale.y = this->actor.scale.x; - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 7.0f, 10.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index dc4adbb1f0..97b802c8b7 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -1001,7 +1001,7 @@ void EnHorse_UpdateSpeed(EnHorse* this, PlayState* play, f32 brakeDecel, f32 bra EnHorse_StickDirection(&this->curStick, &stickMag, &stickAngle); if (Math_CosS(stickAngle) <= brakeAngle) { this->actor.speed -= brakeDecel; - this->actor.speed = this->actor.speed < 0.0f ? 0.0f : this->actor.speed; + this->actor.speed = CLAMP_MIN(this->actor.speed, 0.0f); return; } @@ -3523,7 +3523,7 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) { if (this->playerControlled == true) { EnHorse_RegenBoost(this, play); } - Actor_MoveForward(thisx); + Actor_MoveXZGravity(thisx); if (this->action == ENHORSE_ACT_INGO_RACE) { if (this->rider != NULL) { this->rider->world.pos.x = thisx->world.pos.x; diff --git a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c index c2081c33a7..751fe90d33 100644 --- a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c +++ b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c @@ -287,7 +287,7 @@ void EnHorseGanon_Update(Actor* thisx, PlayState* play) { s32 pad; sActionFuncs[this->action](this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 55.0f, 100.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c index 667069b310..fe92bd10be 100644 --- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c +++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c @@ -554,7 +554,7 @@ void EnHorseLinkChild_Update(Actor* thisx, PlayState* play) { s32 pad; sActionFuncs[this->action](this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 55.0f, 100.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c index f5316d1c85..5629d60592 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c @@ -579,7 +579,7 @@ void EnHorseNormal_Update(Actor* thisx, PlayState* play) { s32 pad; sActionFuncs[this->action](this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 35.0f, 100.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c index e45645f1e7..a6b3672fac 100644 --- a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c +++ b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c @@ -234,7 +234,7 @@ void EnHorseZelda_Update(Actor* thisx, PlayState* play) { sActionFuncs[this->action](this, play); this->actor.speed = 0.0f; - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 55.0f, 100.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/src/overlays/actors/ovl_En_Hs/z_en_hs.c index 1ff786b887..039d0c3144 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -232,7 +232,7 @@ void EnHs_Update(Actor* thisx, PlayState* play) { Collider_UpdateCylinder(thisx, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); if (SkelAnime_Update(&this->skelAnime)) { this->skelAnime.curFrame = 0.0f; diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c index b3eb13e29e..5722c8ac7f 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c @@ -111,7 +111,7 @@ void EnHs2_Update(Actor* thisx, PlayState* play) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); if (SkelAnime_Update(&this->skelAnime)) { this->skelAnime.curFrame = 0.0f; diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index cf87f88c91..d89a7f83c1 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -1087,7 +1087,7 @@ void EnHy_Update(Actor* thisx, PlayState* play) { EnHy_UpdateEyes(this); if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); diff --git a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c index 479a9c6f3c..8a2323df97 100644 --- a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c +++ b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c @@ -245,7 +245,7 @@ void EnIceHono_DropFlame(EnIceHono* this, PlayState* play) { } EnIceHono_SetupActionSpreadFlames(this); } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, this->actor.scale.x * 3500.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); @@ -274,7 +274,7 @@ void EnIceHono_SpreadFlames(EnIceHono* this, PlayState* play) { Math_StepToF(&this->actor.scale.y, 0.0001f, 0.00015f); } this->actor.scale.z = this->actor.scale.x; - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, this->actor.scale.x * 3500.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); if (this->timer < 25) { this->alpha -= 10; @@ -324,7 +324,7 @@ void EnIceHono_SmallFlameMove(EnIceHono* this, PlayState* play) { } this->actor.scale.z = this->actor.scale.x; Math_StepToF(&this->actor.speed, 0, 0.06f); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); if (this->timer < 25) { diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 40265cb6dc..e1e9d5822c 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -832,7 +832,7 @@ void EnIk_UpdateEnemy(Actor* thisx, PlayState* play) { } } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 30.0f, 30.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/src/overlays/actors/ovl_En_Insect/z_en_insect.c index e64b6ea5a4..079f61aac5 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -736,7 +736,7 @@ void EnInsect_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (this->actor.update != NULL) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (this->insectFlags & INSECT_FLAG_CRAWLING) { if (this->insectFlags & INSECT_FLAG_0) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index e61841015e..11034206eb 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -395,7 +395,7 @@ void EnIshi_LiftedUp(EnIshi* this, PlayState* play) { EnIshi_SetupFly(this); EnIshi_Fall(this); func_80A7ED94(&this->actor.velocity, D_80A7FA28[this->actor.params & 1]); - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 7.5f, 35.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_6 | UPDBGCHECKINFO_FLAG_7); @@ -464,7 +464,7 @@ void EnIshi_Fly(EnIshi* this, PlayState* play) { Math_StepToF(&this->actor.shape.yOffset, 0.0f, 2.0f); EnIshi_Fall(this); func_80A7ED94(&this->actor.velocity, D_80A7FA28[type]); - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); this->actor.shape.rot.x += sRotSpeedX; this->actor.shape.rot.y += sRotSpeedY; Actor_UpdateBgCheckInfo(play, &this->actor, 7.5f, 35.0f, 0.0f, diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.c b/src/overlays/actors/ovl_En_Js/z_en_js.c index ecbf0d1f50..89b53e6127 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -170,7 +170,7 @@ void EnJs_Update(Actor* thisx, PlayState* play) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index 662354825d..7a53f61da5 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -328,7 +328,7 @@ void EnKakasi_Update(Actor* thisx, PlayState* play) { this->height = 60.0f; Actor_SetFocus(&this->actor, this->height); this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 50.0f, 100.0f, UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); Collider_UpdateCylinder(&this->actor, &this->collider); diff --git a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index 599f136289..9d0aafc853 100644 --- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -206,7 +206,7 @@ void EnKakasi2_Update(Actor* thisx, PlayState* play2) { this->actor.world.rot = this->actor.shape.rot; Actor_SetFocus(&this->actor, this->height); this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (this->actor.shape.yOffset == 0.0f) { Collider_UpdateCylinder(&this->actor, &this->collider); diff --git a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c index f0fa532501..8fb346226c 100644 --- a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c +++ b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c @@ -424,7 +424,7 @@ void EnKakasi3_Update(Actor* thisx, PlayState* play) { Actor_SetFocus(&this->actor, 60.0f); this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 50.0f, 100.0f, UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); Collider_UpdateCylinder(&this->actor, &this->collider); diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index bce598d761..e79e6257a7 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -439,7 +439,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) { f32 tempYDistToWater; u8 onGround; - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 30.0f, 50.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); @@ -613,7 +613,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = 0.0f; } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (this->actor.speed != 0.0f) { Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 50.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index fce756a889..a16d5335d8 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -415,7 +415,7 @@ void EnKarebaba_Update(Actor* thisx, PlayState* play) { if (this->actionFunc != EnKarebaba_Dead) { if (this->actionFunc == EnKarebaba_Dying) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 15.0f, 10.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); } else { 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 379348e4f5..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; @@ -1279,7 +1279,7 @@ void EnKo_Update(Actor* thisx, PlayState* play) { } } if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } if (func_80A97C7C(this)) { Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index 09bf634cce..48d8cefdc7 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -353,7 +353,7 @@ void EnKusa_LiftedUp(EnKusa* this, PlayState* play) { this->actor.gravity = -0.1f; EnKusa_UpdateVelY(this); EnKusa_RandScaleVecToZero(&this->actor.velocity, 0.005f); - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 7.5f, 35.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_6 | UPDBGCHECKINFO_FLAG_7); @@ -415,7 +415,7 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) { this->actor.shape.rot.x += rotSpeedX; this->actor.shape.rot.y += rotSpeedY; EnKusa_RandScaleVecToZero(&this->actor.velocity, 0.05f); - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 7.5f, 35.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_6 | UPDBGCHECKINFO_FLAG_7); diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c index e614fb3fd0..f330c77f7f 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -466,7 +466,7 @@ void EnKz_Update(Actor* thisx, PlayState* play) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); SkelAnime_Update(&this->skelanime); EnKz_UpdateEyes(this); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (this->actionFunc != EnKz_StartTimer) { func_80A9CB18(this, play); } diff --git a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c index a9fc41085d..cd35e37872 100644 --- a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c +++ b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c @@ -101,7 +101,7 @@ void EnLightbox_Update(Actor* thisx, PlayState* play) { } } } - Actor_MoveForward(thisx); + Actor_MoveXZGravity(thisx); Actor_UpdateBgCheckInfo( play, thisx, thisx->colChkInfo.cylHeight, thisx->colChkInfo.cylRadius, thisx->colChkInfo.cylRadius, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/src/overlays/actors/ovl_En_Mb/z_en_mb.c index fab8b380ef..249696eaad 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -1421,7 +1421,7 @@ void EnMb_Update(Actor* thisx, PlayState* play) { EnMb_CheckColliding(this, play); if (thisx->colChkInfo.damageEffect != ENMB_DMGEFF_FREEZE) { this->actionFunc(this, play); - Actor_MoveForward(thisx); + Actor_MoveXZGravity(thisx); Actor_UpdateBgCheckInfo(play, thisx, 40.0f, 40.0f, 70.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); 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 dc9dd72996..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; @@ -828,7 +828,7 @@ void EnMd_Update(Actor* thisx, PlayState* play) { SkelAnime_Update(&this->skelAnime); EnMd_UpdateEyes(this); func_80AAB5A4(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); func_80AAB158(this, play); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/src/overlays/actors/ovl_En_Mk/z_en_mk.c index ae9e4b380b..d2fcb5dc7e 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -288,7 +288,7 @@ void EnMk_Update(Actor* thisx, PlayState* play) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); if (!(this->flags & 2) && SkelAnime_Update(&this->skelAnime)) { diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index ca7e506e0c..dce416a985 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -388,7 +388,7 @@ s32 func_80AADEF0(EnMm* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->yawToWaypoint, 1, 2500, 0); this->actor.world.rot.y = this->actor.shape.rot.y; Math_SmoothStepToF(&this->actor.speed, this->speedXZ, 0.6f, this->distToWaypoint, 0.0f); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); return 0; @@ -526,9 +526,10 @@ void EnMm_Draw(Actor* thisx, PlayState* play) { if (GET_ITEMGETINF(ITEMGETINF_3B)) { s32 linkChildObjBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_LINK_CHILD); + // Draw Bunny Hood if (linkChildObjBankIndex >= 0) { Mtx* mtx; - Vec3s sp50; + Vec3s earRot; Mtx* mtx2; mtx = Graph_Alloc(play->state.gfxCtx, sizeof(Mtx) * 2); @@ -540,18 +541,20 @@ void EnMm_Draw(Actor* thisx, PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x0B, mtx); gSPSegment(POLY_OPA_DISP++, 0x0D, mtx2 - 7); - sp50.x = 994; - sp50.y = 3518; - sp50.z = -13450; + // Draw the ears in the neutral position (unlike Player, no flopping physics) - Matrix_SetTranslateRotateYXZ(97.0f, -1203.0f, -240.0f, &sp50); + // Right ear + earRot.x = 0x3E2; + earRot.y = 0xDBE; + earRot.z = -0x348A; + Matrix_SetTranslateRotateYXZ(97.0f, -1203.0f, -240.0f, &earRot); Matrix_ToMtx(mtx++, "../z_en_mm.c", 1124); - sp50.x = -994; - sp50.y = -3518; - sp50.z = -13450; - - Matrix_SetTranslateRotateYXZ(97.0f, -1203.0f, 240.0f, &sp50); + // Left ear + earRot.x = -0x3E2; + earRot.y = -0xDBE; + earRot.z = -0x348A; + Matrix_SetTranslateRotateYXZ(97.0f, -1203.0f, 240.0f, &earRot); Matrix_ToMtx(mtx, "../z_en_mm.c", 1131); gSPDisplayList(POLY_OPA_DISP++, gLinkChildBunnyHoodDL); diff --git a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c index e1cf27a324..be1f73d527 100644 --- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c +++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c @@ -303,7 +303,7 @@ void EnMm2_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); } diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/src/overlays/actors/ovl_En_Ms/z_en_ms.c index 7e9eca5bc3..6c36870ebf 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -170,7 +170,7 @@ void EnMs_Update(Actor* thisx, PlayState* play) { if (gSaveContext.entranceIndex == ENTR_LON_LON_RANCH_0 && gSaveContext.sceneLayer == 8) { // ride carpet if in credits - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); osSyncPrintf("OOOHHHHHH %f\n", this->actor.velocity.y); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); } diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c index 7598a0b818..6060ba30c2 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -972,7 +972,7 @@ void EnNiw_Update(Actor* thisx, PlayState* play) { thisx->shape.shadowScale = 15.0f; this->actionFunc(this, play); Actor_SetFocus(&this->actor, this->unk_304); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (this->actionFunc != func_80AB6EB4 && this->actionFunc != func_80AB6450 && play->sceneId != SCENE_ZORAS_RIVER) { Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 60.0f, diff --git a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c index 1d94c56639..85b6bd1bc1 100644 --- a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c +++ b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c @@ -221,7 +221,7 @@ void EnNiwGirl_Update(Actor* thisx, PlayState* play) { this->jumpTimer--; } this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 100.0f, 100.0f, 200.0f, UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); Collider_UpdateCylinder(&this->actor, &this->collider); diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index 73cc948ae7..5f553dd558 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -151,7 +151,7 @@ void EnNutsball_Update(Actor* thisx, PlayState* play) { (this->actionFunc == func_80ABBB34)) { this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 10, sCylinderInit.dim.radius, sCylinderInit.dim.height, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); Collider_UpdateCylinder(&this->actor, &this->collider); diff --git a/src/overlays/actors/ovl_En_Ny/z_en_ny.c b/src/overlays/actors/ovl_En_Ny/z_en_ny.c index dc1c52686f..4f4ae38d6d 100644 --- a/src/overlays/actors/ovl_En_Ny/z_en_ny.c +++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.c @@ -381,7 +381,7 @@ void EnNy_Update(Actor* thisx, PlayState* play) { temp_f22 = (24.0f * temp_f20) + 12.0f; this->actor.shape.rot.x += (s16)(this->unk_1E8 * 1000.0f); func_80ABD3B8(this, temp_f22 + 10.0f, temp_f22 - 10.0f); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Math_StepToF(&this->unk_1E4, this->unk_1E8, 0.1f); this->actionFunc(this, play); this->actor.prevPos.y -= temp_f22; @@ -512,7 +512,7 @@ void EnNy_UpdateUnused(Actor* thisx, PlayState* play2) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Math_StepToF(&this->unk_1E4, this->unk_1E8, 0.1f); } static Vec3f sFireOffsets[] = { diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 6c54384518..f413403d7e 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -600,7 +600,7 @@ void EnOkuta_Update(Actor* thisx, PlayState* play2) { this->actor.scale.y * 100.0f); } else { canRestorePrevPos = false; - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Math_Vec3f_Copy(&prevPos, &this->actor.world.pos); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 15.0f, 30.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 274164c669..4a8b1c40c7 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -2210,7 +2210,7 @@ void EnOssan_MainActionFunc(EnOssan* this, PlayState* play) { sStateFunc[this->stateFlag](this, play, player); } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 26.0f, 10.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); Actor_SetFocus(&this->actor, 90.0f); Actor_SetScale(&this->actor, sShopkeeperScale[this->actor.params]); diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index 3843558f32..d53918d3a7 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -1100,7 +1100,7 @@ void EnOwl_Update(Actor* thisx, PlayState* play) { } if (this->actor.draw != NULL) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } if (this->actionFlags & 2) { diff --git a/src/overlays/actors/ovl_En_Part/z_en_part.c b/src/overlays/actors/ovl_En_Part/z_en_part.c index 2c8098446a..e22c4ff548 100644 --- a/src/overlays/actors/ovl_En_Part/z_en_part.c +++ b/src/overlays/actors/ovl_En_Part/z_en_part.c @@ -247,7 +247,7 @@ void EnPart_Update(Actor* thisx, PlayState* play) { EnPart* this = (EnPart*)thisx; - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if ((this->actor.params > 4 && this->actor.params < 9) || this->actor.params < 0) { Actor_UpdateBgCheckInfo(play, &this->actor, 5.0f, 15.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index ea1c502d9d..1f5ecc67b7 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -926,7 +926,7 @@ void EnPeehat_Update(Actor* thisx, PlayState* play) { } if (thisx->colChkInfo.damageEffect != PEAHAT_DMG_EFF_LIGHT_ICE_ARROW) { if (thisx->speed != 0.0f || thisx->velocity.y != 0.0f) { - Actor_MoveForward(thisx); + Actor_MoveXZGravity(thisx); Actor_UpdateBgCheckInfo(play, thisx, 25.0f, 30.0f, 30.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); } diff --git a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c index 10a2748cb6..4814107b9a 100644 --- a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c +++ b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c @@ -190,7 +190,7 @@ void EnPoDesert_Update(Actor* thisx, PlayState* play) { SkelAnime_Update(&this->skelAnime); this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); EnPoDesert_UpdateSpeedModifier(this); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 27.0f, 60.0f, UPDBGCHECKINFO_FLAG_2); Actor_SetFocus(&this->actor, 42.0f); diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index 3c6487867c..81d4364f42 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -608,7 +608,7 @@ void EnPoField_SoulIdle(EnPoField* this, PlayState* play) { } else if (this->actionTimer == 0) { EnPoField_SetupWaitForSpawn(this, play); } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 10.0f, UPDBGCHECKINFO_FLAG_2); } @@ -854,7 +854,7 @@ void EnPoField_Update(Actor* thisx, PlayState* play) { EnPoField_UpdateFlame(this, play); if (this->actionFunc == EnPoField_Flee || this->actionFunc == EnPoField_Damage || this->actionFunc == EnPoField_Appear) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } if (this->actionFunc != EnPoField_WaitForSpawn) { Actor_SetFocus(&this->actor, 42.0f); diff --git a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c index 1b11926bd9..93d6fb5206 100644 --- a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c +++ b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c @@ -351,7 +351,7 @@ void EnPoRelay_Update(Actor* thisx, PlayState* play) { SkelAnime_Update(&this->skelAnime); this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); EnPoRelay_CorrectY(this); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 27.0f, 60.0f, UPDBGCHECKINFO_FLAG_2); Collider_UpdateCylinder(&this->actor, &this->collider); diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index e607d17f90..2dbafa51df 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -1189,7 +1189,7 @@ void EnPoSisters_Update(Actor* thisx, PlayState* play) { if (this->unk_199 & 8) { func_80ADA35C(this, play); } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (this->unk_199 & 0x10) { Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 0.0f, diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/src/overlays/actors/ovl_En_Poh/z_en_poh.c index 52c6b25db9..62f3b6835c 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -726,7 +726,7 @@ void EnPoh_Death(EnPoh* this, PlayState* play) { Actor_Kill(&this->actor); return; } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 10.0f, UPDBGCHECKINFO_FLAG_2); } @@ -994,7 +994,7 @@ void EnPoh_UpdateLiving(Actor* thisx, PlayState* play) { func_80AE032C(this, play); EnPoh_UpdateVisibility(this); this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (this->actionFunc == EnPoh_Attack && this->unk_198 < 10) { this->actor.flags |= ACTOR_FLAG_24; CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderSph.base); diff --git a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c index c057e36adc..d82814bd59 100644 --- a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c +++ b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c @@ -78,7 +78,7 @@ void EnPubox_Update(Actor* thisx, PlayState* play) { } this->dyna.unk_154 = 0.0f; this->dyna.unk_150 = 0.0f; - Actor_MoveForward(thisx); + Actor_MoveXZGravity(thisx); Actor_UpdateBgCheckInfo( play, thisx, thisx->colChkInfo.cylHeight, thisx->colChkInfo.cylRadius, thisx->colChkInfo.cylRadius, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 77559e0ced..e5e09ce0fa 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -858,7 +858,7 @@ void EnRd_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (this->action != REDEAD_ACTION_GRAB && this->actor.speed != 0.0f) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } if ((this->actor.shape.rot.x == 0) && (this->action != REDEAD_ACTION_GRAB) && (this->actor.speed != 0.0f)) { diff --git a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c index a35075a784..565c291d47 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -178,12 +178,13 @@ void EnReeba_Destroy(Actor* thisx, PlayState* play) { void EnReeba_SetupSurface(EnReeba* this, PlayState* play) { f32 frames = Animation_GetLastFrame(&object_reeba_Anim_0001E4); Player* player = GET_PLAYER(play); - s16 playerSpeed; + s16 absPlayerSpeedXZ; Animation_Change(&this->skelanime, &object_reeba_Anim_0001E4, 2.0f, 0.0f, frames, ANIMMODE_LOOP, -10.0f); - playerSpeed = fabsf(player->linearVelocity); - this->waitTimer = 20 - playerSpeed * 2; + absPlayerSpeedXZ = fabsf(player->speedXZ); + this->waitTimer = 20 - absPlayerSpeedXZ * 2; + if (this->waitTimer < 0) { this->waitTimer = 2; } @@ -205,7 +206,7 @@ void EnReeba_SetupSurface(EnReeba* this, PlayState* play) { void EnReeba_Surface(EnReeba* this, PlayState* play) { Player* player = GET_PLAYER(play); - f32 playerLinearVel; + f32 playerSpeedXZ; SkelAnime_Update(&this->skelanime); @@ -222,23 +223,23 @@ void EnReeba_Surface(EnReeba* this, PlayState* play) { } else { this->yOffsetStep = 0.0f; this->actor.shape.yOffset = 0.0f; - playerLinearVel = player->linearVelocity; + playerSpeedXZ = player->speedXZ; switch (this->aimType) { case 0: this->actor.world.rot.y = this->actor.yawTowardsPlayer; break; case 1: - this->actor.world.rot.y = this->actor.yawTowardsPlayer + (800.0f * playerLinearVel); + this->actor.world.rot.y = this->actor.yawTowardsPlayer + (800.0f * playerSpeedXZ); break; case 2: case 3: this->actor.world.rot.y = this->actor.yawTowardsPlayer + - (player->actor.shape.rot.y - this->actor.yawTowardsPlayer) * (playerLinearVel * 0.15f); + (player->actor.shape.rot.y - this->actor.yawTowardsPlayer) * (playerSpeedXZ * 0.15f); break; case 4: - this->actor.world.rot.y = this->actor.yawTowardsPlayer - (800.0f * playerLinearVel); + this->actor.world.rot.y = this->actor.yawTowardsPlayer - (800.0f * playerSpeedXZ); break; } @@ -626,7 +627,7 @@ void EnReeba_Update(Actor* thisx, PlayState* play2) { this->damagedTimer--; } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 35.0f, 60.0f, 60.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index 668765ff09..bba861737d 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -797,7 +797,7 @@ void EnRr_Update(Actor* thisx, PlayState* play) { } Math_StepToF(&this->actor.speed, 0.0f, 0.1f); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Collider_UpdateCylinder(&this->actor, &this->collider1); this->collider2.dim.pos.x = this->mouthPos.x; this->collider2.dim.pos.y = this->mouthPos.y; diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 60b8342ee3..1e9ccb6042 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -791,12 +791,12 @@ void func_80AEC40C(EnRu1* this) { this->actor.speed = (kREG(3) * 0.01f) + 2.7f; } this->actor.velocity.y = -1.0f; - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } void func_80AEC4CC(EnRu1* this) { this->actor.velocity.y = -1.0f; - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } void func_80AEC4F4(EnRu1* this) { @@ -811,7 +811,7 @@ void func_80AEC4F4(EnRu1* this) { *speedXZ = 0.0f; this->actor.velocity.y = -((kREG(4) * 0.01f) + 13.0f); } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } s32 func_80AEC5FC(EnRu1* this, PlayState* play) { @@ -859,7 +859,7 @@ void func_80AEC780(EnRu1* this, PlayState* play) { play->csCtx.script = D_80AF0880; gSaveContext.cutsceneTrigger = 1; - player->linearVelocity = 0.0f; + player->speedXZ = 0.0f; this->action = 8; } } @@ -1426,7 +1426,7 @@ void func_80AEDEF4(EnRu1* this, PlayState* play) { void func_80AEDFF4(EnRu1* this, PlayState* play) { func_80AEDB30(this, play); func_80AEDEF4(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } void func_80AEE02C(EnRu1* this) { @@ -1466,7 +1466,7 @@ void func_80AEE050(EnRu1* this) { } this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speed; this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speed; - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); } } else { if (this->unk_350 == 1) { @@ -1731,7 +1731,7 @@ void func_80AEECF0(EnRu1* this, PlayState* play) { void func_80AEED58(EnRu1* this, PlayState* play) { func_80AED83C(this); func_80AEAECC(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); func_80AEEAC8(this, play); diff --git a/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/src/overlays/actors/ovl_En_Sa/z_en_sa.c index 8c9e3183f0..0cd87facf6 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -750,7 +750,7 @@ void EnSa_Update(Actor* thisx, PlayState* play) { this->actor.world.pos.y += this->actor.velocity.y; this->actor.world.pos.z += this->actor.velocity.z; } else { - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); } if (play->sceneId != SCENE_SACRED_FOREST_MEADOW) { diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index 0ab42f9180..10831f79de 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -461,7 +461,7 @@ void EnSb_Update(Actor* thisx, PlayState* play) { } else { Actor_SetFocus(&this->actor, 20.0f); Actor_SetScale(&this->actor, 0.006f); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); this->actionFunc(this, play); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 20.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); EnSb_UpdateDamage(this, play); diff --git a/src/overlays/actors/ovl_En_Si/z_en_si.c b/src/overlays/actors/ovl_En_Si/z_en_si.c index 5638706f89..f16f8f25d3 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -136,7 +136,7 @@ void func_80AFB950(EnSi* this, PlayState* play) { void EnSi_Update(Actor* thisx, PlayState* play) { EnSi* this = (EnSi*)thisx; - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); this->actionFunc(this, play); Actor_SetFocus(&this->actor, 16.0f); diff --git a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c index 4a018e28e4..ce2d541502 100644 --- a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c +++ b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c @@ -153,12 +153,12 @@ void func_80AFBE8C(EnSiofuki* this, PlayState* play) { speedScale = dist2d / (this->dyna.actor.scale.x * 40.0f * 10.0f); speedScale = CLAMP_MIN(speedScale, 0.0f); speedScale = CLAMP_MAX(speedScale, 1.0f); - player->linearVelocity *= speedScale; + player->speedXZ *= speedScale; Math_ApproachF(&this->targetAppliedSpeed, 3.0f, 1.0f, 1.0f); Math_ApproachF(&this->appliedSpeed, this->targetAppliedSpeed, 1.0f, 0.3f * speedScale); } else { this->appliedYaw = player->actor.world.rot.y; - player->linearVelocity /= 2.0f; + player->speedXZ /= 2.0f; Math_ApproachF(&this->targetAppliedSpeed, 3.0f, 1.0f, 1.0f); Math_ApproachF(&this->appliedSpeed, this->targetAppliedSpeed, 1.0f, 0.1f); } @@ -168,8 +168,8 @@ void func_80AFBE8C(EnSiofuki* this, PlayState* play) { } } else { if (this->applySpeed) { - player->linearVelocity = this->appliedSpeed + player->linearVelocity; - player->currentYaw = this->appliedYaw; + player->speedXZ = this->appliedSpeed + player->speedXZ; + player->yaw = this->appliedYaw; } this->targetAppliedSpeed = 0.0f; diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index 9d88348012..89b99aace2 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -511,7 +511,7 @@ void EnSkb_Update(Actor* thisx, PlayState* play) { s32 pad; EnSkb_CheckDamage(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 15.0f, 30.0f, 60.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/src/overlays/actors/ovl_En_Skj/z_en_skj.c index 5d68dd93ed..718436a8d0 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -992,7 +992,7 @@ void EnSkj_WaitForSong(EnSkj* this, PlayState* play) { player->stateFlags2 |= PLAYER_STATE2_23; } else { if (play->msgCtx.ocarinaMode >= OCARINA_MODE_05) { - gSaveContext.sunsSongState = 0; + gSaveContext.sunsSongState = SUNSSONG_INACTIVE; if (GET_ITEMGETINF(ITEMGETINF_16)) { play->msgCtx.ocarinaMode = OCARINA_MODE_04; player->unk_6A8 = &this->actor; @@ -1336,7 +1336,7 @@ void EnSkj_Update(Actor* thisx, PlayState* play) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); SkelAnime_Update(&this->skelAnime); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 20.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_2); } @@ -1356,7 +1356,7 @@ void EnSkj_SariasSongShortStumpUpdate(Actor* thisx, PlayState* play) { void EnSkj_TurnPlayer(EnSkj* this, Player* player) { Math_SmoothStepToS(&player->actor.shape.rot.y, this->actor.world.rot.y, 5, 2000, 0); player->actor.world.rot.y = player->actor.shape.rot.y; - player->currentYaw = player->actor.shape.rot.y; + player->yaw = player->actor.shape.rot.y; } void EnSkj_SetupWaitForOcarina(EnSkj* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c index 02e70a2843..58cb7ba249 100644 --- a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c +++ b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c @@ -92,7 +92,7 @@ void EnSkjneedle_Update(Actor* thisx, PlayState* play2) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 20.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_2); } diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c index 088425b46c..13fdc956a3 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -816,7 +816,7 @@ void EnSsh_Update(Actor* thisx, PlayState* play) { EnSsh_Damaged(this); } else { SkelAnime_Update(&this->skelAnime); - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); this->actionFunc(this, play); } diff --git a/src/overlays/actors/ovl_En_St/z_en_st.c b/src/overlays/actors/ovl_En_St/z_en_st.c index e3a2a828f7..e44f46f0dd 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -941,7 +941,7 @@ void EnSt_ReturnToCeiling(EnSt* this, PlayState* play) { */ void EnSt_BounceAround(EnSt* this, PlayState* play) { this->actor.colorFilterTimer = this->deathTimer; - func_8002D868(&this->actor); + Actor_UpdateVelocityXZGravity(&this->actor); this->actor.world.rot.x += 0x800; this->actor.world.rot.z -= 0x800; this->actor.shape.rot = this->actor.world.rot; @@ -979,7 +979,7 @@ void EnSt_FinishBouncing(EnSt* this, PlayState* play) { this->actor.shape.rot = this->actor.world.rot; - func_8002D868(&this->actor); + Actor_UpdateVelocityXZGravity(&this->actor); this->groundBounces = 2; EnSt_IsDoneBouncing(this, play); } @@ -1023,7 +1023,7 @@ void EnSt_Update(Actor* thisx, PlayState* play) { } if (this->swayTimer == 0 && this->stunTimer == 0) { - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); } Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c index c84643eec4..74d5a34fe2 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -317,7 +317,7 @@ void EnSth_Update2(Actor* thisx, PlayState* play) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); if (SkelAnime_Update(&this->skelAnime)) { this->skelAnime.curFrame = 0.0f; diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 99404046b8..fabcfb21dc 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -637,7 +637,7 @@ void func_80B0D878(EnSw* this, PlayState* play) { } void func_80B0DB00(EnSw* this, PlayState* play) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); this->actor.shape.rot.x += 0x1000; this->actor.shape.rot.z += 0x1000; Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); diff --git a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c index 5863d8d06e..2546911de3 100644 --- a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c +++ b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c @@ -105,7 +105,7 @@ void EnSyatekiItm_Idle(EnSyatekiItm* this, PlayState* play) { player->actor.world.pos.x = -12.0f; player->actor.world.pos.y = 20.0f; player->actor.world.pos.z = 182.0f; - player->currentYaw = player->actor.world.rot.y = player->actor.shape.rot.y = 0x7F03; + player->yaw = player->actor.world.rot.y = player->actor.shape.rot.y = 0x7F03; player->actor.world.rot.x = player->actor.shape.rot.x = player->actor.world.rot.z = player->actor.shape.rot.z = 0; func_8008EF44(play, 15); diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c index cfa6e410e0..187e051d1c 100644 --- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c +++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c @@ -617,7 +617,7 @@ void EnSyatekiNiw_Update(Actor* thisx, PlayState* play) { this->actor.shape.shadowScale = 15.0f; this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 60.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/src/overlays/actors/ovl_En_Ta/z_en_ta.c index 1f41bcd24e..c29e7f8a70 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -436,7 +436,7 @@ void EnTa_RunWithAccelerationAndSfx(EnTa* this, PlayState* play) { if (this->actor.speed < 6.0f) { this->actor.speed += 0.4f; } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } void EnTa_RunAwayRunOutOfGate(EnTa* this, PlayState* play) { @@ -1232,7 +1232,7 @@ void EnTa_Update(Actor* thisx, PlayState* play) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2); this->animFunc(this); this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c index e840cef3f8..9f6b744379 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -1708,7 +1708,7 @@ void EnTest_Update(Actor* thisx, PlayState* play) { EnTest_UpdateDamage(this, play); if (this->actor.colChkInfo.damageEffect != STALFOS_DMGEFF_FIREMAGIC) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 30.0f, 30.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index b7da6a2b1a..67a1eebc10 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -902,7 +902,7 @@ void EnTite_Update(Actor* thisx, PlayState* play) { // Stay still if hit by immunity damage type this frame if (thisx->colChkInfo.damageEffect != 0xE) { this->actionFunc(this, play); - Actor_MoveForward(thisx); + Actor_MoveXZGravity(thisx); Actor_UpdateBgCheckInfo(play, thisx, 25.0f, 40.0f, 20.0f, this->unk_2DC); // If on water, snap feet to surface and spawn ripples if ((this->actor.params == TEKTITE_BLUE) && (thisx->bgCheckFlags & BGCHECKFLAG_WATER)) { diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index d512cfa09b..4e9e679415 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -661,7 +661,7 @@ void EnTk_Update(Actor* thisx, PlayState* play) { SkelAnime_Update(&this->skelAnime); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 40.0f, 10.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index db79e6f9dd..7623bd8a63 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -153,7 +153,7 @@ s32 EnTorch2_SwingSword(PlayState* play, Input* input, Player* this) { s32 attackDelay = 7; Player* player = GET_PLAYER(play); - if ((this->linearVelocity < 0.0f) || (player->linearVelocity < 0.0f)) { + if ((this->speedXZ < 0.0f) || (player->speedXZ < 0.0f)) { return 0; } if (gSaveContext.health < 0x50) { @@ -368,9 +368,9 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { this->actor.flags &= ~ACTOR_FLAG_0; sSwordJumpTimer = 27; player->meleeWeaponState = 0; - player->linearVelocity = 0.0f; + player->speedXZ = 0.0f; this->invincibilityTimer = -7; - this->linearVelocity = 0.0f; + this->speedXZ = 0.0f; player->skelAnime.curFrame = 2.0f; LinkAnimation_Update(play, &player->skelAnime); sHoldShieldTimer = 0; @@ -630,7 +630,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { */ input->cur.button = 0; input->press.button = 0; - this->linearVelocity = 0.0f; + this->speedXZ = 0.0f; } play->playerUpdate(this, play, input); @@ -639,17 +639,17 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { * Handles sword clanks and removes their recoil for both Links. Dark Link staggers * if he's had to counter with enough different sword animations in a row. */ - if (this->linearVelocity == -18.0f) { + if (this->speedXZ == -18.0f) { staggerThreshold = (u32)Rand_CenteredFloat(2.0f) + 6; if (gSaveContext.health < 0x50) { staggerThreshold = (u32)Rand_CenteredFloat(2.0f) + 3; } if (this->actor.xzDistToPlayer > 80.0f) { - this->linearVelocity = 1.2f; + this->speedXZ = 1.2f; } else if (this->actor.xzDistToPlayer < 70.0f) { - this->linearVelocity = -1.5f; + this->speedXZ = -1.5f; } else { - this->linearVelocity = 1.0f; + this->speedXZ = 1.0f; } if (staggerThreshold < sStaggerCount) { this->skelAnime.playSpeed *= 0.6f; @@ -658,13 +658,13 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { sStaggerCount = 0; } } - if (player->linearVelocity == -18.0f) { + if (player->speedXZ == -18.0f) { if (this->actor.xzDistToPlayer > 80.0f) { - player->linearVelocity = 1.2f; + player->speedXZ = 1.2f; } else if (this->actor.xzDistToPlayer < 70.0f) { - player->linearVelocity = -1.5f; + player->speedXZ = -1.5f; } else { - player->linearVelocity = 1.0f; + player->speedXZ = 1.0f; } } /* diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/src/overlays/actors/ovl_En_Tp/z_en_tp.c index e69c9e3659..f6485bd903 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -355,7 +355,7 @@ void EnTp_Fragment_SetupFade(EnTp* this) { } void EnTp_Fragment_Fade(EnTp* this, PlayState* play) { - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); this->alpha -= 20; if (this->alpha < 20) { @@ -673,7 +673,7 @@ void EnTp_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (this->actor.params <= TAILPASARAN_HEAD) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (this->actionIndex != TAILPASARAN_ACTION_HEAD_BURROWRETURNHOME) { Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 15.0f, 10.0f, diff --git a/src/overlays/actors/ovl_En_Tr/z_en_tr.c b/src/overlays/actors/ovl_En_Tr/z_en_tr.c index f7f84436d8..289288745c 100644 --- a/src/overlays/actors/ovl_En_Tr/z_en_tr.c +++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.c @@ -488,7 +488,7 @@ void func_80B24038(EnTr* this, PlayState* play, s32 cueChannel) { Math_StepToF(&this->actor.velocity.x, endPos.x, 1.0f); Math_StepToF(&this->actor.velocity.y, endPos.y, 1.0f); Math_StepToF(&this->actor.velocity.z, endPos.z, 1.0f); - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); } void EnTr_SetRotFromCue(EnTr* this, PlayState* play, s32 cueChannel) { diff --git a/src/overlays/actors/ovl_En_Trap/z_en_trap.c b/src/overlays/actors/ovl_En_Trap/z_en_trap.c index dc754f5ddc..7074d9b4b1 100644 --- a/src/overlays/actors/ovl_En_Trap/z_en_trap.c +++ b/src/overlays/actors/ovl_En_Trap/z_en_trap.c @@ -372,7 +372,7 @@ void EnTrap_Update(Actor* thisx, PlayState* play) { } } } - Actor_MoveForward(thisx); // Only used by straight line logic + Actor_MoveXZGravity(thisx); // Only used by straight line logic // Adjust position using bgcheck, but do not adjust x, z position if in straight line mode: if (thisx->params & SPIKETRAP_MODE_LINEAR) { posTemp = thisx->world.pos; diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index b9beb83c2d..40b040f8d9 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -274,7 +274,7 @@ void EnTuboTrap_Update(Actor* thisx, PlayState* play) { s32 pad; this->actionFunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 20.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c index a650277bfd..a2c45e93c1 100644 --- a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c +++ b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c @@ -178,7 +178,7 @@ void EnVbBall_Update(Actor* thisx, PlayState* play2) { this->actor.shape.rot.y += (s16)this->yRotVel; this->actor.velocity.y += -1.0f; this->actor.gravity = -1.0f; - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); if (this->actor.params >= 200) { EnVbBall_UpdateBones(this, play); } else { diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c index f1ab2bfc94..6c9d9b7241 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c @@ -275,7 +275,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) { } EnViewer_UpdatePosition(this, play); - Actor_MoveForward(&this->actor); // has no effect, speed/velocity and gravity are 0 + Actor_MoveXZGravity(&this->actor); // has no effect, speed/velocity and gravity are 0 animationEnded = SkelAnime_Update(&this->skin.skelAnime); if (type == ENVIEWER_TYPE_3_GANONDORF || type == ENVIEWER_TYPE_4_HORSE_GANONDORF) { diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/src/overlays/actors/ovl_En_Vm/z_en_vm.c index c04e596f7a..ddaffc376a 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -372,7 +372,7 @@ void EnVm_Die(EnVm* this, PlayState* play) { this->beamRot.x += 0x5DC; this->headRotY += 0x9C4; - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (--this->timer == 0) { bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index bf243dbdb9..34f165c034 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -548,7 +548,7 @@ void EnWallmas_Update(Actor* thisx, PlayState* play) { } if ((this->actionFunc != EnWallmas_ReturnToCeiling) && (this->actionFunc != EnWallmas_TakePlayer)) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } if (this->actionFunc != EnWallmas_Drop) { diff --git a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index 5478885ad2..5feae2ebf1 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -591,9 +591,9 @@ void EnWeiyer_Update(Actor* thisx, PlayState* play) { this->actor.world.rot.x = -this->actor.shape.rot.x; if ((this->actor.world.rot.x == 0) || (this->actionFunc == func_80B333B8)) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } else { - func_8002D97C(&this->actor); + Actor_MoveXYZ(&this->actor); } Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 30.0f, 45.0f, diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index d24334f3fc..4b6257e039 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -1303,7 +1303,7 @@ void EnWf_Update(Actor* thisx, PlayState* play) { EnWf_UpdateDamage(this, play); if (this->actor.colChkInfo.damageEffect != ENWF_DMGEFF_ICE_MAGIC) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 32.0f, 30.0f, 60.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index e57923b523..5f4164e3fe 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -382,7 +382,7 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) { if (this->unk_14C >= -1) { if (((player->rideActor == NULL) && (sqrt(this->actor.xyzDistToPlayerSq) < 20.0) && - (player->linearVelocity != 0.0f)) || + (player->speedXZ != 0.0f)) || ((player->rideActor != NULL) && (sqrt(this->actor.xyzDistToPlayerSq) < 60.0) && (player->rideActor->speed != 0.0f))) { if ((this->unk_14C >= 0) && (this->unk_14C < 0x64)) { @@ -397,7 +397,7 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) { this->unk_14C++; Math_ApproachF(&this->actor.velocity.x, 0.0f, 1.0f, 5 * 0.01f); Math_ApproachF(&this->actor.velocity.z, 0.0f, 1.0f, 5 * 0.01f); - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); this->actor.shape.rot.z = Math_SinS(3000 * this->unk_14C) * 0x4000; this->unk_14E[0]--; diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/src/overlays/actors/ovl_En_Xc/z_en_xc.c index 7397970b63..64757c5040 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -599,11 +599,11 @@ void EnXc_CalcXZAccel(EnXc* this) { *speedXZ = (kREG(2) * 0.01f) + 1.2f; } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } void func_80B3D644(EnXc* this) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } void EnXc_CalcXZSpeed(EnXc* this) { @@ -615,7 +615,7 @@ void EnXc_CalcXZSpeed(EnXc* this) { } else { *speedXZ = 0.0f; } - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } void func_80B3D6F0(EnXc* this) { @@ -623,7 +623,7 @@ void func_80B3D6F0(EnXc* this) { } void func_80B3D710(EnXc* this) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } void func_80B3D730(EnXc* this) { diff --git a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c index eb0d128ce6..525b7eb3b0 100644 --- a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c +++ b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c @@ -128,7 +128,7 @@ void EnYukabyun_Update(Actor* thisx, PlayState* play) { } this->actionfunc(this, play); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (!(this->actionfunc == func_80B43A94 || this->actionfunc == EnYukabyun_Break)) { Actor_UpdateBgCheckInfo(play, &this->actor, 5.0f, 20.0f, 8.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index aa228c82e8..2e5651fbb7 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -2054,7 +2054,7 @@ void EnZf_Update(Actor* thisx, PlayState* play) { } if (!this->unk_3F8) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); } Actor_UpdateBgCheckInfo(play, &this->actor, 25.0f, 30.0f, 60.0f, diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c index 79fd3860aa..6515f2da4b 100644 --- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -326,7 +326,7 @@ s32 EnZl4_SetupFromLegendCs(EnZl4* this, PlayState* play) { playerx->world.pos.x += 56.0f * Math_SinS(rotY); playerx->world.pos.z += 56.0f * Math_CosS(rotY); - player->linearVelocity = playerx->speed = 0.0f; + player->speedXZ = playerx->speed = 0.0f; EnZl4_SetActiveCamMove(play, 5); Letterbox_SetSizeTarget(32); @@ -438,7 +438,7 @@ s32 EnZl4_CsWaitForPlayer(EnZl4* this, PlayState* play) { playerx->world.pos.x += 56.0f * Math_SinS(rotY); playerx->world.pos.z += 56.0f * Math_CosS(rotY); playerx->speed = 0.0f; - player->linearVelocity = 0.0f; + player->speedXZ = 0.0f; return true; } diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index ada158d1dc..cf2f997b06 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -727,7 +727,7 @@ void EnZo_Update(Actor* thisx, PlayState* play) { EnZo_Blink(this); } - Actor_MoveForward(thisx); + Actor_MoveXZGravity(thisx); Actor_UpdateBgCheckInfo(play, thisx, this->collider.dim.radius, this->collider.dim.height * 0.25f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index 165c9deabc..30b4fdb7c8 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -4060,10 +4060,10 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) { Math_ApproachS(&this->unk_16E, spF6, 3, 0xBB8); } - func_8002D908(&this->actor); + Actor_UpdateVelocityXYZ(&this->actor); } - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); this->actor.world.pos.y += (this->unk_184 * 1.5f); diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index 3d3e699641..a59f8f4ec0 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -197,7 +197,7 @@ void ItemEtcetera_SpawnSparkles(ItemEtcetera* this, PlayState* play) { void ItemEtcetera_MoveFireArrowDown(ItemEtcetera* this, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { ItemEtcetera_SpawnSparkles(this, play); } diff --git a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c index 44e3300df5..2cf86a1297 100644 --- a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -79,7 +79,7 @@ void ItemOcarina_Destroy(Actor* thisx, PlayState* play) { void ItemOcarina_Fly(ItemOcarina* this, PlayState* play) { Vec3f ripplePos; - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); this->actor.shape.rot.x += this->spinRotOffset * 2; this->actor.shape.rot.y += this->spinRotOffset * 3; @@ -130,7 +130,7 @@ void ItemOcarina_GetThrown(ItemOcarina* this, PlayState* play) { } void func_80B864EC(ItemOcarina* this, PlayState* play) { - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); this->actor.shape.rot.x += this->spinRotOffset * 2; this->actor.shape.rot.y += this->spinRotOffset * 3; diff --git a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c index deae7eb69f..ba9ddbecd0 100644 --- a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c +++ b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c @@ -97,7 +97,7 @@ void ItemShield_Destroy(Actor* thisx, PlayState* play) { } void func_80B86AC8(ItemShield* this, PlayState* play) { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); if (Actor_HasParent(&this->actor, play)) { Actor_Kill(&this->actor); return; @@ -147,7 +147,7 @@ void func_80B86CA8(ItemShield* this, PlayState* play) { s32 i; s32 temp; - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); this->actor.shape.yOffset = ABS(Math_SinS(this->actor.shape.rot.x)) * 1500.0f; diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index 07da586e12..3bfe6d965c 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -198,7 +198,7 @@ void ObjKibako_Idle(ObjKibako* this, PlayState* play) { ObjKibako_SpawnCollectible(this, play); Actor_Kill(&this->actor); } else { - Actor_MoveForward(&this->actor); + Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 19.0f, 20.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); if (!(this->collider.base.ocFlags1 & OC1_TYPE_PLAYER) && (this->actor.xzDistToPlayer > 28.0f)) { this->collider.base.ocFlags1 |= OC1_TYPE_PLAYER; @@ -233,7 +233,7 @@ void ObjKibako_Held(ObjKibako* this, PlayState* play) { } else { ObjKibako_SetupThrown(this); ObjKibako_ApplyGravity(this); - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); } Actor_UpdateBgCheckInfo(play, &this->actor, 19.0f, 20.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); } @@ -263,7 +263,7 @@ void ObjKibako_Thrown(ObjKibako* this, PlayState* play) { Actor_Kill(&this->actor); } else { ObjKibako_ApplyGravity(this); - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 19.0f, 20.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c index 6198ce9729..215510ff0c 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -194,7 +194,7 @@ void ObjLift_Fall(ObjLift* this, PlayState* play) { s32 bgId; Vec3f pos; - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); Math_Vec3f_Copy(&pos, &this->dyna.actor.prevPos); pos.y += sMaxFallDistances[(this->dyna.actor.params >> 1) & 1]; this->dyna.actor.floorHeight = diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index 720320ff9b..2e12b0fd52 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -483,7 +483,7 @@ void ObjOshihiki_OnActor(ObjOshihiki* this, PlayState* play) { DynaPolyActor* dynaPolyActor; this->stateFlags |= PUSHBLOCK_ON_ACTOR; - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); if (ObjOshihiki_CheckFloor(this, play)) { bgId = this->floorBgIds[this->highestFloor]; @@ -597,7 +597,7 @@ void ObjOshihiki_Fall(ObjOshihiki* this, PlayState* play) { this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~PLAYER_STATE2_4; } - Actor_MoveForward(&this->dyna.actor); + Actor_MoveXZGravity(&this->dyna.actor); if (ObjOshihiki_CheckGround(this, play)) { if (this->floorBgIds[this->highestFloor] == BGCHECK_SCENE) { ObjOshihiki_SetupOnScene(this, play); diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index 50ffebcb94..d720145e2e 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -285,7 +285,7 @@ void ObjTsubo_LiftedUp(ObjTsubo* this, PlayState* play) { this->actor.room = play->roomCtx.curRoom.num; ObjTsubo_SetupThrown(this); ObjTsubo_ApplyGravity(this); - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 5.0f, 15.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_7); } @@ -318,7 +318,7 @@ void ObjTsubo_Thrown(ObjTsubo* this, PlayState* play) { Actor_Kill(&this->actor); } else { ObjTsubo_ApplyGravity(this); - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); Math_StepToS(&D_80BA1B54, D_80BA1B50, 0x64); Math_StepToS(&D_80BA1B5C, D_80BA1B58, 0x64); this->actor.shape.rot.x += D_80BA1B54; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 78bc30f81a..62924450b7 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -114,14 +114,6 @@ typedef struct { }; } struct_80854B18; // size = 0x08 -typedef struct { - /* 0x00 */ s16 unk_00; - /* 0x02 */ s16 unk_02; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; - /* 0x08 */ s16 unk_08; -} struct_80858AC8; // size = 0x0A - void func_80833770(PlayState* play, Player* this); void func_80833790(PlayState* play, Player* this); void func_8083379C(PlayState* play, Player* this); @@ -255,7 +247,7 @@ void func_8084FB10(Player* this, PlayState* play); void func_8084FBF4(Player* this, PlayState* play); s32 func_8084FCAC(Player* this, PlayState* play); void func_8084FF7C(Player* this); -void func_8085002C(Player* this); +void Player_UpdateBunnyEars(Player* this); s32 func_80850224(Player* this, PlayState* play); void func_808502D0(Player* this, PlayState* play); void func_808505DC(Player* this, PlayState* play); @@ -1212,7 +1204,7 @@ static s8 sItemActions[] = { PLAYER_IA_BOW_LIGHT, // ITEM_BOW_LIGHT PLAYER_IA_SWORD_KOKIRI, // ITEM_SWORD_KOKIRI PLAYER_IA_SWORD_MASTER, // ITEM_SWORD_MASTER - PLAYER_IA_SWORD_BGS, // ITEM_SWORD_BIGGORON + PLAYER_IA_SWORD_BIGGORON, // ITEM_SWORD_BIGGORON }; static s32 (*D_80853EDC[])(Player* this, PlayState* play) = { @@ -1221,7 +1213,7 @@ static s32 (*D_80853EDC[])(Player* this, PlayState* play) = { func_8083485C, // PLAYER_IA_FISHING_POLE func_808349DC, // PLAYER_IA_SWORD_MASTER func_808349DC, // PLAYER_IA_SWORD_KOKIRI - func_808349DC, // PLAYER_IA_SWORD_BGS + func_808349DC, // PLAYER_IA_SWORD_BIGGORON func_8083485C, // PLAYER_IA_DEKU_STICK func_8083485C, // PLAYER_IA_HAMMER func_8083501C, // PLAYER_IA_BOW @@ -1291,7 +1283,7 @@ static void (*D_80853FE8[])(PlayState* play, Player* this) = { func_80833770, // PLAYER_IA_FISHING_POLE func_80833770, // PLAYER_IA_SWORD_MASTER func_80833770, // PLAYER_IA_SWORD_KOKIRI - func_80833770, // PLAYER_IA_SWORD_BGS + func_80833770, // PLAYER_IA_SWORD_BIGGORON func_8083377C, // PLAYER_IA_DEKU_STICK func_80833790, // PLAYER_IA_HAMMER func_8083379C, // PLAYER_IA_BOW @@ -1573,14 +1565,14 @@ static LinkAnimationHeader* D_808543D4[] = { }; // return type can't be void due to regalloc in func_8084FCAC -BAD_RETURN(s32) func_80832210(Player* this) { +BAD_RETURN(s32) Player_ZeroSpeedXZ(Player* this) { this->actor.speed = 0.0f; - this->linearVelocity = 0.0f; + this->speedXZ = 0.0f; } // return type can't be void due to regalloc in func_8083F72C BAD_RETURN(s32) func_80832224(Player* this) { - func_80832210(this); + Player_ZeroSpeedXZ(this); this->unk_6AD = 0; } @@ -1924,7 +1916,7 @@ void func_80832F54(PlayState* play, Player* this, s32 flags) { } this->skelAnime.moveFlags = flags; - func_80832210(this); + Player_ZeroSpeedXZ(this); AnimationContext_DisableQueue(play); } @@ -2213,7 +2205,7 @@ void func_80833A20(Player* this, s32 newMeleeWeaponState) { u16 voiceSfx; if (this->meleeWeaponState == 0) { - if ((this->heldItemAction == PLAYER_IA_SWORD_BGS) && (gSaveContext.swordHealth > 0.0f)) { + if ((this->heldItemAction == PLAYER_IA_SWORD_BIGGORON) && (gSaveContext.swordHealth > 0.0f)) { itemSfx = NA_SE_IT_HAMMER_SWING; } else { itemSfx = NA_SE_IT_SWORD_SWING; @@ -2259,8 +2251,8 @@ s32 func_80833B54(Player* this) { if (this->stateFlags1 & PLAYER_STATE1_4) { this->stateFlags1 &= ~PLAYER_STATE1_4; - if (this->linearVelocity == 0.0f) { - this->currentYaw = this->actor.shape.rot.y; + if (this->speedXZ == 0.0f) { + this->yaw = this->actor.shape.rot.y; } } @@ -2829,7 +2821,7 @@ s32 func_808351D4(Player* this, PlayState* play) { } } this->unk_834 = 10; - func_80832210(this); + Player_ZeroSpeedXZ(this); } else { this->stateFlags1 |= PLAYER_STATE1_9; } @@ -2892,10 +2884,10 @@ void func_808355DC(Player* this) { if (!(this->skelAnime.moveFlags & 0x80) && (this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && (D_80853608 < 0x2000)) { - this->currentYaw = this->actor.shape.rot.y = this->actor.wallYaw + 0x8000; + this->yaw = this->actor.shape.rot.y = this->actor.wallYaw + 0x8000; } - this->targetYaw = this->actor.shape.rot.y; + this->zTargetYaw = this->actor.shape.rot.y; } s32 func_80835644(PlayState* play, Player* this, Actor* arg2) { @@ -3271,7 +3263,7 @@ s32 func_80836670(Player* this, PlayState* play) { func_80832264(play, this, &gPlayerAnim_link_hook_fly_start); func_80832F54(play, this, 0x9B); func_80832224(this); - this->currentYaw = this->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->hoverBootsTimer = 0; this->unk_6AE |= 0x43; @@ -3291,14 +3283,14 @@ s32 func_80836670(Player* this, PlayState* play) { } if (this->unk_830 != 0.0f) { - if ((func_80833350(this) == 0) || (this->linearVelocity != 0.0f)) { + if ((func_80833350(this) == 0) || (this->speedXZ != 0.0f)) { AnimationContext_SetCopyFalse(play, this->skelAnime.limbCount, this->skelAnime2.jointTable, this->skelAnime.jointTable, D_80853410); } Math_StepToF(&this->unk_830, 0.0f, 0.25f); AnimationContext_SetInterp(play, this->skelAnime.limbCount, this->skelAnime.jointTable, this->skelAnime2.jointTable, 1.0f - this->unk_830); - } else if ((func_80833350(this) == 0) || (this->linearVelocity != 0.0f)) { + } else if ((func_80833350(this) == 0) || (this->speedXZ != 0.0f)) { AnimationContext_SetCopyTrue(play, this->skelAnime.limbCount, this->skelAnime.jointTable, this->skelAnime2.jointTable, D_80853410); } else { @@ -3326,10 +3318,10 @@ void func_808368EC(Player* this, PlayState* play) { Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_664->focus.pos), 4000); } else if ((this->stateFlags1 & PLAYER_STATE1_17) && !(this->stateFlags2 & (PLAYER_STATE2_5 | PLAYER_STATE2_6))) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->targetYaw, 4000); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->zTargetYaw, 4000); } } else if (!(this->stateFlags2 & PLAYER_STATE2_6)) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->currentYaw, 2000); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->yaw, 2000); } this->unk_87C = this->actor.shape.rot.y - previousYaw; @@ -3532,7 +3524,7 @@ s32 func_80836FAC(PlayState* play, Player* this, f32* arg2, s16* arg3, f32 arg4) } s32 func_8083721C(Player* this) { - return Math_StepToF(&this->linearVelocity, 0.0f, REG(43) / 100.0f); + return Math_StepToF(&this->speedXZ, 0.0f, REG(43) / 100.0f); } s32 func_80837268(Player* this, f32* arg1, s16* arg2, f32 arg3, PlayState* play) { @@ -3545,7 +3537,7 @@ s32 func_80837268(Player* this, f32* arg1, s16* arg2, f32 arg3, PlayState* play) return 0; } } else if (func_80833B2C(this)) { - *arg2 = this->targetYaw; + *arg2 = this->zTargetYaw; } return 0; @@ -3791,7 +3783,7 @@ void func_80837948(PlayState* play, Player* this, s32 arg2) { func_80832F54(play, this, 0x209); } - this->currentYaw = this->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y; if (Player_HoldsBrokenKnife(this)) { temp = 1; @@ -3898,7 +3890,7 @@ void func_80837C0C(PlayState* play, Player* this, s32 arg2, f32 arg3, f32 arg4, func_80835C58(play, this, func_8084E30C, 0); Player_RequestRumble(this, 180, 20, 50, 0); - this->linearVelocity = 4.0f; + this->speedXZ = 4.0f; this->actor.velocity.y = 0.0f; sp2C = &gPlayerAnim_link_swimer_swim_hit; @@ -3917,14 +3909,14 @@ void func_80837C0C(PlayState* play, Player* this, s32 arg2, f32 arg3, f32 arg4, this->unk_850 = 4; this->actor.speed = 3.0f; - this->linearVelocity = 3.0f; + this->speedXZ = 3.0f; this->actor.velocity.y = 6.0f; func_80832C2C(play, this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_damage_run, this->modelAnimType)); func_80832698(this, NA_SE_VO_LI_DAMAGE_S); } else { this->actor.speed = arg3; - this->linearVelocity = arg3; + this->speedXZ = arg3; this->actor.velocity.y = arg4; if (ABS(arg5) > 0x4000) { @@ -3943,7 +3935,7 @@ void func_80837C0C(PlayState* play, Player* this, s32 arg2, f32 arg3, f32 arg4, this->hoverBootsTimer = 0; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; } else { - if ((this->linearVelocity > 4.0f) && !func_8008E9C4(this)) { + if ((this->speedXZ > 4.0f) && !func_8008E9C4(this)) { this->unk_890 = 20; Player_RequestRumble(this, 120, 20, 10, 0); func_80832698(this, NA_SE_VO_LI_DAMAGE_S); @@ -3959,7 +3951,7 @@ void func_80837C0C(PlayState* play, Player* this, s32 arg2, f32 arg3, f32 arg4, Player_RequestRumble(this, 120, 20, 10, 0); } else { Player_RequestRumble(this, 180, 20, 100, 0); - this->linearVelocity = 23.0f; + this->speedXZ = 23.0f; sp28 += 4; } @@ -3977,7 +3969,7 @@ void func_80837C0C(PlayState* play, Player* this, s32 arg2, f32 arg3, f32 arg4, } this->actor.shape.rot.y += arg5; - this->currentYaw = this->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y; if (ABS(arg5) > 0x4000) { this->actor.shape.rot.y += 0x8000; @@ -4132,8 +4124,8 @@ s32 func_808382DC(Player* this, PlayState* play) { } if (!(this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_21))) { - this->linearVelocity = -18.0f; - this->currentYaw = this->actor.shape.rot.y; + this->speedXZ = -18.0f; + this->yaw = this->actor.shape.rot.y; } } @@ -4264,7 +4256,7 @@ s32 func_80838A14(Player* this, PlayState* play) { if (this->ageProperties->unk_14 <= sp34) { sp38 = &gPlayerAnim_link_normal_250jump_start; - this->linearVelocity = 1.0f; + this->speedXZ = 1.0f; } else { wallPolyNormalX = COLPOLY_GET_NORMAL(this->actor.wallPoly->normal.x); wallPolyNormalZ = COLPOLY_GET_NORMAL(this->actor.wallPoly->normal.z); @@ -4298,14 +4290,14 @@ s32 func_80838A14(Player* this, PlayState* play) { LinkAnimation_PlayOnceSetSpeed(play, &this->skelAnime, sp38, 1.3f); AnimationContext_DisableQueue(play); - this->actor.shape.rot.y = this->currentYaw = this->actor.wallYaw + 0x8000; + this->actor.shape.rot.y = this->yaw = this->actor.wallYaw + 0x8000; return 1; } } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->unk_88C == 1) && (this->unk_88D >= 3)) { temp = (this->wallHeight * 0.08f) + 5.5f; func_808389E8(this, &gPlayerAnim_link_normal_jump, temp, play); - this->linearVelocity = 2.5f; + this->speedXZ = 2.5f; return 1; } @@ -4408,7 +4400,7 @@ s32 func_80839034(PlayState* play, Player* this, CollisionPoly* poly, u32 bgId) s32 exitIndex; s32 temp; s32 sp34; - f32 linearVel; + f32 speedXZ; s32 yaw; if (this->actor.category == ACTORCAT_PLAYER) { @@ -4468,17 +4460,17 @@ s32 func_80839034(PlayState* play, Player* this, CollisionPoly* poly, u32 bgId) gSaveContext.seqId = (u8)NA_BGM_DISABLED; gSaveContext.natureAmbienceId = NATURE_ID_DISABLED; } else { - linearVel = this->linearVelocity; + speedXZ = this->speedXZ; - if (linearVel < 0.0f) { + if (speedXZ < 0.0f) { this->actor.world.rot.y += 0x8000; - linearVel = -linearVel; + speedXZ = -speedXZ; } - if (linearVel > R_RUN_SPEED_LIMIT / 100.0f) { + if (speedXZ > R_RUN_SPEED_LIMIT / 100.0f) { gSaveContext.entranceSpeed = R_RUN_SPEED_LIMIT / 100.0f; } else { - gSaveContext.entranceSpeed = linearVel; + gSaveContext.entranceSpeed = speedXZ; } if (sConveyorSpeedIndex != CONVEYOR_SPEED_DISABLED) { @@ -4490,7 +4482,7 @@ s32 func_80839034(PlayState* play, Player* this, CollisionPoly* poly, u32 bgId) } } else { if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { - func_80832210(this); + Player_ZeroSpeedXZ(this); } } @@ -4612,14 +4604,14 @@ s32 func_80839800(Player* this, PlayState* play) { if (this->doorType == PLAYER_DOORTYPE_SLIDING) { slidingDoor = (SlidingDoorActorBase*)doorActor; - this->currentYaw = slidingDoor->dyna.actor.home.rot.y; + this->yaw = slidingDoor->dyna.actor.home.rot.y; if (doorDirection > 0) { - this->currentYaw -= 0x8000; + this->yaw -= 0x8000; } - this->actor.shape.rot.y = this->currentYaw; + this->actor.shape.rot.y = this->yaw; - if (this->linearVelocity <= 0.0f) { - this->linearVelocity = 0.1f; + if (this->speedXZ <= 0.0f) { + this->speedXZ = 0.1f; } func_80838E70(play, this, 50.0f, this->actor.shape.rot.y); @@ -4641,7 +4633,7 @@ s32 func_80839800(Player* this, PlayState* play) { func_80832B0C(play, this, func_80833338(this)); this->skelAnime.endFrame = 0.0f; } else { - this->linearVelocity = 0.1f; + this->speedXZ = 0.1f; } if (slidingDoor->dyna.actor.category == ACTORCAT_DOOR) { @@ -4679,7 +4671,7 @@ s32 func_80839800(Player* this, PlayState* play) { this->actor.shape.rot.y = doorActor->shape.rot.y - 0x8000; } - this->currentYaw = this->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y; sp6C = (doorDirection * 22.0f); this->actor.world.pos.x = doorActor->world.pos.x + sp6C * sp74; @@ -4768,13 +4760,13 @@ void func_80839E88(Player* this, PlayState* play) { this->unk_874 = this->unk_870; func_80832284(play, this, anim); - this->currentYaw = this->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y; } void func_80839F30(Player* this, PlayState* play) { func_80835C58(play, this, func_808407CC, 1); func_80832B0C(play, this, func_80833338(this)); - this->currentYaw = this->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y; } void func_80839F90(Player* this, PlayState* play) { @@ -4843,7 +4835,7 @@ void func_8083A0F4(PlayState* play, Player* this) { (Math_SinS(interactRangeActor->yawTowardsPlayer) * 20.0f) + interactRangeActor->world.pos.x; this->actor.world.pos.z = (Math_CosS(interactRangeActor->yawTowardsPlayer) * 20.0f) + interactRangeActor->world.pos.z; - this->currentYaw = this->actor.shape.rot.y = interactRangeActor->yawTowardsPlayer + 0x8000; + this->yaw = this->actor.shape.rot.y = interactRangeActor->yawTowardsPlayer + 0x8000; anim = &gPlayerAnim_link_normal_nocarry_free; } else { func_80835C58(play, this, func_80846050, 0); @@ -4911,18 +4903,18 @@ s32 func_8083A4A8(Player* this, PlayState* play) { LinkAnimationHeader* anim; f32 temp; - yawDiff = this->currentYaw - this->actor.shape.rot.y; + yawDiff = this->yaw - this->actor.shape.rot.y; - if ((ABS(yawDiff) < 0x1000) && (this->linearVelocity > 4.0f)) { + if ((ABS(yawDiff) < 0x1000) && (this->speedXZ > 4.0f)) { anim = &gPlayerAnim_link_normal_run_jump; } else { anim = &gPlayerAnim_link_normal_jump; } - if (this->linearVelocity > (IREG(66) / 100.0f)) { + if (this->speedXZ > (IREG(66) / 100.0f)) { temp = IREG(67) / 100.0f; } else { - temp = (IREG(68) / 100.0f) + ((IREG(69) * this->linearVelocity) / 1000.0f); + temp = (IREG(68) / 100.0f) + ((IREG(69) * this->speedXZ) / 1000.0f); } func_80838940(this, anim, temp, play, NA_SE_VO_LI_AUTO_JUMP); @@ -4941,7 +4933,7 @@ void func_8083A5C4(PlayState* play, Player* this, CollisionPoly* arg2, f32 arg3, this->actor.world.pos.x -= (arg3 + 1.0f) * nx; this->actor.world.pos.z -= (arg3 + 1.0f) * nz; - this->actor.shape.rot.y = this->currentYaw = Math_Atan2S(nz, nx); + this->actor.shape.rot.y = this->yaw = Math_Atan2S(nz, nx); func_80832224(this); func_80832CFC(this); @@ -4991,8 +4983,8 @@ s32 func_8083A6AC(Player* this, PlayState* play) { if (sp50) { func_80836898(play, this, func_8083A3B0); - this->currentYaw += 0x8000; - this->actor.shape.rot.y = this->currentYaw; + this->yaw += 0x8000; + this->actor.shape.rot.y = this->yaw; this->stateFlags1 |= PLAYER_STATE1_21; func_80832F54(play, this, 0x9F); @@ -5045,7 +5037,7 @@ void func_8083AA10(Player* this, PlayState* play) { if ((D_80853604 == FLOOR_PROPERTY_7) || (this->meleeWeaponState != 0)) { Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.prevPos); - func_80832210(this); + Player_ZeroSpeedXZ(this); return; } @@ -5055,7 +5047,7 @@ void func_8083AA10(Player* this, PlayState* play) { return; } - sp5C = (s16)(this->currentYaw - this->actor.shape.rot.y); + sp5C = (s16)(this->yaw - this->actor.shape.rot.y); func_80835C58(play, this, func_8084411C, 1); func_80832440(play, this); @@ -5064,7 +5056,7 @@ void func_8083AA10(Player* this, PlayState* play) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_LEAVE) && !(this->stateFlags1 & PLAYER_STATE1_27) && (D_80853604 != FLOOR_PROPERTY_6) && (D_80853604 != FLOOR_PROPERTY_9) && (D_80853600 > 20.0f) && - (this->meleeWeaponState == 0) && (ABS(sp5C) < 0x2000) && (this->linearVelocity > 3.0f)) { + (this->meleeWeaponState == 0) && (ABS(sp5C) < 0x2000) && (this->speedXZ > 3.0f)) { if ((D_80853604 == FLOOR_PROPERTY_11) && !(this->stateFlags1 & PLAYER_STATE1_11)) { @@ -5333,7 +5325,7 @@ s32 func_8083B040(Player* this, PlayState* play) { } this->stateFlags1 |= PLAYER_STATE1_20; func_80078884(NA_SE_SY_CAMERA_ZOOM_UP); - func_80832210(this); + Player_ZeroSpeedXZ(this); return 1; } else { this->unk_6AD = 0; @@ -5454,14 +5446,14 @@ s32 func_8083B998(Player* this, PlayState* play) { return 0; } -void func_8083BA90(PlayState* play, Player* this, s32 arg2, f32 xzVelocity, f32 yVelocity) { +void func_8083BA90(PlayState* play, Player* this, s32 arg2, f32 xzSpeed, f32 yVelocity) { func_80837948(play, this, arg2); func_80835C58(play, this, func_80844AF4, 0); this->stateFlags3 |= PLAYER_STATE3_1; - this->currentYaw = this->actor.shape.rot.y; - this->linearVelocity = xzVelocity; + this->yaw = this->actor.shape.rot.y; + this->speedXZ = xzSpeed; this->actor.velocity.y = yVelocity; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; @@ -5515,8 +5507,8 @@ void func_8083BCD0(Player* this, PlayState* play, s32 arg2) { this->unk_850 = 1; this->unk_84F = arg2; - this->currentYaw = this->actor.shape.rot.y + (arg2 << 0xE); - this->linearVelocity = !(arg2 & 1) ? 6.0f : 8.5f; + this->yaw = this->actor.shape.rot.y + (arg2 << 0xE); + this->speedXZ = !(arg2 & 1) ? 6.0f : 8.5f; this->stateFlags2 |= PLAYER_STATE2_19; @@ -5584,7 +5576,7 @@ void func_8083BF50(Player* this, PlayState* play) { LinkAnimation_Change(play, &this->skelAnime, anim, 1.0f, 0.0f, Animation_GetLastFrame(anim), ANIMMODE_ONCE, 4.0f * sp30); - this->currentYaw = this->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y; } void func_8083C0B8(Player* this, PlayState* play) { @@ -5595,7 +5587,7 @@ void func_8083C0B8(Player* this, PlayState* play) { void func_8083C0E8(Player* this, PlayState* play) { func_80835C58(play, this, func_80840BC8, 1); func_80832264(play, this, func_80833338(this)); - this->currentYaw = this->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y; } void func_8083C148(Player* this, PlayState* play) { @@ -5678,12 +5670,12 @@ s32 func_8083C2B0(Player* this, PlayState* play) { } s32 func_8083C484(Player* this, f32* arg1, s16* arg2) { - s16 yaw = this->currentYaw - *arg2; + s16 yaw = this->yaw - *arg2; if (ABS(yaw) > 0x6000) { if (func_8083721C(this)) { *arg1 = 0.0f; - *arg2 = this->currentYaw; + *arg2 = this->yaw; } else { return 1; } @@ -5702,7 +5694,7 @@ s32 func_8083C544(Player* this, PlayState* play) { if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_B)) { if (!(this->stateFlags1 & PLAYER_STATE1_22) && (Player_GetMeleeWeaponHeld(this) != 0) && (this->unk_844 == 1) && (this->heldItemAction != PLAYER_IA_DEKU_STICK)) { - if ((this->heldItemAction != PLAYER_IA_SWORD_BGS) || (gSaveContext.swordHealth > 0.0f)) { + if ((this->heldItemAction != PLAYER_IA_SWORD_BIGGORON) || (gSaveContext.swordHealth > 0.0f)) { func_808377DC(play, this); return 1; } @@ -5761,7 +5753,7 @@ s32 func_8083C6B8(PlayState* play, Player* this) { func_80835C58(play, this, func_80850C68, 0); this->unk_860 = 1; - func_80832210(this); + Player_ZeroSpeedXZ(this); func_80832264(play, this, &gPlayerAnim_link_fishing_throw); return 1; } else { @@ -5789,7 +5781,7 @@ void func_8083C858(Player* this, PlayState* play) { } void func_8083C8DC(Player* this, PlayState* play, s16 arg2) { - this->actor.shape.rot.y = this->currentYaw = arg2; + this->actor.shape.rot.y = this->yaw = arg2; func_8083C858(this, play); } @@ -5806,7 +5798,7 @@ s32 func_8083C910(PlayState* play, Player* this, f32 arg2) { func_80832C6C(play, this, &gPlayerAnim_link_swimer_swim); this->stateFlags1 |= PLAYER_STATE1_27 | PLAYER_STATE1_29; this->unk_850 = 20; - this->linearVelocity = 2.0f; + this->speedXZ = 2.0f; Player_SetBootData(play, this); return 0; } @@ -5824,7 +5816,7 @@ void func_8083CA20(PlayState* play, Player* this) { } void func_8083CA54(PlayState* play, Player* this) { - this->linearVelocity = 2.0f; + this->speedXZ = 2.0f; gSaveContext.entranceSpeed = 2.0f; if (func_8083C910(play, this, 120.0f)) { this->unk_850 = -15; @@ -5836,10 +5828,10 @@ void func_8083CA9C(PlayState* play, Player* this) { gSaveContext.entranceSpeed = 0.1f; } - this->linearVelocity = gSaveContext.entranceSpeed; + this->speedXZ = gSaveContext.entranceSpeed; if (func_8083C910(play, this, 800.0f)) { - this->unk_850 = -80 / this->linearVelocity; + this->unk_850 = -80 / this->speedXZ; if (this->unk_850 < -20) { this->unk_850 = -20; } @@ -5850,7 +5842,7 @@ void func_8083CB2C(Player* this, s16 yaw, PlayState* play) { func_80835C58(play, this, func_808414F8, 1); LinkAnimation_CopyJointToMorph(play, &this->skelAnime); this->unk_864 = this->unk_868 = 0.0f; - this->currentYaw = yaw; + this->yaw = yaw; } void func_8083CB94(Player* this, PlayState* play) { @@ -5862,8 +5854,8 @@ void func_8083CBF0(Player* this, s16 yaw, PlayState* play) { func_80835C58(play, this, func_808423EC, 1); LinkAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_anchor_back_walk, 2.2f, 0.0f, Animation_GetLastFrame(&gPlayerAnim_link_anchor_back_walk), ANIMMODE_ONCE, -6.0f); - this->linearVelocity = 8.0f; - this->currentYaw = yaw; + this->speedXZ = 8.0f; + this->yaw = yaw; } void func_8083CC9C(Player* this, PlayState* play) { @@ -5878,7 +5870,7 @@ void func_8083CD00(Player* this, PlayState* play) { } void func_8083CD54(PlayState* play, Player* this, s16 yaw) { - this->currentYaw = yaw; + this->yaw = yaw; func_80835C58(play, this, func_80841BA8, 1); this->unk_87E = 1200; this->unk_87E *= D_808535E8; @@ -5898,7 +5890,7 @@ void func_8083CE0C(Player* this, PlayState* play) { } func_80832264(play, this, anim); - this->currentYaw = this->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y; } void func_8083CEAC(Player* this, PlayState* play) { @@ -5908,7 +5900,7 @@ void func_8083CEAC(Player* this, PlayState* play) { } void func_8083CF10(Player* this, PlayState* play) { - if (this->linearVelocity != 0.0f) { + if (this->speedXZ != 0.0f) { func_8083C858(this, play); } else { func_8083CE0C(this, play); @@ -5916,7 +5908,7 @@ void func_8083CF10(Player* this, PlayState* play) { } void func_8083CF5C(Player* this, PlayState* play) { - if (this->linearVelocity != 0.0f) { + if (this->speedXZ != 0.0f) { func_8083C858(this, play); } else { func_80839F90(this, play); @@ -6098,7 +6090,7 @@ void func_8083D6EC(PlayState* play, Player* this) { this->actor.gravity = REG(68) / 100.0f; if (func_8083816C(D_808535E4)) { - temp1 = fabsf(this->linearVelocity) * 20.0f; + temp1 = fabsf(this->speedXZ) * 20.0f; temp3 = 0.0f; if (D_808535E4 == FLOOR_TYPE_4) { @@ -6155,11 +6147,11 @@ void func_8083D6EC(PlayState* play, Player* this) { ripplePos.z = (Rand_ZeroOne() * 10.0f) + this->actor.world.pos.z; EffectSsGRipple_Spawn(play, &ripplePos, 100, 500, 0); - if ((this->linearVelocity > 4.0f) && !func_808332B8(this) && + if ((this->speedXZ > 4.0f) && !func_808332B8(this) && ((this->actor.world.pos.y + this->actor.yDistToWater) < this->bodyPartsPos[PLAYER_BODYPART_WAIST].y)) { func_8083CFA8(play, this, 20.0f, - (fabsf(this->linearVelocity) * 50.0f) + (this->actor.yDistToWater * 5.0f)); + (fabsf(this->speedXZ) * 50.0f) + (this->actor.yDistToWater * 5.0f)); } } } @@ -6238,9 +6230,9 @@ void func_8083DDC8(Player* this, PlayState* play) { s16 temp1; s16 temp2; - if (!func_8002DD78(this) && !func_808334B4(this) && (this->linearVelocity > 5.0f)) { - temp1 = this->linearVelocity * 200.0f; - temp2 = (s16)(this->currentYaw - this->actor.shape.rot.y) * this->linearVelocity * 0.1f; + if (!func_8002DD78(this) && !func_808334B4(this) && (this->speedXZ > 5.0f)) { + temp1 = this->speedXZ * 200.0f; + temp2 = (s16)(this->yaw - this->actor.shape.rot.y) * this->speedXZ * 0.1f; temp1 = CLAMP(temp1, -4000, 4000); temp2 = CLAMP(-temp2, -4000, 4000); Math_ScaledStepToS(&this->unk_6BC, temp1, 900); @@ -6254,24 +6246,24 @@ void func_8083DDC8(Player* this, PlayState* play) { } void func_8083DF68(Player* this, f32 arg1, s16 arg2) { - Math_AsymStepToF(&this->linearVelocity, arg1, REG(19) / 100.0f, 1.5f); - Math_ScaledStepToS(&this->currentYaw, arg2, REG(27)); + Math_AsymStepToF(&this->speedXZ, arg1, REG(19) / 100.0f, 1.5f); + Math_ScaledStepToS(&this->yaw, arg2, REG(27)); } void func_8083DFE0(Player* this, f32* arg1, s16* arg2) { - s16 yawDiff = this->currentYaw - *arg2; + s16 yawDiff = this->yaw - *arg2; if (this->meleeWeaponState == 0) { - this->linearVelocity = CLAMP(this->linearVelocity, -(R_RUN_SPEED_LIMIT / 100.0f), (R_RUN_SPEED_LIMIT / 100.0f)); + this->speedXZ = CLAMP(this->speedXZ, -(R_RUN_SPEED_LIMIT / 100.0f), (R_RUN_SPEED_LIMIT / 100.0f)); } if (ABS(yawDiff) > 0x6000) { - if (Math_StepToF(&this->linearVelocity, 0.0f, 1.0f)) { - this->currentYaw = *arg2; + if (Math_StepToF(&this->speedXZ, 0.0f, 1.0f)) { + this->yaw = *arg2; } } else { - Math_AsymStepToF(&this->linearVelocity, *arg1, 0.05f, 0.1f); - Math_ScaledStepToS(&this->currentYaw, *arg2, 200); + Math_AsymStepToF(&this->speedXZ, *arg1, 0.05f, 0.1f); + Math_ScaledStepToS(&this->yaw, *arg2, 200); } } @@ -6311,7 +6303,7 @@ s32 func_8083E0FC(Player* this, PlayState* play) { rideActor->actor.world.pos.z + rideActor->riderPos.z + ((unk_08 * sp38) - (unk_04 * sp34)); this->unk_878 = rideActor->actor.world.pos.y - this->actor.world.pos.y; - this->currentYaw = this->actor.shape.rot.y = rideActor->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y = rideActor->actor.shape.rot.y; Actor_MountHorse(play, this, &rideActor->actor); func_80832264(play, this, D_80854578[temp].anim); @@ -6374,8 +6366,8 @@ s32 func_8083E318(PlayState* play, Player* this, CollisionPoly* floorPoly) { this->unk_84F = 1; } func_80832BE8(play, this, D_80854590[this->unk_84F]); - this->linearVelocity = sqrtf(SQ(this->actor.velocity.x) + SQ(this->actor.velocity.z)); - this->currentYaw = playerVelYaw; + this->speedXZ = sqrtf(SQ(this->actor.velocity.x) + SQ(this->actor.velocity.z)); + this->yaw = playerVelYaw; return true; } } @@ -6464,7 +6456,7 @@ s32 func_8083E5A8(Player* this, PlayState* play) { chest->dyna.actor.world.pos.x - (Math_SinS(chest->dyna.actor.shape.rot.y) * 29.4343f); this->actor.world.pos.z = chest->dyna.actor.world.pos.z - (Math_CosS(chest->dyna.actor.shape.rot.y) * 29.4343f); - this->currentYaw = this->actor.shape.rot.y = chest->dyna.actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y = chest->dyna.actor.shape.rot.y; func_80832224(this); if ((giEntry->itemId != ITEM_NONE) && (giEntry->gi >= 0) && @@ -6524,7 +6516,7 @@ void func_8083EA94(Player* this, PlayState* play) { s32 func_8083EAF0(Player* this, Actor* actor) { if ((actor != NULL) && !(actor->flags & ACTOR_FLAG_23) && - ((this->linearVelocity < 1.1f) || (actor->id == ACTOR_EN_BOM_CHU))) { + ((this->speedXZ < 1.1f) || (actor->id == ACTOR_EN_BOM_CHU))) { return 0; } @@ -6634,11 +6626,11 @@ s32 func_8083EC18(Player* this, PlayState* play, u32 interactWallFlags) { } this->unk_850 = -2; this->actor.world.pos.y += phi_f20; - this->actor.shape.rot.y = this->currentYaw = this->actor.wallYaw + 0x8000; + this->actor.shape.rot.y = this->yaw = this->actor.wallYaw + 0x8000; } else { sp30 = this->ageProperties->unk_A8; this->unk_850 = -4; - this->actor.shape.rot.y = this->currentYaw = this->actor.wallYaw; + this->actor.shape.rot.y = this->yaw = this->actor.wallYaw; } this->actor.world.pos.x = (sp34 * wallPolyNormalX) + sp80; @@ -6719,7 +6711,7 @@ s32 Player_TryEnteringCrawlspace(Player* this, PlayState* play, u32 interactWall func_80836898(play, this, func_8083A40C); this->stateFlags2 |= PLAYER_STATE2_CRAWLING; - this->actor.shape.rot.y = this->currentYaw = this->actor.wallYaw + 0x8000; + this->actor.shape.rot.y = this->yaw = this->actor.wallYaw + 0x8000; this->actor.world.pos.x = xVertex1 + (wallDistance * wallPolyNormalX); this->actor.world.pos.z = zVertex1 + (wallDistance * wallPolyNormalZ); func_80832224(this); @@ -6770,7 +6762,7 @@ s32 func_8083F360(PlayState* play, Player* this, f32 arg1, f32 arg2, f32 arg3, f temp = Math_Atan2S(-wallPolyNormalZ, -wallPolyNormalX); Math_ScaledStepToS(&this->actor.shape.rot.y, temp, 800); - this->currentYaw = this->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y; this->actor.world.pos.x = sp54.x - (Math_SinS(this->actor.shape.rot.y) * arg2); this->actor.world.pos.z = sp54.z - (Math_CosS(this->actor.shape.rot.y) * arg2); @@ -6795,21 +6787,21 @@ s32 func_8083F524(PlayState* play, Player* this) { s32 Player_TryLeavingCrawlspace(Player* this, PlayState* play) { s16 yawToWall; - if ((this->linearVelocity != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && + if ((this->speedXZ != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (sInteractWallFlags & WALL_FLAG_CRAWLSPACE)) { // The exit wallYaws will always point inward on the crawlline // Interacting with the exit wall in front will have a yaw diff of 0x8000 // Interacting with the exit wall behind will have a yaw diff of 0 yawToWall = this->actor.shape.rot.y - this->actor.wallYaw; - if (this->linearVelocity < 0.0f) { + if (this->speedXZ < 0.0f) { yawToWall += 0x8000; } if (ABS(yawToWall) > 0x4000) { func_80835C58(play, this, func_8084C81C, 0); - if (this->linearVelocity > 0.0f) { + if (this->speedXZ > 0.0f) { // Leaving a crawlspace forwards this->actor.shape.rot.y = this->actor.wallYaw + 0x8000; func_80832264(play, this, &gPlayerAnim_link_child_tunnel_end); @@ -6825,8 +6817,8 @@ s32 Player_TryLeavingCrawlspace(Player* this, PlayState* play) { OnePointCutscene_Init(play, 9602, 999, NULL, CAM_ID_MAIN); } - this->currentYaw = this->actor.shape.rot.y; - func_80832210(this); + this->yaw = this->actor.shape.rot.y; + Player_ZeroSpeedXZ(this); return true; } @@ -6843,7 +6835,7 @@ void func_8083F72C(Player* this, LinkAnimationHeader* anim, PlayState* play) { func_80832264(play, this, anim); func_80832224(this); - this->actor.shape.rot.y = this->currentYaw = this->actor.wallYaw + 0x8000; + this->actor.shape.rot.y = this->yaw = this->actor.wallYaw + 0x8000; } s32 func_8083F7BC(Player* this, PlayState* play) { @@ -6852,12 +6844,12 @@ s32 func_8083F7BC(Player* this, PlayState* play) { if (!(this->stateFlags1 & PLAYER_STATE1_11) && (this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && (D_80853608 < 0x3000)) { - if (((this->linearVelocity > 0.0f) && func_8083EC18(this, play, sInteractWallFlags)) || + if (((this->speedXZ > 0.0f) && func_8083EC18(this, play, sInteractWallFlags)) || Player_TryEnteringCrawlspace(this, play, sInteractWallFlags)) { return 1; } - if (!func_808332B8(this) && ((this->linearVelocity == 0.0f) || !(this->stateFlags2 & PLAYER_STATE2_2)) && + if (!func_808332B8(this) && ((this->speedXZ == 0.0f) || !(this->stateFlags2 & PLAYER_STATE2_2)) && (sInteractWallFlags & WALL_FLAG_6) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->wallHeight >= 39.0f)) { @@ -6877,7 +6869,7 @@ s32 func_8083F7BC(Player* this, PlayState* play) { this->stateFlags1 |= PLAYER_STATE1_11; this->interactRangeActor = &wallPolyActor->actor; this->getItemId = GI_NONE; - this->currentYaw = this->actor.wallYaw + 0x8000; + this->yaw = this->actor.wallYaw + 0x8000; func_80832224(this); return 1; @@ -6937,7 +6929,7 @@ void func_8083FB14(Player* this, PlayState* play) { void func_8083FB7C(Player* this, PlayState* play) { this->stateFlags1 &= ~(PLAYER_STATE1_21 | PLAYER_STATE1_27); func_80837B9C(this, play); - this->linearVelocity = -0.4f; + this->speedXZ = -0.4f; } s32 func_8083FBC0(Player* this, PlayState* play) { @@ -6973,7 +6965,7 @@ s32 func_8083FC68(Player* this, f32 arg1, s16 arg2) { } s32 func_8083FD78(Player* this, f32* arg1, s16* arg2, PlayState* play) { - s16 sp2E = *arg2 - this->targetYaw; + s16 sp2E = *arg2 - this->zTargetYaw; u16 sp2C = ABS(sp2E); if ((func_8002DD78(this) || func_808334B4(this)) && (this->unk_664 == NULL)) { @@ -7093,8 +7085,8 @@ void func_8084029C(Player* this, f32 arg1) { (this->hoverBootsTimer != 0)) { func_8002F8F0(&this->actor, NA_SE_PL_HOBBERBOOTS_LV - SFX_FLAG); } else if (func_8084021C(this->unk_868, arg1, 29.0f, 10.0f) || func_8084021C(this->unk_868, arg1, 29.0f, 24.0f)) { - func_808327F8(this, this->linearVelocity); - if (this->linearVelocity > 4.0f) { + func_808327F8(this, this->speedXZ); + if (this->speedXZ > 4.0f) { this->stateFlags2 |= PLAYER_STATE2_3; } } @@ -7163,29 +7155,29 @@ void func_80840450(Player* this, PlayState* play) { return; } - func_8084029C(this, (this->linearVelocity * 0.3f) + 1.0f); + func_8084029C(this, (this->speedXZ * 0.3f) + 1.0f); func_80840138(this, sp44, sp42); temp2 = this->unk_868; if ((temp2 < 6) || ((temp2 - 0xE) < 6)) { - Math_StepToF(&this->linearVelocity, 0.0f, 1.5f); + Math_StepToF(&this->speedXZ, 0.0f, 1.5f); return; } - temp3 = sp42 - this->currentYaw; + temp3 = sp42 - this->yaw; temp4 = ABS(temp3); if (temp4 > 0x4000) { - if (Math_StepToF(&this->linearVelocity, 0.0f, 1.5f)) { - this->currentYaw = sp42; + if (Math_StepToF(&this->speedXZ, 0.0f, 1.5f)) { + this->yaw = sp42; } return; } - Math_AsymStepToF(&this->linearVelocity, sp44 * 0.3f, 2.0f, 1.5f); + Math_AsymStepToF(&this->speedXZ, sp44 * 0.3f, 2.0f, 1.5f); if (!(this->stateFlags3 & PLAYER_STATE3_3)) { - Math_ScaledStepToS(&this->currentYaw, sp42, temp4 * 0.1f); + Math_ScaledStepToS(&this->yaw, sp42, temp4 * 0.1f); } } } @@ -7212,7 +7204,7 @@ void func_808407CC(Player* this, PlayState* play) { if (!func_80833B2C(this)) { func_80835DAC(play, this, func_80840BC8, 1); - this->currentYaw = this->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y; return; } @@ -7356,7 +7348,7 @@ void func_80840BC8(Player* this, PlayState* play) { } Math_ScaledStepToS(&this->actor.shape.rot.y, sp3A, 1200); - this->currentYaw = this->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y; if (func_80833338(this) == this->skelAnime.animation) { func_8083DC54(this, play); } @@ -7390,18 +7382,18 @@ void func_80840DE4(Player* this, PlayState* play) { this->skelAnime.animLength = frames; this->skelAnime.endFrame = frames - 1.0f; - if ((s16)(this->currentYaw - this->actor.shape.rot.y) >= 0) { + if ((s16)(this->yaw - this->actor.shape.rot.y) >= 0) { direction = 1; } else { direction = -1; } - this->skelAnime.playSpeed = direction * (this->linearVelocity * coeff); + this->skelAnime.playSpeed = direction * (this->speedXZ * coeff); LinkAnimation_Update(play, &this->skelAnime); if (LinkAnimation_OnFrame(&this->skelAnime, 0.0f) || LinkAnimation_OnFrame(&this->skelAnime, frames * 0.5f)) { - func_808327F8(this, this->linearVelocity); + func_808327F8(this, this->speedXZ); } if (!func_80837348(play, this, D_808543F4, 1)) { @@ -7434,23 +7426,23 @@ void func_80840DE4(Player* this, PlayState* play) { return; } - if ((sp44 == 0.0f) && (this->linearVelocity == 0.0f)) { + if ((sp44 == 0.0f) && (this->speedXZ == 0.0f)) { func_80839F30(this, play); return; } - temp2 = sp42 - this->currentYaw; + temp2 = sp42 - this->yaw; temp3 = ABS(temp2); if (temp3 > 0x4000) { - if (Math_StepToF(&this->linearVelocity, 0.0f, 1.5f)) { - this->currentYaw = sp42; + if (Math_StepToF(&this->speedXZ, 0.0f, 1.5f)) { + this->yaw = sp42; } return; } - Math_AsymStepToF(&this->linearVelocity, sp44 * 0.4f, 1.5f, 1.5f); - Math_ScaledStepToS(&this->currentYaw, sp42, temp3 * 0.1f); + Math_AsymStepToF(&this->speedXZ, sp44 * 0.4f, 1.5f, 1.5f); + Math_ScaledStepToS(&this->yaw, sp42, temp3 * 0.1f); } } @@ -7469,16 +7461,16 @@ void func_80841138(Player* this, PlayState* play) { } temp1 = this->unk_864; } else { - temp2 = this->linearVelocity - (REG(48) / 100.0f); + temp2 = this->speedXZ - (REG(48) / 100.0f); if (temp2 < 0.0f) { temp1 = 1.0f; - func_8084029C(this, (REG(35) / 1000.0f) + ((REG(36) / 1000.0f) * this->linearVelocity)); + func_8084029C(this, (REG(35) / 1000.0f) + ((REG(36) / 1000.0f) * this->speedXZ)); LinkAnimation_LoadToJoint(play, &this->skelAnime, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_back_walk, this->modelAnimType), this->unk_868); } else { temp1 = (REG(37) / 1000.0f) * temp2; if (temp1 < 1.0f) { - func_8084029C(this, (REG(35) / 1000.0f) + ((REG(36) / 1000.0f) * this->linearVelocity)); + func_8084029C(this, (REG(35) / 1000.0f) + ((REG(36) / 1000.0f) * this->speedXZ)); } else { temp1 = 1.0f; func_8084029C(this, 1.2f + ((REG(38) / 1000.0f) * temp2)); @@ -7501,7 +7493,7 @@ void func_8084140C(Player* this, PlayState* play) { } s32 func_80841458(Player* this, f32* arg1, s16* arg2, PlayState* play) { - if (this->linearVelocity > 6.0f) { + if (this->speedXZ > 6.0f) { func_8084140C(this, play); return 1; } @@ -7509,7 +7501,7 @@ s32 func_80841458(Player* this, f32* arg1, s16* arg2, PlayState* play) { if (*arg1 != 0.0f) { if (func_8083721C(this)) { *arg1 = 0.0f; - *arg2 = this->currentYaw; + *arg2 = this->yaw; } else { return 1; } @@ -7528,7 +7520,7 @@ void func_808414F8(Player* this, PlayState* play) { if (!func_80837348(play, this, D_80854400, 1)) { if (!func_80833C04(this)) { - func_8083C8DC(this, play, this->currentYaw); + func_8083C8DC(this, play, this->yaw); return; } @@ -7546,12 +7538,12 @@ void func_808414F8(Player* this, PlayState* play) { } } } else { - sp2A = sp32 - this->currentYaw; + sp2A = sp32 - this->yaw; - Math_AsymStepToF(&this->linearVelocity, sp34 * 1.5f, 1.5f, 2.0f); - Math_ScaledStepToS(&this->currentYaw, sp32, sp2A * 0.1f); + Math_AsymStepToF(&this->speedXZ, sp34 * 1.5f, 1.5f, 2.0f); + Math_ScaledStepToS(&this->yaw, sp32, sp2A * 0.1f); - if ((sp34 == 0.0f) && (this->linearVelocity == 0.0f)) { + if ((sp34 == 0.0f) && (this->speedXZ == 0.0f)) { func_80839F30(this, play); } } @@ -7574,8 +7566,8 @@ void func_8084170C(Player* this, PlayState* play) { if (!func_80837348(play, this, D_80854400, 1)) { func_80837268(this, &sp30, &sp2E, 0.0f, play); - if (this->linearVelocity == 0.0f) { - this->currentYaw = this->actor.shape.rot.y; + if (this->speedXZ == 0.0f) { + this->yaw = this->actor.shape.rot.y; if (func_8083FD78(this, &sp30, &sp2E, play) > 0) { func_8083C858(this, play); @@ -7605,7 +7597,7 @@ void func_80841860(PlayState* play, Player* this) { this->skelAnime.animation = sp38; - func_8084029C(this, (REG(30) / 1000.0f) + ((REG(32) / 1000.0f) * this->linearVelocity)); + func_8084029C(this, (REG(30) / 1000.0f) + ((REG(32) / 1000.0f) * this->speedXZ)); frame = this->unk_868 * (16.0f / 29.0f); LinkAnimation_BlendToJoint(play, &this->skelAnime, sp34, frame, sp38, frame, this->unk_870, this->blendTable); @@ -7648,7 +7640,7 @@ void func_8084193C(Player* this, PlayState* play) { return; } - if ((this->linearVelocity < 3.6f) && (sp3C < 4.0f)) { + if ((this->speedXZ < 3.6f) && (sp3C < 4.0f)) { if (!func_8008E9C4(this) && func_80833B2C(this)) { func_8083CB94(this, play); } else { @@ -7659,19 +7651,19 @@ void func_8084193C(Player* this, PlayState* play) { func_80840138(this, sp3C, sp3A); - temp2 = sp3A - this->currentYaw; + temp2 = sp3A - this->yaw; temp3 = ABS(temp2); if (temp3 > 0x4000) { - if (Math_StepToF(&this->linearVelocity, 0.0f, 3.0f) != 0) { - this->currentYaw = sp3A; + if (Math_StepToF(&this->speedXZ, 0.0f, 3.0f) != 0) { + this->yaw = sp3A; } return; } sp3C *= 0.9f; - Math_AsymStepToF(&this->linearVelocity, sp3C, 2.0f, 3.0f); - Math_ScaledStepToS(&this->currentYaw, sp3A, temp3 * 0.1f); + Math_AsymStepToF(&this->speedXZ, sp3C, 2.0f, 3.0f); + Math_ScaledStepToS(&this->yaw, sp3A, temp3 * 0.1f); } } @@ -7698,7 +7690,7 @@ void func_80841BA8(Player* this, PlayState* play) { func_8083C0E8(this, play); } - this->currentYaw = this->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y; } } @@ -7732,7 +7724,7 @@ void func_80841CC4(Player* this, s32 arg1, PlayState* play) { rate = this->unk_6C4 * 0.0006f; } - rate *= fabsf(this->linearVelocity) * 0.5f; + rate *= fabsf(this->speedXZ) * 0.5f; if (rate > 1.0f) { rate = 1.0f; @@ -7772,17 +7764,17 @@ void func_80841EE4(Player* this, PlayState* play) { temp1 = this->unk_864; } else { - temp2 = this->linearVelocity - (REG(48) / 100.0f); + temp2 = this->speedXZ - (REG(48) / 100.0f); if (temp2 < 0.0f) { temp1 = 1.0f; - func_8084029C(this, (REG(35) / 1000.0f) + ((REG(36) / 1000.0f) * this->linearVelocity)); + func_8084029C(this, (REG(35) / 1000.0f) + ((REG(36) / 1000.0f) * this->speedXZ)); func_80841CC4(this, 0, play); } else { temp1 = (REG(37) / 1000.0f) * temp2; if (temp1 < 1.0f) { - func_8084029C(this, (REG(35) / 1000.0f) + ((REG(36) / 1000.0f) * this->linearVelocity)); + func_8084029C(this, (REG(35) / 1000.0f) + ((REG(36) / 1000.0f) * this->speedXZ)); } else { temp1 = 1.0f; func_8084029C(this, 1.2f + ((REG(38) / 1000.0f) * temp2)); @@ -7818,7 +7810,7 @@ void func_80842180(Player* this, PlayState* play) { func_8083DF68(this, sp2C, sp2A); func_8083DDC8(this, play); - if ((this->linearVelocity == 0.0f) && (sp2C == 0.0f)) { + if ((this->speedXZ == 0.0f) && (sp2C == 0.0f)) { func_8083C0B8(this, play); } } @@ -7850,7 +7842,7 @@ void func_8084227C(Player* this, PlayState* play) { func_8083DF68(this, sp2C, sp2A); func_8083DDC8(this, play); - if ((this->linearVelocity == 0) && (sp2C == 0)) { + if ((this->speedXZ == 0) && (sp2C == 0)) { func_80839F90(this, play); } } @@ -7899,8 +7891,8 @@ void func_8084251C(Player* this, PlayState* play) { if (!func_80837348(play, this, D_80854440, 1)) { func_80837268(this, &sp30, &sp2E, 0.0f, play); - if (this->linearVelocity == 0.0f) { - this->currentYaw = this->actor.shape.rot.y; + if (this->speedXZ == 0.0f) { + this->yaw = this->actor.shape.rot.y; if (func_8083FC68(this, sp30, sp2E) > 0) { func_8083C858(this, play); @@ -7967,7 +7959,7 @@ s32 func_808428D8(Player* this, PlayState* play) { func_80832264(play, this, &gPlayerAnim_link_normal_defense_kiru); this->unk_84F = 1; this->meleeWeaponAnimation = PLAYER_MWA_STAB_1H; - this->currentYaw = this->actor.shape.rot.y + this->unk_6BE; + this->yaw = this->actor.shape.rot.y + this->unk_6BE; return 1; } @@ -8014,7 +8006,7 @@ s32 func_80842AC4(PlayState* play, Player* this) { } s32 func_80842B7C(PlayState* play, Player* this) { - if (this->heldItemAction == PLAYER_IA_SWORD_BGS) { + if (this->heldItemAction == PLAYER_IA_SWORD_BIGGORON) { if (!gSaveContext.bgsFlag && (gSaveContext.swordHealth > 0.0f)) { if ((gSaveContext.swordHealth -= 1.0f) <= 0.0f) { EffectSsStick_Spawn(play, &this->bodyPartsPos[PLAYER_BODYPART_R_HAND], @@ -8060,7 +8052,7 @@ void func_80842D20(PlayState* play, Player* this) { } Player_RequestRumble(this, 180, 20, 100, 0); - this->linearVelocity = -18.0f; + this->speedXZ = -18.0f; func_80842CF0(play, this); } @@ -8103,7 +8095,7 @@ s32 func_80842DF4(PlayState* play, Player* this) { return 1; } - if (this->linearVelocity >= 0.0f) { + if (this->speedXZ >= 0.0f) { surfaceMaterial = SurfaceType_GetMaterial(&play->colCtx, groundPoly, bgId); if (surfaceMaterial == SURFACE_MATERIAL_WOOD) { @@ -8118,7 +8110,7 @@ s32 func_80842DF4(PlayState* play, Player* this) { } func_80842CF0(play, this); - this->linearVelocity = -14.0f; + this->speedXZ = -14.0f; Player_RequestRumble(this, 180, 20, 100, 0); } } @@ -8297,8 +8289,8 @@ void func_8084377C(Player* this, PlayState* play) { if (!(this->stateFlags1 & PLAYER_STATE1_29) && (this->unk_850 == 0) && (this->unk_8A1 != 0)) { s16 temp = this->actor.shape.rot.y - this->unk_8A2; - this->currentYaw = this->actor.shape.rot.y = this->unk_8A2; - this->linearVelocity = this->unk_8A4; + this->yaw = this->actor.shape.rot.y = this->unk_8A2; + this->speedXZ = this->unk_8A4; if (ABS(temp) > 0x4000) { this->actor.shape.rot.y = this->unk_8A2 + 0x8000; @@ -8326,8 +8318,8 @@ void func_8084377C(Player* this, PlayState* play) { } func_80832264(play, this, - (this->currentYaw != this->actor.shape.rot.y) ? &gPlayerAnim_link_normal_front_downB - : &gPlayerAnim_link_normal_back_downB); + (this->yaw != this->actor.shape.rot.y) ? &gPlayerAnim_link_normal_front_downB + : &gPlayerAnim_link_normal_back_downB); func_80832698(this, NA_SE_VO_LI_FREEZE); } } @@ -8343,7 +8335,7 @@ void func_80843954(Player* this, PlayState* play) { func_8083721C(this); - if (LinkAnimation_Update(play, &this->skelAnime) && (this->linearVelocity == 0.0f)) { + if (LinkAnimation_Update(play, &this->skelAnime) && (this->speedXZ == 0.0f)) { if (this->stateFlags1 & PLAYER_STATE1_29) { this->unk_850++; } else { @@ -8352,9 +8344,9 @@ void func_80843954(Player* this, PlayState* play) { } func_808322D0(play, this, - (this->currentYaw != this->actor.shape.rot.y) ? &gPlayerAnim_link_normal_front_down_wake - : &gPlayerAnim_link_normal_back_down_wake); - this->currentYaw = this->actor.shape.rot.y; + (this->yaw != this->actor.shape.rot.y) ? &gPlayerAnim_link_normal_front_down_wake + : &gPlayerAnim_link_normal_back_down_wake); + this->yaw = this->actor.shape.rot.y; } } @@ -8476,7 +8468,7 @@ s32 func_80843E64(PlayState* play, Player* this) { sp34 = this->fallDistance; } - Math_StepToF(&this->linearVelocity, 0.0f, 1.0f); + Math_StepToF(&this->speedXZ, 0.0f, 1.0f); this->stateFlags1 &= ~(PLAYER_STATE1_18 | PLAYER_STATE1_19); @@ -8556,7 +8548,7 @@ void func_8084411C(Player* this, PlayState* play) { if (!func_80835644(play, this, heldActor) && (heldActor->id == ACTOR_EN_NIW) && CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)) { - func_8084409C(play, this, this->linearVelocity + 2.0f, this->actor.velocity.y + 2.0f); + func_8084409C(play, this, this->speedXZ + 2.0f, this->actor.velocity.y + 2.0f); } } @@ -8590,7 +8582,7 @@ void func_8084411C(Player* this, PlayState* play) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && !(this->stateFlags2 & PLAYER_STATE2_19) && - !(this->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_27)) && (this->linearVelocity > 0.0f)) { + !(this->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_27)) && (this->speedXZ > 0.0f)) { if ((this->wallHeight >= 150.0f) && (this->unk_84B[this->unk_846] == 0)) { func_8083EC18(this, play, sInteractWallFlags); } else if ((this->unk_88C >= 2) && (this->wallHeight < 150.0f) && @@ -8605,7 +8597,7 @@ void func_8084411C(Player* this, PlayState* play) { this->actor.world.pos.y += this->wallHeight; func_8083A5C4(play, this, this->actor.wallPoly, this->wallDistance, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_jump_climb_hold, this->modelAnimType)); - this->actor.shape.rot.y = this->currentYaw += 0x8000; + this->actor.shape.rot.y = this->yaw += 0x8000; this->stateFlags1 |= PLAYER_STATE1_13; } } @@ -8678,14 +8670,14 @@ void func_80844708(Player* this, PlayState* play) { if (func_80842964(this, play) == 0) { if (this->unk_850 != 0) { - Math_StepToF(&this->linearVelocity, 0.0f, 2.0f); + Math_StepToF(&this->speedXZ, 0.0f, 2.0f); temp = func_808374A0(play, this, &this->skelAnime, 5.0f); if ((temp != 0) && ((temp > 0) || sp44)) { func_8083A060(this, play); } } else { - if (this->linearVelocity >= 7.0f) { + if (this->speedXZ >= 7.0f) { if (((this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && (D_8085360C < 0x2000)) || ((this->cylinder.base.ocFlags1 & OC1_HIT) && (cylinderOc = this->cylinder.base.oc, @@ -8702,7 +8694,7 @@ void func_80844708(Player* this, PlayState* play) { } func_80832264(play, this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_hip_down, this->modelAnimType)); - this->linearVelocity = -this->linearVelocity; + this->speedXZ = -this->speedXZ; Player_RequestQuake(play, 33267, 3, 12); Player_RequestRumble(this, 255, 20, 150, 0); Player_PlaySfx(this, NA_SE_PL_BODY_HIT); @@ -8744,7 +8736,7 @@ void func_80844A44(Player* this, PlayState* play) { func_80832284(play, this, &gPlayerAnim_link_normal_run_jump_water_fall_wait); } - Math_StepToF(&this->linearVelocity, 0.0f, 0.05f); + Math_StepToF(&this->speedXZ, 0.0f, 0.05f); if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.colChkInfo.damage = 0x10; @@ -8766,7 +8758,7 @@ void func_80844AF4(Player* this, PlayState* play) { if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { func_80837268(this, &sp2C, &sp2A, 0.0f, play); - func_8083DFE0(this, &sp2C, &this->currentYaw); + func_8083DFE0(this, &sp2C, &this->yaw); return; } @@ -8819,7 +8811,7 @@ void func_80844D68(Player* this, PlayState* play) { func_80839FFC(this, play); func_80832318(this); func_80832B0C(play, this, D_80854368[Player_HoldsTwoHandedWeapon(this)]); - this->currentYaw = this->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y; } void func_80844DC8(Player* this, PlayState* play) { @@ -8884,10 +8876,10 @@ void func_80845000(Player* this, PlayState* play) { s16 temp5; s32 sp44; - temp1 = this->currentYaw - this->actor.shape.rot.y; + temp1 = this->yaw - this->actor.shape.rot.y; temp2 = ABS(temp1); - sp5C = fabsf(this->linearVelocity); + sp5C = fabsf(this->speedXZ); sp58 = sp5C * 1.5f; this->stateFlags1 |= PLAYER_STATE1_12; @@ -8919,23 +8911,23 @@ void func_80845000(Player* this, PlayState* play) { if (temp4 == 0) { sp54 = 0.0f; - sp52 = this->currentYaw; + sp52 = this->yaw; } - temp5 = sp52 - this->currentYaw; + temp5 = sp52 - this->yaw; sp44 = ABS(temp5); if (sp44 > 0x4000) { - if (Math_StepToF(&this->linearVelocity, 0.0f, 1.0f)) { - this->currentYaw = sp52; + if (Math_StepToF(&this->speedXZ, 0.0f, 1.0f)) { + this->yaw = sp52; } return; } - Math_AsymStepToF(&this->linearVelocity, sp54 * 0.2f, 1.0f, 0.5f); - Math_ScaledStepToS(&this->currentYaw, sp52, sp44 * 0.1f); + Math_AsymStepToF(&this->speedXZ, sp54 * 0.2f, 1.0f, 0.5f); + Math_ScaledStepToS(&this->yaw, sp52, sp44 * 0.1f); - if ((sp54 == 0.0f) && (this->linearVelocity == 0.0f)) { + if ((sp54 == 0.0f) && (this->speedXZ == 0.0f)) { func_80844DC8(this, play); } } @@ -8950,7 +8942,7 @@ void func_80845308(Player* this, PlayState* play) { s16 temp5; s32 sp44; - sp5C = fabsf(this->linearVelocity); + sp5C = fabsf(this->speedXZ); this->stateFlags1 |= PLAYER_STATE1_12; @@ -8987,23 +8979,23 @@ void func_80845308(Player* this, PlayState* play) { if (temp4 == 0) { sp54 = 0.0f; - sp52 = this->currentYaw; + sp52 = this->yaw; } - temp5 = sp52 - this->currentYaw; + temp5 = sp52 - this->yaw; sp44 = ABS(temp5); if (sp44 > 0x4000) { - if (Math_StepToF(&this->linearVelocity, 0.0f, 1.0f)) { - this->currentYaw = sp52; + if (Math_StepToF(&this->speedXZ, 0.0f, 1.0f)) { + this->yaw = sp52; } return; } - Math_AsymStepToF(&this->linearVelocity, sp54 * 0.2f, 1.0f, 0.5f); - Math_ScaledStepToS(&this->currentYaw, sp52, sp44 * 0.1f); + Math_AsymStepToF(&this->speedXZ, sp54 * 0.2f, 1.0f, 0.5f); + Math_ScaledStepToS(&this->yaw, sp52, sp44 * 0.1f); - if ((sp54 == 0.0f) && (this->linearVelocity == 0.0f) && (sp5C == 0.0f)) { + if ((sp54 == 0.0f) && (this->speedXZ == 0.0f) && (sp5C == 0.0f)) { func_80844DC8(this, play); } } @@ -9019,7 +9011,7 @@ void func_80845668(Player* this, PlayState* play) { sp3C = LinkAnimation_Update(play, &this->skelAnime); if (this->skelAnime.animation == &gPlayerAnim_link_normal_250jump_start) { - this->linearVelocity = 1.0f; + this->speedXZ = 1.0f; if (LinkAnimation_OnFrame(&this->skelAnime, 8.0f)) { temp1 = this->wallHeight; @@ -9095,7 +9087,7 @@ void func_808458D0(Player* this, PlayState* play) { } s32 func_80845964(PlayState* play, Player* this, CsCmdActorCue* cue, f32 arg3, s16 arg4, s32 arg5) { - if ((arg5 != 0) && (this->linearVelocity == 0.0f)) { + if ((arg5 != 0) && (this->speedXZ == 0.0f)) { return LinkAnimation_Update(play, &this->skelAnime); } @@ -9128,7 +9120,7 @@ s32 func_80845964(PlayState* play, Player* this, CsCmdActorCue* cue, f32 arg3, s func_80841EE4(this, play); func_8083DF68(this, arg3, arg4); - if ((arg3 == 0.0f) && (this->linearVelocity == 0.0f)) { + if ((arg3 == 0.0f) && (this->speedXZ == 0.0f)) { func_8083BF50(this, play); } @@ -9173,7 +9165,7 @@ void func_80845CA4(Player* this, PlayState* play) { LinkAnimation_Update(play, &this->skelAnime); if (DECR(this->doorTimer) == 0) { - this->linearVelocity = 0.1f; + this->speedXZ = 0.1f; this->unk_850 = 1; } } else if (this->unk_84F == 0) { @@ -9206,7 +9198,7 @@ void func_80845CA4(Player* this, PlayState* play) { temp = func_80845BA0(play, this, &sp34, sp30); - if ((this->unk_850 == 0) || ((temp == 0) && (this->linearVelocity == 0.0f) && + if ((this->unk_850 == 0) || ((temp == 0) && (this->speedXZ == 0.0f) && (Play_GetCamera(play, CAM_ID_MAIN)->stateFlags & CAM_STATE_4))) { func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN)); @@ -9418,7 +9410,7 @@ void func_80846578(Player* this, PlayState* play) { } if (LinkAnimation_OnFrame(&this->skelAnime, 3.0f)) { - func_8084409C(play, this, this->linearVelocity + 8.0f, 12.0f); + func_8084409C(play, this, this->speedXZ + 8.0f, 12.0f); } } @@ -9527,7 +9519,7 @@ void func_808467D4(PlayState* play, Player* this) { func_80835C58(play, this, func_8084E9AC, 0); this->stateFlags1 |= PLAYER_STATE1_29; Math_Vec3f_Copy(&this->actor.world.pos, &D_808546F4); - this->currentYaw = this->actor.shape.rot.y = -0x8000; + this->yaw = this->actor.shape.rot.y = -0x8000; LinkAnimation_Change(play, &this->skelAnime, this->ageProperties->unk_A0, 2.0f / 3.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f); func_80832F54(play, this, 0x28F); @@ -9588,7 +9580,7 @@ void Player_InitCommon(Player* this, PlayState* play, FlexSkeletonHeader* skelHe this->ageProperties = &sAgeProperties[gSaveContext.linkAge]; Actor_ProcessInitChain(&this->actor, sInitChain); this->meleeWeaponEffectIndex = TOTAL_EFFECT_COUNT; - this->currentYaw = this->actor.world.rot.y; + this->yaw = this->actor.world.rot.y; func_80834644(play, this); SkelAnime_InitLink(play, &this->skelAnime, skelHeader, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_wait, this->modelAnimType), @@ -9613,9 +9605,22 @@ void Player_InitCommon(Player* this, PlayState* play, FlexSkeletonHeader* skelHe } static void (*D_80854738[])(PlayState* play, Player* this) = { - func_80846648, func_808467D4, func_80846660, func_808468A8, func_808468E8, func_808469BC, - func_80846A68, func_80846978, func_8083CA54, func_8083CA54, func_8083CA54, func_8083CA54, - func_8083CA54, func_8083CA20, func_8083CA54, func_8083CA9C, + /* 0x0 */ func_80846648, + /* 0x1 */ func_808467D4, // From time travel + /* 0x2 */ func_80846660, + /* 0x3 */ func_808468A8, + /* 0x4 */ func_808468E8, + /* 0x5 */ func_808469BC, + /* 0x6 */ func_80846A68, + /* 0x7 */ func_80846978, + /* 0x8 */ func_8083CA54, + /* 0x9 */ func_8083CA54, + /* 0xA */ func_8083CA54, + /* 0xB */ func_8083CA54, + /* 0xC */ func_8083CA54, + /* 0xD */ func_8083CA20, + /* 0xE */ func_8083CA54, + /* 0xF */ func_8083CA9C, }; static Vec3f D_80854778 = { 0.0f, 50.0f, 0.0f }; @@ -9670,7 +9675,7 @@ void Player_Init(Actor* thisx, PlayState* play2) { Math_Vec3f_Copy(&thisx->home.pos, &thisx->world.pos); Math_Vec3f_Copy(&thisx->prevPos, &thisx->world.pos); this->fallStartHeight = thisx->world.pos.y; - this->currentYaw = thisx->shape.rot.y = gSaveContext.respawn[respawnMode].yaw; + this->yaw = thisx->shape.rot.y = gSaveContext.respawn[respawnMode].yaw; thisx->params = gSaveContext.respawn[respawnMode].playerParams; } @@ -10081,7 +10086,7 @@ void func_80847BA0(PlayState* play, Player* this) { D_80853608 = ABS(sp9A); - sp9A = this->currentYaw - (s16)(this->actor.wallYaw + 0x8000); + sp9A = this->yaw - (s16)(this->actor.wallYaw + 0x8000); D_8085360C = ABS(sp9A); @@ -10161,7 +10166,7 @@ void func_80847BA0(PlayState* play, Player* this) { } if (spC7 == this->unk_88C) { - if ((this->linearVelocity != 0.0f) && (this->unk_88D < 100)) { + if ((this->speedXZ != 0.0f) && (this->unk_88D < 100)) { this->unk_88D++; } } else { @@ -10189,8 +10194,8 @@ void func_80847BA0(PlayState* play, Player* this) { invFloorPolyNormalY = 1.0f / COLPOLY_GET_NORMAL(floorPoly->normal.y); floorPolyNormalZ = COLPOLY_GET_NORMAL(floorPoly->normal.z); - sp4C = Math_SinS(this->currentYaw); - sp44 = Math_CosS(this->currentYaw); + sp4C = Math_SinS(this->yaw); + sp44 = Math_CosS(this->yaw); this->unk_898 = Math_Atan2S(1.0f, (-(floorPolyNormalX * sp4C) - (floorPolyNormalZ * sp44)) * invFloorPolyNormalY); @@ -10281,7 +10286,7 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) { camMode = CAM_MODE_STILL; } else { camMode = CAM_MODE_NORMAL; - if ((this->linearVelocity == 0.0f) && + if ((this->speedXZ == 0.0f) && (!(this->stateFlags1 & PLAYER_STATE1_23) || (this->rideActor->speed == 0.0f))) { // not moving seqMode = SEQ_MODE_STILL; @@ -10376,7 +10381,7 @@ void func_80848C74(PlayState* play, Player* this) { if (this->currentTunic == PLAYER_TUNIC_GORON) { sp54 = 20; } else { - sp54 = (s32)(this->linearVelocity * 0.4f) + 1; + sp54 = (s32)(this->speedXZ * 0.4f) + 1; } spawnedFlame = false; @@ -10537,8 +10542,8 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { if (this->stateFlags2 & PLAYER_STATE2_15) { if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { - func_80832210(this); - Actor_MoveForward(&this->actor); + Player_ZeroSpeedXZ(this); + Actor_MoveXZGravity(&this->actor); } func_80847BA0(play, this); @@ -10589,7 +10594,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { this->actor.shape.face = this->unk_3A8[0] + ((play->gameplayFrames & 32) ? 0 : 3); if (this->currentMask == PLAYER_MASK_BUNNY) { - func_8085002C(this); + Player_UpdateBunnyEars(this); } if (func_8002DD6C(this) != 0) { @@ -10601,38 +10606,38 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { (this->currentBoots != PLAYER_BOOTS_IRON)) || ((this->currentBoots == PLAYER_BOOTS_HOVER) && !(this->stateFlags1 & (PLAYER_STATE1_27 | PLAYER_STATE1_29)))) { - f32 sp70 = this->linearVelocity; - s16 sp6E = this->currentYaw; - s16 yawDiff = this->actor.world.rot.y - sp6E; + f32 speedXZTarget = this->speedXZ; + s16 yawTarget = this->yaw; + s16 yawDiff = this->actor.world.rot.y - yawTarget; s32 pad; if ((ABS(yawDiff) > 0x6000) && (this->actor.speed != 0.0f)) { - sp70 = 0.0f; - sp6E += 0x8000; + speedXZTarget = 0.0f; + yawTarget += 0x8000; } - if (Math_StepToF(&this->actor.speed, sp70, 0.35f) && (sp70 == 0.0f)) { - this->actor.world.rot.y = this->currentYaw; + if (Math_StepToF(&this->actor.speed, speedXZTarget, 0.35f) && (speedXZTarget == 0.0f)) { + this->actor.world.rot.y = this->yaw; } - if (this->linearVelocity != 0.0f) { - s32 phi_v0; + if (this->speedXZ != 0.0f) { + s32 step; - phi_v0 = (fabsf(this->linearVelocity) * 700.0f) - (fabsf(this->actor.speed) * 100.0f); - phi_v0 = CLAMP(phi_v0, 0, 1350); + step = (fabsf(this->speedXZ) * 700.0f) - (fabsf(this->actor.speed) * 100.0f); + step = CLAMP(step, 0, 1350); - Math_ScaledStepToS(&this->actor.world.rot.y, sp6E, phi_v0); + Math_ScaledStepToS(&this->actor.world.rot.y, yawTarget, step); } - if ((this->linearVelocity == 0.0f) && (this->actor.speed != 0.0f)) { - func_800F4138(&this->actor.projectedPos, 0xD0, this->actor.speed); + if ((this->speedXZ == 0.0f) && (this->actor.speed != 0.0f)) { + func_800F4138(&this->actor.projectedPos, NA_SE_PL_SLIP_LEVEL - SFX_FLAG, this->actor.speed); } } else { - this->actor.speed = this->linearVelocity; - this->actor.world.rot.y = this->currentYaw; + this->actor.speed = this->speedXZ; + this->actor.world.rot.y = this->yaw; } - func_8002D868(&this->actor); + Actor_UpdateVelocityXZGravity(&this->actor); if ((this->pushedSpeed != 0.0f) && !Player_InCsMode(play) && !(this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_21)) && @@ -10641,7 +10646,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { this->actor.velocity.z += this->pushedSpeed * Math_CosS(this->pushedYaw); } - func_8002D7EC(&this->actor); + Actor_UpdatePos(&this->actor); func_80847BA0(play, this); } else { D_808535E4 = FLOOR_TYPE_0; @@ -10729,11 +10734,11 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { if ((cue != NULL) && (D_808547C4[cue->id] != PLAYER_CSMODE_NONE)) { func_8002DF54(play, NULL, PLAYER_CSMODE_6); - func_80832210(this); + Player_ZeroSpeedXZ(this); } else if ((this->csMode == PLAYER_CSMODE_NONE) && !(this->stateFlags2 & PLAYER_STATE2_10) && (play->csCtx.state != CS_STATE_STOP)) { func_8002DF54(play, NULL, PLAYER_CSMODE_49); - func_80832210(this); + Player_ZeroSpeedXZ(this); } } @@ -10929,7 +10934,13 @@ void Player_Update(Actor* thisx, PlayState* play) { MREG(55) = this->actor.world.rot.y; } -static struct_80858AC8 D_80858AC8; +typedef struct { + /* 0x0 */ Vec3s rot; + /* 0x6 */ Vec3s angVel; +} BunnyEarKinematics; // size = 0xC + +static BunnyEarKinematics sBunnyEarKinematics; + static Vec3s D_80858AD8[25]; static Gfx* sMaskDlists[PLAYER_MASK_MAX - 1] = { @@ -10952,24 +10963,26 @@ void Player_DrawGameplay(PlayState* play, Player* this, s32 lod, Gfx* cullDList, Player_PostLimbDrawGameplay, this); if ((overrideLimbDraw == Player_OverrideLimbDrawGameplayDefault) && (this->currentMask != PLAYER_MASK_NONE)) { - Mtx* sp70 = Graph_Alloc(play->state.gfxCtx, 2 * sizeof(Mtx)); + Mtx* bunnyEarMtx = Graph_Alloc(play->state.gfxCtx, 2 * sizeof(Mtx)); if (this->currentMask == PLAYER_MASK_BUNNY) { - Vec3s sp68; + Vec3s earRot; - gSPSegment(POLY_OPA_DISP++, 0x0B, sp70); + gSPSegment(POLY_OPA_DISP++, 0x0B, bunnyEarMtx); - sp68.x = D_80858AC8.unk_02 + 0x3E2; - sp68.y = D_80858AC8.unk_04 + 0xDBE; - sp68.z = D_80858AC8.unk_00 - 0x348A; - Matrix_SetTranslateRotateYXZ(97.0f, -1203.0f, -240.0f, &sp68); - Matrix_ToMtx(sp70++, "../z_player.c", 19273); + // Right ear + earRot.x = sBunnyEarKinematics.rot.y + 0x3E2; + earRot.y = sBunnyEarKinematics.rot.z + 0xDBE; + earRot.z = sBunnyEarKinematics.rot.x - 0x348A; + Matrix_SetTranslateRotateYXZ(97.0f, -1203.0f, -240.0f, &earRot); + Matrix_ToMtx(bunnyEarMtx++, "../z_player.c", 19273); - sp68.x = D_80858AC8.unk_02 - 0x3E2; - sp68.y = -0xDBE - D_80858AC8.unk_04; - sp68.z = D_80858AC8.unk_00 - 0x348A; - Matrix_SetTranslateRotateYXZ(97.0f, -1203.0f, 240.0f, &sp68); - Matrix_ToMtx(sp70, "../z_player.c", 19279); + // Left ear + earRot.x = sBunnyEarKinematics.rot.y - 0x3E2; + earRot.y = -sBunnyEarKinematics.rot.z - 0xDBE; + earRot.z = sBunnyEarKinematics.rot.x - 0x348A; + Matrix_SetTranslateRotateYXZ(97.0f, -1203.0f, 240.0f, &earRot); + Matrix_ToMtx(bunnyEarMtx, "../z_player.c", 19279); } gSPDisplayList(POLY_OPA_DISP++, sMaskDlists[this->currentMask - 1]); @@ -11176,7 +11189,7 @@ void func_8084AEEC(Player* this, f32* arg1, f32 arg2, s16 arg3) { } Math_AsymStepToF(arg1, arg2 * 0.8f, temp1, (fabsf(*arg1) * 0.02f) + 0.05f); - Math_ScaledStepToS(&this->currentYaw, arg3, 1600); + Math_ScaledStepToS(&this->yaw, arg3, 1600); } void func_8084B000(Player* this) { @@ -11250,7 +11263,7 @@ void func_8084B158(PlayState* play, Player* this, Input* input, f32 arg3) { void func_8084B1D8(Player* this, PlayState* play) { if (this->stateFlags1 & PLAYER_STATE1_27) { func_8084B000(this); - func_8084AEEC(this, &this->linearVelocity, 0, this->actor.shape.rot.y); + func_8084AEEC(this, &this->speedXZ, 0, this->actor.shape.rot.y); } else { func_8083721C(this); } @@ -11276,7 +11289,7 @@ void func_8084B1D8(Player* this, PlayState* play) { } } - this->currentYaw = this->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y; } s32 func_8084B3CC(PlayState* play, Player* this) { @@ -11290,7 +11303,7 @@ s32 func_8084B3CC(PlayState* play, Player* this) { this->stateFlags1 |= PLAYER_STATE1_20; func_80832264(play, this, func_80833338(this)); - func_80832210(this); + Player_ZeroSpeedXZ(this); func_8083B010(this); return 1; } @@ -11364,7 +11377,7 @@ void func_8084B530(Player* this, PlayState* play) { } if (this->unk_664 != NULL) { - this->currentYaw = this->actor.shape.rot.y = func_8083DB98(this, 0); + this->yaw = this->actor.shape.rot.y = func_8083DB98(this, 0); } } @@ -11436,7 +11449,7 @@ void func_8084B898(Player* this, PlayState* play) { if (this->stateFlags2 & PLAYER_STATE2_4) { func_8084B840(play, this, 2.0f); - this->linearVelocity = 2.0f; + this->speedXZ = 2.0f; } } @@ -11532,7 +11545,7 @@ void func_8084BBE4(Player* this, PlayState* play) { } } - Math_ScaledStepToS(&this->actor.shape.rot.y, this->currentYaw, 0x800); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->yaw, 0x800); if (this->unk_84F != 0) { func_80837268(this, &sp3C, &sp3A, 0.0f, play); @@ -11549,9 +11562,9 @@ void func_8084BBE4(Player* this, PlayState* play) { if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A) || (this->actor.shape.feetFloorFlag != 0)) { func_80837B60(this); if (this->unk_84F < 0) { - this->linearVelocity = -0.8f; + this->speedXZ = -0.8f; } else { - this->linearVelocity = 0.8f; + this->speedXZ = 0.8f; } func_80837B9C(this, play); this->stateFlags1 &= ~(PLAYER_STATE1_13 | PLAYER_STATE1_14); @@ -11657,8 +11670,8 @@ void func_8084BF1C(Player* this, PlayState* play) { this->stateFlags1 &= ~PLAYER_STATE1_21; func_8083A5C4(play, this, this->actor.wallPoly, this->ageProperties->unk_3C, &gPlayerAnim_link_normal_jump_climb_up_free); - this->currentYaw += 0x8000; - this->actor.shape.rot.y = this->currentYaw; + this->yaw += 0x8000; + this->actor.shape.rot.y = this->yaw; func_8083A9B8(this, &gPlayerAnim_link_normal_jump_climb_up_free, play); this->stateFlags1 |= PLAYER_STATE1_14; } else { @@ -11799,7 +11812,7 @@ void func_8084C760(Player* this, PlayState* play) { if (!Player_TryLeavingCrawlspace(this, play)) { // Move forward and back while inside the crawlspace - this->linearVelocity = sControlInput->rel.stick_y * 0.03f; + this->speedXZ = sControlInput->rel.stick_y * 0.03f; } } return; @@ -12055,7 +12068,7 @@ void func_8084CC98(Player* this, PlayState* play) { this->actor.world.pos.y = (rideActor->actor.world.pos.y + rideActor->riderPos.y) - 27.0f; this->actor.world.pos.z = rideActor->actor.world.pos.z + rideActor->riderPos.z; - this->currentYaw = this->actor.shape.rot.y = rideActor->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y = rideActor->actor.shape.rot.y; if ((this->csMode != PLAYER_CSMODE_NONE) || (!func_8083224C(play) && ((rideActor->actor.speed != 0.0f) || !func_8083B644(this, play)) && @@ -12184,7 +12197,7 @@ void func_8084D530(Player* this, f32* arg1, f32 arg2, s16 arg3) { void func_8084D574(PlayState* play, Player* this, s16 arg2) { func_80835C58(play, this, func_8084D84C, 0); - this->actor.shape.rot.y = this->currentYaw = arg2; + this->actor.shape.rot.y = this->yaw = arg2; func_80832C6C(play, this, &gPlayerAnim_link_swimer_swim); } @@ -12220,7 +12233,7 @@ void func_8084D610(Player* this, PlayState* play) { if (sp34 != 0.0f) { s16 temp = this->actor.shape.rot.y - sp32; - if ((ABS(temp) > 0x6000) && !Math_StepToF(&this->linearVelocity, 0.0f, 1.0f)) { + if ((ABS(temp) > 0x6000) && !Math_StepToF(&this->speedXZ, 0.0f, 1.0f)) { return; } @@ -12232,7 +12245,7 @@ void func_8084D610(Player* this, PlayState* play) { } } - func_8084AEEC(this, &this->linearVelocity, sp34, sp32); + func_8084AEEC(this, &this->speedXZ, sp34, sp32); } } @@ -12240,7 +12253,7 @@ void func_8084D7C4(Player* this, PlayState* play) { if (!func_8083B040(this, play)) { this->stateFlags2 |= PLAYER_STATE2_5; - func_8084B158(play, this, NULL, this->linearVelocity); + func_8084B158(play, this, NULL, this->speedXZ); func_8084B000(this); if (DECR(this->unk_850) == 0) { @@ -12256,7 +12269,7 @@ void func_8084D84C(Player* this, PlayState* play) { this->stateFlags2 |= PLAYER_STATE2_5; - func_8084B158(play, this, sControlInput, this->linearVelocity); + func_8084B158(play, this, sControlInput, this->speedXZ); func_8084B000(this); if (!func_80837348(play, this, D_80854444, 1) && !func_8083D12C(play, this, sControlInput)) { @@ -12269,7 +12282,7 @@ void func_8084D84C(Player* this, PlayState* play) { func_8084D5CC(play, this); } - func_8084D530(this, &this->linearVelocity, sp34, sp32); + func_8084D530(this, &this->speedXZ, sp34, sp32); } } @@ -12278,16 +12291,16 @@ s32 func_8084D980(PlayState* play, Player* this, f32* arg2, s16* arg3) { s16 temp1; s32 temp2; - temp1 = this->currentYaw - *arg3; + temp1 = this->yaw - *arg3; if (ABS(temp1) > 0x6000) { anim = &gPlayerAnim_link_swimer_swim_wait; - if (Math_StepToF(&this->linearVelocity, 0.0f, 1.0f)) { - this->currentYaw = *arg3; + if (Math_StepToF(&this->speedXZ, 0.0f, 1.0f)) { + this->yaw = *arg3; } else { *arg2 = 0.0f; - *arg3 = this->currentYaw; + *arg3 = this->yaw; } } else { temp2 = func_8083FD78(this, arg2, arg3, play); @@ -12315,7 +12328,7 @@ void func_8084DAB4(Player* this, PlayState* play) { f32 sp2C; s16 sp2A; - func_8084B158(play, this, sControlInput, this->linearVelocity); + func_8084B158(play, this, sControlInput, this->speedXZ); func_8084B000(this); if (!func_80837348(play, this, D_80854444, 1) && !func_8083D12C(play, this, sControlInput)) { @@ -12329,7 +12342,7 @@ void func_8084DAB4(Player* this, PlayState* play) { func_8084D980(play, this, &sp2C, &sp2A); } - func_8084D530(this, &this->linearVelocity, sp2C, sp2A); + func_8084D530(this, &this->speedXZ, sp2C, sp2A); } } @@ -12338,8 +12351,8 @@ void func_8084DBC4(PlayState* play, Player* this, f32 arg2) { s16 sp2A; func_80837268(this, &sp2C, &sp2A, 0.0f, play); - func_8084AEEC(this, &this->linearVelocity, sp2C * 0.5f, sp2A); - func_8084AEEC(this, &this->actor.velocity.y, arg2, this->currentYaw); + func_8084AEEC(this, &this->speedXZ, sp2C * 0.5f, sp2A); + func_8084AEEC(this, &this->actor.velocity.y, arg2, this->yaw); } void func_8084DC48(Player* this, PlayState* play) { @@ -12418,7 +12431,7 @@ void func_8084DFAC(PlayState* play, Player* this) { func_8084DF6C(play, this); func_808322FC(this); func_8083C0E8(this, play); - this->currentYaw = this->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y; } s32 func_8084DFF4(PlayState* play, Player* this) { @@ -12490,7 +12503,7 @@ void func_8084E1EC(Player* this, PlayState* play) { } func_8084B000(this); - func_8084AEEC(this, &this->linearVelocity, 0.0f, this->actor.shape.rot.y); + func_8084AEEC(this, &this->speedXZ, 0.0f, this->actor.shape.rot.y); } void func_8084E30C(Player* this, PlayState* play) { @@ -12500,7 +12513,7 @@ void func_8084E30C(Player* this, PlayState* play) { func_80838F18(play, this); } - func_8084AEEC(this, &this->linearVelocity, 0.0f, this->actor.shape.rot.y); + func_8084AEEC(this, &this->speedXZ, 0.0f, this->actor.shape.rot.y); } void func_8084E368(Player* this, PlayState* play) { @@ -12510,7 +12523,7 @@ void func_8084E368(Player* this, PlayState* play) { func_80843AE8(play, this); } - func_8084AEEC(this, &this->linearVelocity, 0.0f, this->actor.shape.rot.y); + func_8084AEEC(this, &this->speedXZ, 0.0f, this->actor.shape.rot.y); } static s16 sWarpSongEntrances[] = { @@ -12942,7 +12955,7 @@ void func_8084F104(Player* this, PlayState* play) { } if ((this->unk_84F == 0) && (this->unk_664 != NULL)) { - this->currentYaw = this->actor.shape.rot.y = func_8083DB98(this, 0); + this->yaw = this->actor.shape.rot.y = func_8083DB98(this, 0); } } @@ -12988,7 +13001,7 @@ void func_8084F390(Player* this, PlayState* play) { sp44 = downwardSlopeYaw + 0x8000; } - if (this->linearVelocity < 0) { + if (this->speedXZ < 0) { downwardSlopeYaw += 0x8000; } @@ -13006,7 +13019,7 @@ void func_8084F390(Player* this, PlayState* play) { sp4C = 1.0f; } - if (Math_AsymStepToF(&this->linearVelocity, sp50, sp4C, sp48) && (sp50 == 0)) { + if (Math_AsymStepToF(&this->speedXZ, sp50, sp4C, sp48) && (sp50 == 0)) { LinkAnimationHeader* anim; if (this->unk_84F == 0) { @@ -13017,7 +13030,7 @@ void func_8084F390(Player* this, PlayState* play) { func_8083A098(this, anim, play); } - Math_SmoothStepToS(&this->currentYaw, downwardSlopeYaw, 10, 4000, 800); + Math_SmoothStepToS(&this->yaw, downwardSlopeYaw, 10, 4000, 800); Math_ScaledStepToS(&this->actor.shape.rot.y, sp44, 2000); } } @@ -13111,7 +13124,7 @@ void func_8084F9C0(Player* this, PlayState* play) { if (this->actor.velocity.y < 0.0f) { func_80837B9C(this, play); } else if (this->actor.velocity.y < 6.0f) { - Math_StepToF(&this->linearVelocity, 3.0f, 0.5f); + Math_StepToF(&this->speedXZ, 3.0f, 0.5f); } } @@ -13195,7 +13208,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)) { @@ -13223,7 +13236,7 @@ s32 func_8084FCAC(Player* this, PlayState* play) { } } - func_80832210(this); + Player_ZeroSpeedXZ(this); this->actor.gravity = 0.0f; this->actor.velocity.z = 0.0f; @@ -13255,44 +13268,50 @@ void func_8084FF7C(Player* this) { } } -void func_8085002C(Player* this) { - s32 pad; - s16 sp2A; - s16 sp28; - s16 sp26; +/** + * Updates the Bunny Hood's floppy ears' rotation and velocity. + */ +void Player_UpdateBunnyEars(Player* this) { + Vec3s force; + s16 angle; - D_80858AC8.unk_06 -= D_80858AC8.unk_06 >> 3; - D_80858AC8.unk_08 -= D_80858AC8.unk_08 >> 3; - D_80858AC8.unk_06 += -D_80858AC8.unk_00 >> 2; - D_80858AC8.unk_08 += -D_80858AC8.unk_02 >> 2; + // Damping: decay by 1/8 the previous value each frame + sBunnyEarKinematics.angVel.x -= sBunnyEarKinematics.angVel.x >> 3; + sBunnyEarKinematics.angVel.y -= sBunnyEarKinematics.angVel.y >> 3; - sp26 = this->actor.world.rot.y - this->actor.shape.rot.y; + // Elastic restorative force + sBunnyEarKinematics.angVel.x += -sBunnyEarKinematics.rot.x >> 2; + sBunnyEarKinematics.angVel.y += -sBunnyEarKinematics.rot.y >> 2; - sp28 = (s32)(this->actor.speed * -200.0f * Math_CosS(sp26) * (Rand_CenteredFloat(2.0f) + 10.0f)) & 0xFFFF; - sp2A = (s32)(this->actor.speed * 100.0f * Math_SinS(sp26) * (Rand_CenteredFloat(2.0f) + 10.0f)) & 0xFFFF; + // Forcing from motion relative to shape frame + angle = this->actor.world.rot.y - this->actor.shape.rot.y; + force.x = (s32)(this->actor.speed * -200.0f * Math_CosS(angle) * (Rand_CenteredFloat(2.0f) + 10.0f)) & 0xFFFF; + force.y = (s32)(this->actor.speed * 100.0f * Math_SinS(angle) * (Rand_CenteredFloat(2.0f) + 10.0f)) & 0xFFFF; - D_80858AC8.unk_06 += sp28 >> 2; - D_80858AC8.unk_08 += sp2A >> 2; + sBunnyEarKinematics.angVel.x += force.x >> 2; + sBunnyEarKinematics.angVel.y += force.y >> 2; - if (D_80858AC8.unk_06 > 6000) { - D_80858AC8.unk_06 = 6000; - } else if (D_80858AC8.unk_06 < -6000) { - D_80858AC8.unk_06 = -6000; + // Clamp both angular velocities to [-6000, 6000] + if (sBunnyEarKinematics.angVel.x > 6000) { + sBunnyEarKinematics.angVel.x = 6000; + } else if (sBunnyEarKinematics.angVel.x < -6000) { + sBunnyEarKinematics.angVel.x = -6000; + } + if (sBunnyEarKinematics.angVel.y > 6000) { + sBunnyEarKinematics.angVel.y = 6000; + } else if (sBunnyEarKinematics.angVel.y < -6000) { + sBunnyEarKinematics.angVel.y = -6000; } - if (D_80858AC8.unk_08 > 6000) { - D_80858AC8.unk_08 = 6000; - } else if (D_80858AC8.unk_08 < -6000) { - D_80858AC8.unk_08 = -6000; - } + // Add angular velocity to rotations + sBunnyEarKinematics.rot.x += sBunnyEarKinematics.angVel.x; + sBunnyEarKinematics.rot.y += sBunnyEarKinematics.angVel.y; - D_80858AC8.unk_00 += D_80858AC8.unk_06; - D_80858AC8.unk_02 += D_80858AC8.unk_08; - - if (D_80858AC8.unk_00 < 0) { - D_80858AC8.unk_04 = D_80858AC8.unk_00 >> 1; + // swivel ears outwards if bending backwards + if (sBunnyEarKinematics.rot.x < 0) { + sBunnyEarKinematics.rot.z = sBunnyEarKinematics.rot.x >> 1; } else { - D_80858AC8.unk_04 = 0; + sBunnyEarKinematics.rot.z = 0; } } @@ -13328,15 +13347,15 @@ void func_808502D0(Player* this, PlayState* play) { if ((this->stateFlags2 & PLAYER_STATE2_30) && (this->heldItemAction != PLAYER_IA_HAMMER) && LinkAnimation_OnFrame(&this->skelAnime, 0.0f)) { - this->linearVelocity = 15.0f; + this->speedXZ = 15.0f; this->stateFlags2 &= ~PLAYER_STATE2_30; } - if (this->linearVelocity > 12.0f) { + if (this->speedXZ > 12.0f) { func_8084269C(play, this); } - Math_StepToF(&this->linearVelocity, 0.0f, 5.0f); + Math_StepToF(&this->speedXZ, 0.0f, 5.0f); func_8083C50C(this); if (LinkAnimation_Update(play, &this->skelAnime)) { @@ -13548,7 +13567,7 @@ void func_808507F4(Player* this, PlayState* play) { } } else if (D_80854A7C[this->unk_84F] < this->unk_850++) { LinkAnimation_PlayOnceSetSpeed(play, &this->skelAnime, D_80854A70[this->unk_84F], 0.83f); - this->currentYaw = this->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y; this->unk_84F = -1; } } @@ -13579,7 +13598,7 @@ void func_80850AEC(Player* this, PlayState* play) { this->actor.world.rot.x = this->actor.shape.rot.x = 0; this->actor.world.pos.y -= temp; - this->linearVelocity = 1.0f; + this->speedXZ = 1.0f; this->actor.velocity.y = 0.0f; func_80837B9C(this, play); this->stateFlags2 &= ~PLAYER_STATE2_10; @@ -13871,24 +13890,24 @@ static struct_80854B18 D_80854E50[PLAYER_CSMODE_MAX] = { void func_80850ED8(PlayState* play, Player* this, LinkAnimationHeader* anim) { func_80832DB0(this); func_80832B0C(play, this, anim); - func_80832210(this); + Player_ZeroSpeedXZ(this); } void func_80850F1C(PlayState* play, Player* this, LinkAnimationHeader* anim) { func_80832DB0(this); LinkAnimation_Change(play, &this->skelAnime, anim, (2.0f / 3.0f), 0.0f, Animation_GetLastFrame(anim), ANIMMODE_ONCE, -8.0f); - func_80832210(this); + Player_ZeroSpeedXZ(this); } void func_80850F9C(PlayState* play, Player* this, LinkAnimationHeader* anim) { func_80832DB0(this); LinkAnimation_Change(play, &this->skelAnime, anim, (2.0f / 3.0f), 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f); - func_80832210(this); + Player_ZeroSpeedXZ(this); } void func_80851008(PlayState* play, Player* this, void* anim) { - func_80832210(this); + Player_ZeroSpeedXZ(this); } void func_80851030(PlayState* play, Player* this, void* anim) { @@ -13898,7 +13917,7 @@ void func_80851030(PlayState* play, Player* this, void* anim) { void func_80851050(PlayState* play, Player* this, void* anim) { func_80832DB0(this); func_80832C2C(play, this, anim); - func_80832210(this); + Player_ZeroSpeedXZ(this); } void func_80851094(PlayState* play, Player* this, void* anim) { @@ -14000,7 +14019,7 @@ void func_808513BC(PlayState* play, Player* this, CsCmdActorCue* cue) { } else { func_8084B158(play, this, NULL, fabsf(this->actor.velocity.y)); Math_ScaledStepToS(&this->unk_6C2, -10000, 800); - func_8084AEEC(this, &this->actor.velocity.y, 4.0f, this->currentYaw); + func_8084AEEC(this, &this->actor.velocity.y, 4.0f, this->yaw); } return; } @@ -14014,7 +14033,7 @@ void func_808513BC(PlayState* play, Player* this, CsCmdActorCue* cue) { } func_8084B000(this); - func_8084AEEC(this, &this->linearVelocity, 0.0f, this->actor.shape.rot.y); + func_8084AEEC(this, &this->speedXZ, 0.0f, this->actor.shape.rot.y); } void func_808514C0(PlayState* play, Player* this, CsCmdActorCue* cue) { @@ -14059,7 +14078,7 @@ void func_808515A4(PlayState* play, Player* this, CsCmdActorCue* cue) { ANIMMODE_LOOP, -4.0f); } - func_80832210(this); + Player_ZeroSpeedXZ(this); } void func_80851688(PlayState* play, Player* this, CsCmdActorCue* cue) { @@ -14095,13 +14114,13 @@ void func_80851750(PlayState* play, Player* this, CsCmdActorCue* cue) { void func_80851788(PlayState* play, Player* this, CsCmdActorCue* cue) { this->stateFlags1 &= ~PLAYER_STATE1_25; - this->currentYaw = this->actor.shape.rot.y = this->actor.world.rot.y = + this->yaw = this->actor.shape.rot.y = this->actor.world.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_450); - if (this->linearVelocity <= 0.0f) { - this->linearVelocity = 0.1f; - } else if (this->linearVelocity > 2.5f) { - this->linearVelocity = 2.5f; + if (this->speedXZ <= 0.0f) { + this->speedXZ = 0.1f; + } else if (this->speedXZ > 2.5f) { + this->speedXZ = 2.5f; } } @@ -14376,7 +14395,7 @@ void func_808521B8(PlayState* play, Player* this, CsCmdActorCue* cue) { void func_808521F4(PlayState* play, Player* this, CsCmdActorCue* cue) { func_80832B0C(play, this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_nwait, this->modelAnimType)); - func_80832210(this); + Player_ZeroSpeedXZ(this); } void func_80852234(PlayState* play, Player* this, CsCmdActorCue* cue) { @@ -14479,7 +14498,7 @@ void func_80852554(PlayState* play, Player* this, CsCmdActorCue* cue) { void func_80852564(PlayState* play, Player* this, CsCmdActorCue* cue) { this->stateFlags3 |= PLAYER_STATE3_1; - this->linearVelocity = 2.0f; + this->speedXZ = 2.0f; this->actor.velocity.y = -1.0f; func_80832264(play, this, &gPlayerAnim_link_normal_back_downA); @@ -14597,7 +14616,7 @@ void func_808529D0(PlayState* play, Player* this, CsCmdActorCue* cue) { } this->actor.world.pos.z = cue->startPos.z; - this->currentYaw = this->actor.shape.rot.y = cue->rot.y; + this->yaw = this->actor.shape.rot.y = cue->rot.y; } void func_80852A54(PlayState* play, Player* this, CsCmdActorCue* cue) { @@ -14607,7 +14626,7 @@ void func_80852A54(PlayState* play, Player* this, CsCmdActorCue* cue) { f32 dist = sqrtf(SQ(dx) + SQ(dy) + SQ(dz)); s16 yawDiff = (s16)cue->rot.y - this->actor.shape.rot.y; - if ((this->linearVelocity == 0.0f) && ((dist > 50.0f) || (ABS(yawDiff) > 0x4000))) { + if ((this->speedXZ == 0.0f) && ((dist > 50.0f) || (ABS(yawDiff) > 0x4000))) { func_808529D0(play, this, cue); } @@ -14643,7 +14662,7 @@ void func_80852C50(PlayState* play, Player* this, CsCmdActorCue* cueUnused) { if (play->csCtx.state == CS_STATE_STOP) { func_8002DF54(play, NULL, PLAYER_CSMODE_7); this->cueId = 0; - func_80832210(this); + Player_ZeroSpeedXZ(this); return; } @@ -14741,7 +14760,7 @@ s32 func_80852FFC(PlayState* play, Actor* actor, s32 csMode) { void func_80853080(Player* this, PlayState* play) { func_80835C58(play, this, func_80840BC8, 1); func_80832B0C(play, this, func_80833338(this)); - this->currentYaw = this->actor.shape.rot.y; + this->yaw = this->actor.shape.rot.y; } s32 Player_InflictDamage(PlayState* play, s32 damage) { diff --git a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c index 5ca2c08afc..9a5127e8af 100644 --- a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c +++ b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c @@ -40,7 +40,7 @@ u32 EffectSsDFire_Init(PlayState* play, u32 index, EffectSs* this, void* initPar //! It works out in practice because this effect is spawned from an actor who uses the same object //! and previously already set it to segment 6. this->gfx = SEGMENTED_TO_VIRTUAL(gDodongoFireDL); - + this->life = initParams->life; this->rScale = initParams->scale; this->rScaleStep = initParams->scaleStep; diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index be64be6cf2..9e76c45bb8 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -40,7 +40,7 @@ static u8 sEquipmentItemOffsets[] = { 0, // unused ITEM_SWORD_KOKIRI - ITEM_SWORD_KOKIRI, // EQUIP_VALUE_SWORD_KOKIRI ITEM_SWORD_MASTER - ITEM_SWORD_KOKIRI, // EQUIP_VALUE_SWORD_MASTER - ITEM_SWORD_BIGGORON - ITEM_SWORD_KOKIRI, // EQUIP_VALUE_SWORD_BGS + ITEM_SWORD_BIGGORON - ITEM_SWORD_KOKIRI, // EQUIP_VALUE_SWORD_BIGGORON // EQUIP_TYPE_SHIELD 0, // unused ITEM_SHIELD_DEKU - ITEM_SWORD_KOKIRI, // EQUIP_VALUE_SHIELD_DEKU @@ -487,7 +487,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } if ((pauseCtx->cursorY[PAUSE_EQUIP] == EQUIP_TYPE_SWORD) && - (pauseCtx->cursorX[PAUSE_EQUIP] == EQUIP_VALUE_SWORD_BGS)) { + (pauseCtx->cursorX[PAUSE_EQUIP] == EQUIP_VALUE_SWORD_BIGGORON)) { if (gSaveContext.bgsFlag) { cursorItem = ITEM_HEART_PIECE_2; } else if (CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE)) { @@ -546,7 +546,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { gSaveContext.infTable[INFTABLE_1DX_INDEX] = 0; gSaveContext.equips.buttonItems[0] = cursorItem; - if ((pauseCtx->cursorX[PAUSE_EQUIP] == EQUIP_VALUE_SWORD_BGS) && gSaveContext.bgsFlag) { + if ((pauseCtx->cursorX[PAUSE_EQUIP] == EQUIP_VALUE_SWORD_BIGGORON) && gSaveContext.bgsFlag) { gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BIGGORON; gSaveContext.swordHealth = 8; } else { @@ -659,10 +659,10 @@ void KaleidoScope_DrawEquipment(PlayState* play) { for (k = 0, bit = rowStart, point = 4; k < 3; k++, point += 4, temp++, bit++) { - if (((u32)i == EQUIP_TYPE_SWORD) && (k == EQUIP_INV_SWORD_BGS) && gSaveContext.bgsFlag) { + if (((u32)i == EQUIP_TYPE_SWORD) && (k == EQUIP_INV_SWORD_BIGGORON) && gSaveContext.bgsFlag) { KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIconSwordBiggoronTex, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, point); - } else if ((i == EQUIP_TYPE_SWORD) && (k == EQUIP_INV_SWORD_BGS) && + } else if ((i == EQUIP_TYPE_SWORD) && (k == EQUIP_INV_SWORD_BIGGORON) && (gBitFlags[bit + 1] & gSaveContext.inventory.equipment)) { KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIconBrokenGiantsKnifeTex, ITEM_ICON_WIDTH, ITEM_ICON_HEIGHT, point); diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 214ee7d4d8..ab9e98e999 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -557,7 +557,7 @@ u8 gEquipAgeReqs[4][4] = { AGE_REQ_ADULT, // 0 UPG_QUIVER AGE_REQ_CHILD, // EQUIP_TYPE_SWORD EQUIP_VALUE_SWORD_KOKIRI AGE_REQ_ADULT, // EQUIP_TYPE_SWORD EQUIP_VALUE_SWORD_MASTER - AGE_REQ_ADULT, // EQUIP_TYPE_SWORD EQUIP_VALUE_SWORD_BGS + AGE_REQ_ADULT, // EQUIP_TYPE_SWORD EQUIP_VALUE_SWORD_BIGGORON }, { AGE_REQ_NONE, // 0 UPG_BOMB_BAG