summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMax Roncace <me@caseif.net>2025-11-27 17:28:39 -0500
committerGitHub <noreply@github.com>2025-11-27 14:28:39 -0800
commit767caeecc3e374779cccc9960b6546b74e7a9e50 (patch)
treed4bb7dbab1ae12cf40dc83ac9aec1efd337db907 /include
parentf8d6c5fe1bc9db56528179f5119b6ea0403aa329 (diff)
d_a_npc_ykm debug almost matching (#2877)
Diffstat (limited to 'include')
-rw-r--r--include/d/actor/d_a_npc.h202
-rw-r--r--include/d/actor/d_a_npc_ykm.h48
-rw-r--r--include/d/actor/d_a_obj_gadget.h2
-rw-r--r--include/d/actor/d_a_tag_evtarea.h3
4 files changed, 133 insertions, 122 deletions
diff --git a/include/d/actor/d_a_npc.h b/include/d/actor/d_a_npc.h
index 59bf616126..875d7b87f3 100644
--- a/include/d/actor/d_a_npc.h
+++ b/include/d/actor/d_a_npc.h
@@ -115,6 +115,106 @@ public:
/* 8014D0C0 */ virtual ~daNpcT_MotionSeqMngr_c() {}
};
+class daNpcT_Hermite_c {
+public:
+ /* 0x00 */ f32 field_0x00;
+ /* 0x04 */ f32 H00;
+ /* 0x08 */ f32 H01;
+ /* 0x0C */ f32 H10;
+ /* 0x10 */ f32 H11;
+
+ /* 8014CBAC */ virtual ~daNpcT_Hermite_c() {}
+
+ f32 GetH00() { return H00; }
+ f32 GetH01() { return H01; }
+ f32 GetH10() { return H10; }
+ f32 GetH11() { return H11; }
+
+ void Set(f32 param_1) {
+ field_0x00 = param_1;
+ f32 cubed = param_1 * param_1 * param_1;
+ f32 sqr = param_1 * param_1;
+
+ H00 = 1.0f + (2.0f * cubed - 3.0f * sqr);
+ H01 = -2.0f * cubed + 3.0f * sqr;
+ H10 = param_1 + (cubed - 2.0f * sqr);
+ H11 = cubed - sqr;
+ }
+};
+
+class daNpcT_Path_c {
+public:
+ /* 0x00 */ dPath* mPathInfo;
+ /* 0x04 */ cXyz mPosition;
+ /* 0x10 */ f32 field_0x10;
+ /* 0x14 */ f32 field_0x14;
+ /* 0x18 */ f32 field_0x18;
+ /* 0x1C */ u16 mIdx;
+ /* 0x1E */ u16 field_0x1E;
+ /* 0x20 */ u8 mDirection;
+ /* 0x21 */ u8 mIsClosed;
+
+ /* 80145B7C */ void hermite(cXyz&, cXyz&, cXyz&, cXyz&, daNpcT_Hermite_c&, cXyz&);
+ /* 80145C40 */ void initialize();
+ /* 80145C74 */ int setPathInfo(u8, s8, u8);
+ /* 80145D2C */ int setNextPathInfo(s8, u8);
+ /* 80145DA0 */ void reverse();
+ void setNextIdx() { setNextIdx(getNumPnts()); }
+ /* 80145DD0 */ int setNextIdx(int);
+ int getDstPos(cXyz i_pnt, cXyz* o_pos_p) {
+ return getDstPos(i_pnt, o_pos_p, getNumPnts());
+ }
+ /* 80145E38 */ int getDstPos(cXyz, cXyz*, int);
+ /* 80145FB4 */ int getDstPosH(cXyz, cXyz*, int, int);
+ /* 80146188 */ int chkPassed1(cXyz, int);
+ /* 801464D8 */ int chkPassed2(cXyz, cXyz*, int, int);
+#if DEBUG
+ int drawDbgInfo(f32, int);
+#endif
+
+ daNpcT_Path_c() {
+ initialize();
+ }
+
+ virtual ~daNpcT_Path_c() {}
+
+ Vec getPntPos(int i_idx) { return mPathInfo->m_points[i_idx].m_position; }
+
+ int getArg0() { return mPathInfo->m_points[mIdx].mArg0; }
+ int getArg1() { return mPathInfo->m_points[mIdx].mArg1; }
+ int getArg2() { return mPathInfo->m_points[mIdx].mArg2; }
+
+ int chkClose() {
+ return dPath_ChkClose(mPathInfo);
+ }
+
+ bool chkReverse() { return mDirection == 1; }
+
+ int getNumPnts() { return mPathInfo->m_num; }
+
+ void setIdx(int i_idx) { mIdx = i_idx; }
+
+ const int getIdx() { return mIdx; }
+
+ dPath* getPathInfo() { return mPathInfo; }
+
+ void onReverse() {
+ mDirection = 1;
+ field_0x1E = 1;
+ }
+
+ void offReverse() {
+ mDirection = 0;
+ field_0x1E = 1;
+ }
+
+ bool checkReverse() {
+ return mDirection == 1;
+ }
+
+ BOOL chkNextId() { return mPathInfo->m_nextID != 0xFFFF; }
+};
+
class daNpcT_JntAnm_c {
private:
/* 0x000 */ daNpcT_ActorMngr_c mActrMngr;
@@ -350,6 +450,8 @@ public:
/* 80147E3C */ void calc(BOOL);
void initialize() {
+ //TODO: Separate decl is fakematch, but using 0 directly in the setall call causes
+ // weird issues in some functions that call this.
u8 zero = 0;
for (int i = 0; i < 2; i++) {
mAngle[i].setall(zero);
@@ -412,106 +514,6 @@ struct daNpcT_motionAnmData_c {
/* 0x1A */ s16 field_0x1a;
};
-class daNpcT_Hermite_c {
-public:
- /* 0x00 */ f32 field_0x00;
- /* 0x04 */ f32 H00;
- /* 0x08 */ f32 H01;
- /* 0x0C */ f32 H10;
- /* 0x10 */ f32 H11;
-
- /* 8014CBAC */ virtual ~daNpcT_Hermite_c() {}
-
- f32 GetH00() { return H00; }
- f32 GetH01() { return H01; }
- f32 GetH10() { return H10; }
- f32 GetH11() { return H11; }
-
- void Set(f32 param_1) {
- field_0x00 = param_1;
- f32 cubed = param_1 * param_1 * param_1;
- f32 sqr = param_1 * param_1;
-
- H00 = 1.0f + (2.0f * cubed - 3.0f * sqr);
- H01 = -2.0f * cubed + 3.0f * sqr;
- H10 = param_1 + (cubed - 2.0f * sqr);
- H11 = cubed - sqr;
- }
-};
-
-class daNpcT_Path_c {
-public:
- /* 0x00 */ dPath* mPathInfo;
- /* 0x04 */ cXyz mPosition;
- /* 0x10 */ f32 field_0x10;
- /* 0x14 */ f32 field_0x14;
- /* 0x18 */ f32 field_0x18;
- /* 0x1C */ u16 mIdx;
- /* 0x1E */ u16 field_0x1E;
- /* 0x20 */ u8 mDirection;
- /* 0x21 */ u8 mIsClosed;
-
- /* 80145B7C */ void hermite(cXyz&, cXyz&, cXyz&, cXyz&, daNpcT_Hermite_c&, cXyz&);
- /* 80145C40 */ void initialize();
- /* 80145C74 */ int setPathInfo(u8, s8, u8);
- /* 80145D2C */ int setNextPathInfo(s8, u8);
- /* 80145DA0 */ void reverse();
- void setNextIdx() { setNextIdx(getNumPnts()); }
- /* 80145DD0 */ int setNextIdx(int);
- int getDstPos(cXyz i_pnt, cXyz* o_pos_p) {
- return getDstPos(i_pnt, o_pos_p, getNumPnts());
- }
- /* 80145E38 */ int getDstPos(cXyz, cXyz*, int);
- /* 80145FB4 */ int getDstPosH(cXyz, cXyz*, int, int);
- /* 80146188 */ int chkPassed1(cXyz, int);
- /* 801464D8 */ int chkPassed2(cXyz, cXyz*, int, int);
-#if DEBUG
- int drawDbgInfo(f32, int);
-#endif
-
- daNpcT_Path_c() {
- initialize();
- }
-
- virtual ~daNpcT_Path_c() {}
-
- Vec getPntPos(int i_idx) { return mPathInfo->m_points[i_idx].m_position; }
-
- int getArg0() { return mPathInfo->m_points[mIdx].mArg0; }
- int getArg1() { return mPathInfo->m_points[mIdx].mArg1; }
- int getArg2() { return mPathInfo->m_points[mIdx].mArg2; }
-
- int chkClose() {
- return dPath_ChkClose(mPathInfo);
- }
-
- bool chkReverse() { return mDirection == 1; }
-
- int getNumPnts() { return mPathInfo->m_num; }
-
- void setIdx(int i_idx) { mIdx = i_idx; }
-
- const int getIdx() { return mIdx; }
-
- dPath* getPathInfo() { return mPathInfo; }
-
- void onReverse() {
- mDirection = 1;
- field_0x1E = 1;
- }
-
- void offReverse() {
- mDirection = 0;
- field_0x1E = 1;
- }
-
- bool checkReverse() {
- return mDirection == 1;
- }
-
- BOOL chkNextId() { return mPathInfo->m_nextID != 0xFFFF; }
-};
-
class mDoExt_McaMorfSO;
class daNpcT_c : public fopAc_ac_c {
diff --git a/include/d/actor/d_a_npc_ykm.h b/include/d/actor/d_a_npc_ykm.h
index a731de1d63..a1018d82a4 100644
--- a/include/d/actor/d_a_npc_ykm.h
+++ b/include/d/actor/d_a_npc_ykm.h
@@ -17,7 +17,6 @@
struct daNpc_ykM_HIOParam {
/* 0x00 */ daNpcT_HIOParam common;
/* 0x8C */ s16 step_speed; // ステップの速さ (Step Speed)
- /* 0x8E */ s16 field_0x8e;
/* 0x90 */ f32 attention_dist; // 注目距離 (Attention Distance)
/* 0x94 */ f32 conversation_dist; // 会話距離 (Conversation Distance)
/* 0x98 */ f32 jump_speed; // 飛び出し速度 (Jump Speed)
@@ -29,24 +28,36 @@ struct daNpc_ykM_HIOParam {
/* 0xB0 */ f32 slide_acceleration; // 滑り加速 (Slide Acceleration)
/* 0xB4 */ f32 slide_speed; // 滑り速度 (Slide Speed)
/* 0xB8 */ s16 wait_time; // ウエイト時間 (Wait Time)
- /* 0xBA */ s16 field_0xba;
/* 0xBC */ f32 run_speed; // 走り速度 (Run Speed)
/* 0xC0 */ s16 competition_prm_a; // 競争パラメ−タa (Competition Parameter A)
/* 0xC2 */ s16 competition_prm_b; // 競争パラメ−タb (Competition Parameter B)
/* 0xC4 */ f32 competition_prm_c; // 競争パラメ−タc (Competition Parameter C)
};
-class daNpc_ykM_Param_c : public JORReflexible {
+class daNpc_ykM_Param_c {
public:
-#if DEBUG
- virtual void genMessage(JORMContext*);
-#endif
-
/* 80B5D6C8 */ virtual ~daNpc_ykM_Param_c() {}
static daNpc_ykM_HIOParam const m;
};
+#if DEBUG
+class daNpc_ykM_HIO_c : public mDoHIO_entry_c {
+public:
+ daNpc_ykM_HIO_c();
+ virtual ~daNpc_ykM_HIO_c() {}
+
+ virtual void listenPropertyEvent(const JORPropertyEvent*);
+ virtual void genMessage(JORMContext*);
+
+ daNpc_ykM_HIOParam m;
+};
+
+#define NPC_YKM_HIO_CLASS daNpc_ykM_HIO_c
+#else
+#define NPC_YKM_HIO_CLASS daNpc_ykM_Param_c
+#endif
+
class daNpc_ykM_c : public daNpcT_c {
public:
enum FaceMotion {
@@ -252,7 +263,9 @@ public:
char** i_arcNames)
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
- i_arcNames) {}
+ i_arcNames) {
+ OS_REPORT("|%06d:%x|daNpc_ykM_c -> コンストラクト\n", g_Counter.mCounter0, this);
+ }
/* 80B5D688 */ u16 getEyeballMaterialNo() { return 2; }
/* 80B5D690 */ s32 getHeadJointNo() { return JNT_HEAD; }
/* 80B5D698 */ s32 getNeckJointNo() { return JNT_NECK; }
@@ -262,27 +275,24 @@ public:
u32 getFlowNodeNo() {
u32 rv = (u16)home.angle.x;
-
+ u32 result;
if (rv == 0xFFFF) {
- return -1;
+ result = -1;
+ } else {
+ result = (u16)rv;
}
-
- return rv;
+ return result;
}
- int getBitTRB() { return (fopAcM_GetParam(this) & 0x3F0000) >> 16; }
+ int getBitTRB() { return (u8)((fopAcM_GetParam(this) & 0x3F0000) >> 16); }
u8 getPathID() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; }
- void dComIfGs_setRaceGameTime(u32 i_time) {
- g_dComIfG_gameInfo.info.getMiniGame().setRaceGameTime(i_time);
- }
-
static char* mCutNameList[10];
static cutFunc mCutList[10];
private:
/* 0x0E40 */ mDoExt_McaMorfSO* mFishModelMorf;
/* 0x0E44 */ mDoExt_McaMorfSO* mLeafModelMorf;
- /* 0x0E48 */ u8 field_0xe48[0xe4c - 0xe48];
+ /* 0x0E48 */ NPC_YKM_HIO_CLASS* mpHIO;
/* 0x0E4C */ J3DModel* field_0xe4c[3];
/* 0x0E58 */ dCcD_Cyl field_0xe58;
/* 0x0F94 */ dCcD_Sph field_0xf94[4];
@@ -296,7 +306,7 @@ private:
/* 0x1508 */ cXyz field_0x1508;
/* 0x1514 */ cXyz field_0x1514;
/* 0x1520 */ cXyz field_0x1520;
- /* 0x152C */ u8 field_0x152c[0x1534 - 0x152c];
+ /* 0x152C */ csXyz field_0x152c;
/* 0x1534 */ fpc_ProcID field_0x1534;
/* 0x1538 */ int field_0x1538;
/* 0x153C */ int field_0x153c;
diff --git a/include/d/actor/d_a_obj_gadget.h b/include/d/actor/d_a_obj_gadget.h
index a9c64ae298..5ed070f72f 100644
--- a/include/d/actor/d_a_obj_gadget.h
+++ b/include/d/actor/d_a_obj_gadget.h
@@ -88,7 +88,7 @@ public:
old.pos = current.pos;
}
- int iVar1 = cM_deg2s(param_2);
+ s16 iVar1 = cM_deg2s(param_2);
speed.setall(0.0f);
speed.y = param_1 * cM_ssin(iVar1);
speedF = param_1 * cM_scos(iVar1);
diff --git a/include/d/actor/d_a_tag_evtarea.h b/include/d/actor/d_a_tag_evtarea.h
index 9215979ef5..d4f0db0f68 100644
--- a/include/d/actor/d_a_tag_evtarea.h
+++ b/include/d/actor/d_a_tag_evtarea.h
@@ -13,8 +13,7 @@ public:
/* 8048C94C */ BOOL chkPointInArea(cXyz, cXyz);
/* 8048CD08 */ BOOL chkPointInArea(cXyz param_0) {
- cXyz local_28;
- local_28.set(0.0f, 0.0f, 0.0f);
+ cXyz local_28(0.0f, 0.0f, 0.0f);
return chkPointInArea(param_0, local_28);
}