summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2025-01-27 19:26:14 -0500
committerLagoLunatic <LagoLunatic@users.noreply.github.com>2025-01-27 19:26:14 -0500
commit901bc51f40b875338e5c7552ffd2b58e0cdaae83 (patch)
tree5e9e915efd96e4253286624b33ee4ebe47f35ab9 /include
parent46801e0ee9dce4d085e028a83fef010c066185e3 (diff)
d_a_npc_md work
Diffstat (limited to 'include')
-rw-r--r--include/DynamicLink.h3
-rw-r--r--include/JSystem/JGeometry.h4
-rw-r--r--include/SSystem/SComponent/c_lib.h5
-rw-r--r--include/d/actor/d_a_npc_md.h91
-rw-r--r--include/d/d_com_inf_game.h1
-rw-r--r--include/m_Do/m_Do_ext.h6
6 files changed, 72 insertions, 38 deletions
diff --git a/include/DynamicLink.h b/include/DynamicLink.h
index dd531826..0433926e 100644
--- a/include/DynamicLink.h
+++ b/include/DynamicLink.h
@@ -18,7 +18,8 @@ struct DynamicModuleControlBase {
virtual const char* getModuleName() const { return NULL; }
virtual int getModuleSize() const { return 0; }
virtual const char* getModuleTypeString() const { return "Base"; }
-#ifdef __MWERKS__
+#if __MWERKS__ && __MWERKS__ < 0x4200
+ // This is illegal function overloading, but MWCC for GC allows it. MWCC for Wii does not.
virtual void dump();
#endif
static void dump();
diff --git a/include/JSystem/JGeometry.h b/include/JSystem/JGeometry.h
index be331fa8..72f0cdd3 100644
--- a/include/JSystem/JGeometry.h
+++ b/include/JSystem/JGeometry.h
@@ -213,7 +213,7 @@ struct TVec3<f32> : public Vec {
}
f32 norm = TUtil<f32>::inv_sqrt(sq);
scale(norm * len);
- return sq * norm;
+ return norm * sq;
}
f32 setLength(const TVec3<f32>& b, f32 len) {
@@ -224,7 +224,7 @@ struct TVec3<f32> : public Vec {
}
f32 norm = TUtil<f32>::inv_sqrt(sq);
scale(norm * len, b);
- return sq * norm;
+ return norm * sq;
}
template<typename S>
diff --git a/include/SSystem/SComponent/c_lib.h b/include/SSystem/SComponent/c_lib.h
index 44ac0e8b..a8239554 100644
--- a/include/SSystem/SComponent/c_lib.h
+++ b/include/SSystem/SComponent/c_lib.h
@@ -65,6 +65,11 @@ inline T cLib_minMaxLimit(T val, T min, T max) {
}
template <typename T>
+inline bool cLib_checkMinMaxLimit(T val, T min, T max) {
+ return val >= min && val <= max;
+}
+
+template <typename T>
inline T cLib_maxLimit(T val, T max) {
return (T)((T)val > (T)max ? (T)max : (T)val);
}
diff --git a/include/d/actor/d_a_npc_md.h b/include/d/actor/d_a_npc_md.h
index 14d17062..766aec85 100644
--- a/include/d/actor/d_a_npc_md.h
+++ b/include/d/actor/d_a_npc_md.h
@@ -210,6 +210,26 @@ public:
ACTION_ENDING = -1,
};
+ enum daNpc_Md_StatusBit_e {
+ daMdStts_UNK1 = 0x00000001,
+ daMdStts_UNK2 = 0x00000002,
+ daMdStts_UNK4 = 0x00000004,
+ daMdStts_FLY = 0x00000010,
+ daMdStts_CAM_TAG_IN = 0x00000020,
+ daMdStts_UNK40 = 0x00000040,
+ daMdStts_UNK80 = 0x00000080,
+ daMdStts_XY_TALK = 0x00000100,
+ daMdStts_UNK200 = 0x00000200,
+ daMdStts_UNK400 = 0x00000400,
+ daMdStts_CARRY_ACTION = 0x00000800,
+ daMdStts_SHIP_RIDE = 0x00001000,
+ daMdStts_LIGHT_HIT = 0x00002000,
+ daMdStts_UNK4000 = 0x00004000,
+ daMdStts_LIGHT_BODY_HIT = 0x00008000,
+ daMdStts_DEFAULT_TALK_XY = 0x00010000,
+ daMdStts_UNK20000 = 0x00020000,
+ };
+
typedef BOOL (daNpc_Md_c::*ActionFunc)(void*);
typedef void (daNpc_Md_c::*EventActionInitFunc)(int evtStaffId);
typedef BOOL (daNpc_Md_c::*EventActionFunc)(int evtStaffId);
@@ -217,29 +237,32 @@ public:
BOOL chkPlayerAction(ActionFunc func) { return mCurrPlayerActionFunc == func; }
BOOL chkNpcAction(ActionFunc func) { return mCurrNpcActionFunc == func; }
- bool checkStatusFly() { return cLib_checkBit(m30F0, 0x10UL); }
- void onBitCamTagIn() { cLib_onBit(m30F0, 0x20UL); }
- void offBitCamTagIn() { cLib_offBit(m30F0, 0x20UL); }
- bool checkStatusCamTagIn() { return cLib_checkBit(m30F0, 0x20UL); }
- void onXYTalk() { cLib_onBit(m30F0, 0x100UL); }
- void offXYTalk() { cLib_offBit(m30F0, 0x100UL); }
- bool isXYTalk() { return cLib_checkBit(m30F0, 0x100UL); }
- void noCarryAction() { cLib_onBit(m30F0, 0x800UL); }
- void offNoCarryAction() { cLib_offBit(m30F0, 0x800UL); }
- bool isNoCarryAction() { return cLib_checkBit(m30F0, 0x800UL); }
- void onShipRide() { cLib_onBit(m30F0, 0x1000UL); }
- void offShipRide() { cLib_offBit(m30F0, 0x1000UL); }
- bool isShipRide() { return cLib_checkBit(m30F0, 0x1000UL); }
- void onLightHit() { cLib_onBit(m30F0, 0x2000UL); }
- void offLightHit() { cLib_offBit(m30F0, 0x2000UL); }
- bool isLightHit() { return cLib_checkBit(m30F0, 0x2000UL); }
- void onLightBodyHit() { cLib_onBit(m30F0, 0x8000UL); }
- void offLightBodyHit() { cLib_offBit(m30F0, 0x8000UL); }
- bool isLightBodyHit() { return cLib_checkBit(m30F0, 0x8000UL); }
- bool isOldLightBodyHit() { return cLib_checkBit(m30F0, 0x8000UL); }
- void onDefaultTalkXY() { cLib_onBit(m30F0, 0x10000UL); }
- void offDefaultTalkXY() { cLib_offBit(m30F0, 0x10000UL); }
- bool isDefaultTalkXY() { return cLib_checkBit(m30F0, 0x10000UL); }
+ void setBitStatus(u32 status) { cLib_onBit<u32>(m30F0, status); }
+ void clearStatus(u32 status) { cLib_offBit<u32>(m30F0, status); }
+ bool checkStatus(u32 status) { return cLib_checkBit<u32>(m30F0, status); }
+ bool checkStatusFly() { return cLib_checkBit<u32>(m30F0, daMdStts_FLY); }
+ void onBitCamTagIn() { cLib_onBit<u32>(m30F0, daMdStts_CAM_TAG_IN); }
+ void offBitCamTagIn() { cLib_offBit<u32>(m30F0, daMdStts_CAM_TAG_IN); }
+ bool checkStatusCamTagIn() { return cLib_checkBit<u32>(m30F0, daMdStts_CAM_TAG_IN); }
+ void onXYTalk() { cLib_onBit<u32>(m30F0, daMdStts_XY_TALK); }
+ void offXYTalk() { cLib_offBit<u32>(m30F0, daMdStts_XY_TALK); }
+ bool isXYTalk() { return cLib_checkBit<u32>(m30F0, daMdStts_XY_TALK); }
+ void noCarryAction() { cLib_onBit<u32>(m30F0, daMdStts_CARRY_ACTION); }
+ void offNoCarryAction() { cLib_offBit<u32>(m30F0, daMdStts_CARRY_ACTION); }
+ bool isNoCarryAction() { return cLib_checkBit<u32>(m30F0, daMdStts_CARRY_ACTION); }
+ void onShipRide() { cLib_onBit<u32>(m30F0, daMdStts_SHIP_RIDE); }
+ void offShipRide() { cLib_offBit<u32>(m30F0, daMdStts_SHIP_RIDE); }
+ bool isShipRide() { return cLib_checkBit<u32>(m30F0, daMdStts_SHIP_RIDE); }
+ void onLightHit() { cLib_onBit<u32>(m30F0, daMdStts_LIGHT_HIT); }
+ void offLightHit() { cLib_offBit<u32>(m30F0, daMdStts_LIGHT_HIT); }
+ bool isLightHit() { return cLib_checkBit<u32>(m30F0, daMdStts_LIGHT_HIT); }
+ void onLightBodyHit() { cLib_onBit<u32>(m30F0, daMdStts_LIGHT_BODY_HIT); }
+ void offLightBodyHit() { cLib_offBit<u32>(m30F0, daMdStts_LIGHT_BODY_HIT); }
+ bool isLightBodyHit() { return cLib_checkBit<u32>(m30F0, daMdStts_LIGHT_BODY_HIT); }
+ bool isOldLightBodyHit() { return cLib_checkBit<u32>(m30F0, daMdStts_LIGHT_BODY_HIT); }
+ void onDefaultTalkXY() { cLib_onBit<u32>(m30F0, daMdStts_DEFAULT_TALK_XY); }
+ void offDefaultTalkXY() { cLib_offBit<u32>(m30F0, daMdStts_DEFAULT_TALK_XY); }
+ bool isDefaultTalkXY() { return cLib_checkBit<u32>(m30F0, daMdStts_DEFAULT_TALK_XY); }
void setOldLightBodyHit() {} // 0x20000?
@@ -294,22 +317,24 @@ public:
}
}
+ void setRunRate(f32 rate) {
+ mRunRate = rate;
+ mpMorf->setAnmRate(mRunRate);
+ mpArmMorf->setAnmRate(mRunRate);
+ }
+
+ void setStatus(u32) {}
void getFlyingTimer() {}
void setFlyingTimer(s16) {}
void calcFlyingTimer() {}
void checkBitEffectStatus(u8) {}
- void checkStatus(u32) {}
- void setStatus(u32) {}
void clearJntAng() {}
void clearStatus() {}
- void clearStatus(u32) {}
void getTalkType() {}
void setTalkType(u8) {}
void setBitEffectStatus(u8) {}
- void setBitStatus(u32) {}
void setEffectStatus(u8) {}
void setPiyo2TalkCNT(u8) {}
- void setRunRate(f32) {}
daNpc_Md_c() {}
~daNpc_Md_c();
@@ -343,7 +368,7 @@ public:
void restartPoint(s16);
void setMessageAnimation(u8);
void waitGroundCheck();
- void chkAdanmaeDemoOrder();
+ BOOL chkAdanmaeDemoOrder();
BOOL waitNpcAction(void*);
BOOL harpWaitNpcAction(void*);
BOOL XYTalkCheck();
@@ -435,8 +460,8 @@ public:
BOOL setAnm(int);
bool dNpc_Md_setAnm(mDoExt_McaMorf2*, f32, int, f32, f32, char*, char*, const char*);
bool dNpc_Md_setAnm(mDoExt_McaMorf*, int, f32, f32, char*, const char*);
- void chkAttention(cXyz, s16, int);
- void chkArea(cXyz*);
+ u8 chkAttention(cXyz, s16, int);
+ bool chkArea(cXyz*);
void carryCheck();
void eventOrder();
void checkOrder();
@@ -520,8 +545,8 @@ public:
/* 0x30F0 */ u32 m30F0;
/* 0x30F4 */ u8 m30F4[0x30F8 - 0x30F4];
/* 0x30F8 */ f32 m30F8;
- /* 0x30FC */ f32 m30FC;
- /* 0x3100 */ u8 m3100[0x3104 - 0x3100];
+ /* 0x30FC */ f32 mRunRate;
+ /* 0x3100 */ int m3100;
/* 0x3104 */ int m3104;
/* 0x3108 */ f32 m3108;
/* 0x310C */ f32 m310C;
diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h
index 48e76362..c58dfdae 100644
--- a/include/d/d_com_inf_game.h
+++ b/include/d/d_com_inf_game.h
@@ -51,6 +51,7 @@ enum daPy__PlayerStatus0 {
daPyStts0_SWIM_e = 0x00100000,
daPyStts0_TELESCOPE_LOOK_e = 0x00200000,
daPyStts0_BOOMERANG_WAIT_e = 0x00400000,
+ daPyStts0_UNK800000_e = 0x00800000,
daPyStts0_UNK2000000_e = 0x02000000,
daPyStts0_CRAWL_e = 0x08000000,
daPyStts0_UNK20000000_e = 0x20000000,
diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h
index d8f84859..6094e0ef 100644
--- a/include/m_Do/m_Do_ext.h
+++ b/include/m_Do/m_Do_ext.h
@@ -416,7 +416,9 @@ public:
return mFrameCtrl.checkPass(frame);
}
BOOL isMorf() { return mCurMorf < 1.0f; }
- void setAnmRate(f32) {} // TODO
+ void setAnmRate(f32 rate) {
+ mAnmRate = rate;
+ }
/* 0x50 */ J3DModel* mpModel;
/* 0x54 */ J3DAnmTransform* mpAnm1;
@@ -427,7 +429,7 @@ public:
/* 0x78 */ f32 mCurMorf;
/* 0x7C */ f32 mPrevMorf;
/* 0x80 */ f32 mMorfStep;
- /* 0x84 */ f32 field_0x84;
+ /* 0x84 */ f32 mAnmRate;
/* 0x88 */ mDoExt_zelAnime* mpSound;
/* 0x8C */ mDoExt_McaMorfCallBack1_c * mpCallback1;
/* 0x90 */ mDoExt_McaMorfCallBack2_c * mpCallback2;