summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPrakxo <87568477+Prakxo@users.noreply.github.com>2023-09-27 20:03:11 +0200
committerGitHub <noreply@github.com>2023-09-27 11:03:11 -0700
commit02dc7fc7af3b39e44b9b030235f1dd66e7644efe (patch)
treea2dd820938746fa8ca56384f5919b679def35cf0 /include
parent4ba08394238a50c9dd5c049a80cb6ae2c04da481 (diff)
m_lib OK (#103)
* m_lib OK * fixes * rename segmented2virtual macro
Diffstat (limited to 'include')
-rw-r--r--include/c_keyframe.h52
-rw-r--r--include/m_actor.h38
-rw-r--r--include/m_collision_bg.h8
-rw-r--r--include/m_collision_obj.h4
-rw-r--r--include/m_field_info.h14
-rw-r--r--include/m_lib.h138
-rw-r--r--include/m_lights.h12
-rw-r--r--include/m_npc.h4
-rw-r--r--include/m_rcp.h2
-rw-r--r--include/m_scene.h4
-rw-r--r--include/m_skin_matrix.h2
-rw-r--r--include/m_snowman.h2
-rw-r--r--include/m_submenu.h2
-rw-r--r--include/m_view.h2
-rw-r--r--include/macros.h5
-rw-r--r--include/sys_math3d.h16
-rw-r--r--include/sys_matrix.h22
-rw-r--r--include/z64math.h4
18 files changed, 175 insertions, 156 deletions
diff --git a/include/c_keyframe.h b/include/c_keyframe.h
index d375efa..26a00c7 100644
--- a/include/c_keyframe.h
+++ b/include/c_keyframe.h
@@ -24,7 +24,7 @@ typedef struct {
/* 0x0 */ Gfx* shape;
/* 0x4 */ u8 numberOfChildren;
/* 0x5 */ u8 displayBufferFlag;
- /* 0x6 */ Vec3s translation;
+ /* 0x6 */ s_xyz translation;
} JointElemR; // size = 0xC
typedef struct {
@@ -51,13 +51,13 @@ typedef struct {
typedef struct {
/* 0x00 */ s32 transformationFlag;
- /* 0x04 */ Vec3f baseWorldPosition;
+ /* 0x04 */ xyz_t baseWorldPosition;
/* 0x10 */ s16 baseAngleY;
- /* 0x14 */ Vec3f baseShapeTranslation;
- /* 0x20 */ Vec3s baseShapeRotation;
- /* 0x26 */ Vec3s updatedBaseShapeRotation;
+ /* 0x14 */ xyz_t baseShapeTranslation;
+ /* 0x20 */ s_xyz baseShapeRotation;
+ /* 0x26 */ s_xyz updatedBaseShapeRotation;
/* 0x2C */ f32 counter;
- /* 0x30 */ Vec3f shapeWorldPositionCorrection;
+ /* 0x30 */ xyz_t shapeWorldPositionCorrection;
/* 0x3C */ s16 shapeAngleCorrection;
} AnimationMove; // size = 0x40
@@ -66,9 +66,9 @@ typedef struct {
/* 0x18 */ BaseSkeletonR* skeleton;
/* 0x1C */ BaseAnimationR* animation;
/* 0x20 */ f32 morphCounter;
- /* 0x24 */ Vec3s* jointTable;
- /* 0x28 */ Vec3s* morphTable;
- /* 0x2C */ Vec3s* diffRotTable;
+ /* 0x24 */ s_xyz* jointTable;
+ /* 0x28 */ s_xyz* morphTable;
+ /* 0x2C */ s_xyz* diffRotTable;
/* 0x30 */ AnimationMove animationMove;
} SkeletonInfoR; // size = 0x70
@@ -83,7 +83,7 @@ typedef struct {
/* 0x1C */ s32 keyframeStartIndex;
} SkeletonInfoRCombineWork; // size = 0x20
-typedef s32 (*DrawCallback)(struct Game_Play* game_play, SkeletonInfoR* skeletonInfo, s32 jointIndex, Gfx** dlist, u8* displayBufferFlag, void*, Vec3s* rotation, Vec3f* translation);
+typedef s32 (*DrawCallback)(struct Game_Play* game_play, SkeletonInfoR* skeletonInfo, s32 jointIndex, Gfx** dlist, u8* displayBufferFlag, void*, s_xyz* rotation, xyz_t* translation);
void cKF_FrameControl_zeroClear(FrameControl* frameControl);
void cKF_FrameControl_ct(FrameControl* frameControl);
@@ -100,22 +100,22 @@ void cKF_SkeletonInfo_subRotInterpolation(f32 t, s16* out, s16 jointRotation, s1
void cKF_SkeletonInfo_morphST(s16* joint, s16* morph, f32 t);
void cKF_SkeletonInfo_R_zeroClear(SkeletonInfoR* skeletonInfo);
void cKF_SkeletonInfo_R_ct(SkeletonInfoR* skeletonInfo, BaseSkeletonR* skeleton, BaseAnimationR* animation,
- Vec3s* jointTable, Vec3s* morphTable);
+ s_xyz* jointTable, s_xyz* morphTable);
void cKF_SkeletonInfo_R_dt(SkeletonInfoR* skeletonInfo);
-void cKF_SkeletonInfo_R_init_standard_stop(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation, Vec3s* diffRotTable);
+void cKF_SkeletonInfo_R_init_standard_stop(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation, s_xyz* diffRotTable);
void cKF_SkeletonInfo_R_init_standard_stop_speedset(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation,
- Vec3s* diffRotTable, f32 speed);
+ s_xyz* diffRotTable, f32 speed);
void cKF_SkeletonInfo_R_init_standard_stop_morph(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation,
- Vec3s* diffRotTable, f32 morphCounter);
+ s_xyz* diffRotTable, f32 morphCounter);
void cKF_SkeletonInfo_R_init_standard_repeat(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation,
- Vec3s* diffRotTable);
+ s_xyz* diffRotTable);
void cKF_SkeletonInfo_R_init_standard_repeat_speedset(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation,
- Vec3s* diffRotTable, f32 speed);
+ s_xyz* diffRotTable, f32 speed);
void cKF_SkeletonInfo_R_init_standard_repeat_morph(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation,
- Vec3s* diffRotTable, f32 morphCounter);
+ s_xyz* diffRotTable, f32 morphCounter);
void cKF_SkeletonInfo_R_init(SkeletonInfoR* skeletonInfo, BaseSkeletonR* skeleton, BaseAnimationR* animation,
f32 startFrame, f32 endFrame, f32 currentFrame, f32 speed, f32 morphCounter,
- AnimationMode mode, Vec3s* diffRotTable);
+ AnimationMode mode, s_xyz* diffRotTable);
void cKF_SkeletonInfo_R_setAnim(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation);
void cKF_SkeletonInfo_R_morphJoint(SkeletonInfoR* skeletonInfo);
s32 cKF_SkeletonInfo_R_play(SkeletonInfoR* skeletonInfo);
@@ -124,16 +124,16 @@ void cKF_Si3_draw_SV_R_child(struct Game_Play* game_play, SkeletonInfoR* skeleto
void cKF_Si3_draw_R_SV(struct Game_Play* game_play, SkeletonInfoR* skeletonInfo, Mtx* mtx, DrawCallback beforeCallback,
DrawCallback afterCallback, void* arg);
void cKF_SkeletonInfo_R_init_standard_repeat_speedsetandmorph(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation,
- Vec3s* diffRotTable, f32 speed, f32 morphCounter);
+ s_xyz* diffRotTable, f32 speed, f32 morphCounter);
void cKF_SkeletonInfo_R_init_standard_repeat_setframeandspeedandmorph(SkeletonInfoR* skeletonInfo,
- BaseAnimationR* animation, Vec3s* diffRotTable,
+ BaseAnimationR* animation, s_xyz* diffRotTable,
f32 currentFrame, f32 speed, f32 morphCounter);
void cKF_SkeletonInfo_R_init_standard_setframeandspeedandmorphandmode(SkeletonInfoR* skeletonInfo,
- BaseAnimationR* animation, Vec3s* diffRotTable,
+ BaseAnimationR* animation, s_xyz* diffRotTable,
f32 currentFrame, f32 speed, f32 morphCounter,
AnimationMode mode);
void cKF_SkeletonInfo_R_init_reverse_setspeedandmorphandmode(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation,
- Vec3s* diffRotTable, f32 currentFrame, f32 speed,
+ s_xyz* diffRotTable, f32 currentFrame, f32 speed,
AnimationMode mode);
void func_80053384_jp(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, UNK_PTR* arg6, UNK_PTR* arg7,
UNK_PTR* arg8);
@@ -147,12 +147,12 @@ void cKF_SkeletonInfo_R_T_combine_play(s32* arg0, s32* arg1, s32* arg2, Skeleton
s32 arg8, s32 arg9, s32 argA, s32 argB, s8* flag);
void cKF_SkeletonInfo_R_Animation_Set_base_shape_trs(SkeletonInfoR* skeletonInfo, f32 translationX, f32 translationY,
f32 translationZ, s16 rotX, s16 rotY, s16 rotZ);
-void cKF_SkeletonInfo_R_AnimationMove_ct_base(Vec3f* arg0, Vec3f* arg1, s16 arg2, s16 arg3, f32 arg4,
+void cKF_SkeletonInfo_R_AnimationMove_ct_base(xyz_t* arg0, xyz_t* arg1, s16 arg2, s16 arg3, f32 arg4,
SkeletonInfoR* skeletonInfo, s32 transformationFlag);
void cKF_SkeletonInfo_R_AnimationMove_dt(SkeletonInfoR* skeletonInfo);
-void cKF_SkeletonInfo_R_AnimationMove_base(Vec3f* arg0, Vec3s* arg1, Vec3f* arg2, s16 arg3,
+void cKF_SkeletonInfo_R_AnimationMove_base(xyz_t* arg0, s_xyz* arg1, xyz_t* arg2, s16 arg3,
SkeletonInfoR* skeletonInfo);
-void cKF_SkeletonInfo_R_AnimationMove_CulcTransToWorld(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4, s16 arg5,
- Vec3f* arg6, SkeletonInfoR* skeleton, s32 arg8);
+void cKF_SkeletonInfo_R_AnimationMove_CulcTransToWorld(xyz_t* arg0, xyz_t* arg1, f32 arg2, f32 arg3, f32 arg4, s16 arg5,
+ xyz_t* arg6, SkeletonInfoR* skeleton, s32 arg8);
#endif
diff --git a/include/m_actor.h b/include/m_actor.h
index a2eeb2f..1293e10 100644
--- a/include/m_actor.h
+++ b/include/m_actor.h
@@ -65,14 +65,14 @@ typedef struct ActorProfile {
} ActorProfile; // size = 0x24
typedef struct PosRot {
- /* 0x00 */ Vec3f pos;
- /* 0x0C */ Vec3s rot;
+ /* 0x00 */ xyz_t pos;
+ /* 0x0C */ s_xyz rot;
} PosRot; // size = 0x14
typedef void (*Shape_Info_unk_0C)(struct Actor*, struct LightsN*, struct Game_Play*);
typedef struct Shape_Info {
- /* 0x00 */ Vec3s rot;
+ /* 0x00 */ s_xyz rot;
/* 0x08 */ f32 unk_08;
/* 0x0C */ Shape_Info_unk_0C unk_0C;
/* 0x10 */ f32 unk_10;
@@ -80,13 +80,13 @@ typedef struct Shape_Info {
/* 0x18 */ f32 unk_18;
/* 0x1C */ f32 unk_1C;
/* 0x20 */ s32 unk_20;
- /* 0x24 */ Vec3f* unk_24; // maybe PosRot*
+ /* 0x24 */ xyz_t* unk_24; // maybe PosRot*
/* 0x28 */ s32 unk_28;
/* 0x2C */ s8 unk_2C;
/* 0x2D */ s8 unk_2D;
/* 0x2E */ s8 unk_2E;
/* 0x2F */ UNK_TYPE1 unk_2F[0x1];
- /* 0x30 */ Vec3f feetPos[FOOT_MAX];
+ /* 0x30 */ xyz_t feetPos[FOOT_MAX];
} Shape_Info; // size = 0x48
typedef struct Actor {
@@ -103,10 +103,10 @@ typedef struct Actor {
/* 0x024 */ s16 params;
/* 0x026 */ s16 unk_026; // objBankIndex
/* 0x028 */ PosRot world;
- /* 0x03C */ Vec3f prevPos;
+ /* 0x03C */ xyz_t prevPos;
/* 0x048 */ PosRot eye; // focus
- /* 0x05C */ Vec3f scale;
- /* 0x068 */ Vec3f velocity;
+ /* 0x05C */ xyz_t scale;
+ /* 0x068 */ xyz_t velocity;
/* 0x074 */ f32 speed;
/* 0x078 */ f32 gravity;
/* 0x07C */ f32 terminalVelocity;
@@ -119,7 +119,7 @@ typedef struct Actor {
/* 0x0C0 */ f32 playerHeightRel;
/* 0x0C4 */ CollisionCheck_Status colStatus; // made-up name
/* 0x0DC */ Shape_Info shape;
- /* 0x124 */ Vec3f projectedPos;
+ /* 0x124 */ xyz_t projectedPos;
/* 0x130 */ f32 projectedW;
/* 0x134 */ f32 uncullZoneScale;
/* 0x138 */ f32 uncullZoneDownward;
@@ -229,7 +229,7 @@ typedef struct ActorInfo {
#define ACTOR_FGNAME_GET_F000(fgName) (((fgName) & 0xF000) >> 12)
-void projection_pos_set(struct Game_Play* game_play, Vec3f* worldPos, Vec3f* projectedPos, f32* invW);
+void projection_pos_set(struct Game_Play* game_play, xyz_t* worldPos, xyz_t* projectedPos, f32* invW);
void Actor_world_to_eye(Actor* actor, f32 arg1);
void Actor_position_move(Actor* actor);
void Actor_position_speed_set(Actor* actor);
@@ -237,10 +237,10 @@ void Actor_position_moveF(Actor* actor);
s32 Actor_player_look_direction_check(Actor* actor, s16 maxAngleDiff, struct Game_Play* game_play);
void Actor_display_position_set(struct Game_Play* game_play, Actor* actor, s16* x, s16* y);
void Shape_Info_init(Actor* actor, f32 arg1, Shape_Info_unk_0C arg2, f32 arg3, f32 arg4);
-void Actor_foot_shadow_pos_set(Actor* actor, s32 limbIndex, s32 leftFootIndex, Vec3f* leftFootPos, s32 rightFootIndex, Vec3f* rightFootPos);
+void Actor_foot_shadow_pos_set(Actor* actor, s32 limbIndex, s32 leftFootIndex, xyz_t* leftFootPos, s32 rightFootIndex, xyz_t* rightFootPos);
void Actor_delete(Actor* actor);
s32 Actor_draw_actor_no_culling_check(Actor* actor);
-s32 Actor_draw_actor_no_culling_check2(Actor* actor, Vec3f* arg1, f32 arg2);
+s32 Actor_draw_actor_no_culling_check2(Actor* actor, xyz_t* arg1, f32 arg2);
void Actor_cull_check(Actor* actor);
void Actor_delete_check(Actor* actor, struct Game_Play* game_play);
void Actor_info_ct(struct Game_Play* game_play2, ActorInfo* actorInfo, struct ActorEntry* actorEntry);
@@ -260,12 +260,12 @@ Actor* Actor_info_delete(ActorInfo* actorInfo, Actor* actor, struct Game_Play* g
Actor* Actor_info_name_search(ActorInfo* actorInfo, s16 name, ActorPart part);
Actor* Actor_info_fgName_search(ActorInfo* actorInfo, u16 fgName, ActorPart part);
void Part_Break_init(Part_Break* partBreak, s32 count, UNK_TYPE arg2);
-Gfx* HiliteReflect_new(Vec3f* object, Vec3f* eye, Vec3f* lightDir, struct GraphicsContext* gfxCtx, Gfx* gfx, Hilite** hilite);
-Hilite* HiliteReflect_init(Vec3f* object, Vec3f* eye, Vec3f* lightDir, struct GraphicsContext* gfxCtx);
-Hilite* HiliteReflect_xlu_init(Vec3f* object, Vec3f* eye, Vec3f* lightDir, struct GraphicsContext* gfxCtx);
-Hilite* HiliteReflect_light_init(Vec3f* object, Vec3f* eye, Vec3f* lightDir, struct GraphicsContext* gfxCtx);
-Hilite* Setpos_HiliteReflect_init(Vec3f* object, struct Game_Play* game_play);
-Hilite* Setpos_HiliteReflect_xlu_init(Vec3f* object, struct Game_Play* game_play);
-Hilite* Setpos_HiliteReflect_light_init(Vec3f* object, struct Game_Play* game_play);
+Gfx* HiliteReflect_new(xyz_t* object, xyz_t* eye, xyz_t* lightDir, struct GraphicsContext* gfxCtx, Gfx* gfx, Hilite** hilite);
+Hilite* HiliteReflect_init(xyz_t* object, xyz_t* eye, xyz_t* lightDir, struct GraphicsContext* gfxCtx);
+Hilite* HiliteReflect_xlu_init(xyz_t* object, xyz_t* eye, xyz_t* lightDir, struct GraphicsContext* gfxCtx);
+Hilite* HiliteReflect_light_init(xyz_t* object, xyz_t* eye, xyz_t* lightDir, struct GraphicsContext* gfxCtx);
+Hilite* Setpos_HiliteReflect_init(xyz_t* object, struct Game_Play* game_play);
+Hilite* Setpos_HiliteReflect_xlu_init(xyz_t* object, struct Game_Play* game_play);
+Hilite* Setpos_HiliteReflect_light_init(xyz_t* object, struct Game_Play* game_play);
#endif
diff --git a/include/m_collision_bg.h b/include/m_collision_bg.h
index 0fb4a07..896da7c 100644
--- a/include/m_collision_bg.h
+++ b/include/m_collision_bg.h
@@ -99,7 +99,7 @@ typedef struct mCoBG_OffsetTable {
// void func_8006B5C0_jp();
// void func_8006B664_jp();
// void func_8006B92C_jp();
-s32 mCoBG_RegistMoveBg(s8 *arg0, PosRot *arg1, Vec3f *arg2, s16 *arg3, f32 arg4, s32 arg5, s32 arg6, s32 arg7, s32 arg8, s32 arg9, s32 argA, f32 argB);
+s32 mCoBG_RegistMoveBg(s8 *arg0, PosRot *arg1, xyz_t *arg2, s16 *arg3, f32 arg4, s32 arg5, s32 arg6, s32 arg7, s32 arg8, s32 arg9, s32 argA, f32 argB);
// void func_8006BAA8_jp();
void mCoBG_CrossOffMoveBg(s32 arg0, struct Actor *actor);
void func_8006BB64_jp(void);
@@ -180,7 +180,7 @@ void func_8006C8D0_jp(void);
// void func_80071884_jp();
// void func_80071A08_jp();
// void func_80071AB8_jp();
-f32 mCoBG_GetBgY_OnlyCenter_FromWpos2(Vec3f arg0, f32 arg1);
+f32 mCoBG_GetBgY_OnlyCenter_FromWpos2(xyz_t arg0, f32 arg1);
// void func_80071C1C_jp();
// void func_80071DB4_jp();
// void func_800721C8_jp();
@@ -207,7 +207,7 @@ f32 mCoBG_GetBgY_OnlyCenter_FromWpos2(Vec3f arg0, f32 arg1);
// void func_80072B24_jp();
// void func_80072BE8_jp();
// void func_80072C60_jp();
-s32 mCoBG_SearchWaterLimitDistN(UNK_TYPE* arg0, Vec3f arg1, s16 arg4, f32 arg5, s32 arg6);
+s32 mCoBG_SearchWaterLimitDistN(UNK_TYPE* arg0, xyz_t arg1, s16 arg4, f32 arg5, s32 arg6);
// void func_80072E70_jp();
// void func_80072F9C_jp();
// void func_800730C8_jp();
@@ -225,7 +225,7 @@ s32 mCoBG_SearchWaterLimitDistN(UNK_TYPE* arg0, Vec3f arg1, s16 arg4, f32 arg5,
// void func_800739FC_jp();
// void func_80073C38_jp();
// void func_80073CC0_jp();
-void mCoBG_SetPluss5PointOffset_file(Vec3f pos, mCoBG_OffsetTable offsetData, char* file, s32 line);
+void mCoBG_SetPluss5PointOffset_file(xyz_t pos, mCoBG_OffsetTable offsetData, char* file, s32 line);
// void func_80074090_jp();
// void func_80074174_jp();
// void func_800741DC_jp();
diff --git a/include/m_collision_obj.h b/include/m_collision_obj.h
index 62ba5ee..62c552e 100644
--- a/include/m_collision_obj.h
+++ b/include/m_collision_obj.h
@@ -110,7 +110,7 @@ typedef struct ClObjTrisElemAttr_Init {
typedef struct ClObjTrisElemAttr {
/* 0x00 */ Triangle3 unk_00;
- /* 0x34 */ Vec3f unk_34;
+ /* 0x34 */ xyz_t unk_34;
} ClObjTrisElemAttr; // size = 0x40
@@ -154,7 +154,7 @@ typedef struct CollisionCheck_Status_Init {
} CollisionCheck_Status_Init; // size = 0xA
typedef struct CollisionCheck_Status {
- /* 0x00 */ Vec3f displacement;
+ /* 0x00 */ xyz_t displacement;
/* 0x0C */ s16 unk_0C;
/* 0x0E */ s16 unk_0E;
/* 0x10 */ s16 unk_10;
diff --git a/include/m_field_info.h b/include/m_field_info.h
index 758931e..755c7c2 100644
--- a/include/m_field_info.h
+++ b/include/m_field_info.h
@@ -30,7 +30,7 @@ struct Game_Play;
// void func_80088458_jp();
// void func_800884E0_jp();
// void func_800885A8_jp();
-s32 mFI_Wpos2BlockNum(s32*, s32*, Vec3f);
+s32 mFI_Wpos2BlockNum(s32*, s32*, xyz_t);
// void func_80088780_jp();
// void func_8008883C_jp();
// void func_800888AC_jp();
@@ -88,13 +88,13 @@ void mFI_BlockKind2BkNum(s32*,s32*,s32);
// void func_8008A3BC_jp();
// void func_8008A410_jp();
// void func_8008A4F8_jp();
-u16* mFI_GetUnitFG(Vec3f);
+u16* mFI_GetUnitFG(xyz_t);
// void func_8008A608_jp();
// void func_8008A670_jp();
// void func_8008A74C_jp();
// void func_8008A81C_jp();
// void func_8008A960_jp();
-UNK_TYPE mFI_SetFG_common(u16 fgName, Vec3f arg1, s32 arg2);
+UNK_TYPE mFI_SetFG_common(u16 fgName, xyz_t arg1, s32 arg2);
// void func_8008AA98_jp();
// void func_8008AB14_jp();
// void func_8008AC74_jp();
@@ -111,8 +111,8 @@ UNK_TYPE mFI_SetFG_common(u16 fgName, Vec3f arg1, s32 arg2);
// void func_8008B2D0_jp();
// void func_8008B300_jp();
// void func_8008B318_jp();
-void mFI_SetBearActor(struct Game_Play* game_play, Vec3f arg1, s32 arg2);
-s32 func_8008B3E8_jp(Vec3f* arg0, UNK_TYPE arg1);
+void mFI_SetBearActor(struct Game_Play* game_play, xyz_t arg1, s32 arg2);
+s32 func_8008B3E8_jp(xyz_t* arg0, UNK_TYPE arg1);
// void func_8008B4C0_jp();
// void func_8008B598_jp();
// void func_8008B66C_jp();
@@ -154,7 +154,7 @@ void func_8008C478_jp(u16* deposit, int ut_x, int ut_z);
// void func_8008C610_jp();
// void func_8008C630_jp();
// void func_8008C650_jp();
-void mFI_Wpos2DepositOFF(Vec3f);
+void mFI_Wpos2DepositOFF(xyz_t);
// void func_8008C708_jp();
// void func_8008C764_jp();
// void func_8008C798_jp();
@@ -189,7 +189,7 @@ void func_8008DCF8_jp(void);
// void func_8008DF04_jp();
// void func_8008E058_jp();
// void func_8008E514_jp();
-void func_8008E5F4_jp(Vec3f arg0);
+void func_8008E5F4_jp(xyz_t arg0);
// void mFI_PrintNowBGNum();
// void mFI_PrintFgAttr();
// void func_8008E8E0_jp();
diff --git a/include/m_lib.h b/include/m_lib.h
index 1fdaecd..d411a96 100644
--- a/include/m_lib.h
+++ b/include/m_lib.h
@@ -3,71 +3,85 @@
#include "ultra64.h"
#include "z64math.h"
-#include "unk.h"
+#include "overlays/gamestates/ovl_play/m_play.h"
+#include "color.h"
+#include "sys_math.h"
-struct Game_Play;
-void mem_copy(void* dst, void* src, u32 size);
-s32 mem_clear(void* ptr, size_t size, u8 value);
-// void mem_cmp();
+typedef struct {
+ u32 cont: 1;
+ u32 type: 4;
+ u32 offset: 11;
+ s32 value: 16;
+} ValueSet;
+
+
+typedef void (*ValueSetProc)(u8*, ValueSet*);
+
+
+extern ValueSetProc D_80107B00_jp[];
+
+void mem_copy(u8* dest, u8* src, size_t len);
+void mem_clear(u8* ptr, size_t len, u8 value);
+s32 mem_cmp(u8* ptr1, u8* ptr2, size_t len);
f32 cos_s(s16 angle);
f32 sin_s(s16 angle);
-// void chase_angle();
-// void chase_s();
-s32 chase_f(f32* arg0, f32 arg1, f32 arg2);
-// void chase_angle2();
-// void chase_s2();
-// void chase_s3();
-// void chase_f2();
-// void chase_f3();
-// void inter_float();
-// void stick_ratio_set();
-// void get_random_timer();
-// void get_random_pattern_timer();
-void xyz_t_move(Vec3f* dst, Vec3f* src);
-void xyz_t_move_s_xyz(Vec3f* dst, Vec3s* src);
-// void xyz_t_add();
-// void xyz_t_sub();
-// void xyz_t_sub_ss();
-// void xyz_t_mult_v();
-// void search_position_distance();
-// void search_position_distance2();
-f32 search_position_distanceXZ(Vec3f* arg0, Vec3f* arg1);
-// void search_position_high();
-s16 search_position_angleY(Vec3f* arg0, Vec3f* arg1);
-// void search_position_angleX();
-// void ValueSet_process();
-// void ValueSet__s_char();
-// void ValueSet__u_char();
-// void ValueSet__s_short();
-// void ValueSet__u_short();
-// void ValueSet__s_int();
-// void ValueSet__u_int();
-// void ValueSet__float();
-// void ValueSet__float_x1000();
-// void ValueSet__xyz_t();
-// void ValueSet__xyz_t_x1000();
-// void ValueSet__s_xyz();
-f32 add_calc(f32* pValue, f32 target, f32 fraction, f32 maxStep, f32 minStep);
-// void add_calc2();
-// void add_calc0();
-// void add_calc_a();
-// void add_calc_short_angle2();
-// void add_calc_short_angle3();
-// void adds();
-// void rgba_t_move();
-UNK_RET none_proc1(void);
-// void none_proc2();
-// void Cheap_gfx_display();
-// void Cheap_gfx_display_xlu();
-s32 _Game_play_isPause(struct Game_Play* game_play);
-void *Lib_SegmentedToVirtual(void *ptr); //original name unknown, taken from majora's mask
-// void func_8009ADE0_jp();
-// void func_8009AE28_jp();
-// void func_8009AE44_jp();
-f32 check_percent_abs(f32 x, f32 min, f32 max, f32 scale, int shift_by_min);
-// void get_percent_forAccelBrake();
-// void Game_play_Projection_Trans();
-// void get_percent();
+s32 chase_angle(s16* pValue, s16 target, s16 step);
+s32 chase_s(s16* pValue, s16 target, s16 step);
+s32 chase_f(f32* pValue, f32 target, f32 step);
+s32 chase_angle2(s16* pValue, s16 limit, s16 step);
+s32 chase_s2(s16* pValue, s16 limit, s16 step);
+s32 chase_s3(s16* pValue, s16 target, s16 step);
+s32 chase_f2(f32* pValue, f32 limit, f32 step);
+s32 chase_f3(f32* pValue, f32 target, f32 incrStep, f32 decrStep);
+void inter_float(f32* pValue, f32 arg1, s32 stepCount);
+void stick_ratio_set(f32* radius, s16* angle, Input* input);
+s16 get_random_timer(s16 base, s16 range);
+s16 get_random_pattern_timer(s16 base, s16 stride, s16 range);
+void xyz_t_move(xyz_t* dest, xyz_t* src);
+void xyz_t_move_s_xyz(xyz_t* dest, s_xyz* src);
+void xyz_t_add(xyz_t* augend, xyz_t* addend, xyz_t* total);
+void xyz_t_sub(xyz_t* minuend, xyz_t* subtrahend, xyz_t* diff);
+void xyz_t_sub_ss(xyz_t* dest, s_xyz* minuend, s_xyz* subtrahend);
+void xyz_t_mult_v(xyz_t* multiplicand, f32 multiplier);
+f32 search_position_distance(xyz_t* subtrahend, xyz_t* minuend);
+f32 search_position_distance2(xyz_t* subtrahend, xyz_t* minuend, xyz_t* dest);
+f32 search_position_distanceXZ(xyz_t* subtrahend, xyz_t* minuend);
+f32 search_position_high(xyz_t* subtrahend, xyz_t* minuend);
+s16 search_position_angleY(xyz_t* subtrahend, xyz_t* minuend);
+s16 search_position_angleX(xyz_t* subtrahend, xyz_t* minuend);
+void ValueSet_process(u8* ptr, ValueSet* values);
+void ValueSet__s_char(u8* ptr, ValueSet* value_set);
+void ValueSet__u_char(u8* ptr, ValueSet* value_set);
+void ValueSet__s_short(u8* ptr, ValueSet* value_set);
+void ValueSet__u_short(u8* ptr, ValueSet* value_set);
+void ValueSet__s_int(u8* ptr, ValueSet* value_set);
+void ValueSet__u_int(u8* ptr, ValueSet* value_set);
+void ValueSet__float(u8* ptr, ValueSet* value_set);
+void ValueSet__float_x1000(u8* ptr, ValueSet* value_set);
+void ValueSet__xyz_t(u8* ptr, ValueSet* value_set);
+void ValueSet__xyz_t_x1000(u8* ptr, ValueSet* value_set);
+void ValueSet__s_xyz(u8* ptr, ValueSet* value_set);
+f32 add_calc(f32* pValue, f32 target, f32 fraction, f32 step, f32 minStep);
+void add_calc2(f32* pValue, f32 target, f32 fraction, f32 step);
+void add_calc0(f32* pValue, f32 fraction, f32 step);
+f32 add_calc_a(f32* pValue, f32 target, f32 fraction, f32 step, f32 minStep);
+s16 add_calc_short_angle2(s16* pValue, s16 target, f32 fraction, s16 step, s16 minStep);
+s16 add_calc_short_angle3(s16* pValue, s16 target, f32 fraction, s16 maxStep, s16 minStep);
+void adds(s16* pValue, s16 target, s16 scale, s16 maxStep);
+void rgba_t_move(Color_RGBA8* dest, Color_RGBA8* src);
+s32 none_proc1();
+void none_proc2(Actor* actor, struct Game_Play* play);
+void Cheap_gfx_display(struct Game_Play* play, Gfx* dl);
+void Cheap_gfx_display_xlu(struct Game_Play* play, Gfx* dl);
+s32 _Game_play_isPause(struct Game_Play* play);
+void* Lib_SegmentedToVirtual(void* ptr);
+void* Lib_SegmentedToVirtualNull(void* ptr);
+void* PhysicalToVirtual(uintptr_t ptr);
+void* PhysicalToVirtualNull(uintptr_t ptr);
+f32 check_percent_abs(f32 x, f32 min, f32 max, f32 scale, s32 shiftMin);
+f32 get_percent_forAccelBrake(f32 x, f32 min, f32 max, f32 accelRange, f32 brakeRange);
+void Game_play_Projection_Trans(struct Game_Play* play, xyz_t* src, xyz_t* dst);
+f32 get_percent(s32 max, s32 min, s32 x);
#endif
diff --git a/include/m_lights.h b/include/m_lights.h
index 740b5e2..95e5a3c 100644
--- a/include/m_lights.h
+++ b/include/m_lights.h
@@ -61,8 +61,8 @@ typedef struct Global_light {
/* 0xC */ s16 fogFar;
} Global_light; // size = 0x10
-typedef void (*light_point_proc)(LightsN*, LightParams*, Vec3f*);
-typedef void (*light_P_point_proc)(LightsN*, LightParams*, Vec3f*);
+typedef void (*light_point_proc)(LightsN*, LightParams*, xyz_t*);
+typedef void (*light_P_point_proc)(LightsN*, LightParams*, xyz_t*);
void point_data_set(Lights* lights, s16 x, s16 y, s16 z, u8 r, u8 g, u8 b, s16 radius, s32 type);
void Light_point_ct(Lights* lights, s16 x, s16 y, s16 z, u8 r, u8 g, u8 b, s16 radius);
@@ -72,10 +72,10 @@ void Light_diffuse_ct(Lights* lights, s8 x, s8 y, s8 z, u8 r, u8 g, u8 b);
void LightsN_ct(LightsN* lights, u8 r, u8 g, u8 b);
void LightsN_disp(LightsN* lights, struct GraphicsContext* gfxCtx);
Light* LightsN_new_diffuse(LightsN* lights);
-void LightsN__point_proc(LightsN* lights, LightParams* lightInfo, Vec3f* point);
-void LightsN__P_point_proc(LightsN* lights, LightParams* lightInfo, Vec3f* pos);
-void LightsN__diffuse_proc(LightsN* lights, LightParams* lightInfo, Vec3f* pos);
-void LightsN_list_check(LightsN* lights, LightNode* node, Vec3f* pos);
+void LightsN__point_proc(LightsN* lights, LightParams* lightInfo, xyz_t* point);
+void LightsN__P_point_proc(LightsN* lights, LightParams* lightInfo, xyz_t* pos);
+void LightsN__diffuse_proc(LightsN* lights, LightParams* lightInfo, xyz_t* pos);
+void LightsN_list_check(LightsN* lights, LightNode* node, xyz_t* pos);
LightNode* Light_list_buf_new(void);
void Light_list_buf_delete(LightNode* lightNode);
void Global_light_ct(Global_light* glight);
diff --git a/include/m_npc.h b/include/m_npc.h
index e55c6e7..4fb1303 100644
--- a/include/m_npc.h
+++ b/include/m_npc.h
@@ -12,7 +12,7 @@
typedef struct NpcList {
/* 0x00 */ char unk00[0x10];
- /* 0x10 */ Vec3f position;
+ /* 0x10 */ xyz_t position;
/* 0x14 */ char unk14[0x1C];
} NpcList; // size = 0x38
@@ -198,7 +198,7 @@ void mNpc_GetNpcWorldNameAnm(PlayerName* arg0, struct mMl_get_npcinfo_from_mail_
// void func_800ACD74_jp();
// void func_800ACDF8_jp();
// void func_800ACE90_jp();
-void mNpc_GetAnimalPlateName(char* arg0, Vec3f arg1);
+void mNpc_GetAnimalPlateName(char* arg0, xyz_t arg1);
// void func_800AD084_jp();
// void func_800AD0B8_jp();
// void func_800AD104_jp();
diff --git a/include/m_rcp.h b/include/m_rcp.h
index 57d180c..d58dce4 100644
--- a/include/m_rcp.h
+++ b/include/m_rcp.h
@@ -17,7 +17,7 @@ Gfx* gfx_set_fog_nosync(Gfx* gfx, u8 arg1, u8 arg2, u8 arg3, s32 arg4, s16 arg5,
void _texture_z_light_fog_prim(struct GraphicsContext *gfxCtx);
// void _texture_z_light_fog_prim_shadow();
// void func_800BD538_jp();
-void func_800BD598_jp(Gfx* gfx);
+void _texture_z_light_fog_prim_xlu(struct GraphicsContext *gfxCtx);
void func_800BD5C0_jp(struct GraphicsContext* gfxCtx);
void func_800BD5E8_jp(Gfx* gfx);
// void func_800BD648_jp();
diff --git a/include/m_scene.h b/include/m_scene.h
index c809733..1cb1da7 100644
--- a/include/m_scene.h
+++ b/include/m_scene.h
@@ -8,8 +8,8 @@ struct Game_Play;
typedef struct ActorEntry {
/* 0x0 */ s16 id;
- /* 0x2 */ Vec3s pos;
- /* 0x8 */ Vec3s rot;
+ /* 0x2 */ s_xyz pos;
+ /* 0x8 */ s_xyz rot;
/* 0xE */ s16 params;
} ActorEntry; // size = 0x10
diff --git a/include/m_skin_matrix.h b/include/m_skin_matrix.h
index 224a8f5..272f89d 100644
--- a/include/m_skin_matrix.h
+++ b/include/m_skin_matrix.h
@@ -4,7 +4,7 @@
#include "ultra64.h"
#include "z64math.h"
-void Skin_Matrix_PrjMulVector(MtxF* mf, Vec3f* src, Vec3f* xyzDest, f32* wDest);
+void Skin_Matrix_PrjMulVector(MtxF* mf, xyz_t* src, xyz_t* xyzDest, f32* wDest);
// void Skin_Matrix_MulVector();
void Skin_Matrix_MulMatrix(MtxF* mfB, MtxF* mfA, MtxF* dest);
// void Skin_Matrix_getUnitMatrixPointer();
diff --git a/include/m_snowman.h b/include/m_snowman.h
index b2c9a15..dd041ac 100644
--- a/include/m_snowman.h
+++ b/include/m_snowman.h
@@ -15,7 +15,7 @@ typedef struct SnowmanData {
typedef struct SnowmanInfo {
/* 0x00 */ s32 unk0; //scale
- /* 0x04 */ Vec3f position;
+ /* 0x04 */ xyz_t position;
} SnowmanInfo; // size = 0x10
s32 mSN_check_life(u16* name, s32 daysElapsed);
diff --git a/include/m_submenu.h b/include/m_submenu.h
index 95d2b51..b1a8d05 100644
--- a/include/m_submenu.h
+++ b/include/m_submenu.h
@@ -92,7 +92,7 @@ typedef struct Submenu {
/* 0xE0 */ u16 unk_E0;
/* 0xE2 */ u8 unk_E2;
/* 0xE3 */ u8 unk_E3;
- /* 0xE4 */ Vec3f unk_E4;
+ /* 0xE4 */ xyz_t unk_E4;
} Submenu; // size = 0xF0
s32 SubmenuArea_IsPlayer(void);
diff --git a/include/m_view.h b/include/m_view.h
index 177232c..346c2bc 100644
--- a/include/m_view.h
+++ b/include/m_view.h
@@ -15,7 +15,7 @@ typedef struct Game_Play1938 {
/* 0x010 */ s32 unk_010;
/* 0x018 */ s32 unk_014;
/* 0x01C */ UNK_TYPE1 unk_018[0x10];
- /* 0x028 */ Vec3f unk_028;
+ /* 0x028 */ xyz_t unk_028;
/* 0x034 */ UNK_TYPE1 unk_034[0x1C];
/* 0x050 */ Vp vp;
/* 0x060 */ Mtx unk_060;
diff --git a/include/macros.h b/include/macros.h
index a420d5c..7b4df6b 100644
--- a/include/macros.h
+++ b/include/macros.h
@@ -1,6 +1,9 @@
#ifndef MACROS_H
#define MACROS_H
+#include "ultra64.h"
+#include "code_variables.h"
+
#if defined(__GNUC__) || defined(__clang__)
#define UNREACHABLE __builtin_unreachable()
#else
@@ -16,6 +19,8 @@
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
#define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0]))
+#define SEGMENTED_TO_K0(addr) (void*)((gSegments[SEGMENT_NUMBER(addr)] + K0BASE) + SEGMENT_OFFSET(addr))
+
#define ABS(x) (((x) >= 0) ? (x): -(x))
#define CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x))
diff --git a/include/sys_math3d.h b/include/sys_math3d.h
index 52e5322..525a89f 100644
--- a/include/sys_math3d.h
+++ b/include/sys_math3d.h
@@ -6,17 +6,17 @@
#include "unk.h"
typedef struct Sphere {
- /* 0x0 */ Vec3s center;
+ /* 0x0 */ s_xyz center;
/* 0x6 */ s16 radius;
} Sphere; // size = 0x6
typedef struct Triangle {
- /* 0x00 */ Vec3f vertices[3];
+ /* 0x00 */ xyz_t vertices[3];
} Triangle; // size = 0x24
typedef struct Triangle3 {
/* 0x00 */ Triangle unk_00;
- /* 0x24 */ Vec3f unk_24;
+ /* 0x24 */ xyz_t unk_24;
/* 0x30 */ f32 unk_30;
} Triangle3; // size = 0x34
@@ -24,7 +24,7 @@ typedef struct Pipe {
/* 0x0 */ s16 radius;
/* 0x2 */ s16 unk_2;
/* 0x4 */ s16 yShift;
- /* 0x6 */ Vec3s pos;
+ /* 0x6 */ s_xyz pos;
} Pipe; // size = 0xC
// void Math3d_normalizeXyz_t();
@@ -62,7 +62,7 @@ typedef struct Pipe {
// void func_800DB4E4_jp();
// void func_800DBF5C_jp();
// void func_800DC0C8_jp();
-void Math3DPlane(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2, f32* arg3, f32* arg4, f32* arg5, f32* arg6);
+void Math3DPlane(xyz_t* arg0, xyz_t* arg1, xyz_t* arg2, f32* arg3, f32* arg4, f32* arg5, f32* arg6);
// void func_800DC268_jp();
// void func_800DC2A8_jp();
// void Math3DLengthPlaneAndPos();
@@ -95,10 +95,10 @@ void Math3DPlane(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2, f32* arg3, f32* arg4, f3
// void func_800DDCAC_jp();
// void Math3D_sphereCrossLineSegment();
// void Math3D_sphereCrossTriangleCalc_cp();
-s32 Math3D_sphereCrossTriangle3_cp(Sphere* sphere, Triangle3* triangle3, Vec3f* arg2);
+s32 Math3D_sphereCrossTriangle3_cp(Sphere* sphere, Triangle3* triangle3, xyz_t* arg2);
// void func_800DE55C_jp();
// void func_800DE618_jp();
-s32 Math3D_pipeCrossTriangle_cp(Pipe* pipe, Triangle* arg1, Vec3f* arg2);
+s32 Math3D_pipeCrossTriangle_cp(Pipe* pipe, Triangle* arg1, xyz_t* arg2);
// void func_800DF46C_jp();
// void func_800DF48C_jp();
s32 Math3D_sphereCrossSphere_cl(Sphere* sphere1, Sphere* sphere2, f32* arg2);
@@ -115,6 +115,6 @@ s32 Math3D_pipeVsPipe_cl(Pipe* pipe1, Pipe* pipe2, f32* arg2);
// void sMath_RotateX();
// void sMath_RotateZ();
-extern Vec3f ZeroVec;
+extern xyz_t ZeroVec;
#endif
diff --git a/include/sys_matrix.h b/include/sys_matrix.h
index 21b0e6d..c33504e 100644
--- a/include/sys_matrix.h
+++ b/include/sys_matrix.h
@@ -25,25 +25,25 @@ void Matrix_RotateX(s16 x, MatrixMode mode);
void Matrix_RotateY(s16 y, MatrixMode mode);
void Matrix_RotateZ(s16 z, MatrixMode mode);
void Matrix_rotateXYZ(s16 x, s16 y, s16 z, MatrixMode mode);
-void Matrix_softcv3_mult(Vec3f* translation, Vec3s* rot);
-void Matrix_softcv3_load(f32 x, f32 y, f32 z, Vec3s* rot);
+void Matrix_softcv3_mult(xyz_t* translation, s_xyz* rot);
+void Matrix_softcv3_load(f32 x, f32 y, f32 z, s_xyz* rot);
Mtx* _MtxF_to_Mtx(MtxF* src, Mtx* dest);
Mtx* _Matrix_to_Mtx(Mtx* dest);
Mtx* _Matrix_to_Mtx_new(struct GraphicsContext* gfxCtx);
void _MtxF_to_Mtx_new(MtxF* src, struct GraphicsContext* gfxCtx);
-void Matrix_Position(Vec3f* src, Vec3f* dest);
-void Matrix_Position_Zero(Vec3f* dest);
-void Matrix_Position_VecX(f32 x, Vec3f* dest);
-void Matrix_Position_VecY(f32 y, Vec3f* dest);
-void Matrix_Position_VecZ(f32 z, Vec3f* dest);
+void Matrix_Position(xyz_t* src, xyz_t* dest);
+void Matrix_Position_Zero(xyz_t* dest);
+void Matrix_Position_VecX(f32 x, xyz_t* dest);
+void Matrix_Position_VecY(f32 y, xyz_t* dest);
+void Matrix_Position_VecZ(f32 z, xyz_t* dest);
void Matrix_copy_MtxF(MtxF* dest, MtxF* src);
void Matrix_MtxtoMtxF(Mtx* src, MtxF* dest);
-void Matrix_MtxF_Position2(Vec3f* src, Vec3f* dest, MtxF* mf);
+void Matrix_MtxF_Position2(xyz_t* src, xyz_t* dest, MtxF* mf);
void Matrix_reverse(MtxF* mf);
void Matrix_rotate_scale_exchange(MtxF* mf);
-void Matrix_to_rotate_new(MtxF* src, Vec3s* dest, s32 nonUniformScale);
-void Matrix_to_rotate2_new(MtxF* src, Vec3s* dest, s32 nonUniformScale);
-void Matrix_RotateVector(s16 angle, Vec3f* axis, u8 mode);
+void Matrix_to_rotate_new(MtxF* src, s_xyz* dest, s32 nonUniformScale);
+void Matrix_to_rotate2_new(MtxF* src, s_xyz* dest, s32 nonUniformScale);
+void Matrix_RotateVector(s16 angle, xyz_t* axis, u8 mode);
void suMtxMakeTS(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, f32 translateX, f32 translateY, f32 translateZ);
void suMtxMakeSRT(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, s16 rotX, s16 rotY, s16 rotZ, f32 translateX,
f32 translateY, f32 translateZ);
diff --git a/include/z64math.h b/include/z64math.h
index 33bab3a..02deb0c 100644
--- a/include/z64math.h
+++ b/include/z64math.h
@@ -22,7 +22,7 @@ typedef struct {
/* 0x0 */ f32 x;
/* 0x4 */ f32 y;
/* 0x8 */ f32 z;
-} Vec3f; // size = 0xC
+} xyz_t; // size = 0xC
typedef struct {
/* 0x0 */ u16 x;
@@ -34,7 +34,7 @@ typedef struct {
/* 0x0 */ s16 x;
/* 0x2 */ s16 y;
/* 0x4 */ s16 z;
-} Vec3s; // size = 0x6
+} s_xyz; // size = 0x6
typedef struct {
/* 0x0 */ s32 x;