summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrakxo <87568477+Prakxo@users.noreply.github.com>2024-07-13 15:50:22 +0200
committerGitHub <noreply@github.com>2024-07-13 06:50:22 -0700
commitaeb01dcb95e8281f89f355604dbeba519ef073d5 (patch)
tree96b20d128b016c994ccac5c7b0c690a3b5a5a801
parent0e66d077f8cf321c3f11978f531502ec592c0cdb (diff)
m_roll_lib OK (#198)
-rw-r--r--include/6F2150.h22
-rw-r--r--include/m_actor.h6
-rw-r--r--include/m_collision_bg.h20
-rw-r--r--include/m_field_info.h7
-rw-r--r--include/m_roll_lib.h28
-rw-r--r--include/z64math.h2
-rw-r--r--linker_scripts/jp/symbol_addrs_code.txt16
-rw-r--r--src/code/m_roll_lib.c294
-rw-r--r--src/overlays/actors/ovl_Airplane/ac_airplane.c8
-rw-r--r--src/overlays/actors/ovl_Ball/ac_ball.c52
-rw-r--r--src/overlays/actors/ovl_Fuusen/ac_fuusen.c2
-rw-r--r--yamls/jp/code.yaml4
12 files changed, 392 insertions, 69 deletions
diff --git a/include/6F2150.h b/include/6F2150.h
deleted file mode 100644
index 4b2c0a1..0000000
--- a/include/6F2150.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef C_6F2150_H
-#define C_6F2150_H
-
-#include "ultra64.h"
-
-void mRlib_spdXZ_to_spdF_Angle(xyz_t*, f32*, s16*);
-void mRlib_spdF_Angle_to_spdXZ(xyz_t*, f32*, s16*);
-void mRlib_position_move_for_sloop(struct Actor*, s_xyz*);
-void mRlib_Get_norm_Clif(struct Actor*, xyz_t*);
-void mRlib_Roll_Matrix_to_s_xyz(struct Actor*, void*, s16);
-s16 mRlib_Get_HitWallAngleY(struct Actor*);
-void mRlib_Station_step_modify_to_wall(struct Actor*);
-s32 mRlib_Set_Position_Check(struct Actor*);
-s32 mRlib_HeightGapCheck_And_ReversePos(void);
-// void func_800CEC30_jp();
-s32 mRlib_Get_ground_norm_inHole(struct Actor*, xyz_t*, f32*, s16*, s16*, f32);
-// void func_800CEE24_jp();
-// void func_800CEED4_jp();
-// void func_800CF05C_jp();
-// void func_800CF16C_jp();
-
-#endif
diff --git a/include/m_actor.h b/include/m_actor.h
index 955be5d..819d7dc 100644
--- a/include/m_actor.h
+++ b/include/m_actor.h
@@ -111,9 +111,9 @@ typedef struct Actor {
/* 0x074 */ f32 speed;
/* 0x078 */ f32 gravity;
/* 0x07C */ f32 terminalVelocity;
- /* 0x080 */ UNK_TYPE1 unk_080[0x18];
- /* 0x098 */ mCoBG_CheckResult colResult;
- /* 0x09C */ UNK_TYPE1 unk_09C[0x19];
+ /* 0x080 */ UNK_TYPE1 unk_080[0x4];
+ /* 0x084 */ mCoBG_Check colCheck;
+ /* 0x0B4 */ UNK_TYPE1 unk_0B4[0x1];
/* 0x0B5 */ u8 isDrawn;
/* 0x0B6 */ s16 yawTowardsPlayer;
/* 0x0B8 */ f32 xyzDistToPlayerSq;
diff --git a/include/m_collision_bg.h b/include/m_collision_bg.h
index 3294cd1..f02ba47 100644
--- a/include/m_collision_bg.h
+++ b/include/m_collision_bg.h
@@ -35,6 +35,12 @@ typedef union mCoBG_unkStructUnion {
u32 raw;
} mCoBG_unkStructUnion;
+// collision bg wall info
+typedef struct mCoBG_WallInfo {
+ /* 0x0 */ s16 angleY;
+ /* 0x2 */ s16 type;
+} mCoBG_WallInfo; // size = 0x4
+
// collision bg result data
typedef struct mCoBG_CheckResult {
u32 onGround:1; // [31] on_ground
@@ -53,6 +59,14 @@ typedef struct mCoBG_CheckResult {
u32 unk13:4; // [3:0] unk_flag6
} mCoBG_CheckResult;
+typedef struct mCoBG_Check{
+ /* 0x00 */ u8 unk0[0x11];
+ /* 0x11 */ mCoBG_CheckResult colResult;
+ /* 0x14 */ u8 unk14[0xC];
+ /* 0x20 */ mCoBG_WallInfo wallInfo[2];
+ /* 0x2C */ s16 unk20;
+}mCoBG_Check; // size = 0x30
+
// void func_80067430_jp();
// void func_800674B0_jp();
// void func_800674D8_jp();
@@ -249,11 +263,11 @@ s32 func_8007244C_jp(u32);
s32 mCoBG_SearchWaterLimitDistN(UNK_TYPE* arg0, xyz_t arg1, s16 arg4, f32 arg5, s32 arg6);
// void func_80072E70_jp();
f32 mCoBG_GetBalloonGroundY(xyz_t*);
-// void func_800730C8_jp();
+s32 mCoBG_CheckAttribute_BallRolling(s16*, xyz_t*);
// void func_800731A8_jp();
-// void func_800732DC_jp();
+f32 mCoBG_CheckBallRollingArea(s16, xyz_t*);
// void func_800734BC_jp();
-// void func_8007352C_jp();
+s32 mCoBG_ExistHeightGap_KeepAndNow_Detail(xyz_t);
// void func_80073680_jp();
// void func_80073718_jp();
// void func_80073784_jp();
diff --git a/include/m_field_info.h b/include/m_field_info.h
index 352fdf2..6d6457c 100644
--- a/include/m_field_info.h
+++ b/include/m_field_info.h
@@ -11,6 +11,13 @@ struct Game_Play;
struct FieldMakeBlockInfo;
struct FieldMakeMoveActor;
+#define FI_UT_WORLDSIZE_Z 40
+#define FI_UT_WORLDSIZE_Z_F (f32)FI_UT_WORLDSIZE_Z
+#define FI_UT_WORLDSIZE_X 40
+#define FI_UT_WORLDSIZE_X_F (f32)FI_UT_WORLDSIZE_Z
+#define FI_UT_BASE_SIZE 40
+#define FI_UT_BASE_SIZE_F ((f32)FI_UT_BASE_SIZE)
+
typedef enum FieldType {
/* 0 */ FI_FIELDTYPE_FG,
/* 1 */ FI_FIELDTYPE_1,
diff --git a/include/m_roll_lib.h b/include/m_roll_lib.h
new file mode 100644
index 0000000..9cfa25d
--- /dev/null
+++ b/include/m_roll_lib.h
@@ -0,0 +1,28 @@
+#ifndef M_ROLL_LIB_H
+#define M_ROLL_LIB_H
+
+#include "ultra64.h"
+
+struct xyz_t;
+struct Actor;
+struct s_xyz;
+struct Game_Play;
+
+void mRlib_spdXZ_to_spdF_Angle(struct xyz_t* speed, f32* speedf, s16* angle);
+void mRlib_spdF_Angle_to_spdXZ(struct xyz_t* speed, f32* speedf, s16* angle);
+s32 mRlib_position_move_for_sloop(struct Actor* actor, struct s_xyz* slopeAngle);
+s32 mRlib_Get_norm_Clif(struct Actor* actor, struct xyz_t* norm);
+void mRlib_Roll_Matrix_to_s_xyz(struct Actor* actor, struct s_xyz* rot, s16 angle);
+s16 mRlib_Get_HitWallAngleY(struct Actor* actor);
+void mRlib_Station_step_modify_to_wall(struct Actor* actor);
+s32 mRlib_Set_Position_Check(struct Actor* actor);
+s32 mRlib_HeightGapCheck_And_ReversePos(struct Actor* actor);
+s32 mRlib_Hole_check(struct Actor* actor);
+s32 mRlib_Get_ground_norm_inHole(struct Actor* actor, struct xyz_t* norm, f32* dist, s16* angleY, s16* angleRate, f32 rate);
+s32 mRlib_PSnowmanTouchCheck(const struct xyz_t* wpos);
+s32 mRlib_PSnowmanBreakCheck(struct Actor* actor, struct Game_Play* play, f32* speed);
+s32 mRlib_PSnowmanBreakNeckSwing(f32 f0, f32 scale, s16* angleY);
+s32 mRlib_PSnowman_NormalTalk(struct Actor* actor, struct Game_Play* play, f32* speed, void* proc);
+
+
+#endif
diff --git a/include/z64math.h b/include/z64math.h
index b533ba2..f7aac28 100644
--- a/include/z64math.h
+++ b/include/z64math.h
@@ -84,6 +84,8 @@ typedef union {
#define DEG_TO_BINANG_ALT(degrees) TRUNCF_BINANG(((degrees) / 180.0f) * 0x8000)
#define DEG_TO_BINANG_ALT2(degrees) TRUNCF_BINANG(((degrees) * 0x10000) / 360.0f)
#define DEG_TO_BINANG_ALT3(degrees) ((degrees) * (0x8000 / 180.0f))
+#define DEG_TO_BINANG_ALT4(degrees) (TRUNCF_BINANG((degrees) * (0x10000 / 360.0f)))
+
#define RAD_TO_DEG(radians) ((radians) * (180.0f / (f32)M_PI))
#define RAD_TO_BINANG(radians) TRUNCF_BINANG((radians) * (0x8000 / (f32)M_PI))
diff --git a/linker_scripts/jp/symbol_addrs_code.txt b/linker_scripts/jp/symbol_addrs_code.txt
index f093435..242936e 100644
--- a/linker_scripts/jp/symbol_addrs_code.txt
+++ b/linker_scripts/jp/symbol_addrs_code.txt
@@ -800,11 +800,11 @@ func_80072C60_jp = 0x80072C60; // type:func
mCoBG_SearchWaterLimitDistN = 0x80072CC4; // type:func
func_80072E70_jp = 0x80072E70; // type:func
mCoBG_GetBalloonGroundY = 0x80072F9C; // type:func
-func_800730C8_jp = 0x800730C8; // type:func
+mCoBG_CheckAttribute_BallRolling = 0x800730C8; // type:func
func_800731A8_jp = 0x800731A8; // type:func
-func_800732DC_jp = 0x800732DC; // type:func
+mCoBG_CheckBallRollingArea = 0x800732DC; // type:func
func_800734BC_jp = 0x800734BC; // type:func
-func_8007352C_jp = 0x8007352C; // type:func
+mCoBG_ExistHeightGap_KeepAndNow_Detail = 0x8007352C; // type:func
func_80073680_jp = 0x80073680; // type:func
func_80073718_jp = 0x80073718; // type:func
func_80073784_jp = 0x80073784; // type:func
@@ -3256,12 +3256,12 @@ mRlib_Get_HitWallAngleY = 0x800CE874; // type:func
mRlib_Station_step_modify_to_wall = 0x800CE8F0; // type:func
mRlib_Set_Position_Check = 0x800CE9C4; // type:func
mRlib_HeightGapCheck_And_ReversePos = 0x800CEB1C; // type:func
-func_800CEC30_jp = 0x800CEC30; // type:func
+mRlib_Hole_check = 0x800CEC30; // type:func
mRlib_Get_ground_norm_inHole = 0x800CEC98; // type:func
-func_800CEE24_jp = 0x800CEE24; // type:func
-func_800CEED4_jp = 0x800CEED4; // type:func
-func_800CF05C_jp = 0x800CF05C; // type:func
-func_800CF16C_jp = 0x800CF16C; // type:func
+mRlib_PSnowmanTouchCheck = 0x800CEE24; // type:func
+mRlib_PSnowmanBreakCheck = 0x800CEED4; // type:func
+mRlib_PSnowmanBreakNeckSwing = 0x800CF05C; // type:func
+mRlib_PSnowman_NormalTalk = 0x800CF16C; // type:func
wallpaper_draw1 = 0x800CF240; // type:func
wallpaper_draw = 0x800CF6EC; // type:func
gfx_SetUpCFB = 0x800CF780; // type:func
diff --git a/src/code/m_roll_lib.c b/src/code/m_roll_lib.c
new file mode 100644
index 0000000..775f1fc
--- /dev/null
+++ b/src/code/m_roll_lib.c
@@ -0,0 +1,294 @@
+#include "m_roll_lib.h"
+#include "z64math.h"
+#include "m_field_info.h"
+#include "m_field_make.h"
+#include "overlays/gamestates/ovl_play/m_play.h"
+#include "overlays/actors/player_actor/m_player.h"
+#include "m_player_lib.h"
+#include "sys_math_atan.h"
+#include "m_collision_bg.h"
+#include "69E2C0.h"
+#include "macros.h"
+
+void mRlib_spdXZ_to_spdF_Angle(xyz_t* speed, f32* speedf, s16* angle) {
+ f32 x = speed->x;
+ f32 z = speed->z;
+
+ speedf[0] = sqrtf(x * x + z * z);
+ angle[0] = atans_table(z, x);
+}
+
+void mRlib_spdF_Angle_to_spdXZ(xyz_t* speed, f32* speedf, s16* angle) {
+ speed->x = speedf[0] * sin_s(angle[0]);
+ speed->z = speedf[0] * cos_s(angle[0]);
+}
+
+s32 mRlib_position_move_for_sloop(Actor* actor, s_xyz* slopeAngle) {
+ UNUSED s32 pad;
+ f32 y;
+ f32 x;
+ f32 z;
+
+ if (actor->colCheck.colResult.onGround && (slopeAngle->x != 0 || slopeAngle->z != 0)) {
+ x = (actor->velocity.x * ABS(cos_s(slopeAngle->z)));
+ y = actor->velocity.y;
+ z = (actor->velocity.z * ABS(cos_s(slopeAngle->x)));
+
+ actor->world.pos.x += x + actor->colStatus.displacement.x;
+ actor->world.pos.y += y + actor->colStatus.displacement.y;
+ actor->world.pos.z += z + actor->colStatus.displacement.z;
+
+ return TRUE;
+ } else {
+ Actor_position_move(actor);
+ return FALSE;
+ }
+}
+
+s32 mRlib_Get_norm_Clif(Actor* actor, xyz_t* norm) {
+ s16 angles[2];
+ s16 angle;
+ f32 percent;
+ s32 i;
+
+ if (mCoBG_CheckAttribute_BallRolling(angles, &actor->world.pos)) {
+
+ for (i = 0; i < 2; i++) {
+ percent = mCoBG_CheckBallRollingArea(angles[i], &actor->world.pos);
+
+ if (percent > 0.0f && percent < 0.5f) {
+ xyz_t rot;
+ xyz_t pos;
+ angle = angles[i] + DEG_TO_BINANG_ALT2(90.0f);
+ pos = *norm;
+
+ rot.x = sin_s(angle);
+ rot.y = 0.0f;
+ rot.z = cos_s(angle);
+
+ Matrix_RotateVector(DEG_TO_BINANG_ALT4((0.5f - percent) * 80.0f), &rot, 0);
+ Matrix_Position(&pos, norm);
+
+ return TRUE;
+ }
+ }
+ }
+ return FALSE;
+}
+
+void mRlib_Roll_Matrix_to_s_xyz(Actor* actor, s_xyz* rot, s16 angle) {
+ MtxF matrix;
+ xyz_t axis;
+
+ axis.x = cos_s(actor->world.rot.y);
+ axis.z = -sin_s(actor->world.rot.y);
+ axis.y = 0.0f;
+
+ Matrix_RotateVector(angle, &axis, 0);
+ Matrix_rotateXYZ(rot->x, rot->y, rot->z, 1);
+ Matrix_get(&matrix);
+ Matrix_to_rotate2_new(&matrix, rot, 0);
+}
+
+s16 mRlib_Get_HitWallAngleY(Actor* actor) {
+ u16 angle = actor->colCheck.wallInfo[0].angleY;
+ u16 angle2;
+ s16 median;
+
+ if (actor->colCheck.colResult.unk3 != 1) {
+ angle2 = actor->colCheck.wallInfo[1].angleY;
+ median = (angle + angle2) >> 1;
+
+ if (ABS(angle - angle2) > 0x8000) {
+ median += 0x8000;
+ }
+ } else {
+ median = angle;
+ }
+
+ return median;
+}
+
+void mRlib_Station_step_modify_to_wall(Actor* actor) {
+ s_xyz angle;
+ f32 z;
+
+ mCoBG_GetBgY_AngleS_FromWpos(&angle, actor->world.pos, 0.0f);
+
+ if (angle.x >= DEG_TO_BINANG_ALT2(45.0f)) {
+ actor->colCheck.colResult.hitWall |= 3;
+ z = FI_UT_WORLDSIZE_Z_F + ((s32)(actor->world.pos.z / FI_UT_WORLDSIZE_Z_F) * FI_UT_WORLDSIZE_Z);
+ actor->colCheck.wallInfo[0].angleY = 0.0f;
+ actor->colCheck.colResult.unk3 = 1;
+ actor->world.pos.z = z;
+ }
+}
+
+s32 mRlib_Set_Position_Check(Actor* actor) {
+ s32 bx;
+ s32 bz;
+ s32 utX;
+ s32 utZ;
+ s32 set;
+ s32 ofsX;
+ s32 ofsZ;
+
+ mFI_Wpos2BkandUtNuminBlock(&bx, &bz, &utX, &utZ, actor->world.pos);
+
+ set = mNpc_CheckNpcSet(bx, bz, utX, utZ);
+ if (set == FALSE) {
+ for (ofsX = -1; ofsX < 2; ofsX++) {
+ for (ofsZ = -1; ofsZ < 2; ofsZ++) {
+ if ((ofsX != 0 || ofsZ != 0) && (utX + ofsX) < UT_X_NUM && (utX + ofsX) > 0 &&
+ (utZ + ofsZ) < UT_Z_NUM && (utZ + ofsZ) > 0) {
+ set = mNpc_CheckNpcSet(bx, bz, utX + ofsX, utZ + ofsZ);
+ }
+
+ if (set == TRUE) {
+ f32 y = actor->world.pos.y;
+
+ mFI_BkandUtNum2CenterWpos(&actor->world.pos, bx, bz, utX + ofsX, utZ + ofsZ);
+ actor->world.pos.y = y;
+
+ return set;
+ }
+ }
+ }
+ }
+
+ return set;
+}
+
+s32 mRlib_HeightGapCheck_And_ReversePos(Actor* actor) {
+ s32 bx;
+ s32 bz;
+ s32 utX;
+ s32 utZ;
+
+ if (mFI_GetPlayerWade() == 2 && mCoBG_ExistHeightGap_KeepAndNow_Detail(actor->world.pos)) {
+ if (mRlib_Set_Position_Check(actor) != FALSE) {
+ actor->velocity.y = 0.0f;
+ } else {
+ mFI_Wpos2BkandUtNuminBlock(&bx, &bz, &utX, &utZ, actor->world.pos);
+
+ if (mNpc_GetMakeUtNuminBlock_hard_area(&utX, &utZ, bx, bz, 0)) {
+ f32 y = actor->world.pos.y;
+
+ mFI_BkandUtNum2CenterWpos(&actor->world.pos, bx, bz, utX, utZ);
+ actor->world.pos.y = y;
+ actor->velocity.y = 0.0f;
+
+ return TRUE;
+ }
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+s32 mRlib_Hole_check(Actor* actor) {
+ u16* unitFG = mFI_GetUnitFG(actor->world.pos);
+
+ if (unitFG != NULL && ((unitFG[0] >= 0x11 && unitFG[0] <= 0x29) || unitFG[0] == 0x5D)) {
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+s32 mRlib_Get_ground_norm_inHole(Actor* actor, xyz_t* norm, f32* dist, s16* angleY, s16* angleRate, f32 rate) {
+ if (mRlib_Hole_check(actor) != FALSE) {
+ xyz_t centerPos;
+
+ mFI_Wpos2UtCenterWpos(&centerPos, actor->world.pos);
+ dist[0] = search_position_distance(&actor->world.pos, &centerPos);
+ angleRate[0] = DEG_TO_BINANG_ALT4((dist[0] * 90.0f) * 0.0325f);
+ angleRate[0] = (angleRate[0] * rate);
+ angleY[0] = atans_table(actor->world.pos.z - centerPos.z, actor->world.pos.x - centerPos.x);
+
+ norm->x = (-cos_s(angleRate[0])) * sin_s(angleY[0]);
+ norm->y = -sin_s(angleRate[0]);
+ norm->z = (-cos_s(angleRate[0])) * cos_s(angleY[0]);
+
+ return TRUE;
+ } else {
+ dist[0] = 0.0f;
+
+ return FALSE;
+ }
+}
+
+s32 mRlib_PSnowmanTouchCheck(const xyz_t* wpos) {
+ if (ABS(wpos->x) < FI_UT_WORLDSIZE_X_F && ABS(wpos->z) < FI_UT_WORLDSIZE_Z_F && ABS(wpos->y) < FI_UT_BASE_SIZE_F) {
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+s32 mRlib_PSnowmanBreakCheck(Actor* actor, Game_Play* play, f32* speed) {
+ Player* player = get_player_actor_withoutCheck(play);
+ xyz_t posDiff;
+ f32 y = actor->world.pos.y;
+
+ actor->world.pos.y = mCoBG_GetBgY_OnlyCenter_FromWpos2(actor->world.pos, 0.0f);
+ xyz_t_sub(&actor->world.pos, &player->actor.world.pos, &posDiff);
+ actor->world.pos.y = y;
+
+ if (mRlib_PSnowmanTouchCheck(&posDiff)) {
+ if (Math3d_normalizeXyz_t(&posDiff)) {
+ xyz_t velocity = player->actor.velocity;
+ f32 dist = (posDiff.x * velocity.x) + (posDiff.z * velocity.z);
+
+ if (dist > 0.0f) {
+ speed[0] += dist;
+ } else {
+ add_calc0(speed, 30.0f / 100.0f, 20.0f);
+ }
+ if (speed[0] > 200.0f) {
+ return TRUE;
+ }
+ } else {
+ add_calc0(speed, 30.0f / 100.0f, 20.0f);
+ }
+ } else {
+ add_calc0(speed, 30.0f / 100.0f, 20.0f);
+ }
+ return FALSE;
+}
+
+s32 mRlib_PSnowmanBreakNeckSwing(f32 f0, f32 scale, s16* angleY) {
+ s16 rotX;
+ s16 rotZ;
+ s16 angle;
+
+ if (f0 > 20.0f) {
+ angleY[0] += (s16)((f0 * 40.0f));
+ angle = angleY[0] & 0x7000;
+ rotX = (4.5f * f0) * sin_s(angle);
+ rotZ = (4.5f * f0) * cos_s(angle);
+
+ Matrix_translate(0.0f, -1400.0f * scale, 0.0f, 1);
+ Matrix_rotateXYZ(rotX, 0, rotZ, 1);
+ Matrix_translate(0.0f, 1400.0f * scale, 0.0f, 1);
+ }
+}
+
+s32 mRlib_PSnowman_NormalTalk(Actor* actor, Game_Play* play, f32* speed, void* proc) {
+ if (mDemo_Check(7, actor) == FALSE) {
+ f32 y;
+
+ if (mRlib_PSnowmanBreakCheck(actor, play, speed) != FALSE) {
+ return FALSE;
+ }
+ y = actor->world.pos.y;
+ actor->world.pos.y = mCoBG_GetBgY_AngleS_FromWpos(NULL, actor->world.pos, 0.0f);
+ mDemo_Request(7, actor, proc);
+ actor->world.pos.y = y;
+ } else {
+ add_calc0(speed, 3.0f / 10.0f, 20.0f);
+ }
+
+ return TRUE;
+}
diff --git a/src/overlays/actors/ovl_Airplane/ac_airplane.c b/src/overlays/actors/ovl_Airplane/ac_airplane.c
index 69f2b1b..3b0dcad 100644
--- a/src/overlays/actors/ovl_Airplane/ac_airplane.c
+++ b/src/overlays/actors/ovl_Airplane/ac_airplane.c
@@ -78,14 +78,14 @@ void aAp_RubberMove(f32* pValue, f32 target, f32 step) {
}
void aAp_FallByWall(Airplane* this) {
- if (this->actor.colResult.hitWall != 0) {
+ if (this->actor.colCheck.colResult.hitWall != 0) {
this->state = Ap_STATE_FALL_FLY_MOVE;
}
}
void aAp_GroundFriction(Airplane* this, Game_Play* game_play) {
- if (this->actor.colResult.onGround) {
+ if (this->actor.colCheck.colResult.onGround) {
aAp_RubberMove(&this->speed, 0.0f, 0.6f);
if (this->speed < 1.0f) {
this->state = Ap_STATE_STOP_FLY_MOVE;
@@ -201,7 +201,7 @@ void aAp_FallFlyMove(Airplane* this, Game_Play* game_play) {
aAp_RubberMove(&this->xRot, 60.0f, 0.04f);
aAp_RubberMove(&this->speed, 5.0f, 0.02f);
this->actor.world.pos.y -= 0.15f;
- if (this->actor.colResult.onGround) {
+ if (this->actor.colCheck.colResult.onGround) {
common_data.clip.unk_090->unk_00(1, this->actor.world.pos, 1, this->actor.world.rot.y, game_play,
this->actor.fgName, 0, 8);
this->state = Ap_STATE_STOP_FLY_MOVE;
@@ -212,7 +212,7 @@ void aAp_FallFlyMove2(Airplane* this, Game_Play* game_play) {
aAp_RubberMove(&this->xRot, 70.0f, 0.15f);
aAp_RubberMove(&this->speed, 10.0f, 0.02f);
this->actor.world.pos.y -= 0.15f;
- if (this->actor.colResult.onGround) {
+ if (this->actor.colCheck.colResult.onGround) {
common_data.clip.unk_090->unk_00(1, this->actor.world.pos, 1, this->actor.world.rot.y, game_play,
this->actor.fgName, 0, 8);
this->state = Ap_STATE_STOP_FLY_MOVE;
diff --git a/src/overlays/actors/ovl_Ball/ac_ball.c b/src/overlays/actors/ovl_Ball/ac_ball.c
index ba0f82e..87879d9 100644
--- a/src/overlays/actors/ovl_Ball/ac_ball.c
+++ b/src/overlays/actors/ovl_Ball/ac_ball.c
@@ -7,7 +7,7 @@
#include "libc/math.h"
#include "m_npc.h"
#include "audio.h"
-#include "6F2150.h"
+#include "m_roll_lib.h"
#include "m_field_info.h"
#include "sys_math_atan.h"
#include "m_player_lib.h"
@@ -227,7 +227,7 @@ void aBALL_position_move(Ball* this) {
mCoBG_GetBgY_AngleS_FromWpos(&slopeAngle, this->actor.world.pos, 0.0f);
- if (this->actor.colResult.onGround || this->actor.colResult.inWater) {
+ if (this->actor.colCheck.colResult.onGround || this->actor.colCheck.colResult.inWater) {
chase_f(&this->actor.speed, this->maxSpeed, this->acceleration);
}
@@ -258,7 +258,7 @@ void aBALL_BGcheck(Ball* this) {
yVelocity = this->actor.velocity.y;
if ((this->process == aBALL_process_air_water) || (this->process == aBALL_process_ground_water) ||
- (this->actor.colResult.unk5 == 0xB)) {
+ (this->actor.colCheck.colResult.unk5 == 0xB)) {
mCoBG_BgCheckControll(&this->bgPos, &this->actor, 12.0f, -12.0f, 0, 1, 0);
this->actor.world.pos.x += this->bgPos.x;
this->actor.world.pos.z += this->bgPos.z;
@@ -268,13 +268,13 @@ void aBALL_BGcheck(Ball* this) {
}
if (((this->process == aBALL_process_air) || (this->process == aBALL_process_air_water)) &&
- this->actor.colResult.onGround) {
+ this->actor.colCheck.colResult.onGround) {
if (this->bounceTimer < 3) {
do {
this->bounceTimer++;
} while (0);
- if (this->actor.colResult.inWater) {
+ if (this->actor.colCheck.colResult.inWater) {
this->actor.velocity.y = 0.2f;
} else {
this->actor.velocity.y = -yVelocity * 0.7f;
@@ -282,7 +282,7 @@ void aBALL_BGcheck(Ball* this) {
}
}
- hitWall = this->actor.colResult.hitWall;
+ hitWall = this->actor.colCheck.colResult.hitWall;
if (hitWall & 1) {
wallAngle = mRlib_Get_HitWallAngleY(&this->actor);
rot = this->actor.world.rot.y - wallAngle - 0x8000;
@@ -363,7 +363,7 @@ void aBALL_OBJcheck(Ball* this) {
ballSpeed = sqrtf(SQ(newXVelocity) + SQ(newZVelocity));
ballSpeed = CLAMP_MAX(ballSpeed, 11.0f);
- if (this->actor.colResult.onGround) {
+ if (this->actor.colCheck.colResult.onGround) {
f32 speedFactor;
s16 verticalAngle;
@@ -409,7 +409,7 @@ void aBALL_OBJcheck(Ball* this) {
}
void aBALL_House_Tree_Rev_Check(Ball* this) {
- if (mRlib_HeightGapCheck_And_ReversePos() != 1) {
+ if (mRlib_HeightGapCheck_And_ReversePos(&this->actor) != 1) {
this->unk_208 |= BALL_208_FLAG_1;
Actor_delete(&this->actor);
}
@@ -435,13 +435,13 @@ void aBALL_process_air(Ball* this, Game_Play* game_play) {
this->actor.terminalVelocity = -20.0f;
this->actor.gravity = 0.6f;
this->speed = this->actor.speed;
- if (this->actor.colResult.onGround) {
- if (this->actor.colResult.inWater) {
+ if (this->actor.colCheck.colResult.onGround) {
+ if (this->actor.colCheck.colResult.inWater) {
aBALL_process_ground_water_init(this, game_play);
} else {
aBALL_process_ground_init(this, game_play);
}
- } else if (this->actor.colResult.inWater) {
+ } else if (this->actor.colCheck.colResult.inWater) {
aBALL_process_air_water_init(this, game_play);
}
}
@@ -518,20 +518,20 @@ void aBALL_process_ground(Ball* this, Game_Play* game_play) {
this->actor.terminalVelocity = -20.0f;
this->actor.gravity = 0.6f;
this->speed = this->actor.speed;
- if (this->actor.colResult.inWater || this->actor.colResult.unk5 == 0xB) {
- if (this->actor.colResult.onGround) {
+ if (this->actor.colCheck.colResult.inWater || this->actor.colCheck.colResult.unk5 == 0xB) {
+ if (this->actor.colCheck.colResult.onGround) {
aBALL_process_ground_water_init(this, game_play);
} else {
this->bounceTimer = 0;
aBALL_process_air_water_init(this, game_play);
}
- } else if (!this->actor.colResult.onGround) {
+ } else if (!this->actor.colCheck.colResult.onGround) {
this->bounceTimer = 0;
aBALL_process_air_init(this, game_play);
return;
}
- if (!(game_play->state.frameCounter & 7) && this->actor.colResult.unk5 == 9) {
+ if (!(game_play->state.frameCounter & 7) && this->actor.colCheck.colResult.unk5 == 9) {
if (this->actor.speed > 1.0f) {
if (this->actor.speed > 4.0f) {
@@ -566,7 +566,7 @@ void aBALL_set_spd_relations_in_water(Ball* this, Game_Play* game_play) {
waterHeight = mCoBG_GetWaterHeight_File(this->actor.world.pos, "../ac_ball.c", 949);
add_calc0(&this->height, 0.5f, 100.0f);
- mCoBG_GetWaterFlow(&flowPos, this->actor.colResult.unk5);
+ mCoBG_GetWaterFlow(&flowPos, this->actor.colCheck.colResult.unk5);
yRot = atans_table(flowPos.z, flowPos.x);
yDiffAngle = ABS((s16)(this->actor.world.rot.y - yRot));
@@ -612,13 +612,13 @@ void aBALL_process_air_water(Ball* this, Game_Play* game_play) {
common_data.clip.unk_0A8->unk_0C(&this->actor.world.pos, 20.0f, 1);
}
- if (this->actor.colResult.onGround) {
- if (this->actor.colResult.inWater) {
+ if (this->actor.colCheck.colResult.onGround) {
+ if (this->actor.colCheck.colResult.inWater) {
aBALL_process_ground_water_init(this, game_play);
- } else if (this->actor.colResult.unk5 != 0xB) {
+ } else if (this->actor.colCheck.colResult.unk5 != 0xB) {
aBALL_process_ground_init(this, game_play);
}
- } else if (!this->actor.colResult.inWater) {
+ } else if (!this->actor.colCheck.colResult.inWater) {
aBALL_process_air_init(this, game_play);
}
}
@@ -634,7 +634,7 @@ void aBALL_process_ground_water(Ball* this, Game_Play* game_play) {
u32 unitAttribute;
xyz_t* bgPos;
- unitAttribute = this->actor.colResult.unk5;
+ unitAttribute = this->actor.colCheck.colResult.unk5;
aBALL_set_spd_relations_in_water(this, game_play);
this->speed = this->actor.speed;
@@ -642,11 +642,11 @@ void aBALL_process_ground_water(Ball* this, Game_Play* game_play) {
if (common_data.clip.unk_0A8 != NULL) {
common_data.clip.unk_0A8->unk_0C(&this->actor.world.pos, 20.0f, 1);
}
- if (this->actor.colResult.onGround) {
- if (!this->actor.colResult.inWater && (unitAttribute != 0xB) && (unitAttribute != 0x16)) {
+ if (this->actor.colCheck.colResult.onGround) {
+ if (!this->actor.colCheck.colResult.inWater && (unitAttribute != 0xB) && (unitAttribute != 0x16)) {
aBALL_process_ground_init(this, game_play);
}
- } else if (!this->actor.colResult.inWater) {
+ } else if (!this->actor.colCheck.colResult.inWater) {
aBALL_process_air_init(this, game_play);
} else {
aBALL_process_air_water_init(this, game_play);
@@ -725,7 +725,7 @@ void aBALL_status_check(Ball* this, Game_Play* game_play) {
}
}
if (!(this->unk_208 & BALL_208_FLAG_1)) {
- if (this->actor.colResult.inWater) {
+ if (this->actor.colCheck.colResult.inWater) {
sAdo_OngenTrgStart(0x27, &this->actor.world.pos);
this->unk_208 |= BALL_208_FLAG_1;
if (common_data.clip.unk_0A8 != NULL) {
@@ -748,7 +748,7 @@ void aBALL_actor_move(Actor* thisx, Game_Play* game_play) {
aBALL_House_Tree_Rev_Check(this);
if (!((this->actor.flags) & ACTOR_FLAG_40)) {
- if ((this->actor.colResult.inWater) || (this->unk_208 & BALL_208_FLAG_2)) {
+ if ((this->actor.colCheck.colResult.inWater) || (this->unk_208 & BALL_208_FLAG_2)) {
Actor_delete(&this->actor);
}
if (this->actor.speed == 0.0f) {
diff --git a/src/overlays/actors/ovl_Fuusen/ac_fuusen.c b/src/overlays/actors/ovl_Fuusen/ac_fuusen.c
index 937a47b..e4dc970 100644
--- a/src/overlays/actors/ovl_Fuusen/ac_fuusen.c
+++ b/src/overlays/actors/ovl_Fuusen/ac_fuusen.c
@@ -210,7 +210,7 @@ void aFSN_moving(Actor* thisx, Game_Play* game_play) {
Game_play_Projection_Trans(game_play, &this->actor.world.pos, &screenPos);
if (!(screenPos.x < -40.0f) && !(screenPos.x > 360.0f) && !(screenPos.y < -40.0f) && !(screenPos.y > 280.0f)) {
mCoBG_BgCheckControll(NULL, &this->actor, 12.0f, 0, 0, 0, 0);
- if (this->actor.colResult.hitWall & 1 || this->actor.colResult.unk1 & 1) {
+ if (this->actor.colCheck.colResult.hitWall & 1 || this->actor.colCheck.colResult.unk1 & 1) {
this->heightOffset += 0.01f;
if (this->heightOffset >= 300.0f) {
this->heightOffset = 300.0f;
diff --git a/yamls/jp/code.yaml b/yamls/jp/code.yaml
index d66f54f..b02d016 100644
--- a/yamls/jp/code.yaml
+++ b/yamls/jp/code.yaml
@@ -86,7 +86,7 @@
- [0x6EE540, c, code/m_view]
- [0x6EFC20, asm, code/6EFC20]
- [0x6F12E0, asm, code/6F12E0]
- - [0x6F2150, asm, code/6F2150]
+ - [0x6F2150, c, code/m_roll_lib]
- [0x6F2EE0, c, code/PreRender]
- [0x6F5180, c, code/THA_GA]
- [0x6F5390, c, code/TwoHeadArena]
@@ -256,7 +256,7 @@
- [0x73B7D0, .rodata, code/m_view]
- [0x73B7E0, rodata, code/73B7E0]
- [0x73B830, rodata, code/73B830]
- - [0x73B880, rodata, code/73B880]
+ - [0x73B880, .rodata, code/m_roll_lib]
- [0x73B890, .rodata, code/audio]
- [0x73B920, .rodata, code/audioMgr]
- [0x73B960, rodata, code/73B960]