diff --git a/include/PR/os_internal.h b/include/PR/os_internal.h index f2c5bfa177..10ae5515eb 100644 --- a/include/PR/os_internal.h +++ b/include/PR/os_internal.h @@ -7,8 +7,8 @@ #include "os_internal_rsp.h" typedef struct __osHwInt { - /* 0x00 */ s32 (*handler)(void); - /* 0x04 */ void* stackEnd; -} __osHwInt; // size = 0x08 + /* 0x0 */ s32 (*handler)(void); + /* 0x4 */ void* stackEnd; +} __osHwInt; // size = 0x8 #endif diff --git a/include/PR/os_pfs.h b/include/PR/os_pfs.h index 4ce1acd52c..f0ee2fa5c8 100644 --- a/include/PR/os_pfs.h +++ b/include/PR/os_pfs.h @@ -95,14 +95,14 @@ typedef struct { typedef union { struct { - /* 0x00 */ u8 bank; - /* 0x01 */ u8 page; + /* 0x0 */ u8 bank; + /* 0x1 */ u8 page; } inode_t; - /* 0x00 */ u16 ipage; -} __OSInodeUnit; // size = 0x02 + /* 0x0 */ u16 ipage; +} __OSInodeUnit; // size = 0x2 typedef struct { - /* 0x00 */ __OSInodeUnit inodePage[128]; + /* 0x0 */ __OSInodeUnit inodePage[128]; } __OSInode; // size = 0x100 typedef struct { diff --git a/include/PR/os_thread.h b/include/PR/os_thread.h index bced9f5989..4823377d09 100644 --- a/include/PR/os_thread.h +++ b/include/PR/os_thread.h @@ -11,10 +11,10 @@ typedef s32 OSId; typedef union { struct { - /* 0x00 */ f32 f_odd; - /* 0x04 */ f32 f_even; + /* 0x0 */ f32 f_odd; + /* 0x4 */ f32 f_even; } f; -} __OSfp; // size = 0x08 +} __OSfp; // size = 0x8 typedef struct { /* 0x000 */ u64 at, v0, v1, a0, a1, a2, a3; @@ -29,9 +29,9 @@ typedef struct { } __OSThreadContext; // size = 0x190 typedef struct { - /* 0x00 */ u32 flag; - /* 0x04 */ u32 count; - /* 0x08 */ u64 time; + /* 0x0 */ u32 flag; + /* 0x4 */ u32 count; + /* 0x8 */ u64 time; } __OSThreadprofile; // size = 0x10 typedef struct OSThread { diff --git a/include/PR/viint.h b/include/PR/viint.h index bc9ce23359..25c7d12249 100644 --- a/include/PR/viint.h +++ b/include/PR/viint.h @@ -49,7 +49,7 @@ typedef struct { /* 0x0 */ f32 factor; /* 0x4 */ u16 offset; /* 0x8 */ u32 scale; -} __OSViScale; // size = 0x0C +} __OSViScale; // size = 0xC typedef struct { /* 0x00 */ u16 state; diff --git a/include/gfx.h b/include/gfx.h index 0a7a645774..eb9c6805b5 100644 --- a/include/gfx.h +++ b/include/gfx.h @@ -86,8 +86,8 @@ Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f); Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f); Gfx* Gfx_SetFog2(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f); -Gfx* Gfx_BranchTexScroll(Gfx** gfxp, u32 x, u32 y, s32 width, s32 height); -void func_8012CB04(Gfx** gfxp, u32 x, u32 y); +Gfx* Gfx_BranchTexScroll(Gfx** gfxP, u32 x, u32 y, s32 width, s32 height); +void func_8012CB04(Gfx** gfxP, u32 x, u32 y); Gfx* func_8012CB28(GraphicsContext* gfxCtx, u32 x, u32 y); Gfx* Gfx_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height); Gfx* Gfx_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2); diff --git a/include/gfx_setupdl.h b/include/gfx_setupdl.h index feafc6b214..54d5c813ef 100644 --- a/include/gfx_setupdl.h +++ b/include/gfx_setupdl.h @@ -85,7 +85,7 @@ typedef enum SetupDL { Gfx* Gfx_SetupDLImpl(Gfx* gfx, u32 i); Gfx* Gfx_SetupDL(Gfx* gfx, u32 i); -void Gfx_SetupDLAtPtr(Gfx** gfxp, u32 i); +void Gfx_SetupDLAtPtr(Gfx** gfxP, u32 i); Gfx* Gfx_SetupDL57(Gfx* gfx); Gfx* Gfx_SetupDL57_b(Gfx* gfx); Gfx* Gfx_SetupDL52_NoCD(Gfx* gfx); @@ -128,7 +128,7 @@ void Gfx_SetupDL2_Opa(GraphicsContext* gfxCtx); Gfx* Gfx_SetupDL39(Gfx* gfx); void Gfx_SetupDL39_Opa(GraphicsContext* gfxCtx); void Gfx_SetupDL39_Overlay(GraphicsContext* gfxCtx); -void Gfx_SetupDL39_Ptr(Gfx** gfxp); +void Gfx_SetupDL39_Ptr(Gfx** gfxP); void Gfx_SetupDL40_Opa(GraphicsContext* gfxCtx); void Gfx_SetupDL41_Opa(GraphicsContext* gfxCtx); void Gfx_SetupDL47_Xlu(GraphicsContext* gfxCtx); @@ -147,7 +147,7 @@ void Gfx_SetupDL27_Xlu(GraphicsContext* gfxCtx); void Gfx_SetupDL60_XluNoCD(GraphicsContext* gfxCtx); void Gfx_SetupDL61_Xlu(GraphicsContext* gfxCtx); void Gfx_SetupDL56_Opa(GraphicsContext* gfxCtx); -void Gfx_SetupDL56_Ptr(Gfx** gfxp); +void Gfx_SetupDL56_Ptr(Gfx** gfxP); void Gfx_SetupDL59_Opa(GraphicsContext* gfxCtx); extern Gfx gSetupDLs[SETUPDL_MAX][6]; diff --git a/include/sfx.h b/include/sfx.h index 719422dfec..d37e333ac0 100644 --- a/include/sfx.h +++ b/include/sfx.h @@ -98,7 +98,7 @@ typedef struct { typedef struct { /* 0x0 */ u32 priority; // lower is more prioritized /* 0x4 */ u8 entryIndex; -} ActiveSfx; // size = 0x08 +} ActiveSfx; // size = 0x8 // SfxParams bit-packing diff --git a/include/z64camera.h b/include/z64camera.h index 8c2a001d29..969dca94f0 100644 --- a/include/z64camera.h +++ b/include/z64camera.h @@ -1022,10 +1022,10 @@ typedef struct { { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } typedef struct { - /* 0x00 */ f32 unk_00; - /* 0x04 */ f32 unk_04; - /* 0x08 */ f32 fov; - /* 0x0C */ s16 interfaceFlags; + /* 0x0 */ f32 unk_00; + /* 0x4 */ f32 unk_04; + /* 0x8 */ f32 fov; + /* 0xC */ s16 interfaceFlags; } Fixed1ReadOnlyData; // size = 0x10 typedef struct { @@ -1162,8 +1162,8 @@ typedef struct { } Unique2ReadOnlyData; // size = 0x14 typedef struct { - /* 0x00 */ f32 unk_00; - /* 0x04 */ s16 unk_04; + /* 0x0 */ f32 unk_00; + /* 0x4 */ s16 unk_04; } Unique2ReadWriteData; // size = 0x8 typedef struct { @@ -1205,8 +1205,8 @@ typedef struct { } Unique0ReadWriteData; // size = 0x40 typedef struct { - /* 0x00 */ Unique0ReadOnlyData roData; - /* 0x0C */ Unique0ReadWriteData rwData; + /* 0x0 */ Unique0ReadOnlyData roData; + /* 0xC */ Unique0ReadWriteData rwData; } Unique0; // size = 0x4C #define UNIQUE0_FLAG_0 (1 << 0) @@ -1220,11 +1220,11 @@ typedef struct { */ typedef struct { - /* 0x00 */ s16 interfaceFlags; + /* 0x0 */ s16 interfaceFlags; } Unique6ReadOnlyData; // size = 0x4 typedef struct { - /* 0x00 */ Unique6ReadOnlyData roData; + /* 0x0 */ Unique6ReadOnlyData roData; } Unique6; // size = 0x4 #define UNIQUE6_FLAG_0 (1 << 0) @@ -1246,7 +1246,7 @@ typedef struct { */ typedef struct { - /* 0x00 */ s16 interfaceFlags; + /* 0x0 */ s16 interfaceFlags; } Demo1ReadOnlyData; // size = 0x4 typedef struct { @@ -1257,8 +1257,8 @@ typedef struct { } Demo1ReadWriteData; // size = 0x20 typedef struct { - /* 0x00 */ Demo1ReadOnlyData roData; - /* 0x04 */ Demo1ReadWriteData rwData; + /* 0x0 */ Demo1ReadOnlyData roData; + /* 0x4 */ Demo1ReadWriteData rwData; } Demo1; // size = 0x24 @@ -1273,9 +1273,9 @@ typedef struct { { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } typedef struct { - /* 0x00 */ f32 fov; - /* 0x04 */ f32 unk_04; // unused - /* 0x08 */ s16 interfaceFlags; + /* 0x0 */ f32 fov; + /* 0x4 */ f32 unk_04; // unused + /* 0x8 */ s16 interfaceFlags; } Demo2ReadOnlyData; // size = 0xC typedef struct { @@ -1286,8 +1286,8 @@ typedef struct { } Demo2ReadWriteData; // size = 0x14 typedef struct { - /* 0x08 */ Demo2ReadOnlyData roData; - /* 0x0C */ Demo2ReadWriteData rwData; + /* 0x8 */ Demo2ReadOnlyData roData; + /* 0xC */ Demo2ReadWriteData rwData; } Demo2; // size = 0x20 @@ -1297,18 +1297,18 @@ typedef struct { */ typedef struct { - /* 0x00 */ s16 interfaceFlags; + /* 0x0 */ s16 interfaceFlags; } Demo3ReadOnlyData; // size = 0x4 typedef struct { - /* 0x00 */ f32 unk_00; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 timer; + /* 0x0 */ f32 unk_00; + /* 0x4 */ s16 unk_04; + /* 0x6 */ s16 timer; } Demo3ReadWriteData; // size = 0x8 typedef struct { - /* 0x00 */ Demo3ReadOnlyData roData; - /* 0x04 */ Demo3ReadWriteData rwData; + /* 0x0 */ Demo3ReadOnlyData roData; + /* 0x4 */ Demo3ReadWriteData rwData; } Demo3; // size = 0xC @@ -1318,7 +1318,7 @@ typedef struct { */ typedef struct { - /* 0x00 */ s16 interfaceFlags; + /* 0x0 */ s16 interfaceFlags; } Demo4ReadOnlyData; // size = 0x4 typedef struct { @@ -1332,8 +1332,8 @@ typedef struct { } Demo4ReadWriteData; // size = 0x24 typedef struct { - /* 0x00 */ Demo4ReadOnlyData roData; - /* 0x04 */ Demo4ReadWriteData rwData; + /* 0x0 */ Demo4ReadOnlyData roData; + /* 0x4 */ Demo4ReadWriteData rwData; } Demo4; // size = 0x28 @@ -1343,7 +1343,7 @@ typedef struct { */ typedef struct { - /* 0x00 */ s16 interfaceFlags; + /* 0x0 */ s16 interfaceFlags; } Demo5ReadOnlyData; // size = 0x4 typedef struct { @@ -1358,8 +1358,8 @@ typedef struct { } Demo5ReadWriteData; // size = 0x28 typedef struct { - /* 0x00 */ Demo5ReadOnlyData roData; - /* 0x04 */ Demo5ReadWriteData rwData; + /* 0x0 */ Demo5ReadOnlyData roData; + /* 0x4 */ Demo5ReadWriteData rwData; } Demo5; // size = 0x2C @@ -1369,7 +1369,7 @@ typedef struct { */ typedef struct { - /* 0x00 */ s16 interfaceFlags; + /* 0x0 */ s16 interfaceFlags; } Demo0ReadOnlyData; // size = 0x4 typedef struct { @@ -1383,8 +1383,8 @@ typedef struct { } Demo0ReadWriteData; // size = 0x1C typedef struct { - /* 0x00 */ Demo0ReadOnlyData roData; - /* 0x04 */ Demo0ReadWriteData rwData; + /* 0x0 */ Demo0ReadOnlyData roData; + /* 0x4 */ Demo0ReadWriteData rwData; } Demo0; // size = 0x20 @@ -1415,7 +1415,7 @@ typedef struct { } Special5ReadOnlyData; // size = 0x1C typedef struct { - /* 0x00 */ s16 animTimer; + /* 0x0 */ s16 animTimer; } Special5ReadWriteData; // size = 0x4 typedef struct { @@ -1432,9 +1432,9 @@ typedef struct { // For functions that deal with doors, an extra struct is added to the paramData typedef struct { - /* 0x00 */ Actor* doorActor; - /* 0x04 */ s16 bgCamIndex; - /* 0x06 */ union { + /* 0x0 */ Actor* doorActor; + /* 0x4 */ s16 bgCamIndex; + /* 0x6 */ union { Vec3s eye; // position of the camera while exiting a spiral staircase struct { s16 timer1; // timer while camera is fixed in front of the door @@ -1470,9 +1470,9 @@ typedef struct { } Special8ReadOnlyData; // size = 0x14 typedef struct { - /* 0x00 */ Vec3f eye; - /* 0x0C */ s16 spiralDoorCsFrame; // 1/5th of the length of the cutscene - /* 0x0E */ s16 fov; + /* 0x0 */ Vec3f eye; + /* 0xC */ s16 spiralDoorCsFrame; // 1/5th of the length of the cutscene + /* 0xE */ s16 fov; } Special8ReadWriteData; // size = 0x10 typedef struct { @@ -1495,18 +1495,18 @@ typedef struct { { interfaceFlags, CAM_DATA_INTERFACE_FLAGS } typedef struct { - /* 0x00 */ f32 yOffset; - /* 0x04 */ f32 fov; - /* 0x08 */ s16 interfaceFlags; + /* 0x0 */ f32 yOffset; + /* 0x4 */ f32 fov; + /* 0x8 */ s16 interfaceFlags; } Special9ReadOnlyData; // size = 0xC typedef struct { - /* 0x00 */ s16 unk_00; + /* 0x0 */ s16 unk_00; } Special9ReadWriteData; // size = 0x4 typedef struct { - /* 0x00 */ Special9ReadOnlyData roData; - /* 0x0C */ Special9ReadWriteData rwData; + /* 0x0 */ Special9ReadOnlyData roData; + /* 0xC */ Special9ReadWriteData rwData; } Special9; // size = 0x10 #define SPECIAL9_FLAG_0 (1 << 0) diff --git a/include/z64cutscene.h b/include/z64cutscene.h index a308048cd2..a7e19ebf58 100644 --- a/include/z64cutscene.h +++ b/include/z64cutscene.h @@ -624,16 +624,16 @@ typedef struct { /* Actor Cutscenes, which encompasses all cutscenes */ typedef struct { - /* 0x00 */ s16 priority; // Lower means higher priority. -1 means it ignores priority - /* 0x02 */ s16 length; - /* 0x04 */ s16 csCamId; // Index of CsCameraEntry to use. Negative indices use sGlobalCamDataSettings. Indices 0 and above use CsCameraEntry from a sceneLayer - /* 0x06 */ s16 scriptIndex; - /* 0x08 */ s16 additionalCsId; - /* 0x0A */ u8 endSfx; - /* 0x0B */ u8 customValue; // 0 - 99: actor-specific custom value. 100+: spawn. 255: none - /* 0x0C */ s16 hudVisibility; - /* 0x0E */ u8 endCam; - /* 0x0F */ u8 letterboxSize; + /* 0x0 */ s16 priority; // Lower means higher priority. -1 means it ignores priority + /* 0x2 */ s16 length; + /* 0x4 */ s16 csCamId; // Index of CsCameraEntry to use. Negative indices use sGlobalCamDataSettings. Indices 0 and above use CsCameraEntry from a sceneLayer + /* 0x6 */ s16 scriptIndex; + /* 0x8 */ s16 additionalCsId; + /* 0xA */ u8 endSfx; + /* 0xB */ u8 customValue; // 0 - 99: actor-specific custom value. 100+: spawn. 255: none + /* 0xC */ s16 hudVisibility; + /* 0xE */ u8 endCam; + /* 0xF */ u8 letterboxSize; } CutsceneEntry; // size = 0x10 typedef enum { diff --git a/include/z64cutscene_commands.h b/include/z64cutscene_commands.h index 749f742f85..1bc350af74 100644 --- a/include/z64cutscene_commands.h +++ b/include/z64cutscene_commands.h @@ -294,7 +294,7 @@ * FORMAT * Capital U is Unused * ttttssss eeeerrgg bbUUUUUU - * size = 0x0C + * size = 0xC */ #define CS_TRANSITION_GENERAL(type, startFrame, endFrame, red, green, blue) \ { CMD_HH(type, startFrame) }, { CMD_HBB(endFrame, red, green) }, { CMD_BBBB(blue, 0, 0, 0) } @@ -461,7 +461,7 @@ * FORMAT * Capital U is Unused * ppppssss eeeeUUUU UUUUUUUU - * size = 0x0C + * size = 0xC */ #define CS_FADE_OUT_SEQ(seqPlayer, startFrame, endFrame) \ { CMD_HH(seqPlayer, startFrame) }, { CMD_HH(endFrame, 0) }, { CMD_W(0) } diff --git a/include/z64environment.h b/include/z64environment.h index 74f89aadeb..514801f6b5 100644 --- a/include/z64environment.h +++ b/include/z64environment.h @@ -65,7 +65,9 @@ typedef enum { /* 0 */ WEATHER_MODE_CLEAR, /* 1 */ WEATHER_MODE_RAIN, /* 2 */ WEATHER_MODE_2, - /* 3 */ WEATHER_MODE_SNOW + /* 3 */ WEATHER_MODE_SNOW, + /* 4 */ WEATHER_MODE_4, + /* 5 */ WEATHER_MODE_5 } WeatherMode; typedef enum { diff --git a/include/z64math.h b/include/z64math.h index 5d31396b1d..a8f0da7dfe 100644 --- a/include/z64math.h +++ b/include/z64math.h @@ -72,8 +72,8 @@ The plane paramaters are of form `ax + by + cz + d = 0` where `(a,b,c)` is the plane's normal vector and d is the originDist */ typedef struct { - /* 0x00 */ Vec3f normal; - /* 0x0C */ f32 originDist; + /* 0x0 */ Vec3f normal; + /* 0xC */ f32 originDist; } Plane; // size = 0x10 typedef struct { diff --git a/include/z64player.h b/include/z64player.h index 25d04eb5a0..dc5bb1b6f0 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -1246,10 +1246,10 @@ typedef struct Player { /* 0xADE */ u8 unk_ADE; /* 0xADF */ s8 unk_ADF[4]; // Circular buffer used for testing for triggering a quickspin /* 0xAE3 */ s8 unk_AE3[4]; // Circular buffer used for ? - /* 0xAE7 */ union { + /* 0xAE7 */ union { s8 actionVar1; } av1; // "Action Variable 1": context dependent variable that has different meanings depending on what action is currently running - /* 0xAE8 */ union { + /* 0xAE8 */ union { s16 actionVar2; } av2; // "Action Variable 2": context dependent variable that has different meanings depending on what action is currently running /* 0xAEC */ f32 unk_AEC; diff --git a/include/z64prerender.h b/include/z64prerender.h index 813f6827ac..07c4738ab2 100644 --- a/include/z64prerender.h +++ b/include/z64prerender.h @@ -47,19 +47,19 @@ void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf, void PreRender_Init(PreRender* this); void PreRender_SetValues(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf); void PreRender_Destroy(PreRender* this); -void PreRender_CopyImage(PreRender* this, Gfx** gfxp, void* img, void* imgDst, u32 useThresholdAlphaCompare); -void PreRender_RestoreBuffer(PreRender* this, Gfx** gfxp, void* buf, void* bufSave); -void func_8016FF90(PreRender* this, Gfx** gfxp, void* buf, void* bufSave, s32 envR, s32 envG, s32 envB, s32 envA); -void func_80170200(PreRender* this, Gfx** gfxp, void* buf, void* bufSave); -void PreRender_CoverageRgba16ToI8(PreRender* this, Gfx** gfxp, void* img, void* cvgDst); -void PreRender_SaveZBuffer(PreRender* this, Gfx** gfxp); -void PreRender_SaveFramebuffer(PreRender* this, Gfx** gfxp); -void PreRender_FetchFbufCoverage(PreRender* this, Gfx** gfxp); -void PreRender_DrawCoverage(PreRender* this, Gfx** gfxp); -void PreRender_RestoreZBuffer(PreRender* this, Gfx** gfxp); -void func_80170798(PreRender* this, Gfx** gfxp); -void func_80170AE0(PreRender* this, Gfx** gfxp, s32 alpha); -void PreRender_RestoreFramebuffer(PreRender* this, Gfx** gfxp); +void PreRender_CopyImage(PreRender* this, Gfx** gfxP, void* img, void* imgDst, u32 useThresholdAlphaCompare); +void PreRender_RestoreBuffer(PreRender* this, Gfx** gfxP, void* buf, void* bufSave); +void func_8016FF90(PreRender* this, Gfx** gfxP, void* buf, void* bufSave, s32 envR, s32 envG, s32 envB, s32 envA); +void func_80170200(PreRender* this, Gfx** gfxP, void* buf, void* bufSave); +void PreRender_CoverageRgba16ToI8(PreRender* this, Gfx** gfxP, void* img, void* cvgDst); +void PreRender_SaveZBuffer(PreRender* this, Gfx** gfxP); +void PreRender_SaveFramebuffer(PreRender* this, Gfx** gfxP); +void PreRender_FetchFbufCoverage(PreRender* this, Gfx** gfxP); +void PreRender_DrawCoverage(PreRender* this, Gfx** gfxP); +void PreRender_RestoreZBuffer(PreRender* this, Gfx** gfxP); +void func_80170798(PreRender* this, Gfx** gfxP); +void func_80170AE0(PreRender* this, Gfx** gfxP, s32 alpha); +void PreRender_RestoreFramebuffer(PreRender* this, Gfx** gfxP); void PreRender_AntiAliasFilterPixel(PreRender* this, s32 x, s32 y); void PreRender_AntiAliasFilter(PreRender* this); u32 PreRender_Get5bMedian9(u8* px1, u8* px2, u8* px3); @@ -68,6 +68,6 @@ void PreRender_ApplyFilters(PreRender* this); void PreRender_ApplyFiltersSlowlyInit(PreRender* this); void PreRender_ApplyFiltersSlowlyDestroy(PreRender* this); void func_801720C4(PreRender* this); -void Prerender_DrawBackground2D(Gfx** gfxp, void* timg, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tt, u16 tlutCount, f32 x, f32 y, f32 xScale, f32 yScale, u32 flags); +void Prerender_DrawBackground2D(Gfx** gfxP, void* timg, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tt, u16 tlutCount, f32 x, f32 y, f32 xScale, f32 yScale, u32 flags); #endif diff --git a/include/z64transition.h b/include/z64transition.h index 923e076cb6..c4d8c78467 100644 --- a/include/z64transition.h +++ b/include/z64transition.h @@ -244,7 +244,7 @@ void TransitionFade_SetType(void* thisx, s32 type); // z_fbdemo_circle.c -void TransitionCircle_LoadAndSetTexture(Gfx** gfxp, void const* texture, s32 fmt, s32 arg3, s32 masks, s32 maskt, f32 arg6); +void TransitionCircle_LoadAndSetTexture(Gfx** gfxP, void const* texture, s32 fmt, s32 arg3, s32 masks, s32 maskt, f32 arg6); // z_overlay.c diff --git a/include/z64view.h b/include/z64view.h index b5474147f8..780a8c758f 100644 --- a/include/z64view.h +++ b/include/z64view.h @@ -10,10 +10,10 @@ struct GraphicsContext; typedef struct Viewport { - /* 0x00 */ s32 topY; // uly (upper left y) - /* 0x04 */ s32 bottomY; // lry (lower right y) - /* 0x08 */ s32 leftX; // ulx (upper left x) - /* 0x0C */ s32 rightX; // lrx (lower right x) + /* 0x0 */ s32 topY; // uly (upper left y) + /* 0x4 */ s32 bottomY; // lry (lower right y) + /* 0x8 */ s32 leftX; // ulx (upper left x) + /* 0xC */ s32 rightX; // lrx (lower right x) } Viewport; // size = 0x10 typedef struct View { @@ -99,6 +99,6 @@ s32 View_Apply(View* view, s32 mask); s32 View_ApplyOrthoToOverlay(View* view); s32 View_ApplyPerspectiveToOverlay(View* view); s32 View_UpdateViewingMatrix(View* view); -s32 View_ApplyTo(View* view, Gfx** gfxp); +s32 View_ApplyTo(View* view, Gfx** gfxP); #endif diff --git a/src/code/PreRender.c b/src/code/PreRender.c index 0a46b9ccc5..8cae8a52ae 100644 --- a/src/code/PreRender.c +++ b/src/code/PreRender.c @@ -59,8 +59,8 @@ void PreRender_Destroy(PreRender* this) { ListAlloc_FreeAll(&this->alloc); } -void PreRender_CopyImage(PreRender* this, Gfx** gfxp, void* img, void* imgDst, u32 useThresholdAlphaCompare) { - Gfx* gfx = *gfxp; +void PreRender_CopyImage(PreRender* this, Gfx** gfxP, void* img, void* imgDst, u32 useThresholdAlphaCompare) { + Gfx* gfx = *gfxP; u32 flags; gDPPipeSync(gfx++); @@ -77,15 +77,15 @@ void PreRender_CopyImage(PreRender* this, Gfx** gfxp, void* img, void* imgDst, u gDPPipeSync(gfx++); gDPSetColorImage(gfx++, G_IM_FMT_RGBA, G_IM_SIZ_16b, this->width, this->fbuf); - *gfxp = gfx; + *gfxP = gfx; } -void PreRender_RestoreBuffer(PreRender* this, Gfx** gfxp, void* buf, void* bufSave) { - PreRender_CopyImage(this, gfxp, buf, bufSave, false); +void PreRender_RestoreBuffer(PreRender* this, Gfx** gfxP, void* buf, void* bufSave) { + PreRender_CopyImage(this, gfxP, buf, bufSave, false); } -void func_8016FF90(PreRender* this, Gfx** gfxp, void* buf, void* bufSave, s32 envR, s32 envG, s32 envB, s32 envA) { - Gfx* gfx = *gfxp; +void func_8016FF90(PreRender* this, Gfx** gfxP, void* buf, void* bufSave, s32 envR, s32 envG, s32 envB, s32 envA) { + Gfx* gfx = *gfxP; gDPPipeSync(gfx++); @@ -113,23 +113,23 @@ void func_8016FF90(PreRender* this, Gfx** gfxp, void* buf, void* bufSave, s32 en gDPPipeSync(gfx++); gDPSetColorImage(gfx++, G_IM_FMT_RGBA, G_IM_SIZ_16b, this->width, this->fbuf); - *gfxp = gfx; + *gfxP = gfx; } -void func_80170200(PreRender* this, Gfx** gfxp, void* buf, void* bufSave) { - func_8016FF90(this, gfxp, buf, bufSave, 255, 255, 255, 255); +void func_80170200(PreRender* this, Gfx** gfxP, void* buf, void* bufSave) { + func_8016FF90(this, gfxP, buf, bufSave, 255, 255, 255, 255); } /** * Reads the coverage values stored in the RGBA16 format `img` with dimensions `this->width`, `this->height` and * converts it to an 8-bpp intensity image. * - * @param gfxp Display list pointer + * @param gfxP Display list pointer * @param img Image to read coverage from * @param cvgDst Buffer to store coverage into */ -void PreRender_CoverageRgba16ToI8(PreRender* this, Gfx** gfxp, void* img, void* cvgDst) { - Gfx* gfx = *gfxp; +void PreRender_CoverageRgba16ToI8(PreRender* this, Gfx** gfxP, void* img, void* cvgDst) { + Gfx* gfx = *gfxP; s32 rowsRemaining; s32 curRow; s32 nRows; @@ -202,24 +202,24 @@ void PreRender_CoverageRgba16ToI8(PreRender* this, Gfx** gfxp, void* img, void* gDPPipeSync(gfx++); gDPSetColorImage(gfx++, G_IM_FMT_RGBA, G_IM_SIZ_16b, this->width, this->fbuf); - *gfxp = gfx; + *gfxP = gfx; } /** * Saves zbuf to zbufSave */ -void PreRender_SaveZBuffer(PreRender* this, Gfx** gfxp) { +void PreRender_SaveZBuffer(PreRender* this, Gfx** gfxP) { if ((this->zbufSave != NULL) && (this->zbuf != NULL)) { - PreRender_RestoreBuffer(this, gfxp, this->zbuf, this->zbufSave); + PreRender_RestoreBuffer(this, gfxP, this->zbuf, this->zbufSave); } } /** * Saves fbuf to fbufSave */ -void PreRender_SaveFramebuffer(PreRender* this, Gfx** gfxp) { +void PreRender_SaveFramebuffer(PreRender* this, Gfx** gfxP) { if ((this->fbufSave != NULL) && (this->fbuf != NULL)) { - func_80170200(this, gfxp, this->fbuf, this->fbufSave); + func_80170200(this, gfxP, this->fbuf, this->fbufSave); } } @@ -227,8 +227,8 @@ void PreRender_SaveFramebuffer(PreRender* this, Gfx** gfxp) { * Fetches the coverage of the current framebuffer into an image of the same format as the current color image, storing * it over the framebuffer in memory. */ -void PreRender_FetchFbufCoverage(PreRender* this, Gfx** gfxp) { - Gfx* gfx = *gfxp; +void PreRender_FetchFbufCoverage(PreRender* this, Gfx** gfxP) { + Gfx* gfx = *gfxP; gDPPipeSync(gfx++); // Set the blend color to full white and set maximum depth @@ -257,33 +257,33 @@ void PreRender_FetchFbufCoverage(PreRender* this, Gfx** gfxp) { gDPFillRectangle(gfx++, 0, 0, this->width, this->height); gDPPipeSync(gfx++); - *gfxp = gfx; + *gfxP = gfx; } /** * Draws the coverage of the current framebuffer `this->fbuf` to an I8 image at `this->cvgSave`. Overwrites * `this->fbuf` in the process. */ -void PreRender_DrawCoverage(PreRender* this, Gfx** gfxp) { - PreRender_FetchFbufCoverage(this, gfxp); +void PreRender_DrawCoverage(PreRender* this, Gfx** gfxP) { + PreRender_FetchFbufCoverage(this, gfxP); if (this->cvgSave != NULL) { - PreRender_CoverageRgba16ToI8(this, gfxp, this->fbuf, this->cvgSave); + PreRender_CoverageRgba16ToI8(this, gfxP, this->fbuf, this->cvgSave); } } /** * Restores zbufSave to zbuf */ -void PreRender_RestoreZBuffer(PreRender* this, Gfx** gfxp) { - PreRender_RestoreBuffer(this, gfxp, this->zbufSave, this->zbuf); +void PreRender_RestoreZBuffer(PreRender* this, Gfx** gfxP) { + PreRender_RestoreBuffer(this, gfxP, this->zbufSave, this->zbuf); } /** * Draws a full-screen image to the current framebuffer, that sources the rgb channel from `this->fbufSave` and * the alpha channel from `this->cvgSave` modulated by environment color. */ -void func_80170798(PreRender* this, Gfx** gfxp) { +void func_80170798(PreRender* this, Gfx** gfxP) { Gfx* gfx; s32 rowsRemaining; s32 curRow; @@ -291,7 +291,7 @@ void func_80170798(PreRender* this, Gfx** gfxp) { s32 rtile = 1; if (this->cvgSave != NULL) { - gfx = *gfxp; + gfx = *gfxP; gDPPipeSync(gfx++); gDPSetEnvColor(gfx++, 255, 255, 255, 32); @@ -347,19 +347,19 @@ void func_80170798(PreRender* this, Gfx** gfxp) { } gDPPipeSync(gfx++); - *gfxp = gfx; + *gfxP = gfx; } } -void func_80170AE0(PreRender* this, Gfx** gfxp, s32 alpha) { - func_8016FF90(this, gfxp, this->fbufSave, this->fbuf, 255, 255, 255, alpha); +void func_80170AE0(PreRender* this, Gfx** gfxP, s32 alpha) { + func_8016FF90(this, gfxP, this->fbufSave, this->fbuf, 255, 255, 255, alpha); } /** * Copies fbufSave to fbuf */ -void PreRender_RestoreFramebuffer(PreRender* this, Gfx** gfxp) { - PreRender_RestoreBuffer(this, gfxp, this->fbufSave, this->fbuf); +void PreRender_RestoreFramebuffer(PreRender* this, Gfx** gfxP) { + PreRender_RestoreBuffer(this, gfxP, this->fbufSave, this->fbuf); } /** @@ -759,7 +759,7 @@ typedef struct { /* 0x24 */ u32 flags; } PreRenderBackground2DParams; // size = 0x28 -void Prerender_DrawBackground2DImpl(PreRenderBackground2DParams* bg2D, Gfx** gfxp) { +void Prerender_DrawBackground2DImpl(PreRenderBackground2DParams* bg2D, Gfx** gfxP) { Gfx* gfx; uObjBg* bg; u32 alphaCompare; @@ -769,7 +769,7 @@ void Prerender_DrawBackground2DImpl(PreRenderBackground2DParams* bg2D, Gfx** gfx loadS2DEX2 = (bg2D->flags & BG2D_FLAGS_LOAD_S2DEX2) != 0; alphaCompare = (bg2D->flags & BG2D_FLAGS_AC_THRESHOLD) ? G_AC_THRESHOLD : G_AC_NONE; - gfxTemp = *gfxp; + gfxTemp = *gfxP; bg = Gfx_Alloc(&gfxTemp, sizeof(uObjBg)); gfx = gfxTemp; @@ -837,10 +837,10 @@ void Prerender_DrawBackground2DImpl(PreRenderBackground2DParams* bg2D, Gfx** gfx gSPLoadUcode(gfx++, SysUcode_GetUCode(), SysUcode_GetUCodeData()); } - *gfxp = gfx; + *gfxP = gfx; } -void Prerender_DrawBackground2D(Gfx** gfxp, void* timg, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tt, +void Prerender_DrawBackground2D(Gfx** gfxP, void* timg, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tt, u16 tlutCount, f32 x, f32 y, f32 xScale, f32 yScale, u32 flags) { PreRenderBackground2DParams bg2D; PreRenderBackground2DParams* bg2DPtr = &bg2D; @@ -859,5 +859,5 @@ void Prerender_DrawBackground2D(Gfx** gfxp, void* timg, void* tlut, u16 width, u bg2D.yScale = yScale; bg2D.flags = flags; - Prerender_DrawBackground2DImpl(bg2DPtr, gfxp); + Prerender_DrawBackground2DImpl(bg2DPtr, gfxP); } diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 1b3c11ed6d..b297143315 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -2773,12 +2773,13 @@ void DynaPoly_EnableFloorCollision(PlayState* play, DynaCollisionContext* dyna, void DynaPoly_DeleteBgActor(PlayState* play, DynaCollisionContext* dyna, s32 bgId) { DynaPolyActor* actor; - if (DynaPoly_IsBgIdBgActor(bgId) == false) { + if (!DynaPoly_IsBgIdBgActor(bgId)) { return; } - actor = DynaPoly_GetActor(&play->colCtx, bgId); - if (actor != NULL) { + actor = DynaPoly_GetActor(&play->colCtx, bgId); + + if (actor != NULL) { actor->bgId = BGACTOR_NEG_ONE; dyna->bgActors[bgId].actor = NULL; dyna->bgActorFlags[bgId] |= BGACTOR_1; diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 143a003db2..72e0561249 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -558,8 +558,8 @@ s32 func_800CBC84(Camera* camera, Vec3f* from, CameraCollision* to, s32 arg3) { toPoint.y = to->pos.y + fromToNorm.y; toPoint.z = to->pos.z + fromToNorm.z; - if (!BgCheck_CameraLineTest1(colCtx, from, &toPoint, &toNewPos, &to->poly, (arg3 & 1) ? 0 : 1, 1, - (arg3 & 2) ? 0 : 1, -1, &floorBgId)) { + if (!BgCheck_CameraLineTest1(colCtx, from, &toPoint, &toNewPos, &to->poly, (arg3 & 1) ? false : true, true, + (arg3 & 2) ? false : true, -1, &floorBgId)) { toNewPos = to->pos; toNewPos.y += 5.0f; @@ -618,7 +618,8 @@ s32 Camera_BgCheckInfo(Camera* camera, Vec3f* from, CameraCollision* to) { Vec3f toNewPos; Vec3f fromToNorm; - if (BgCheck_CameraLineTest1(&camera->play->colCtx, from, &to->pos, &toNewPos, &to->poly, 1, 1, 1, -1, &to->bgId)) { + if (BgCheck_CameraLineTest1(&camera->play->colCtx, from, &to->pos, &toNewPos, &to->poly, true, true, true, -1, + &to->bgId)) { floorPoly = to->poly; to->norm.x = COLPOLY_GET_NORMAL(floorPoly->normal.x); to->norm.y = COLPOLY_GET_NORMAL(floorPoly->normal.y); @@ -665,7 +666,7 @@ s32 Camera_CheckOOB(Camera* camera, Vec3f* from, Vec3f* to) { CollisionContext* colCtx = &camera->play->colCtx; poly = NULL; - if ((BgCheck_CameraLineTest1(colCtx, from, to, &intersect, &poly, 1, 1, 1, 0, &bgId)) && + if (BgCheck_CameraLineTest1(colCtx, from, to, &intersect, &poly, true, true, true, 0, &bgId) && (CollisionPoly_GetPointDistanceFromPlane(poly, from) < 0.0f)) { return true; } diff --git a/src/code/z_fbdemo_circle.c b/src/code/z_fbdemo_circle.c index 2bbf7938ed..a285e59295 100644 --- a/src/code/z_fbdemo_circle.c +++ b/src/code/z_fbdemo_circle.c @@ -28,7 +28,7 @@ void TransitionCircle_Destroy(void* thisx); void TransitionCircle_Update(void* thisx, s32 updateRate); void TransitionCircle_SetColor(void* thisx, u32 color); void TransitionCircle_SetType(void* thisx, s32 type); -void TransitionCircle_Draw(void* thisx, Gfx** gfxp); +void TransitionCircle_Draw(void* thisx, Gfx** gfxP); s32 TransitionCircle_IsDone(void* thisx); TransitionProfile TransitionCircle_Profile = { @@ -93,9 +93,9 @@ void TransitionCircle_SetType(void* thisx, s32 type) { } } -void TransitionCircle_LoadAndSetTexture(Gfx** gfxp, void const* texture, s32 fmt, s32 arg3, s32 masks, s32 maskt, +void TransitionCircle_LoadAndSetTexture(Gfx** gfxP, void const* texture, s32 fmt, s32 arg3, s32 masks, s32 maskt, f32 arg6) { - Gfx* gfx = *gfxp; + Gfx* gfx = *gfxP; s32 xh = gCfbWidth; s32 yh = gCfbHeight; s32 width = 1 << masks; @@ -132,11 +132,11 @@ void TransitionCircle_LoadAndSetTexture(Gfx** gfxp, void const* texture, s32 fmt dtdy); gDPPipeSync(gfx++); - *gfxp = gfx; + *gfxP = gfx; } -void TransitionCircle_Draw(void* thisx, Gfx** gfxp) { - Gfx* gfx = *gfxp; +void TransitionCircle_Draw(void* thisx, Gfx** gfxP) { + Gfx* gfx = *gfxP; TransitionCircle* this = (TransitionCircle*)thisx; gDPPipeSync(gfx++); @@ -153,7 +153,7 @@ void TransitionCircle_Draw(void* thisx, Gfx** gfxp) { this->referenceRadius); gDPPipeSync(gfx++); - *gfxp = gfx; + *gfxP = gfx; } s32 TransitionCircle_IsDone(void* thisx) { diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index 16bf28e02e..18f065a2db 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -3124,8 +3124,8 @@ void Environment_SetupSkyboxStars(PlayState* play) { } } -void Environment_DrawSkyboxStar(Gfx** gfxp, f32 x, f32 y, s32 width, s32 height) { - Gfx* gfx = *gfxp; +void Environment_DrawSkyboxStar(Gfx** gfxP, f32 x, f32 y, s32 width, s32 height) { + Gfx* gfx = *gfxP; u32 xl = x * 4.0f; u32 yl = y * 4.0f; u32 xd = width; @@ -3133,7 +3133,7 @@ void Environment_DrawSkyboxStar(Gfx** gfxp, f32 x, f32 y, s32 width, s32 height) gSPTextureRectangle(gfx++, xl, yl, xl + xd, yl + yd, 0, 0, 0, 0, 0); - *gfxp = gfx; + *gfxP = gfx; } void Environment_DrawSkyboxStarsImpl(PlayState* play, Gfx** gfxP) { diff --git a/src/code/z_rcp.c b/src/code/z_rcp.c index 5636e96568..f4750162a2 100644 --- a/src/code/z_rcp.c +++ b/src/code/z_rcp.c @@ -908,8 +908,8 @@ Gfx* Gfx_SetupDL(Gfx* gfx, u32 i) { return Gfx_SetupDLImpl(gfx, i); } -void Gfx_SetupDLAtPtr(Gfx** gfxp, u32 i) { - *gfxp = Gfx_SetupDL(*gfxp, i); +void Gfx_SetupDLAtPtr(Gfx** gfxP, u32 i) { + *gfxP = Gfx_SetupDL(*gfxP, i); } Gfx* Gfx_SetupDL57(Gfx* gfx) { @@ -1212,11 +1212,11 @@ void Gfx_SetupDL39_Overlay(GraphicsContext* gfxCtx) { CLOSE_DISPS(gfxCtx); } -void Gfx_SetupDL39_Ptr(Gfx** gfxp) { - Gfx* gfx = *gfxp; +void Gfx_SetupDL39_Ptr(Gfx** gfxP) { + Gfx* gfx = *gfxP; gSPDisplayList(gfx++, gSetupDLs[SETUPDL_39]); - *gfxp = gfx; + *gfxP = gfx; } void Gfx_SetupDL40_Opa(GraphicsContext* gfxCtx) { @@ -1347,11 +1347,11 @@ void Gfx_SetupDL56_Opa(GraphicsContext* gfxCtx) { CLOSE_DISPS(gfxCtx); } -void Gfx_SetupDL56_Ptr(Gfx** gfxp) { - Gfx* gfx = *gfxp; +void Gfx_SetupDL56_Ptr(Gfx** gfxP) { + Gfx* gfx = *gfxP; gSPDisplayList(gfx++, gSetupDLs[SETUPDL_56]); - *gfxp = gfx; + *gfxP = gfx; } void Gfx_SetupDL59_Opa(GraphicsContext* gfxCtx) { @@ -1362,8 +1362,8 @@ void Gfx_SetupDL59_Opa(GraphicsContext* gfxCtx) { CLOSE_DISPS(gfxCtx); } -Gfx* Gfx_BranchTexScroll(Gfx** gfxp, u32 x, u32 y, s32 width, s32 height) { - Gfx* gfx = Gfx_Alloc(gfxp, 3 * sizeof(Gfx)); +Gfx* Gfx_BranchTexScroll(Gfx** gfxP, u32 x, u32 y, s32 width, s32 height) { + Gfx* gfx = Gfx_Alloc(gfxP, 3 * sizeof(Gfx)); gDPTileSync(&gfx[0]); gDPSetTileSize(&gfx[1], 0, x, y, (x + ((width - 1) << 2)), (y + ((height - 1) << 2))); @@ -1372,8 +1372,8 @@ Gfx* Gfx_BranchTexScroll(Gfx** gfxp, u32 x, u32 y, s32 width, s32 height) { return gfx; } -void func_8012CB04(Gfx** gfxp, u32 x, u32 y) { - Gfx_BranchTexScroll(gfxp, x, y, 0, 0); +void func_8012CB04(Gfx** gfxP, u32 x, u32 y) { + Gfx_BranchTexScroll(gfxP, x, y, 0, 0); } Gfx* func_8012CB28(GraphicsContext* gfxCtx, u32 x, u32 y) { diff --git a/src/code/z_view.c b/src/code/z_view.c index 56af72134e..cd7ab807f0 100644 --- a/src/code/z_view.c +++ b/src/code/z_view.c @@ -129,24 +129,24 @@ void View_GetViewport(View* view, Viewport* viewport) { } void View_SetScissor(Gfx** gfx, s32 ulx, s32 uly, s32 lrx, s32 lry) { - Gfx* gfxp = *gfx; + Gfx* gfxP = *gfx; - gDPSetScissor(gfxp++, G_SC_NON_INTERLACE, ulx, uly, lrx, lry); + gDPSetScissor(gfxP++, G_SC_NON_INTERLACE, ulx, uly, lrx, lry); - *gfx = gfxp; + *gfx = gfxP; } void View_ClearScissor(View* view, Gfx** gfx) { - Gfx* gfxp = *gfx; + Gfx* gfxP = *gfx; s32 ulx = view->viewport.leftX; s32 uly = view->viewport.topY; s32 lrx = view->viewport.rightX; s32 lry = view->viewport.bottomY; - gDPPipeSync(gfxp++); - View_SetScissor(&gfxp, ulx, uly, lrx, lry); + gDPPipeSync(gfxP++); + View_SetScissor(&gfxP, ulx, uly, lrx, lry); - *gfx = gfxp; + *gfx = gfxP; } void View_ApplyLetterbox(View* view) { @@ -523,8 +523,8 @@ s32 View_UpdateViewingMatrix(View* view) { return 1; } -s32 View_ApplyTo(View* view, Gfx** gfxp) { - Gfx* gfx = *gfxp; +s32 View_ApplyTo(View* view, Gfx** gfxP) { + Gfx* gfx = *gfxP; GraphicsContext* gfxCtx = view->gfxCtx; Viewport* viewport = &view->viewport; Mtx* projection; @@ -547,7 +547,7 @@ s32 View_ApplyTo(View* view, Gfx** gfxp) { view->projection = *projection; gSPMatrix(gfx++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - *gfxp = gfx; + *gfxP = gfx; return 1; } 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 5c30a1375c..59707e1806 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -256,8 +256,11 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { if (SurfaceType_IsHookshotSurface(&play->colCtx, poly, bgId)) { DynaPolyActor* dynaPolyActor; - if ((bgId != BGCHECK_SCENE) && (dynaPolyActor = DynaPoly_GetActor(&play->colCtx, bgId)) != NULL) { - ArmsHook_AttachHookToActor(this, &dynaPolyActor->actor); + if (bgId != BGCHECK_SCENE) { + dynaPolyActor = DynaPoly_GetActor(&play->colCtx, bgId); + if (dynaPolyActor != NULL) { + ArmsHook_AttachHookToActor(this, &dynaPolyActor->actor); + } } func_808C1154(this); Audio_PlaySfx_AtPos(&this->actor.projectedPos, NA_SE_IT_HOOKSHOT_STICK_OBJ); diff --git a/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.c b/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.c index c753055f59..0b51ceb2f3 100644 --- a/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.c +++ b/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.c @@ -271,8 +271,8 @@ void func_80B84568(BgDblueWaterfall* this, PlayState* play) { s32 pad; CollisionPoly* sp40; WaterBox* waterBox; - s32 sp38; - f32 sp34 = BgCheck_EntityRaycastFloor5(&play->colCtx, &sp40, &sp38, &this->actor, &this->actor.world.pos); + s32 bgId; + f32 sp34 = BgCheck_EntityRaycastFloor5(&play->colCtx, &sp40, &bgId, &this->actor, &this->actor.world.pos); f32 sp30; if (WaterBox_GetSurface1_2(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp30, diff --git a/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c b/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c index 74c682253b..9795a42ee2 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c @@ -92,7 +92,7 @@ s32 func_80B7EB94(BgIkanaBlock* this, PlayState* play) { Vec3f sp64; Vec3f sp58; CollisionPoly* sp54; - s32 sp50; + s32 bgId; s32 sp4C = false; s16 phi_a0; f32 phi_f12; @@ -125,7 +125,7 @@ s32 func_80B7EB94(BgIkanaBlock* this, PlayState* play) { sp64.y += this->dyna.actor.world.pos.y + this->unk_170 + 2.0f; sp64.z += this->dyna.actor.world.pos.z; - return !BgCheck_EntityLineTest3(&play->colCtx, &sp70, &sp64, &sp58, &sp54, true, false, false, true, &sp50, + return !BgCheck_EntityLineTest3(&play->colCtx, &sp70, &sp64, &sp58, &sp54, true, false, false, true, &bgId, &this->dyna.actor, 0.0f); } @@ -147,15 +147,15 @@ void func_80B7ED54(BgIkanaBlock* this) { s32 func_80B7EDC4(BgIkanaBlock* this, PlayState* play) { s32 pad; Vec3f sp30; - s32 sp2C; + s32 bgId; sp30.x = this->dyna.actor.world.pos.x; sp30.y = this->dyna.actor.world.pos.y + this->unk_170 + 40.0f; sp30.z = this->dyna.actor.world.pos.z; this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor5_2(play, &play->colCtx, &this->dyna.actor.floorPoly, - &sp2C, &this->dyna.actor, &sp30); - this->dyna.actor.floorBgId = sp2C; + &bgId, &this->dyna.actor, &sp30); + this->dyna.actor.floorBgId = bgId; return ((this->dyna.actor.world.pos.y + this->unk_170) - this->dyna.actor.floorHeight) < 2.0f; } diff --git a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c index 0495e14c3b..3481b19c5f 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c @@ -513,7 +513,7 @@ void func_80B81010(BgIkanaRotaryroom* this, PlayState* play) { Vec3f sp84; BgIkanaRotaryroomStruct2* ptr2; CollisionPoly* sp7C; - s32 sp78; + s32 bgId; if (CutsceneManager_GetCurrentCsId() == this->dyna.actor.csId) { phi_s7 = true; @@ -540,7 +540,7 @@ void func_80B81010(BgIkanaRotaryroom* this, PlayState* play) { sp84.y = ptr->prevPos.y + 50.0f; sp84.z = ptr->prevPos.z; - temp_f0 = BgCheck_EntityRaycastFloor5_2(play, &play->colCtx, &sp7C, &sp78, NULL, &sp84); + temp_f0 = BgCheck_EntityRaycastFloor5_2(play, &play->colCtx, &sp7C, &bgId, NULL, &sp84); if (ptr->world.pos.y <= temp_f0) { ptr->world.pos.y = temp_f0; } else { @@ -580,7 +580,7 @@ void func_80B81234(BgIkanaRotaryroom* this, PlayState* play) { f32 temp_f0; f32 sp44 = D_80B82200[player->transformation] * 0.5f; CollisionPoly* sp40; - s32 sp3C; + s32 bgId; if (CutsceneManager_GetCurrentCsId() == this->dyna.actor.csId) { if (player == NULL) { @@ -614,7 +614,7 @@ void func_80B81234(BgIkanaRotaryroom* this, PlayState* play) { Matrix_Pop(); - temp_f0 = BgCheck_EntityRaycastFloor5_2(play, &play->colCtx, &sp40, &sp3C, NULL, &sp58); + temp_f0 = BgCheck_EntityRaycastFloor5_2(play, &play->colCtx, &sp40, &bgId, NULL, &sp58); if (ptr->unk_4C.y <= temp_f0) { ptr->unk_4C.y = temp_f0; } else { diff --git a/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c b/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c index 2765781dfd..e49b1061ef 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c @@ -67,7 +67,7 @@ s32 func_80B6FB30(BgKin2Shelf* this, PlayState* play) { Vec3f sp64; Vec3f sp58; CollisionPoly* sp54; - s32 sp50; + s32 bgId; if (this->unk_164 & 2) { spA2 = 0x4000; @@ -94,7 +94,7 @@ s32 func_80B6FB30(BgKin2Shelf* this, PlayState* play) { Matrix_MultVec3f(&sp94, &sp7C); Matrix_MultVec3f(&sp88, &sp70); - return BgCheck_EntityLineTest3(&play->colCtx, &sp7C, &sp70, &sp64, &sp54, true, false, false, true, &sp50, + return BgCheck_EntityLineTest3(&play->colCtx, &sp7C, &sp70, &sp64, &sp54, true, false, false, true, &bgId, &this->dyna.actor, 0.0f); } @@ -109,7 +109,7 @@ s32 func_80B6FCA4(BgKin2Shelf* this, PlayState* play) { Vec3f sp60; Vec3f sp54; CollisionPoly* sp50; - s32 sp4C; + s32 bgId; if (this->unk_164 & 1) { sp9E = 0; @@ -136,7 +136,7 @@ s32 func_80B6FCA4(BgKin2Shelf* this, PlayState* play) { Matrix_MultVec3f(&sp90, &sp78); Matrix_MultVec3f(&sp84, &sp6C); - return BgCheck_EntityLineTest3(&play->colCtx, &sp78, &sp6C, &sp60, &sp50, true, false, false, true, &sp4C, + return BgCheck_EntityLineTest3(&play->colCtx, &sp78, &sp6C, &sp60, &sp50, true, false, false, true, &bgId, &this->dyna.actor, 0.0f); } diff --git a/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c b/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c index 1d4fbdc4c8..4ca75e086a 100644 --- a/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c +++ b/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c @@ -33,12 +33,12 @@ static InitChainEntry sInitChain[] = { void BgLotus_Init(Actor* thisx, PlayState* play) { BgLotus* this = THIS; s32 pad; - s32 sp2C; + s32 bgId; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); DynaPolyActor_LoadMesh(play, &this->dyna, &gLilyPadCol); - this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor5(&play->colCtx, &this->dyna.actor.floorPoly, &sp2C, + this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor5(&play->colCtx, &this->dyna.actor.floorPoly, &bgId, &this->dyna.actor, &this->dyna.actor.world.pos); this->unk168 = 0x60; this->dyna.actor.world.rot.y = (s32)Rand_Next() >> 0x10; diff --git a/src/overlays/actors/ovl_Boss_02/z_boss_02.c b/src/overlays/actors/ovl_Boss_02/z_boss_02.c index 082a671287..b5a2268749 100644 --- a/src/overlays/actors/ovl_Boss_02/z_boss_02.c +++ b/src/overlays/actors/ovl_Boss_02/z_boss_02.c @@ -712,7 +712,7 @@ void func_809DAB78(Boss02* this, PlayState* play) { f32 sp9C; Vec3f sp90; CollisionPoly* sp8C; - s32 sp88; + s32 bgId; Vec3f sp7C; Vec3f sp70; Vec3f sp64; @@ -1068,7 +1068,7 @@ void func_809DAB78(Boss02* this, PlayState* play) { spD0.x = this->unk_0170.x + sp90.x; spD0.y = this->unk_0170.y + (1000.0f * sGiantModeScaleFactor); spD0.z = this->unk_0170.z + sp90.z; - if (BgCheck_EntityRaycastFloor3(&play->colCtx, &sp8C, &sp88, &spD0) != BGCHECK_Y_MIN) { + if (BgCheck_EntityRaycastFloor3(&play->colCtx, &sp8C, &bgId, &spD0) != BGCHECK_Y_MIN) { spA0 = BgCheck_EntityRaycastFloor1(&play->colCtx, &sp8C, &spD0); Matrix_MultVecZ(5.0f * sGiantModeScaleFactor, &sp70); sp70.y = 2.0f * sGiantModeScaleFactor; @@ -1129,11 +1129,7 @@ void func_809DBFB4(Boss02* this, PlayState* play) { damage = this->actor.colChkInfo.damage; if (otherTwinmold->unk_0144 < 20) { - do { - do { - this->actor.colChkInfo.health -= damage; - } while (0); - } while (0); + this->actor.colChkInfo.health -= damage; if ((s8)this->actor.colChkInfo.health <= 0) { Actor_Kill(this->actor.child); diff --git a/src/overlays/actors/ovl_Boss_04/z_boss_04.c b/src/overlays/actors/ovl_Boss_04/z_boss_04.c index f07d297ea4..71390b5811 100644 --- a/src/overlays/actors/ovl_Boss_04/z_boss_04.c +++ b/src/overlays/actors/ovl_Boss_04/z_boss_04.c @@ -150,7 +150,7 @@ void Boss04_Init(Actor* thisx, PlayState* play2) { CollisionPoly* spC0; Vec3f spB4; Vec3f spA8; - s32 spA4; + s32 bgId; f32 phi_f20; f32 phi_f24; Vec3f sp90; @@ -181,7 +181,7 @@ void Boss04_Init(Actor* thisx, PlayState* play2) { spA8.x = D_809EE1F8[i].x + this->actor.world.pos.x; spA8.z = D_809EE1F8[i].z + this->actor.world.pos.z; if (BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &spA8, &spB4, &spC0, true, false, false, - true, &spA4)) { + true, &bgId)) { if (i == 0) { this->unk_6D8 = spB4.x; } else if (i == 1) { diff --git a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c index 008bfd8a11..07e0985434 100644 --- a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c +++ b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c @@ -1066,12 +1066,13 @@ void DmChar00_Draw(Actor* thisx, PlayState* play2) { Gfx_SetupDL27_Xlu(play->state.gfxCtx); - do { - phi_a0 = (this->unk_262 * 50) & 511; - if (phi_a0 >= 256) { - phi_a0 = 511 - phi_a0; - } - } while (0); + //! FAKE: + if (1) {} + + phi_a0 = (this->unk_262 * 50) % 512U; + if (phi_a0 >= 256) { + phi_a0 = 511 - phi_a0; + } gSPSegment(POLY_XLU_DISP++, 0x08, &gfx[0]); 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 c55cd6d34b..9c94b28411 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -286,7 +286,7 @@ void func_8088A894(EnArrow* this, PlayState* play) { Vec3f sp50; f32 sp4C; f32 temp_f0; - s32 sp44; + s32 bgId; Math_Vec3f_Diff(&this->actor.world.pos, &this->unk_228, &sp68); sp4C = ((this->actor.world.pos.x - this->unk_264->world.pos.x) * sp68.x) + @@ -305,7 +305,7 @@ void func_8088A894(EnArrow* this, PlayState* play) { Math_Vec3f_Scale(&sp68, temp_f0); Math_Vec3f_Sum(&this->unk_264->world.pos, &sp68, &sp5C); if (BgCheck_EntityLineTest1(&play->colCtx, &this->unk_264->world.pos, &sp5C, &sp50, &sp74, true, true, true, true, - &sp44)) { + &bgId)) { this->unk_264->world.pos.x = ((sp5C.x <= sp50.x) ? 1.0f : -1.0f) + sp50.x; this->unk_264->world.pos.y = ((sp5C.y <= sp50.y) ? 1.0f : -1.0f) + sp50.y; this->unk_264->world.pos.z = ((sp5C.z <= sp50.z) ? 1.0f : -1.0f) + sp50.z; @@ -365,7 +365,7 @@ void func_8088AA98(EnArrow* this, PlayState* play) { void func_8088ACE0(EnArrow* this, PlayState* play) { CollisionPoly* spAC; - s32 spA8; + s32 bgId; Vec3f sp9C; s32 phi_a2 = 0; EffectSsSbnInitParams sp84; @@ -515,11 +515,11 @@ void func_8088ACE0(EnArrow* this, PlayState* play) { } if ((this->unk_262 = BgCheck_ProjectileLineTest(&play->colCtx, &this->actor.prevPos, &this->actor.world.pos, - &sp9C, &this->actor.wallPoly, true, true, true, true, &spA8))) { + &sp9C, &this->actor.wallPoly, true, true, true, true, &bgId))) { // `func_800B90AC` only returns a boolean, and does not process any code - func_800B90AC(play, &this->actor, this->actor.wallPoly, spA8, &sp9C); + func_800B90AC(play, &this->actor, this->actor.wallPoly, bgId, &sp9C); Math_Vec3f_Copy(&this->actor.world.pos, &sp9C); - this->actor.wallBgId = spA8; + this->actor.wallBgId = bgId; } if (ARROW_IS_ARROW(this->actor.params)) { @@ -535,7 +535,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) { Math_Vec3f_Sum(&this->unk_228, &this->unk_268, &sp60); Math_Vec3f_Sum(&this->actor.world.pos, &this->unk_268, &sp54); - if (BgCheck_EntityLineTest1(&play->colCtx, &sp60, &sp54, &sp9C, &spAC, true, true, true, true, &spA8)) { + if (BgCheck_EntityLineTest1(&play->colCtx, &sp60, &sp54, &sp9C, &spAC, true, true, true, true, &bgId)) { this->unk_264->world.pos.x = ((sp54.x <= sp9C.x) ? 1.0f : -1.0f) + sp9C.x; this->unk_264->world.pos.y = ((sp54.y <= sp9C.y) ? 1.0f : -1.0f) + sp9C.y; this->unk_264->world.pos.z = ((sp54.z <= sp9C.z) ? 1.0f : -1.0f) + sp9C.z; diff --git a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c index f620822bde..8c46a76165 100644 --- a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c +++ b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c @@ -227,7 +227,7 @@ void func_80A2778C(EnBigpamet* this) { void func_80A27970(EnBigpamet* this, PlayState* play2) { Vec3f sp9C; f32 temp_fs1 = this->actor.depthInWater + this->actor.world.pos.y; - s32 sp94; + s32 bgId; s32 i; s16 temp_s0; f32 temp_fs0; @@ -242,7 +242,7 @@ void func_80A27970(EnBigpamet* this, PlayState* play2) { sp9C.y = Rand_ZeroFloat(10.0f) + this->actor.floorHeight + 8.0f; sp9C.z = (Math_CosS(temp_s0) * temp_fs0) + this->actor.world.pos.z; - if (BgCheck_EntityRaycastFloor5_2(play, &play->colCtx, &sp84, &sp94, &this->actor, &sp9C) < temp_fs1) { + if (BgCheck_EntityRaycastFloor5_2(play, &play->colCtx, &sp84, &bgId, &this->actor, &sp9C) < temp_fs1) { sp9C.y = temp_fs1; EffectSsGSplash_Spawn(play, &sp9C, NULL, NULL, 0, Rand_S16Offset(1000, 200)); } else { 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 f33b8c12c2..460937385a 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -335,7 +335,7 @@ void EnBom_Explode(EnBom* this, PlayState* play) { Vec3f spC0; Vec3f spB4; CollisionPoly* spB0; - s32 spAC; + s32 bgId; Vec3f spA0; Vec3f sp94; Vec3f sp88; @@ -394,8 +394,8 @@ void EnBom_Explode(EnBom* this, PlayState* play) { spB4.x = this->actor.world.pos.x + spC0.x; spB4.y = this->actor.world.pos.y + 500.0f; spB4.z = this->actor.world.pos.z + spC0.z; - if (BgCheck_EntityRaycastFloor3(&play->colCtx, &spB0, &spAC, &spB4) != BGCHECK_Y_MIN) { - floorType = SurfaceType_GetFloorType(&play->colCtx, spB0, spAC); + if (BgCheck_EntityRaycastFloor3(&play->colCtx, &spB0, &bgId, &spB4) != BGCHECK_Y_MIN) { + floorType = SurfaceType_GetFloorType(&play->colCtx, spB0, bgId); temp_f20 = BgCheck_EntityRaycastFloor1(&play->colCtx, &spB0, &spB4); if ((floorType == FLOOR_TYPE_4) || (floorType == FLOOR_TYPE_15) || (floorType == FLOOR_TYPE_14)) { @@ -706,7 +706,7 @@ void func_808726DC(PlayState* play, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, s32 a for (i = 0; i < spB0; i++, fuseSegmentPtr++, fuseSegmentPtr2++, arg4 -= 240) { f32 phi_f22; CollisionPoly* spA0; - s32 sp9C; + s32 bgId; Vec3f sp90; if (arg4 >= 240) { @@ -756,7 +756,7 @@ void func_808726DC(PlayState* play, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, s32 a sp90.y += 50.0f; - temp_f2 = BgCheck_EntityRaycastFloor3(&play->colCtx, &spA0, &sp9C, &sp90) - fuseSegmentPtr2->pos.y; + temp_f2 = BgCheck_EntityRaycastFloor3(&play->colCtx, &spA0, &bgId, &sp90) - fuseSegmentPtr2->pos.y; if (temp_f2 >= 0.0f) { spC0.y += temp_f2; if (phi_f22 < spC0.y) { 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 26c3478755..397ac74a5d 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 @@ -203,7 +203,7 @@ void EnBomChu_WaitForRelease(EnBomChu* this, PlayState* play) { s32 EnBomChu_IsOnCollisionPoly(PlayState* play, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** poly, s32* bgId) { - if ((BgCheck_EntityLineTest1(&play->colCtx, posA, posB, posResult, poly, true, true, true, true, bgId)) && + if (BgCheck_EntityLineTest1(&play->colCtx, posA, posB, posResult, poly, true, true, true, true, bgId) && !(SurfaceType_GetWallFlags(&play->colCtx, *poly, *bgId) & (WALL_FLAG_4 | WALL_FLAG_5))) { return true; } diff --git a/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c b/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c index b9fb21b551..bf5bb3196d 100644 --- a/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c +++ b/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c @@ -278,7 +278,7 @@ void func_80C03AF4(EnBombers* this, PlayState* play) { Vec3f sp54; f32 x; f32 z; - s32 sp48; + s32 bgId; s16 abs; switch (this->unk_2A0) { @@ -291,7 +291,7 @@ void func_80C03AF4(EnBombers* this, PlayState* play) { abs = ABS_ALT(BINANG_SUB(this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp60))); if ((abs < 0x4000) && !BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &sp60, &sp6C, - &colPoly, true, false, false, true, &sp48)) { + &colPoly, true, false, false, true, &bgId)) { EnBombers_ChangeAnim(this, ENBOMBERS_ANIM_2, 1.0f); Math_Vec3f_Copy(&this->unk_294, &sp60); this->unk_2AA = Rand_S16Offset(30, 50); @@ -312,7 +312,7 @@ void func_80C03AF4(EnBombers* this, PlayState* play) { sp54.z += Math_CosS(this->actor.world.rot.y) * 60.0f; if (BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &sp54, &sp6C, &colPoly, true, false, - false, true, &sp48)) { + false, true, &bgId)) { this->unk_2A8 = 0; if (Rand_ZeroOne() < 0.5f) { EnBombers_ChangeAnim(this, ENBOMBERS_ANIM_16, 1.0f); diff --git a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c index 6aa4884901..8e20c1edb4 100644 --- a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c +++ b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c @@ -316,7 +316,7 @@ void func_80BFE67C(EnBomjima* this, PlayState* play) { Vec3f sp60; Vec3f sp54; CollisionPoly* sp50; - s32 sp4C; + s32 bgId; this->unk_2DC = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_2A4); Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2DC, 1, 0x1388, 0); @@ -331,7 +331,7 @@ void func_80BFE67C(EnBomjima* this, PlayState* play) { abs = ABS_ALT(BINANG_SUB(this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp54))); if ((abs < 0x4000) && !BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &sp54, &sp6C, - &sp50, true, false, false, true, &sp4C)) { + &sp50, true, false, false, true, &bgId)) { EnBomjima_ChangeAnim(this, ENBOMJIMA_ANIM_5, 1.0f); Math_Vec3f_Copy(&this->unk_2A4, &sp54); this->unk_2BE = Rand_S16Offset(30, 50); @@ -354,7 +354,7 @@ void func_80BFE67C(EnBomjima* this, PlayState* play) { sp60.z += Math_CosS(this->actor.world.rot.y) * 60.0f; if (BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &sp60, &sp6C, &sp50, true, false, - false, true, &sp4C)) { + false, true, &bgId)) { this->unk_2C0 = 0; if (Rand_ZeroOne() < 0.5f) { EnBomjima_ChangeAnim(this, ENBOMJIMA_ANIM_19, 1.0f); diff --git a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c index c298fe36c5..00308ba6f8 100644 --- a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c +++ b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c @@ -328,7 +328,7 @@ void func_80C014E4(EnBomjimb* this, PlayState* play) { Vec3f sp60; Vec3f sp54; Vec3f sp48; - s32 sp44; + s32 bgId; if (func_80C012FC(this, play) || func_80C013B4(this) || func_80C013F0(this, play)) { return; @@ -343,7 +343,7 @@ void func_80C014E4(EnBomjimb* this, PlayState* play) { abs = ABS_ALT(BINANG_SUB(this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp48))); if ((abs < 0x4000) && !BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &sp48, &sp60, - &colPoly, true, false, false, true, &sp44)) { + &colPoly, true, false, false, true, &bgId)) { EnBomjimb_ChangeAnim(this, ENBOMJIMB_ANIM_5, 1.0f); Math_Vec3f_Copy(&this->unk_294, &sp48); this->unk_2B0 = Rand_S16Offset(30, 50); @@ -363,7 +363,7 @@ void func_80C014E4(EnBomjimb* this, PlayState* play) { sp54.x += Math_SinS(this->actor.world.rot.y) * 60.0f; sp54.z += Math_CosS(this->actor.world.rot.y) * 60.0f; if (BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &sp54, &sp60, &colPoly, true, false, - false, true, &sp44)) { + false, true, &bgId)) { this->unk_2AE = 0; if (Rand_ZeroOne() < 0.5f) { EnBomjimb_ChangeAnim(this, ENBOMJIMB_ANIM_20, 1.0f); @@ -594,8 +594,8 @@ void func_80C0217C(EnBomjimb* this, PlayState* play) { Vec3f sp74; CollisionPoly* sp70; Vec3f sp64; - s32 sp60; - s32 sp5C = this->actor.floorBgId; + s32 bgId; + s32 floorBgId = this->actor.floorBgId; CollisionPoly* sp58 = this->actor.floorPoly; Player* player = GET_PLAYER(play); s32 sp50 = false; @@ -627,7 +627,7 @@ void func_80C0217C(EnBomjimb* this, PlayState* play) { sp74.z += Math_CosS(this->actor.world.rot.y) * 50.0f; if (BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &sp74, &sp64, &sp70, true, false, false, true, - &sp60)) { + &bgId)) { s16 temp = BINANG_SUB((this->actor.world.rot.y - this->actor.yawTowardsPlayer), 0x8000); this->unk_2D6 = temp; @@ -656,7 +656,7 @@ void func_80C0217C(EnBomjimb* this, PlayState* play) { this->actor.world.rot.y = this->unk_2D6 + this->unk_2D4; - if (SurfaceType_GetSceneExitIndex(&play->colCtx, sp58, sp5C) != 0) { + if (SurfaceType_GetSceneExitIndex(&play->colCtx, sp58, floorBgId) != 0) { s16 temp = BINANG_SUB(this->actor.world.rot.y, this->actor.yawTowardsPlayer - 0x8000); if (temp < 0) { 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 4cd89732fc..4565d3cffa 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -226,21 +226,21 @@ void func_808A2918(EnBoom* this, PlayState* play) { } if (DECR(this->unk_1CC) != 0) { - s32 sp5C; + s32 bgId; Vec3f sp50; s32 pad; sp74 = BgCheck_EntityLineTest1(&play->colCtx, &this->actor.prevPos, &this->actor.world.pos, &sp50, - &this->actor.wallPoly, true, true, true, true, &sp5C); - if (sp74 != 0) { - if (func_800B90AC(play, &this->actor, this->actor.wallPoly, sp5C, &sp50)) { - sp74 = 0; + &this->actor.wallPoly, true, true, true, true, &bgId); + if (sp74) { + if (func_800B90AC(play, &this->actor, this->actor.wallPoly, bgId, &sp50)) { + sp74 = false; } else { CollisionCheck_SpawnShieldParticlesMetal(play, &sp50); } } - if (sp74 != 0) { + if (sp74) { this->actor.world.rot.x = -this->actor.world.rot.x; this->actor.world.rot.y += 0x8000; this->moveTo = &player->actor; diff --git a/src/overlays/actors/ovl_En_Dt/z_en_dt.c b/src/overlays/actors/ovl_En_Dt/z_en_dt.c index 18257c1be4..9a65fda852 100644 --- a/src/overlays/actors/ovl_En_Dt/z_en_dt.c +++ b/src/overlays/actors/ovl_En_Dt/z_en_dt.c @@ -630,7 +630,7 @@ void EnDt_UpdateMeetingCutscene(EnDt* this, PlayState* play) { } void EnDt_FinishMeetingCutscene(EnDt* this, PlayState* play) { - f32 currFrame = this->skelAnime.curFrame; + f32 curFrame = this->skelAnime.curFrame; if (this->timer != 0) { if (this->timer == 1) { @@ -643,7 +643,7 @@ void EnDt_FinishMeetingCutscene(EnDt* this, PlayState* play) { this->appearancePhase = EN_DT_APPEARANCE_RESOLVED_MEETING; } } - } else if (this->animEndFrame <= currFrame) { + } else if (curFrame >= this->animEndFrame) { Camera* subCam; s32 index; s32 csIdIndex = sStringIdCsIndexTable[this->csIdIndex + 1]; 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 0c1381f055..5758a9ed6d 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -252,7 +252,7 @@ void func_80932784(EnFz* this, PlayState* play) { Vec3f sp5C; Vec3f sp50; Vec3f sp44; - s32 sp40; + s32 bgId; CollisionPoly* sp3C; sp5C.x = this->actor.world.pos.x; @@ -266,7 +266,7 @@ void func_80932784(EnFz* this, PlayState* play) { sp44.z = 440.0f; Matrix_MultVec3f(&sp44, &this->unk_22C); - if (BgCheck_EntityLineTest1(&play->colCtx, &sp5C, &this->unk_22C, &sp50, &sp3C, true, false, false, true, &sp40)) { + if (BgCheck_EntityLineTest1(&play->colCtx, &sp5C, &this->unk_22C, &sp50, &sp3C, true, false, false, true, &bgId)) { Math_Vec3f_Copy(&this->unk_22C, &sp50); } 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 50d1f600ce..94a8a89a26 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -1318,7 +1318,7 @@ void func_8094220C(EnGoroiwa* this, PlayState* play) { s32 pad; EnGoroiwaStruct* ptr; s32 i; - s32 spD0; + s32 bgId; Vec3f spC4; Vec3f spB8; f32 phi_f12; @@ -1348,7 +1348,7 @@ void func_8094220C(EnGoroiwa* this, PlayState* play) { spC4.y = ptr->unk_00.y + 25.0f; spC4.z = ptr->unk_00.z; - ptr->unk_18 = BgCheck_EntityRaycastFloor5(&play->colCtx, &ptr->unk_28, &spD0, &this->actor, &spC4); + ptr->unk_18 = BgCheck_EntityRaycastFloor5(&play->colCtx, &ptr->unk_28, &bgId, &this->actor, &spC4); if (ptr->unk_10 <= 0.0f) { Matrix_RotateZYX(ptr->unk_1C, ptr->unk_1E, ptr->unk_20, MTXMODE_NEW); 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 7e785ecf43..32ad580bbb 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -155,13 +155,13 @@ void func_8095D6E0(Actor* thisx, PlayState* play) { s32 func_8095D758(EnIshi* this, PlayState* play, f32 arg2) { Vec3f sp24; - s32 sp20; + s32 bgId; sp24.x = this->actor.world.pos.x; sp24.y = this->actor.world.pos.y + 30.0f; sp24.z = this->actor.world.pos.z; this->actor.floorHeight = - BgCheck_EntityRaycastFloor5(&play->colCtx, &this->actor.floorPoly, &sp20, &this->actor, &sp24); + BgCheck_EntityRaycastFloor5(&play->colCtx, &this->actor.floorPoly, &bgId, &this->actor, &sp24); if (this->actor.floorHeight > BGCHECK_Y_MIN) { this->actor.world.pos.y = this->actor.floorHeight + arg2; Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); @@ -532,7 +532,7 @@ void func_8095E934(EnIshi* this) { void func_8095E95C(EnIshi* this, PlayState* play) { s32 pad; Vec3f sp30; - s32 sp2C; + s32 bgId; if (Actor_HasNoParent(&this->actor, play)) { this->actor.room = play->roomCtx.curRoom.num; @@ -551,7 +551,7 @@ void func_8095E95C(EnIshi* this, PlayState* play) { sp30.y = this->actor.world.pos.y + 20.0f; sp30.z = this->actor.world.pos.z; this->actor.floorHeight = - BgCheck_EntityRaycastFloor5(&play->colCtx, &this->actor.floorPoly, &sp2C, &this->actor, &sp30); + BgCheck_EntityRaycastFloor5(&play->colCtx, &this->actor.floorPoly, &bgId, &this->actor, &sp30); } } diff --git a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c index 81171d1122..806c6b1b96 100644 --- a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c +++ b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c @@ -252,15 +252,15 @@ void func_80A5B954(MtxF* matrix, f32 arg1) { s32 func_80A5BA58(EnKusa2* this, PlayState* play) { Vec3f sp24; - s32 sp20; + s32 bgId; sp24.x = this->actor.world.pos.x; sp24.y = this->actor.world.pos.y + 30.0f; sp24.z = this->actor.world.pos.z; this->actor.floorHeight = - BgCheck_EntityRaycastFloor5(&play->colCtx, &this->actor.floorPoly, &sp20, &this->actor, &sp24); + BgCheck_EntityRaycastFloor5(&play->colCtx, &this->actor.floorPoly, &bgId, &this->actor, &sp24); if (this->actor.floorHeight > BGCHECK_Y_MIN) { - this->actor.floorBgId = sp20; + this->actor.floorBgId = bgId; this->actor.world.pos.y = this->actor.floorHeight; Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); return true; @@ -1018,7 +1018,7 @@ void func_80A5D964(EnKusa2* this) { void func_80A5D9C8(EnKusa2* this, PlayState* play) { s32 pad; Vec3f sp30; - s32 sp2C; + s32 bgId; D_80A5EAF4.x += 11000; D_80A5EAF4.y += 17000; @@ -1063,7 +1063,7 @@ void func_80A5D9C8(EnKusa2* this, PlayState* play) { } this->actor.floorHeight = - BgCheck_EntityRaycastFloor5(&play->colCtx, &this->actor.floorPoly, &sp2C, &this->actor, &sp30); + BgCheck_EntityRaycastFloor5(&play->colCtx, &this->actor.floorPoly, &bgId, &this->actor, &sp30); } } diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/src/overlays/actors/ovl_En_Mag/z_en_mag.c index 1b5a65d388..8772754d2b 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -458,15 +458,15 @@ void EnMag_Update(Actor* thisx, PlayState* play) { /** * Draws an i8 texture. * - * @param[in,out] gfxp Pointer to current displaylist. + * @param[in,out] gfxP Pointer to current displaylist. * @param[in] texture Texture to draw. * @param[in] texWidth Width of the texture. * @param[in] texHeight Height of the texture. * @param[in] rectLeft X coordinate of the top-left of the draw position. * @param[in] rectTop Y coordinate of the top-left of the draw position. */ -void EnMag_DrawTextureI8(Gfx** gfxp, TexturePtr texture, s16 texWidth, s16 texHeight, s16 rectLeft, s16 rectTop) { - Gfx* gfx = *gfxp; +void EnMag_DrawTextureI8(Gfx** gfxP, TexturePtr texture, s16 texWidth, s16 texHeight, s16 rectLeft, s16 rectTop) { + Gfx* gfx = *gfxP; gDPLoadTextureBlock(gfx++, texture, G_IM_FMT_I, G_IM_SIZ_8b, texWidth, texHeight, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); @@ -474,21 +474,21 @@ void EnMag_DrawTextureI8(Gfx** gfxp, TexturePtr texture, s16 texWidth, s16 texHe gSPTextureRectangle(gfx++, rectLeft << 2, rectTop << 2, (rectLeft + texWidth) << 2, (rectTop + texHeight) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); - *gfxp = gfx; + *gfxP = gfx; } /** * Draws an ia8 texture. * - * @param[in,out] gfxp Pointer to current displaylist. + * @param[in,out] gfxP Pointer to current displaylist. * @param[in] texture Texture to draw. * @param[in] texWidth Width of the texture. * @param[in] texHeight Height of the texture. * @param[in] rectLeft X coordinate of the top-left of the draw position. * @param[in] rectTop Y coordinate of the top-left of the draw position. */ -void EnMag_DrawTextureIA8(Gfx** gfxp, TexturePtr texture, s16 texWidth, s16 texHeight, s16 rectLeft, s16 rectTop) { - Gfx* gfx = *gfxp; +void EnMag_DrawTextureIA8(Gfx** gfxP, TexturePtr texture, s16 texWidth, s16 texHeight, s16 rectLeft, s16 rectTop) { + Gfx* gfx = *gfxP; gDPLoadTextureBlock(gfx++, texture, G_IM_FMT_IA, G_IM_SIZ_8b, texWidth, texHeight, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); @@ -496,13 +496,13 @@ void EnMag_DrawTextureIA8(Gfx** gfxp, TexturePtr texture, s16 texWidth, s16 texH gSPTextureRectangle(gfx++, rectLeft << 2, rectTop << 2, (rectLeft + texWidth) << 2, (rectTop + texHeight) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); - *gfxp = gfx; + *gfxP = gfx; } /** * Draws an i8 effect texture, masking it with an i4 mask, with shifting * - * @param[in,out] gfxp Pointer to current displaylist. + * @param[in,out] gfxP Pointer to current displaylist. * @param[in] maskTex Texture with which to mask, i4. * @param[in] effectTex Effect texture to draw, i8. * @param[in] maskWidth Width of masking texture. @@ -516,10 +516,10 @@ void EnMag_DrawTextureIA8(Gfx** gfxp, TexturePtr texture, s16 texWidth, s16 texH * @param[in] index Index into the scrolling arrays to use for gDPSetTileSize. * @param[in] this Pointer to EnMag instance. */ -void EnMag_DrawEffectTextures(Gfx** gfxp, TexturePtr maskTex, TexturePtr effectTex, s16 maskWidth, s16 maskHeight, +void EnMag_DrawEffectTextures(Gfx** gfxP, TexturePtr maskTex, TexturePtr effectTex, s16 maskWidth, s16 maskHeight, s16 effectWidth, s16 effectHeight, s16 rectLeft, s16 rectTop, u16 shifts, u16 shiftt, u16 index, EnMag* this) { - Gfx* gfx = *gfxp; + Gfx* gfx = *gfxP; gDPLoadMultiBlock_4b(gfx++, maskTex, 0x0000, G_TX_RENDERTILE, G_IM_FMT_I, maskWidth, maskHeight, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, @@ -534,22 +534,22 @@ void EnMag_DrawEffectTextures(Gfx** gfxp, TexturePtr maskTex, TexturePtr effectT gSPTextureRectangle(gfx++, rectLeft << 2, rectTop << 2, (rectLeft + maskWidth) << 2, (rectTop + maskHeight) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); - *gfxp = gfx; + *gfxP = gfx; } /** * Draws an rgba32 texture. Because these are so large, this will draw the texture in horizontal stripes, each narrow * enough that that part of the texture will fit into TMEM's 4kB. * - * @param[in,out] gfxp Pointer to current displaylist. + * @param[in,out] gfxP Pointer to current displaylist. * @param[in] centerX X coordinate of the center of the draw position. * @param[in] centerY Y coordinate of the center of the draw position. * @param[in] source Texture to draw. * @param[in] width Width of the texture. * @param[in] height Height of the texture. */ -void EnMag_DrawImageRGBA32(Gfx** gfxp, s16 centerX, s16 centerY, TexturePtr source, u32 width, u32 height) { - Gfx* gfx = *gfxp; +void EnMag_DrawImageRGBA32(Gfx** gfxP, s16 centerX, s16 centerY, TexturePtr source, u32 width, u32 height) { + Gfx* gfx = *gfxP; uintptr_t curTexture; s32 textureCount; u32 rectLeft; @@ -604,19 +604,19 @@ void EnMag_DrawImageRGBA32(Gfx** gfxp, s16 centerX, s16 centerY, TexturePtr sour } } - *gfxp = gfx; + *gfxP = gfx; } /** * Draws one character, expected to be a 16 by 16 i4 texture. It will draw shrunk to 10 by 10. * - * @param[in,out] gfxp Pointer to current displaylist. + * @param[in,out] gfxP Pointer to current displaylist. * @param[in] texture Texture to draw. * @param[in] rectLeft X coordinate of the top-left of the draw position. * @param[in] rectTop Y coordinate of the top-left of the draw position. */ -void EnMag_DrawCharTexture(Gfx** gfxp, TexturePtr texture, s32 rectLeft, s32 rectTop) { - Gfx* gfx = *gfxp; +void EnMag_DrawCharTexture(Gfx** gfxP, TexturePtr texture, s32 rectLeft, s32 rectTop) { + Gfx* gfx = *gfxP; gDPLoadTextureBlock_4b(gfx++, texture, G_IM_FMT_I, 16, 16, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); @@ -626,7 +626,7 @@ void EnMag_DrawCharTexture(Gfx** gfxp, TexturePtr texture, s32 rectLeft, s32 rec gSPTextureRectangle(gfx++, rectLeft << 2, rectTop << 2, (rectLeft + 10) << 2, (rectTop + 10) << 2, G_TX_RENDERTILE, 0, 0, 1625, 1625); - *gfxp = gfx; + *gfxP = gfx; } #define EFFECT_MASK_TEX_WIDTH 64 @@ -678,10 +678,10 @@ void EnMag_DrawCharTexture(Gfx** gfxp, TexturePtr texture, s32 rectLeft, s32 rec #define PRESS_START_SPACE 5 // Extra space between the words /** - * Loads title, PRESS START text, etc. graphics to gfxp, which is made to live on + * Loads title, PRESS START text, etc. graphics to gfxP, which is made to live on * POLY_OPA_DISP, but is used by OVERLAY_DISP. */ -void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxp) { +void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxP) { static u8 sPressStartFontIndices[] = { 0x19, 0x1B, 0x0E, 0x1C, 0x1C, 0x1C, 0x1D, 0x0A, 0x1B, 0x1D, }; // Indices into this->font.fontBuf @@ -704,7 +704,7 @@ void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxp) { s32 pad; EnMag* this = THIS; Font* font = &this->font; - Gfx* gfx = *gfxp; + Gfx* gfx = *gfxP; u16 i; u16 j; u16 k; @@ -952,7 +952,7 @@ void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxp) { } } - *gfxp = gfx; + *gfxP = gfx; } /** diff --git a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c index 4c7f971e79..027f37e036 100644 --- a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c +++ b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c @@ -125,9 +125,9 @@ void func_80A68808(EnMushi2* this) { s32 func_80A68860(EnMushi2* this, PlayState* play) { s32 pad; - s32 sp40; + s32 bgId; CollisionPoly* sp3C; - f32 temp_f0 = BgCheck_EntityRaycastFloor5(&play->colCtx, &sp3C, &sp40, &this->actor, &this->actor.world.pos); + f32 temp_f0 = BgCheck_EntityRaycastFloor5(&play->colCtx, &sp3C, &bgId, &this->actor, &this->actor.world.pos); WaterBox* waterBox; f32 sp30; diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h index 1ac01466ad..51b5c239d0 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h @@ -65,7 +65,7 @@ typedef struct EnOssan { * Items on shelves are indexed as: * 7 5 3 1 * 6 4 2 0 -*/ +*/ typedef enum { /* 0 */ ENOSSAN_CURIOSITY_SHOP_MAN, diff --git a/src/overlays/actors/ovl_En_Pr/z_en_pr.c b/src/overlays/actors/ovl_En_Pr/z_en_pr.c index 4c39d10c4a..b497b44a34 100644 --- a/src/overlays/actors/ovl_En_Pr/z_en_pr.c +++ b/src/overlays/actors/ovl_En_Pr/z_en_pr.c @@ -215,11 +215,11 @@ void EnPr_ChangeAnim(EnPr* this, s32 animIndex) { s32 func_80A324E0(EnPr* this, PlayState* play) { CollisionPoly* sp54; Vec3f sp48; - s32 sp44; + s32 bgId; WaterBox* waterBox; if (BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &this->unk_2E0, &sp48, &sp54, 1, 0, 0, 1, - &sp44)) { + &bgId)) { return 1; } diff --git a/src/overlays/actors/ovl_En_Prz/z_en_prz.c b/src/overlays/actors/ovl_En_Prz/z_en_prz.c index 93f52f4179..813868cbc4 100644 --- a/src/overlays/actors/ovl_En_Prz/z_en_prz.c +++ b/src/overlays/actors/ovl_En_Prz/z_en_prz.c @@ -217,7 +217,7 @@ void func_80A76070(EnPrz* this, s16 arg1, PlayState* play) { s32 func_80A762C0(EnPrz* this, PlayState* play) { CollisionPoly* sp54; Vec3f sp48; - s32 sp44; + s32 bgId; Vec3f sp38; Math_Vec3f_Copy(&sp38, &this->actor.world.pos); @@ -226,7 +226,7 @@ s32 func_80A762C0(EnPrz* this, PlayState* play) { sp38.z += Math_CosS(this->actor.world.rot.y) * 40.0f; if (BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &sp38, &sp48, &sp54, true, false, false, true, - &sp44)) { + &bgId)) { return true; } return false; diff --git a/src/overlays/actors/ovl_En_Rg/z_en_rg.c b/src/overlays/actors/ovl_En_Rg/z_en_rg.c index 35920d19f2..8d3fd67d93 100644 --- a/src/overlays/actors/ovl_En_Rg/z_en_rg.c +++ b/src/overlays/actors/ovl_En_Rg/z_en_rg.c @@ -318,12 +318,12 @@ s32 func_80BF416C(EnRg* this, PlayState* play) { s32 func_80BF4220(EnRg* this, PlayState* play, Actor* arg2) { CollisionPoly* sp44 = NULL; - s32 sp40; + s32 bgId; Vec3f sp34; if (Actor_ActorAIsFacingAndNearActorB(&this->actor, arg2, 400.0f, 0x2000) && !BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &arg2->world.pos, &sp34, &sp44, true, false, - false, true, &sp40)) { + false, true, &bgId)) { return true; } return false; 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 cbd90562ff..fc2c568430 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -497,7 +497,7 @@ void func_8099556C(EnSkb* this, PlayState* play) { this->unk_3D4 = Rand_Next() % 0x7D0; } - this->actor.shape.rot.x = Math_SinS(this->unk_3D4 * sp26) * 20000.0f; + this->actor.shape.rot.x = Math_SinS(this->unk_3D4 * sp26) * 0x4E20; if (Player_GetMask(play) == PLAYER_MASK_CAPTAIN) { this->actor.flags &= ~(ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE); this->actor.flags |= (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY); diff --git a/src/overlays/actors/ovl_En_Slime/z_en_slime.h b/src/overlays/actors/ovl_En_Slime/z_en_slime.h index b25932f698..65f15eeeed 100644 --- a/src/overlays/actors/ovl_En_Slime/z_en_slime.h +++ b/src/overlays/actors/ovl_En_Slime/z_en_slime.h @@ -40,7 +40,7 @@ typedef struct EnSlime { /* 0x14E */ s16 idleRotY; /* 0x150 */ s16 reviveRotY; /* 0x152 */ s16 reviveTime; - /* 0x154 */ union { + /* 0x154 */ union { Vec3f iceBlockSnapPos; Vec3f wobbleRot; }; diff --git a/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c b/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c index 7b37851111..bd4caf886c 100644 --- a/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c +++ b/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c @@ -478,7 +478,7 @@ void EnStoneheishi_Update(Actor* thisx, PlayState* play) { } s32 EnStoneheishi_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx, - Gfx** gfxp) { + Gfx** gfxP) { EnStoneheishi* this = THIS; if (limbIndex == SOLDIER_LIMB_HEAD) { @@ -490,13 +490,13 @@ s32 EnStoneheishi_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, return false; } -void EnStoneheishi_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfxp) { +void EnStoneheishi_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfxP) { static Vec3f sLeftHandPos = { 0.0f, 0.0f, 0.0f }; EnStoneheishi* this = THIS; Gfx* gfx; if ((limbIndex == SOLDIER_LIMB_LEFT_HAND) && (this->bottleDisplay != EN_STONE_BOTTLE_NONE)) { - gfx = Gfx_SetupDL71(*gfxp); + gfx = Gfx_SetupDL71(*gfxP); sLeftHandPos.x = 320.0f; sLeftHandPos.y = 210.0f; @@ -523,7 +523,7 @@ void EnStoneheishi_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec gSPMatrix(gfx++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gfx++, gSoldierBottleDL); - *gfxp = gfx++; + *gfxP = gfx++; } } diff --git a/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c b/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c index 108f3a641f..8febb09344 100644 --- a/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c +++ b/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c @@ -304,7 +304,7 @@ void func_80AE795C(EnStopheishi* this, PlayState* play) { break; case 2: - if (this->animEndFrame <= curFrame) { + if (curFrame >= this->animEndFrame) { EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_5); this->unk_274 = 3; } 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 0dc7957373..9bc4733ba4 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -1152,7 +1152,7 @@ void func_80AEEAD4(EnTk* this, PlayState* play) { } void func_80AEEB88(EnTk* this, PlayState* play) { - s32 sp74; + s32 bgId; Vec3f sp68; s32 i; f32 temp; @@ -1166,7 +1166,7 @@ void func_80AEEB88(EnTk* this, PlayState* play) { sp68.z += this->actor.world.pos.z; temp = - BgCheck_EntityRaycastFloor3(&play->colCtx, &this->actor.floorPoly, &sp74, &sp68) - this->actor.world.pos.y; + BgCheck_EntityRaycastFloor3(&play->colCtx, &this->actor.floorPoly, &bgId, &sp68) - this->actor.world.pos.y; if (temp <= -80.0f) { break; } 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 3e74b3ebcb..6f17b86740 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c @@ -52,17 +52,22 @@ void EnViewer_Init(Actor* thisx, PlayState* play) { this->unk_150 = (u8)ENVIEWER_GET_1FC(&this->actor) * 40.0f; EnViewer_SetupAction(this, func_8089F17C); break; + case ENVIEWER_PARAM_1: this->unk_148 = (u16)ENVIEWER_GET_FE00(&this->actor) * 40.0f; this->unk_150 = (u8)ENVIEWER_GET_1FC(&this->actor) * 40.0f; this->unk_14C = (u16)(this->actor.world.rot.y) * 40.0f; EnViewer_SetupAction(this, func_8089F218); break; + case ENVIEWER_PARAM_2: this->unk_148 = (u16)ENVIEWER_GET_FE00(&this->actor) * 40.0f; this->unk_14C = (u8)ENVIEWER_GET_1FC(&this->actor) * 40.0f; EnViewer_SetupAction(this, func_8089F2C4); break; + + default: + break; } } @@ -76,6 +81,7 @@ void func_8089F014(EnViewer* this, PlayState* play, f32 arg2) { } else if (arg2 < 0.0f) { arg2 = 0.0f; } + play->envCtx.lightSettingOverride = 0; play->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_FULL_CONTROL; play->envCtx.lightSetting = this->actor.world.rot.x; @@ -132,9 +138,11 @@ void func_8089F2C4(EnViewer* this, PlayState* play) { f32 temp; Actor_WorldToActorCoords(&this->actor, &sp20, &player->actor.world.pos); + if (this->unk_14C == 0.0f) { this->unk_14C = 0.1f; } + if ((play->roomCtx.curRoom.num == this->actor.room) && (sp20.x < fabsf(this->unk_148))) { temp = sp20.z / this->unk_14C; func_8089F014(this, play, temp); @@ -151,6 +159,7 @@ void EnViewer_Update(Actor* thisx, PlayState* play2) { D_8089F4D0 = play->state.frames; D_8089F3E4 = 0; } + this->actionFunc(this, play); } 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 8d0468b6ab..a03c630e2a 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -154,13 +154,8 @@ static InitChainEntry sInitChain[] = { ICHAIN_S8(hintId, TATL_HINT_ID_BEAMOS, ICHAIN_STOP), }; -static s32 sTexturesDesegmented = false; - -Color_RGBA8 D_808CD5BC = { 0, 0, 255, 0 }; - -Color_RGBA8 D_808CD5C0 = { 255, 255, 255, 255 }; - void EnVm_Init(Actor* thisx, PlayState* play) { + static s32 sTexturesDesegmented = false; EnVm* this = THIS; s32 i; s32 params; @@ -198,9 +193,9 @@ void EnVm_Destroy(Actor* thisx, PlayState* play) { } void func_808CC420(EnVm* this) { - f32 lastFrame = Animation_GetLastFrame(&gBeamosAnim); + f32 endFrame = Animation_GetLastFrame(&gBeamosAnim); - Animation_Change(&this->skelAnime, &gBeamosAnim, 1.0f, lastFrame, lastFrame, ANIMMODE_ONCE, 0.0f); + Animation_Change(&this->skelAnime, &gBeamosAnim, 1.0f, endFrame, endFrame, ANIMMODE_ONCE, 0.0f); this->actionFunc = func_808CC490; } @@ -236,6 +231,8 @@ void func_808CC5C4(EnVm* this) { } void func_808CC610(EnVm* this, PlayState* play) { + static Color_RGBA8 sPrimColor = { 0, 0, 255, 0 }; + static Color_RGBA8 sEnvColor = { 255, 255, 255, 255 }; Player* player = GET_PLAYER(play); s16 sp3A; s16 sp38; @@ -256,7 +253,7 @@ void func_808CC610(EnVm* this, PlayState* play) { sp3A)) { this->unk_214--; if (this->unk_214 == 0) { - EffectSsDeadDd_Spawn(play, &this->unk_228, &gZeroVec3f, &gZeroVec3f, &D_808CD5BC, &D_808CD5C0, 150, -25, 16, + EffectSsDeadDd_Spawn(play, &this->unk_228, &gZeroVec3f, &gZeroVec3f, &sPrimColor, &sEnvColor, 150, -25, 16, 20); func_808CC788(this); } @@ -475,20 +472,20 @@ void EnVm_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, EnVm* this = THIS; Vec3f sp5C; Vec3f sp50; - CollisionPoly* sp4C; - s32 sp48; + CollisionPoly* poly; + s32 bgId; Collider_UpdateSpheres(limbIndex, &this->colliderJntSph); if (limbIndex == BEAMOS_LIMB_HEAD_ROOT) { - sp4C = NULL; + poly = NULL; Matrix_MultZero(&this->actor.focus.pos); Matrix_MultVecZ(1600.0f, &this->unk_228); Matrix_MultVecZ(this->unk_224 * 71.428566f, &this->unk_234); - if (BgCheck_EntityLineTest1(&play->colCtx, &this->actor.focus.pos, &this->unk_234, &sp5C, &sp4C, true, true, - false, true, &sp48)) { + if (BgCheck_EntityLineTest1(&play->colCtx, &this->actor.focus.pos, &this->unk_234, &sp5C, &poly, true, true, + false, true, &bgId)) { this->unk_224 = Math_Vec3f_DistXYZ(&this->actor.focus.pos, &sp5C) - 5.0f; this->unk_210 = 2; Math_Vec3f_Copy(&this->unk_234, &sp5C); diff --git a/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c b/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c index 587484c784..468778f1e6 100644 --- a/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c +++ b/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c @@ -75,8 +75,8 @@ void EnWarpUzu_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyCylinder(play, &this->collider); } -static Vec3f D_80A664FC = { 0.0f, 53.0f, -29.0f }; void func_80A66208(EnWarpUzu* this, PlayState* play) { + static Vec3f D_80A664FC = { 0.0f, 53.0f, -29.0f }; Vec3f sp24; this->actor.textId = 0; @@ -88,26 +88,19 @@ void func_80A66208(EnWarpUzu* this, PlayState* play) { } void func_80A66278(EnWarpUzu* this, PlayState* play) { - Player* player; - s16 temp_v0; - s16 phi_a0; - s16 phi_v1; + Player* player = GET_PLAYER(play); - do { - player = GET_PLAYER(play); - if (Actor_TalkOfferAccepted(&this->actor, &play->state)) { - func_80A66384(this, play); - } else { - phi_a0 = ABS((s16)(Actor_WorldYawTowardActor(&this->actor, &player->actor) - this->actor.shape.rot.y)); - temp_v0 = player->actor.shape.rot.y - this->actor.shape.rot.y; - phi_v1 = ABS(temp_v0); - if (phi_a0 >= 0x2AAB) { - if (phi_v1 < 0x238E) { - Actor_OfferTalk(&this->actor, play, 70.0f); - } - } + if (Actor_TalkOfferAccepted(&this->actor, &play->state)) { + func_80A66384(this, play); + } else { + s16 phi_a0 = ABS((s16)(Actor_WorldYawTowardActor(&this->actor, &player->actor) - this->actor.shape.rot.y)); + s16 temp_v0 = player->actor.shape.rot.y - this->actor.shape.rot.y; + s16 phi_v1 = ABS(temp_v0); + + if ((phi_a0 >= 0x2AAB) && (phi_v1 < 0x238E)) { + Actor_OfferTalk(&this->actor, play, 70.0f); } - } while (0); + } } void func_80A66384(EnWarpUzu* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index ff784c9fe7..a8d59cba3b 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -121,7 +121,7 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { u8 func_80966608(EnWeatherTag* this, PlayState* play, UNK_TYPE a3, UNK_TYPE a4, u8 lightConfig, u8 changeLightNextConfig, u16 changeDuration, u8 weatherMode) { Player* player = GET_PLAYER(play); - u8 returnVal = 0; + u8 returnVal = false; if (WEATHER_TAG_RANGE100(&this->actor) > Actor_WorldDistXZToActor(&player->actor, &this->actor)) { if (play->envCtx.lightConfig == play->envCtx.changeLightNextConfig) { @@ -139,7 +139,7 @@ u8 func_80966608(EnWeatherTag* this, PlayState* play, UNK_TYPE a3, UNK_TYPE a4, play->envCtx.changeDuration = changeDuration; play->envCtx.changeLightTimer = play->envCtx.changeDuration; } - returnVal = 1; + returnVal = true; } } } @@ -190,7 +190,7 @@ void func_8096689C(EnWeatherTag* this, PlayState* play) { } // this separation is to match, can't be separate temps without regalloc - partialResult = (1.0f - (distance / this->fadeDistance)); // strength based on distance? + partialResult = 1.0f - (distance / this->fadeDistance); // strength based on distance? partialResult = (this->unk154 / 32768.0f) * partialResult; // another scale applied play->envCtx.windSpeed = (this->actor.world.rot.z * partialResult) + 30.0f; @@ -219,12 +219,14 @@ void func_80966A68(EnWeatherTag* this, PlayState* play) { if (this->unk154 == 0) { this->unk154 = 1; } + if ((s16)this->unk154 < 0) { // cast req this->unk154 = 0; // redundant code Actor_Kill(&this->actor); EnWeatherTag_SetupAction(this, EnWeatherTag_Die); } + func_8096689C(this, play); } @@ -237,7 +239,8 @@ void EnWeatherTag_Die(EnWeatherTag* this, PlayState* play) { // poisoned swamp: placed behind the water fall from ikana // this tag stops spawning after STT cleared? void func_80966B08(EnWeatherTag* this, PlayState* play) { - if (func_80966608(this, play, 0, 0, play->envCtx.lightConfig, 5, 100, 2) || (gWeatherMode == WEATHER_MODE_2)) { + if (func_80966608(this, play, 0, 0, play->envCtx.lightConfig, 5, 100, WEATHER_MODE_2) || + (gWeatherMode == WEATHER_MODE_2)) { play->skyboxId = SKYBOX_3; EnWeatherTag_SetupAction(this, func_80966D20); } else if (D_801F4E74 <= 0.01f) { @@ -286,26 +289,27 @@ void func_80966BF4(EnWeatherTag* this, PlayState* play) { // WEATHERTAG_TYPE_UNK1 2 void func_80966D20(EnWeatherTag* this, PlayState* play) { - u8 newUnk20; + u8 lightConfig; switch (gSaveContext.save.day) { case 0: case 1: default: - newUnk20 = 0; + lightConfig = 0; break; case 2: - newUnk20 = 3; + lightConfig = 3; break; case 3: - newUnk20 = 4; + lightConfig = 4; break; } Math_SmoothStepToF(&D_801F4E74, 1.0f, 0.2f, 0.02f, 0.001f); - if (func_80966758(this, play, 1, 0, 5, newUnk20, 100)) { + + if (func_80966758(this, play, 1, 0, 5, lightConfig, 100)) { EnWeatherTag_SetupAction(this, func_80966B08); } @@ -318,7 +322,7 @@ void func_80966D20(EnWeatherTag* this, PlayState* play) { // areas affected: winter goron village, path to mountain village, // path to goron village winter, winter mountain village void func_80966E0C(EnWeatherTag* this, PlayState* play) { - if (func_80966608(this, play, 0, 1, 0, 2, 60, 3)) { + if (func_80966608(this, play, 0, 1, 0, 2, 60, WEATHER_MODE_SNOW)) { play->envCtx.precipitation[PRECIP_SNOW_MAX] = 128; EnWeatherTag_SetupAction(this, func_80966E84); } @@ -336,7 +340,7 @@ void func_80966E84(EnWeatherTag* this, PlayState* play) { // just a heavy fog like the winter fog, but unused? // wait if you enter the scene through a room instead of fog you get a flash rain shower void func_80966EF0(EnWeatherTag* this, PlayState* play) { - if (func_80966608(this, play, 0, 1, 0, 2, 100, 4)) { + if (func_80966608(this, play, 0, 1, 0, 2, 100, WEATHER_MODE_4)) { Environment_PlayStormNatureAmbience(play); play->envCtx.precipitation[PRECIP_RAIN_MAX] = 60; EnWeatherTag_SetupAction(this, func_80966F74); @@ -400,7 +404,7 @@ void EnWeatherTag_DoNothing(EnWeatherTag* this, PlayState* play) { // these two are isolated, they call themselves but nothing calls them? void EnWeatherTag_Unused_809671B8(EnWeatherTag* this, PlayState* play) { - if (func_80966608(this, play, 0, 1, 0, 4, 100, 5)) { + if (func_80966608(this, play, 0, 1, 0, 4, 100, WEATHER_MODE_5)) { Environment_PlayStormNatureAmbience(play); play->envCtx.lightningState = LIGHTNING_ON; play->envCtx.precipitation[PRECIP_RAIN_MAX] = 60; @@ -438,12 +442,10 @@ void func_809672DC(EnWeatherTag* this, PlayState* play) { if (0.8f < strength) { strength = 1.0f; } - D_801F4E30 = (200.0f * strength); - } else { - if (play->envCtx.sandstormState == SANDSTORM_6) { - D_801F4E30 = 0; - play->envCtx.sandstormState = SANDSTORM_7; - } + D_801F4E30 = 200.0f * strength; + } else if (play->envCtx.sandstormState == SANDSTORM_6) { + D_801F4E30 = 0; + play->envCtx.sandstormState = SANDSTORM_7; } Math_SmoothStepToS(&play->envCtx.adjLightSettings.fogNear, -40.0f * strength, 1, 1, 1); @@ -488,6 +490,7 @@ void EnWeatherTag_Update(Actor* thisx, PlayState* play) { EnWeatherTag* this = THIS; this->actionFunc(this, play); + if ((play->actorCtx.flags & ACTORCTX_FLAG_TELESCOPE_ON) && (play->msgCtx.msgMode != MSGMODE_NONE) && (play->msgCtx.currentTextId == 0x5E6) && !FrameAdvance_IsEnabled(play) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE) && 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 9b9937ff98..3d1f72b9e3 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -259,9 +259,8 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_STOP), }; -static s32 sTexturesDesegmented = false; - void EnWf_Init(Actor* thisx, PlayState* play) { + static s32 sTexturesDesegmented = false; EnWf* this = THIS; s32 i; s32 temp_s0; @@ -395,16 +394,13 @@ void EnWf_Blink(EnWf* this) { s32 func_80990948(PlayState* play, EnWf* this, s16 arg2) { Player* player = GET_PLAYER(play); - s32 sp38; - s32 pad; - s32 pad2; + s32 sp38 = ABS_ALT(BINANG_SUB(this->actor.wallYaw, this->actor.shape.rot.y)); + s32 pad[2]; s16 sp2E; Actor* actor; - sp38 = ABS_ALT(BINANG_SUB(this->actor.wallYaw, this->actor.shape.rot.y)); - - if (((this->unk_295 == 0) || - ((this->unk_295 == 1) && (this->actor.child != NULL) && (this->actor.child->update != NULL))) && + if ((!this->unk_295 || + ((this->unk_295 == true) && (this->actor.child != NULL) && (this->actor.child->update != NULL))) && (this->actor.xzDistToPlayer > 160.0f) && (this->unk_2A8 < Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos))) { func_80993524(this); @@ -467,11 +463,11 @@ s32 func_80990948(PlayState* play, EnWf* this, s16 arg2) { } void func_80990C6C(EnWf* this, PlayState* play, s32 arg2) { - static Vec3f D_809942DC = { 0.0f, 0.1f, 0.0f }; + static Vec3f sAccel = { 0.0f, 0.1f, 0.0f }; static Color_RGBA8 D_809942E8 = { 185, 140, 70, 255 }; static Color_RGBA8 D_809942EC = { 255, 255, 255, 255 }; s32 i; - Vec3f sp88; + Vec3f pos; FloorType floorType; Color_RGBA8* phi_s1; s16 phi_s6; @@ -490,10 +486,10 @@ void func_80990C6C(EnWf* this, PlayState* play, s32 arg2) { } for (i = 0; i < arg2; i++) { - sp88.x = Rand_CenteredFloat(50.0f) + this->actor.world.pos.x; - sp88.y = Rand_ZeroFloat(5.0f) + this->actor.world.pos.y; - sp88.z = Rand_CenteredFloat(50.0f) + this->actor.world.pos.z; - func_800B0F18(play, &sp88, &gZeroVec3f, &D_809942DC, phi_s1, phi_s1, phi_s6, 5, + pos.x = Rand_CenteredFloat(50.0f) + this->actor.world.pos.x; + pos.y = Rand_ZeroFloat(5.0f) + this->actor.world.pos.y; + pos.z = Rand_CenteredFloat(50.0f) + this->actor.world.pos.z; + func_800B0F18(play, &pos, &gZeroVec3f, &sAccel, phi_s1, phi_s1, phi_s6, 5, Rand_ZeroFloat(5.0f) + 14.0f); } } @@ -744,6 +740,7 @@ void func_8099177C(EnWf* this, PlayState* play) { this->skelAnime.playSpeed = -phi_f2; SkelAnime_Update(&this->skelAnime); + if (Actor_IsFacingPlayer(&this->actor, 0x1555)) { if (Rand_ZeroOne() > 0.8f) { func_80991948(this); @@ -833,6 +830,7 @@ void func_80991C80(EnWf* this, PlayState* play) { sp30 = ABS_ALT(BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y)); this->actor.speed = 0.0f; + if (((this->skelAnime.curFrame >= 9.0f) && (this->skelAnime.curFrame < 13.0f)) || ((this->skelAnime.curFrame >= 17.0f) && (this->skelAnime.curFrame < 20.0f))) { if (!(this->collider1.base.atFlags & AT_ON)) { @@ -1001,6 +999,7 @@ void func_809924EC(EnWf* this, PlayState* play) { } Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xBB8); + if (SkelAnime_Update(&this->skelAnime)) { sp26 = this->actor.wallYaw - this->actor.shape.rot.y; @@ -1102,15 +1101,17 @@ void func_80992A74(EnWf* this, PlayState* play) { Animation_MorphToLoop(&this->skelAnime, &gWolfosRunAnim, -4.0f); player = GET_PLAYER(play); temp_f0 = Math_SinS((player->actor.shape.rot.y + this->unk_29A) - this->actor.yawTowardsPlayer); + if (temp_f0 > 0.0f) { - this->unk_29A = 16000; + this->unk_29A = 0x3E80; } else if (temp_f0 < 0.0f) { - this->unk_29A = -16000; + this->unk_29A = -0x3E80; } else if (Rand_ZeroOne() > 0.5f) { - this->unk_29A = 16000; + this->unk_29A = 0x3E80; } else { - this->unk_29A = -16000; + this->unk_29A = -0x3E80; } + this->actor.speed = 6.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_2A0 = (s32)Rand_ZeroFloat(10.0f) + 5; @@ -1184,7 +1185,7 @@ void func_80992E0C(EnWf* this, PlayState* play) { } if (SkelAnime_Update(&this->skelAnime)) { - if (this->unk_295 != 0) { + if (this->unk_295) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x70); } else { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x60); @@ -1252,28 +1253,26 @@ void func_80993194(EnWf* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); func_80990E4C(this, play); + if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) { if (func_80990EAC(this)) { func_80990ED4(this); + } else if (this->actor.child->xzDistToPlayer < (80.0f + this->unk_2A4)) { + func_80993350(this); } else { - if (this->actor.child->xzDistToPlayer < (80.0f + this->unk_2A4)) { - func_80993350(this); + sp36 = Actor_WorldYawTowardActor(this->actor.child, &this->actor); + sp34 = Math_SmoothStepToS(&sp36, BINANG_ROT180(this->actor.child->yawTowardsPlayer), 10, this->unk_29C, 16); + this->actor.world.pos.x = (Math_SinS(sp36) * this->unk_2A4) + this->actor.child->world.pos.x; + this->actor.world.pos.z = (Math_CosS(sp36) * this->unk_2A4) + this->actor.child->world.pos.z; + if (sp34 < -0x800) { + sp32 = sp36 - 0x4000; + } else if (sp34 > 0x800) { + sp32 = sp36 + 0x4000; } else { - sp36 = Actor_WorldYawTowardActor(this->actor.child, &this->actor); - sp34 = Math_SmoothStepToS(&sp36, BINANG_ROT180(this->actor.child->yawTowardsPlayer), 10, this->unk_29C, - 16); - this->actor.world.pos.x = (Math_SinS(sp36) * this->unk_2A4) + this->actor.child->world.pos.x; - this->actor.world.pos.z = (Math_CosS(sp36) * this->unk_2A4) + this->actor.child->world.pos.z; - if (sp34 < -0x800) { - sp32 = sp36 - 0x4000; - } else if (sp34 > 0x800) { - sp32 = sp36 + 0x4000; - } else { - sp32 = sp36 + 0x8000; - func_80992FD4(this); - } - Math_ScaledStepToS(&this->actor.shape.rot.y, sp32, 0x800); + sp32 = sp36 + 0x8000; + func_80992FD4(this); } + Math_ScaledStepToS(&this->actor.shape.rot.y, sp32, 0x800); } } else { func_80990ED4(this); @@ -1297,6 +1296,7 @@ void func_809933A0(EnWf* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); func_80990E4C(this, play); + if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) { if (func_80990EAC(this)) { func_80990ED4(this); @@ -1319,6 +1319,7 @@ void func_809933A0(EnWf* this, PlayState* play) { } else { func_80990ED4(this); } + if (this->unk_2A2 == 0) { Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_CRY); } @@ -1336,7 +1337,8 @@ void func_8099357C(EnWf* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); func_80990E4C(this, play); - if (this->unk_295 != 0) { + + if (this->unk_295) { if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) { sp2E = Actor_WorldYawTowardActor(&this->actor, this->actor.child); if (func_80990EAC(this)) { @@ -1463,6 +1465,7 @@ void func_8099386C(EnWf* this, PlayState* play) { } Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); + if (this->actor.colChkInfo.health == 0) { func_80992D6C(this); } else { 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 e6f921bbc6..4f1597f3e8 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -214,11 +214,11 @@ void EnWood02_Init(Actor* thisx, PlayState* play) { case WOOD_BUSH_GREEN_LARGE_SPAWNER: case WOOD_BUSH_BLACK_LARGE_SPAWNER: spawnType = 1; - + // fallthrough case WOOD_BUSH_GREEN_LARGE_SPAWNED: case WOOD_BUSH_BLACK_LARGE_SPAWNED: spawnType++; - + // fallthrough case WOOD_TREE_CONICAL_LARGE: case WOOD_BUSH_GREEN_LARGE: case WOOD_BUSH_BLACK_LARGE: @@ -235,14 +235,14 @@ void EnWood02_Init(Actor* thisx, PlayState* play) { case WOOD_BUSH_GREEN_SMALL_SPAWNER: case WOOD_BUSH_BLACK_SMALL_SPAWNER: spawnType = 1; - + // fallthrough case WOOD_TREE_CONICAL_SPAWNED: case WOOD_TREE_OVAL_YELLOW_SPAWNED: case WOOD_TREE_OVAL_GREEN_SPAWNED: case WOOD_BUSH_GREEN_SMALL_SPAWNED: case WOOD_BUSH_BLACK_SMALL_SPAWNED: spawnType++; - + // fallthrough case WOOD_TREE_CONICAL_MEDIUM: case WOOD_TREE_OVAL_GREEN: case WOOD_TREE_KAKARIKO_ADULT: @@ -268,6 +268,9 @@ void EnWood02_Init(Actor* thisx, PlayState* play) { this->actor.velocity.z = Rand_CenteredFloat(6.0f); this->actor.velocity.y = (Rand_ZeroOne() * 1.25f) + -3.1f; break; + + default: + break; } if (this->actor.params < WOOD_TREE_OVAL_GREEN) { diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c index 8173fb2b27..88da0d04a2 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -455,7 +455,7 @@ void MirRay_SetupReflectionPolys(MirRay* this, PlayState* play, MirRayShieldRefl posB.y = sp60[1] + posA.y; posB.z = sp60[2] + posA.z; - if (BgCheck_AnyLineTest1(&play->colCtx, &posA, &posB, &sp70, &outPoly, 1)) { + if (BgCheck_AnyLineTest1(&play->colCtx, &posA, &posB, &sp70, &outPoly, true)) { reflection[i].reflectionPoly = outPoly; } else { reflection[i].reflectionPoly = NULL; diff --git a/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.c b/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.c index d0ae6310ad..9a787adf6e 100644 --- a/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.c +++ b/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.c @@ -322,7 +322,7 @@ void func_80B9E8D4(MirRay3* this, PlayState* play, MirRay3Struct* ptr) { { CollisionPoly* spC4; - if (!BgCheck_AnyLineTest1(&play->colCtx, &sp140, &sp134, &sp128, &spC4, 1)) { + if (!BgCheck_AnyLineTest1(&play->colCtx, &sp140, &sp134, &sp128, &spC4, true)) { Math_Vec3f_Copy(&sp128, &sp134); } diff --git a/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c b/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c index 36d15ec37c..4f2d94ee9e 100644 --- a/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c +++ b/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c @@ -317,7 +317,7 @@ void func_809A57F4(ObjArmos* this, PlayState* play) { void ObjArmos_Update(Actor* thisx, PlayState* play2) { PlayState* play = play2; ObjArmos* this = THIS; - s32 sp2C; + s32 bgId; this->actionFunc(this, play); this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; @@ -334,7 +334,7 @@ void ObjArmos_Update(Actor* thisx, PlayState* play2) { this->unk_250.y = this->dyna.actor.world.pos.y + 20.0f; this->unk_250.z = (Math_CosS(this->dyna.actor.shape.rot.y) * -9.0f) + this->dyna.actor.world.pos.z; - this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor5(&play->colCtx, &this->dyna.actor.floorPoly, &sp2C, + this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor5(&play->colCtx, &this->dyna.actor.floorPoly, &bgId, &this->dyna.actor, &this->unk_250); } } diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index 7e9e93a717..8192d1be9c 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -121,19 +121,19 @@ static Vec2f D_80938FF8[4] = { void func_80936CF0(ObjBean* this, PlayState* play) { Vec3f sp24; - s32 sp20; + s32 bgId; sp24.x = this->dyna.actor.world.pos.x; sp24.y = this->dyna.actor.world.pos.y + 29.999998f; sp24.z = this->dyna.actor.world.pos.z; this->dyna.actor.floorHeight = - BgCheck_EntityRaycastFloor5(&play->colCtx, &this->dyna.actor.floorPoly, &sp20, &this->dyna.actor, &sp24); + BgCheck_EntityRaycastFloor5(&play->colCtx, &this->dyna.actor.floorPoly, &bgId, &this->dyna.actor, &sp24); } s32 func_80936D58(ObjBean* this, PlayState* play) { static Vec3f D_80939018 = { 0.0f, 30.0f, 0.0f }; s32 pad; - s32 spB8; + s32 bgId; Vec3f spAC; Vec3f spA0; Vec3f sp94; @@ -148,7 +148,7 @@ s32 func_80936D58(ObjBean* this, PlayState* play) { Math_Vec3f_Diff(&this->dyna.actor.world.pos, &spAC, &sp94); if (BgCheck_EntityLineTest2(&play->colCtx, &spA0, &sp94, &sp88, &this->dyna.actor.floorPoly, true, true, true, true, - &spB8, &this->dyna.actor)) { + &bgId, &this->dyna.actor)) { this->dyna.actor.world.pos.x = (COLPOLY_GET_NORMAL(this->dyna.actor.floorPoly->normal.x) * 1.9f) + sp88.x; this->dyna.actor.world.pos.y = (COLPOLY_GET_NORMAL(this->dyna.actor.floorPoly->normal.y) * 1.9f) + sp88.y; this->dyna.actor.world.pos.z = (COLPOLY_GET_NORMAL(this->dyna.actor.floorPoly->normal.z) * 1.9f) + sp88.z; diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index 4ffe1244ab..aee47bb0e1 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -163,14 +163,14 @@ s32 ObjBombiwa_IsUnderwater(ObjBombiwa* this, PlayState* play) { void func_80939594(ObjBombiwa* this, PlayState* play) { s32 pad; Vec3f sp28; - s32 sp24; + s32 bgId; sp28.x = this->actor.world.pos.x; sp28.y = this->actor.world.pos.y + 30.0f; sp28.z = this->actor.world.pos.z; this->actor.floorHeight = - BgCheck_EntityRaycastFloor5(&play->colCtx, &this->actor.floorPoly, &sp24, &this->actor, &sp28); + BgCheck_EntityRaycastFloor5(&play->colCtx, &this->actor.floorPoly, &bgId, &this->actor, &sp28); } void ObjBombiwa_Init(Actor* thisx, PlayState* play) { @@ -406,7 +406,7 @@ void func_8093A1F0(ObjBombiwa* this, PlayState* play) { Vec3f sp9C; ObjBombiwaStruct* ptr; CollisionPoly* sp94; - s32 sp90; + s32 bgId; f32 temp_f0; s16 phi_s1; @@ -429,7 +429,7 @@ void func_8093A1F0(ObjBombiwa* this, PlayState* play) { sp9C.y = ptr->unk_04.y + 30.0f; sp9C.z = ptr->unk_04.z; - temp_f0 = BgCheck_EntityRaycastFloor5(&play->colCtx, &sp94, &sp90, &this->actor, &sp9C); + temp_f0 = BgCheck_EntityRaycastFloor5(&play->colCtx, &sp94, &bgId, &this->actor, &sp9C); if ((temp_f0 <= (BGCHECK_Y_MIN + 10.0f)) || ((ptr->unk_04.y - (200.0f * ptr->unk_00)) < temp_f0)) { this->unk_200++; ptr->unk_1A = 1; diff --git a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c index a9c6e542a0..cb103edfd5 100644 --- a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c +++ b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c @@ -161,15 +161,16 @@ void ObjChan_InitChandelier(ObjChan* this, PlayState* play) { Vec3f childPos; Vec3s childRot; CollisionPoly* sp94; - s32 sp90; + s32 bgId; Vec3f sp84; Math_Vec3f_Copy(&this->unk1C0, &thisx->world.pos); Math_Vec3f_Copy(&sp84, &thisx->world.pos); sp84.y += 1600.0f; + if (BgCheck_EntityLineTest1(&play->colCtx, &thisx->world.pos, &sp84, &this->unk1C0, &sp94, false, false, true, true, - &sp90)) { + &bgId)) { this->unk1CC = thisx->world.pos.y - this->unk1C0.y; } else { Actor_Kill(thisx); diff --git a/src/overlays/actors/ovl_Obj_Chikuwa/z_obj_chikuwa.h b/src/overlays/actors/ovl_Obj_Chikuwa/z_obj_chikuwa.h index ee51742466..43d5215f52 100644 --- a/src/overlays/actors/ovl_Obj_Chikuwa/z_obj_chikuwa.h +++ b/src/overlays/actors/ovl_Obj_Chikuwa/z_obj_chikuwa.h @@ -6,9 +6,9 @@ struct ObjChikuwa; typedef struct { - /* 0x00 */ Vec3f unk_00; - /* 0x0C */ s16 unk_0C; - /* 0x0E */ u8 unk_0E; + /* 0x0 */ Vec3f unk_00; + /* 0xC */ s16 unk_0C; + /* 0xE */ u8 unk_0E; } ObjChikuwaStruct; // size = 0x10 typedef struct { diff --git a/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.c b/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.c index 7a21b8b836..876a0b86f5 100644 --- a/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.c +++ b/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.c @@ -174,7 +174,7 @@ void func_80B12B38(ObjDhouse* this, PlayState* play) { CollisionPoly* sp90; s32 phi_s3; Vec3f sp80; - s32 sp7C; + s32 bgId; ObjDhouseStruct1* ptr; ObjDhouseStruct3* ptr3; @@ -201,7 +201,7 @@ void func_80B12B38(ObjDhouse* this, PlayState* play) { phi_s3 = false; if (ptr->unk_0C.y < 0.0f) { func_80B12A50(ptr, ptr3, &sp80); - temp_f0 = BgCheck_EntityRaycastFloor5(&play->colCtx, &sp90, &sp7C, thisx, &sp80); + temp_f0 = BgCheck_EntityRaycastFloor5(&play->colCtx, &sp90, &bgId, thisx, &sp80); if (((sp80.y - 35.0f) < temp_f0) && (temp_f0 > (BGCHECK_Y_MIN + 1.0f))) { phi_s3 = true; } @@ -385,7 +385,7 @@ void func_80B13724(ObjDhouse* this, PlayState* play) { CollisionPoly* sp80; ObjDhouseStruct2* ptr2; Vec3f sp70; - s32 sp6C; + s32 bgId; for (i = 0, ptr2 = &this->unk_240[0]; i < ARRAY_COUNT(this->unk_240); i++, ptr2++) { if (ptr2->unk_28 > 0) { @@ -407,7 +407,7 @@ void func_80B13724(ObjDhouse* this, PlayState* play) { if (ptr2->unk_29 & 1) { temp_f0 = - BgCheck_EntityRaycastFloor5(&play->colCtx, &sp80, &sp6C, &this->dyna.actor, &ptr2->unk_00); + BgCheck_EntityRaycastFloor5(&play->colCtx, &sp80, &bgId, &this->dyna.actor, &ptr2->unk_00); if (((ptr2->unk_00.y - 20.0f) < temp_f0) && (temp_f0 > BGCHECK_Y_MIN + 1.0f)) { Math_Vec3f_Copy(&sp70, &ptr2->unk_00); ptr2->unk_28 = 0; diff --git a/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.h b/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.h index dfe6a83ea3..4fdddd6212 100644 --- a/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.h +++ b/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.h @@ -6,8 +6,8 @@ struct ObjEnding; typedef struct { - /* 0x0 */ Gfx* dLists[2]; - /* 0x8 */ AnimatedMaterial *animMat; + /* 0x0 */ Gfx* dLists[2]; + /* 0x8 */ AnimatedMaterial *animMat; } ObjEndingModelInfo; // size = 0xC typedef struct ObjEnding { diff --git a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c index f6d199b0d8..2730db9f3d 100644 --- a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c +++ b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c @@ -548,13 +548,13 @@ void func_80A1CC0C(ObjFlowerpot* this, PlayState* play) { func_80A1C5E8(this, play); } else { Vec3f sp30; - s32 sp2C; + s32 bgId; sp30.x = this->actor.world.pos.x; sp30.y = this->actor.world.pos.y + 20.0f; sp30.z = this->actor.world.pos.z; this->actor.floorHeight = - BgCheck_EntityRaycastFloor5(&play->colCtx, &this->actor.floorPoly, &sp2C, &this->actor, &sp30); + BgCheck_EntityRaycastFloor5(&play->colCtx, &this->actor.floorPoly, &bgId, &this->actor, &sp30); } } diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c index 3315f515c8..ce4a8e9800 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -136,14 +136,14 @@ void func_809A10F4(ObjHamishi* this, PlayState* play) { void func_809A13A0(ObjHamishi* this, PlayState* play) { s32 pad; Vec3f sp28; - s32 sp24; + s32 bgId; sp28.x = this->actor.world.pos.x; sp28.y = this->actor.world.pos.y + 30.0f; sp28.z = this->actor.world.pos.z; this->actor.floorHeight = - BgCheck_EntityRaycastFloor5(&play->colCtx, &this->actor.floorPoly, &sp24, &this->actor, &sp28); + BgCheck_EntityRaycastFloor5(&play->colCtx, &this->actor.floorPoly, &bgId, &this->actor, &sp28); } s32 ObjHamishi_IsUnderwater(ObjHamishi* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c b/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c index 26780e1352..71d324d054 100644 --- a/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c +++ b/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c @@ -484,7 +484,7 @@ void func_80A55064(ObjHugebombiwa* this, PlayState* play) { Vec3f spA4; s32 pad2; CollisionPoly* sp9C; - s32 sp98; + s32 bgId; f32 temp_f0; EnHugebombiwaStruct* ptr; s16 phi_s3 = this->actor.shape.rot.y - 0x4000; @@ -510,7 +510,7 @@ void func_80A55064(ObjHugebombiwa* this, PlayState* play) { spA4.y = ptr->unk_0C.y + 60.0f; spA4.z = ptr->unk_0C.z; - temp_f0 = BgCheck_EntityRaycastFloor5(&play->colCtx, &sp9C, &sp98, &this->actor, &spA4); + temp_f0 = BgCheck_EntityRaycastFloor5(&play->colCtx, &sp9C, &bgId, &this->actor, &spA4); if ((temp_f0 <= BGCHECK_Y_MIN + 10.0f) || ((ptr->unk_0C.y - (350.0f * ptr->unk_00.y)) < temp_f0)) { this->unk_4B0++; ptr->unk_24 = 1; @@ -580,7 +580,7 @@ void func_80A55564(ObjHugebombiwa* this, PlayState* play) { Vec3f spA4; s32 pad; CollisionPoly* sp9C; - s32 sp98; + s32 bgId; f32 temp_f0; s16 phi_s3 = this->actor.shape.rot.y - 0x4000; @@ -606,7 +606,7 @@ void func_80A55564(ObjHugebombiwa* this, PlayState* play) { spA4.y = ptr->unk_0C.y + 60.0f; spA4.z = ptr->unk_0C.z; - temp_f0 = BgCheck_EntityRaycastFloor5(&play->colCtx, &sp9C, &sp98, &this->actor, &spA4); + temp_f0 = BgCheck_EntityRaycastFloor5(&play->colCtx, &sp9C, &bgId, &this->actor, &spA4); if ((temp_f0 <= BGCHECK_Y_MIN + 10.0f) || (ptr->unk_0C.y < temp_f0)) { this->unk_4B0++; ptr->unk_24 = 1; diff --git a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c index ba28e1d3b7..c1c0f42247 100644 --- a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c +++ b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c @@ -421,7 +421,7 @@ s32 func_80A24118(ObjIceblock* this, PlayState* play, f32 arg2, Vec3f* arg3) { Vec3f spC4; Vec3f spB8; s32 pad[2]; - s32 spAC; + s32 bgId; CollisionPoly* spA8; s32 ret; s32 i; @@ -459,7 +459,7 @@ s32 func_80A24118(ObjIceblock* this, PlayState* play, f32 arg2, Vec3f* arg3) { spD0.y = spDC.y; spD0.z = temp_f26 + spDC.z; - if (BgCheck_EntityLineTest3(&play->colCtx, &spDC, &spD0, &spB8, &spA8, true, false, false, true, &spAC, + if (BgCheck_EntityLineTest3(&play->colCtx, &spDC, &spD0, &spB8, &spA8, true, false, false, true, &bgId, &this->dyna.actor, 0.0f)) { temp_f20 = Math3D_Vec3fDistSq(&spDC, &spB8); if (temp_f20 < phi_f20) { @@ -496,7 +496,7 @@ s32 func_80A243E0(ObjIceblock* this, PlayState* play, Vec3f* arg0) { Vec3f spC8; s16 temp_s6; f32 temp_f28; - s32 spBC; + s32 bgId; CollisionPoly* spB8; s32 ret; f32 temp_f30; @@ -535,7 +535,7 @@ s32 func_80A243E0(ObjIceblock* this, PlayState* play, Vec3f* arg0) { spE0.y = spEC.y; spE0.z = temp_f30 + spEC.z; - if (BgCheck_EntityLineTest3(&play->colCtx, &spEC, &spE0, &spC8, &spB8, true, false, false, true, &spBC, + if (BgCheck_EntityLineTest3(&play->colCtx, &spEC, &spE0, &spC8, &spB8, true, false, false, true, &bgId, &this->dyna.actor, 0.0f)) { temp_f12 = Math3D_Vec3fDistSq(&spEC, &spC8); if (temp_f12 < phi_f22) { @@ -575,7 +575,7 @@ s32 func_80A246D8(ObjIceblock* this, PlayState* play, Vec3f* arg2) { Vec3f spB4; Vec3f spA8; Vec3f sp9C; - s32 sp98; + s32 bgId; CollisionPoly* sp94; ObjIceblock* temp_v0; f32 temp_f20 = (this->dyna.actor.scale.z * 300.0f) + 2.0f; @@ -599,10 +599,10 @@ s32 func_80A246D8(ObjIceblock* this, PlayState* play, Vec3f* arg2) { spB4.y = spC0.y; spB4.z = (Math_CosS(phi_s3) * temp_f20) + spC0.z; - if (BgCheck_EntityLineTest3(&play->colCtx, &spC0, &spB4, &sp9C, &sp94, true, false, false, true, &sp98, + if (BgCheck_EntityLineTest3(&play->colCtx, &spC0, &spB4, &sp9C, &sp94, true, false, false, true, &bgId, &this->dyna.actor, 0.0f)) { ret = true; - temp_v0 = (ObjIceblock*)DynaPoly_GetActor(&play->colCtx, sp98); + temp_v0 = (ObjIceblock*)DynaPoly_GetActor(&play->colCtx, bgId); if ((temp_v0 != NULL) && (temp_v0->dyna.actor.id == ACTOR_OBJ_ICEBLOCK) && (temp_v0->unk_2B0 == 3)) { temp_v0->unk_1B0 |= 0x80; } diff --git a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.h b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.h index 466cd97b7d..e82e14d9cd 100644 --- a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.h +++ b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.h @@ -12,18 +12,18 @@ typedef void (*ObjIceblockExtendedDrawFunc)(struct ObjIceblock*, PlayState*); #define ICEBLOCK_GET_ICEBERG(thisx) ((thisx)->params & 1) typedef struct { - /* 0x00 */ s16 unk_00; - /* 0x02 */ s16 unk_02; - /* 0x04 */ f32 unk_04; - /* 0x08 */ f32 unk_08; - /* 0x0C */ f32 unk_0C; + /* 0x0 */ s16 unk_00; + /* 0x2 */ s16 unk_02; + /* 0x4 */ f32 unk_04; + /* 0x8 */ f32 unk_08; + /* 0xC */ f32 unk_0C; } ObjIceBlockUnkStruct; // size = 0x10 typedef struct { - /* 0x00 */ CollisionPoly* unk_00; - /* 0x04 */ f32 unk_04; - /* 0x08 */ s32 unk_08; - /* 0x0C */ f32 unk_0C; + /* 0x0 */ CollisionPoly* unk_00; + /* 0x4 */ f32 unk_04; + /* 0x8 */ s32 unk_08; + /* 0xC */ f32 unk_0C; } ObjIceBlockUnkStruct2; // size = 0x10 typedef struct { 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 4eaa0b2e48..57fca6f085 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -180,14 +180,14 @@ void func_8093D9C0(ObjLift* this) { void func_8093DA48(ObjLift* this, PlayState* play) { s32 pad; - s32 sp38; + s32 bgId; Vec3f pos; Actor_MoveWithGravity(&this->dyna.actor); Math_Vec3f_Copy(&pos, &this->dyna.actor.prevPos); pos.y += yOffsets[OBJLIFT_GET_1(&this->dyna.actor)]; this->dyna.actor.floorHeight = - BgCheck_EntityRaycastFloor5(&play->colCtx, &this->dyna.actor.floorPoly, &sp38, &this->dyna.actor, &pos); + BgCheck_EntityRaycastFloor5(&play->colCtx, &this->dyna.actor.floorPoly, &bgId, &this->dyna.actor, &pos); if ((yOffsets[OBJLIFT_GET_1(&this->dyna.actor)] - 0.001f) <= (this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y)) { func_8093D3C0(this, play); diff --git a/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c b/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c index 266aadf877..b987d0ee58 100644 --- a/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c +++ b/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c @@ -221,7 +221,7 @@ s32 func_80A216D4(ObjSkateblock* this, PlayState* play, f32 arg2, Vec3f* arg3) { Vec3f spB0; f32 temp_f20; f32 temp_f24; - s32 spA4; + s32 bgId; CollisionPoly* spA0; s32 ret; f32 temp_f26; @@ -257,7 +257,7 @@ s32 func_80A216D4(ObjSkateblock* this, PlayState* play, f32 arg2, Vec3f* arg3) { spC8.y = spD4.y; spC8.z = temp_f26 + spD4.z; - if (BgCheck_EntityLineTest3(&play->colCtx, &spD4, &spC8, &spB0, &spA0, true, false, false, true, &spA4, + if (BgCheck_EntityLineTest3(&play->colCtx, &spD4, &spC8, &spB0, &spA0, true, false, false, true, &bgId, &this->dyna.actor, 0.0f)) { temp_f2 = Math3D_Vec3fDistSq(&spD4, &spB0); if (temp_f2 < temp_f20) { @@ -292,7 +292,7 @@ s32 func_80A21990(ObjSkateblock* this, PlayState* play, Vec3f* arg2) { Vec3f spC8; f32 temp_f0; f32 temp_f12; - s32 spBC; + s32 bgId; CollisionPoly* spB8; s32 ret; f32 temp_f26; @@ -330,7 +330,7 @@ s32 func_80A21990(ObjSkateblock* this, PlayState* play, Vec3f* arg2) { spE0.y = spEC.y; spE0.z = temp_f30 + spEC.z; - if (BgCheck_EntityLineTest3(&play->colCtx, &spEC, &spE0, &spC8, &spB8, true, false, false, true, &spBC, + if (BgCheck_EntityLineTest3(&play->colCtx, &spEC, &spE0, &spC8, &spB8, true, false, false, true, &bgId, &this->dyna.actor, 0.0f)) { temp_f0 = Math3D_Vec3fDistSq(&spEC, &spC8); if (temp_f0 < phi_f22) { diff --git a/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c b/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c index 972b9a6742..7dea349ac1 100644 --- a/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c +++ b/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c @@ -452,7 +452,7 @@ void ObjSnowball_Init(Actor* thisx, PlayState* play) { Sphere16* sphere; ColliderJntSphElementDim* elementDim; Vec3f sp48; - s32 sp44; + s32 bgId; s32 sp40 = this->actor.home.rot.y; f32 phi_f20; s32 sp34; @@ -500,7 +500,7 @@ void ObjSnowball_Init(Actor* thisx, PlayState* play) { sp48.z = this->actor.home.pos.z; this->actor.floorHeight = - BgCheck_EntityRaycastFloor5(&play->colCtx, &this->actor.floorPoly, &sp44, &this->actor, &sp48); + BgCheck_EntityRaycastFloor5(&play->colCtx, &this->actor.floorPoly, &bgId, &this->actor, &sp48); if (this->actor.floorHeight < (this->actor.home.pos.y - 10.0f)) { this->actor.floorPoly = NULL; } else { @@ -653,7 +653,7 @@ void func_80B047C0(ObjSnowball* this, PlayState* play) { s32 pad; ObjSnowballStruct* ptr; Vec3f sp9C; - s32 sp98; + s32 bgId; s32 i; Vec3f sp88; f32 sp84; @@ -683,7 +683,7 @@ void func_80B047C0(ObjSnowball* this, PlayState* play) { sp9C.y = ptr->unk_00.y + 25.0f; sp9C.z = ptr->unk_00.z; - ptr->unk_18 = BgCheck_EntityRaycastFloor5(&play->colCtx, &ptr->unk_28, &sp98, &this->actor, &sp9C); + ptr->unk_18 = BgCheck_EntityRaycastFloor5(&play->colCtx, &ptr->unk_28, &bgId, &this->actor, &sp9C); if (ptr->unk_10 <= 0.0f) { Matrix_RotateZYX(ptr->unk_1C.x, ptr->unk_1C.y, ptr->unk_1C.z, MTXMODE_NEW); diff --git a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c index c7356129e9..540ee8fc0f 100644 --- a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c +++ b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c @@ -408,7 +408,7 @@ void func_80B39F60(ObjSnowball2* this) { void func_80B39FA8(ObjSnowball2* this, PlayState* play) { s32 pad; Vec3f sp30; - s32 sp2C; + s32 bgId; func_80B39B28(this, play); @@ -431,7 +431,7 @@ void func_80B39FA8(ObjSnowball2* this, PlayState* play) { sp30.y = this->actor.world.pos.y + 20.0f; sp30.z = this->actor.world.pos.z; this->actor.floorHeight = - BgCheck_EntityRaycastFloor5(&play->colCtx, &this->actor.floorPoly, &sp2C, &this->actor, &sp30); + BgCheck_EntityRaycastFloor5(&play->colCtx, &this->actor.floorPoly, &bgId, &this->actor, &sp30); } } diff --git a/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c b/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c index c2b251d1ce..16e89a07a2 100644 --- a/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c +++ b/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c @@ -313,7 +313,7 @@ s32 func_80A1E074(ObjSpinyroll* this, PlayState* play, Vec3f* arg2, s32 arg3) { spBC.x = temp_f22 + spC8.x; spBC.z = temp_f24 + spC8.z; - if (BgCheck_EntityLineTest3(&play->colCtx, &spC8, &spBC, &spB0, &temp_s1->unk_04, 1, 0, 0, 1, + if (BgCheck_EntityLineTest3(&play->colCtx, &spC8, &spBC, &spB0, &temp_s1->unk_04, true, false, false, true, &temp_s1->bgId, &this->dyna.actor, 0.0f)) { if (arg3 && (this->dyna.actor.flags & ACTOR_FLAG_40)) { func_80A1DA50(play, this, &spC8, &spB0); diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index f81e6ef0e6..af1581296e 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -458,11 +458,11 @@ typedef struct FallImpactInfo { } FallImpactInfo; // size = 0x6 typedef struct AttackAnimInfo { - /* 0x00 */ PlayerAnimationHeader* unk_0; - /* 0x04 */ PlayerAnimationHeader* unk_4; - /* 0x08 */ PlayerAnimationHeader* unk_8; - /* 0x0C */ u8 unk_C; - /* 0x0D */ u8 unk_D; + /* 0x0 */ PlayerAnimationHeader* unk_0; + /* 0x4 */ PlayerAnimationHeader* unk_4; + /* 0x8 */ PlayerAnimationHeader* unk_8; + /* 0xC */ u8 unk_C; + /* 0xD */ u8 unk_D; } AttackAnimInfo; // size = 0x10 typedef struct MeleeWeaponDamageInfo { @@ -6104,8 +6104,8 @@ void func_80835324(PlayState* play, Player* this, f32 arg2, s16 arg3) { this->av1.actionVar1 = 1; this->av2.actionVar2 = 1; - this->unk_3A0.x = Math_SinS(arg3) * arg2 + this->actor.world.pos.x; - this->unk_3A0.z = Math_CosS(arg3) * arg2 + this->actor.world.pos.z; + this->unk_3A0.x = this->actor.world.pos.x + Math_SinS(arg3) * arg2; + this->unk_3A0.z = this->actor.world.pos.z + Math_CosS(arg3) * arg2; Player_Anim_PlayOnce(play, this, func_8082ED20(this)); } @@ -10217,8 +10217,8 @@ s32 func_808401F4(PlayState* play, Player* this) { spC8.x = temp_a0->x + (spB0.x * var_fv1); spC8.y = temp_a0->y + (spB0.y * var_fv1); spC8.z = temp_a0->z + (spB0.z * var_fv1); - if (BgCheck_EntityLineTest2(&play->colCtx, &spC8, temp_a0, &pos, &poly, 1, 0, 0, 1, &bgId, - &this->actor)) { + if (BgCheck_EntityLineTest2(&play->colCtx, &spC8, temp_a0, &pos, &poly, true, false, false, + true, &bgId, &this->actor)) { if (!SurfaceType_IsIgnoredByEntities(&play->colCtx, poly, bgId) && (SurfaceType_GetFloorType(&play->colCtx, poly, bgId) != FLOOR_TYPE_6) && !func_800B90AC(play, &this->actor, poly, bgId, &pos)) { @@ -15843,7 +15843,8 @@ void Player_Action_47(Player* this, PlayState* play) { sp4C.x = this->actor.world.pos.x; sp4C.z = this->actor.world.pos.z; sp4C.y = sp64.y; - if (!BgCheck_EntityLineTest2(&play->colCtx, &sp4C, &sp64, &sp40, &poly, 1, 0, 0, 1, &bgId, &this->actor)) { + if (!BgCheck_EntityLineTest2(&play->colCtx, &sp4C, &sp64, &sp40, &poly, true, false, false, true, &bgId, + &this->actor)) { func_808479F4(play, this, -2.0f); return; } diff --git a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h index d44a6a468f..e1f907c035 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h +++ b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h @@ -4,8 +4,8 @@ #include "global.h" typedef struct { - /* 0x00 */ Vec3f pos; - /* 0x0C */ s16 yaw; + /* 0x0 */ Vec3f pos; + /* 0xC */ s16 yaw; } EffectSsStickInitParams; // size = 0x10 #endif diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_debug.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_debug.c index 849b05f989..ad596cccc8 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_debug.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_debug.c @@ -178,12 +178,12 @@ s16 sRowFirstSections[] = { INV_EDITOR_SECTION_DOUBLE_DEFENSE, }; -void KaleidoScope_DrawInventoryEditorText(Gfx** gfxp) { +void KaleidoScope_DrawInventoryEditorText(Gfx** gfxP) { GfxPrint printer; s32 pad[2]; GfxPrint_Init(&printer); - GfxPrint_Open(&printer, *gfxp); + GfxPrint_Open(&printer, *gfxP); // Rupees GfxPrint_SetPos(&printer, 4, 2); @@ -320,7 +320,7 @@ void KaleidoScope_DrawInventoryEditorText(Gfx** gfxp) { GfxPrint_SetPos(&printer, 23, 27); GfxPrint_Printf(&printer, "%s", "バーズ"); - *gfxp = GfxPrint_Close(&printer); + *gfxP = GfxPrint_Close(&printer); GfxPrint_Destroy(&printer); } diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 762edb36cb..9b03869f79 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -6522,8 +6522,8 @@ 0x808CD58C:("D_808CD58C","UNK_TYPE4","",0x4), 0x808CD5AC:("D_808CD5AC","UNK_TYPE1","",0x1), 0x808CD5B8:("sTexturesDesegmented","UNK_TYPE4","",0x4), - 0x808CD5BC:("D_808CD5BC","UNK_TYPE1","",0x1), - 0x808CD5C0:("D_808CD5C0","UNK_TYPE1","",0x1), + 0x808CD5BC:("sPrimColor","UNK_TYPE1","",0x1), + 0x808CD5C0:("sEnvColor","UNK_TYPE1","",0x1), 0x808CD5D0:("D_808CD5D0","f32","",0x4), 0x808CD5D4:("D_808CD5D4","f32","",0x4), 0x808CD5D8:("D_808CD5D8","f32","",0x4), @@ -9014,7 +9014,7 @@ 0x809942C0:("D_809942C0","UNK_PTR","",0x4), 0x809942D0:("D_809942D0","UNK_TYPE1","",0x1), 0x809942D8:("sTexturesDesegmented","UNK_TYPE4","",0x4), - 0x809942DC:("D_809942DC","UNK_TYPE1","",0x1), + 0x809942DC:("sAccel","UNK_TYPE1","",0x1), 0x809942E8:("D_809942E8","UNK_TYPE1","",0x1), 0x809942EC:("D_809942EC","UNK_TYPE1","",0x1), 0x809942F0:("D_809942F0","UNK_TYPE1","",0x1),