summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2025-09-26 21:50:46 -0400
committerGitHub <noreply@github.com>2025-09-26 18:50:46 -0700
commit6242aa6e8411cd6bbcfec5ee4f421950a62cae8d (patch)
treeb8fe4ac0f56c8afbbdb49c67dbe0063b09181a42 /include
parent30fafe135d20aaad8c9efc4c0a2de1e216822487 (diff)
Misc matches and fixes (#2703)
* Match mDoExt_morf_c::getPlayMode * Misc cleanup * Fix actor cull spheres * Match daPy_py_c::getLastSceneSwordAtUpTime, JUTGamePad::testTrigger * Fix improper demangling of dBgS_SphChk::SetCallback * Fix d_camera rangef weak func order * Match more alink_wolf funcs
Diffstat (limited to 'include')
-rw-r--r--include/JSystem/J3DGraphBase/J3DDrawBuffer.h2
-rw-r--r--include/JSystem/JGadget/linklist.h4
-rw-r--r--include/JSystem/JParticle/JPABaseShape.h2
-rw-r--r--include/JSystem/JParticle/JPAChildShape.h2
-rw-r--r--include/JSystem/JParticle/JPADynamicsBlock.h3
-rw-r--r--include/JSystem/JParticle/JPAExTexShape.h2
-rw-r--r--include/JSystem/JParticle/JPAExtraShape.h2
-rw-r--r--include/JSystem/JUtility/JUTGamePad.h2
-rw-r--r--include/d/actor/d_a_player.h2
-rw-r--r--include/d/d_bg_s_sph_chk.h2
-rw-r--r--include/dolphin/gd/GDLight.h1
-rw-r--r--include/f_op/f_op_actor.h8
-rw-r--r--include/f_op/f_op_actor_mng.h8
-rw-r--r--include/global.h9
-rw-r--r--include/m_Do/m_Do_ext.h2
15 files changed, 28 insertions, 23 deletions
diff --git a/include/JSystem/J3DGraphBase/J3DDrawBuffer.h b/include/JSystem/J3DGraphBase/J3DDrawBuffer.h
index 1cc88b4079..3a71f94b45 100644
--- a/include/JSystem/J3DGraphBase/J3DDrawBuffer.h
+++ b/include/JSystem/J3DGraphBase/J3DDrawBuffer.h
@@ -11,6 +11,7 @@ inline f32 J3DCalcZValue(register MtxP m, register Vec v) {
register f32 temp_f2;
register f32 temp_f1 = 1.0f;
+#ifdef __MWERKS__
// clang-format off
asm {
psq_l temp_f0, 0(v), 0, 0 /* qr0 */
@@ -23,6 +24,7 @@ inline f32 J3DCalcZValue(register MtxP m, register Vec v) {
ps_sum0 out, out, out, out
}
// clang-format on
+#endif
return out;
}
diff --git a/include/JSystem/JGadget/linklist.h b/include/JSystem/JGadget/linklist.h
index 69e4db3ee5..864f2b6dd2 100644
--- a/include/JSystem/JGadget/linklist.h
+++ b/include/JSystem/JGadget/linklist.h
@@ -241,8 +241,8 @@ struct TLinkList_factory : public TLinkList<T, I> {
}
}
- TLinkList<T, I>::iterator Erase_destroy(T* param_0) {
- TLinkList<T, I>::iterator spC(Erase(param_0));
+ typename TLinkList<T, I>::iterator Erase_destroy(T* param_0) {
+ typename TLinkList<T, I>::iterator spC(Erase(param_0));
Do_destroy(param_0);
return spC;
}
diff --git a/include/JSystem/JParticle/JPABaseShape.h b/include/JSystem/JParticle/JPABaseShape.h
index 3ebff4528c..6d4dabf2d8 100644
--- a/include/JSystem/JParticle/JPABaseShape.h
+++ b/include/JSystem/JParticle/JPABaseShape.h
@@ -38,7 +38,7 @@ struct JPABaseShapeData {
/* 0x2E */ u8 mAnmRndm;
/* 0x2F */ u8 mClrAnmRndmMask;
/* 0x30 */ u8 mTexAnmRndmMask;
-};
+}; // Size: 0x34
/**
* @ingroup jsystem-jparticle
diff --git a/include/JSystem/JParticle/JPAChildShape.h b/include/JSystem/JParticle/JPAChildShape.h
index 2761a56759..fec4c08a55 100644
--- a/include/JSystem/JParticle/JPAChildShape.h
+++ b/include/JSystem/JParticle/JPAChildShape.h
@@ -34,7 +34,7 @@ struct JPAChildShapeData {
/* 0x44 */ u8 mStep;
/* 0x45 */ u8 mTexIdx;
/* 0x46 */ s16 mRotSpeed;
-};
+}; // Size: 0x48
/**
* @ingroup jsystem-jparticle
diff --git a/include/JSystem/JParticle/JPADynamicsBlock.h b/include/JSystem/JParticle/JPADynamicsBlock.h
index fc175ff69d..38805b3b07 100644
--- a/include/JSystem/JParticle/JPADynamicsBlock.h
+++ b/include/JSystem/JParticle/JPADynamicsBlock.h
@@ -41,8 +41,7 @@ struct JPADynamicsBlockData {
/* 0x74 */ u16 mVolumeSize;
/* 0x76 */ u16 mDivNumber;
/* 0x78 */ u8 mRateStep;
- /* 0x7C */ u32 field_0x7c;
-};
+}; // Size: 0x7C
typedef void (*JPADynamicsCalcVolumeFunc)(JPAEmitterWorkData*);
diff --git a/include/JSystem/JParticle/JPAExTexShape.h b/include/JSystem/JParticle/JPAExTexShape.h
index b202cc9d9c..d1d6013dd1 100644
--- a/include/JSystem/JParticle/JPAExTexShape.h
+++ b/include/JSystem/JParticle/JPAExTexShape.h
@@ -19,7 +19,7 @@ struct JPAExTexShapeData {
/* 0x24 */ s8 mExpScale;
/* 0x25 */ s8 mIndTexIdx;
/* 0x26 */ s8 mSecTexIdx;
-};
+}; // Size: 0x28
/**
* @ingroup jsystem-jparticle
diff --git a/include/JSystem/JParticle/JPAExtraShape.h b/include/JSystem/JParticle/JPAExtraShape.h
index dbf4636341..fac178eb6a 100644
--- a/include/JSystem/JParticle/JPAExtraShape.h
+++ b/include/JSystem/JParticle/JPAExtraShape.h
@@ -38,7 +38,7 @@ struct JPAExtraShapeData {
/* 0x54 */ f32 mRotateSpeed;
/* 0x58 */ f32 mRotateSpeedRandom;
/* 0x5C */ f32 mRotateDirection;
-};
+}; // Size: 0x60
/**
* @ingroup jsystem-jparticle
diff --git a/include/JSystem/JUtility/JUTGamePad.h b/include/JSystem/JUtility/JUTGamePad.h
index 87a6b4d28d..bbb20c0865 100644
--- a/include/JSystem/JUtility/JUTGamePad.h
+++ b/include/JSystem/JUtility/JUTGamePad.h
@@ -100,7 +100,7 @@ public:
JUTGamePadRecordBase* getPadReplay() const { return mPadReplay; }
JUTGamePadRecordBase* getPadRecord() const { return mPadRecord; }
- u32 testTrigger(u32 button) const { return mButton.mTrigger & button; }
+ bool testTrigger(u32 button) const { return mButton.mTrigger & button; }
bool isPushing3ButtonReset() const {
return mPortNum != EPortInvalid && mButtonReset.mReset != false;
diff --git a/include/d/actor/d_a_player.h b/include/d/actor/d_a_player.h
index 275572e46c..14398e88a8 100644
--- a/include/d/actor/d_a_player.h
+++ b/include/d/actor/d_a_player.h
@@ -1131,7 +1131,7 @@ public:
static bool checkWolfCargoCarrySceneChange() { return getLastSceneMode() == 10; }
static int getLastSceneDamage() { return (dComIfGs_getLastSceneMode() >> 4) & 0x7F; }
- static u8 getLastSceneSwordAtUpTime() { return (dComIfGs_getLastSceneMode() >> 11) & 0xFF; }
+ static u32 getLastSceneSwordAtUpTime() { return (dComIfGs_getLastSceneMode() >> 11) & 0xFF; }
static BOOL checkNormalSwordEquip() { return dComIfGs_getSelectEquipSword() == fpcNm_ITEM_SWORD; }
diff --git a/include/d/d_bg_s_sph_chk.h b/include/d/d_bg_s_sph_chk.h
index 460bceb937..15cb92883f 100644
--- a/include/d/d_bg_s_sph_chk.h
+++ b/include/d/d_bg_s_sph_chk.h
@@ -8,7 +8,7 @@
struct cBgD_Vtx_t;
class dBgS_SphChk;
-typedef void* (*SphChk_Callback)(dBgS_SphChk*, cBgD_Vtx_t*, int, int, int, cM3dGPla*, void*);
+typedef void (*SphChk_Callback)(dBgS_SphChk*, cBgD_Vtx_t*, int, int, int, cM3dGPla*, void*);
class dBgS_SphChk : public cM3dGSph, public cBgS_PolyInfo, public cBgS_Chk, public dBgS_Chk {
public:
diff --git a/include/dolphin/gd/GDLight.h b/include/dolphin/gd/GDLight.h
index b67d385c6f..549b07a26e 100644
--- a/include/dolphin/gd/GDLight.h
+++ b/include/dolphin/gd/GDLight.h
@@ -3,6 +3,7 @@
#include <dolphin/gx/GXEnum.h>
#include <dolphin/gx/GXStruct.h>
+#include "global.h"
#ifdef __cplusplus
extern "C" {
diff --git a/include/f_op/f_op_actor.h b/include/f_op/f_op_actor.h
index b165667006..f283f10435 100644
--- a/include/f_op/f_op_actor.h
+++ b/include/f_op/f_op_actor.h
@@ -76,14 +76,8 @@ enum fopAc_Cull_e {
fopAc_CULLSPHERE_5_e,
fopAc_CULLSPHERE_6_e,
fopAc_CULLSPHERE_7_e,
- fopAc_CULLSPHERE_8_e,
- fopAc_CULLSPHERE_9_e,
- fopAc_CULLSPHERE_10_e,
- fopAc_CULLSPHERE_11_e,
- fopAc_CULLSPHERE_12_e,
- fopAc_CULLSPHERE_13_e,
#ifdef DEBUG
- fopAc_CULLSPHERE_14_e,
+ fopAc_CULLSPHERE_8_e,
#endif
fopAc_CULLSPHERE_CUSTOM_e,
};
diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h
index 96f97c0645..33c0f51300 100644
--- a/include/f_op/f_op_actor_mng.h
+++ b/include/f_op/f_op_actor_mng.h
@@ -402,6 +402,14 @@ inline int fopAcM_GetCullSize(const fopAc_ac_c* i_actor) {
return i_actor->cullType;
}
+inline int fopAcM_CULLSIZE_IDX(int i_culltype) {
+ return i_culltype - fopAc_CULLBOX_0_e;
+}
+
+inline int fopAcM_CULLSIZE_Q_IDX(int i_culltype) {
+ return i_culltype - fopAc_CULLSPHERE_0_e;
+}
+
inline BOOL fopAcM_CULLSIZE_IS_BOX(int i_culltype) {
return (i_culltype >= 0 && i_culltype < fopAc_CULLBOX_CUSTOM_e) ||
i_culltype == fopAc_CULLBOX_CUSTOM_e;
diff --git a/include/global.h b/include/global.h
index 7f725ba12c..f81e32af9a 100644
--- a/include/global.h
+++ b/include/global.h
@@ -58,11 +58,12 @@
#define STATIC_ASSERT(...)
#endif
-// hack to make functions that return comparisons as int match
+// Intrinsics
extern int __cntlzw(unsigned int);
-inline BOOL checkEqual(s32 a, s32 b) {
- return (u32)__cntlzw(a - b) >> 5;
-}
+extern int __rlwimi(int, int, int, int, int);
+extern void __dcbz(void*, int);
+extern void __sync();
+extern int __abs(int);
#ifndef __MWERKS__
void* __memcpy(void*, const void*, int);
diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h
index 635ecb623f..5af346ec4f 100644
--- a/include/m_Do/m_Do_ext.h
+++ b/include/m_Do/m_Do_ext.h
@@ -290,7 +290,7 @@ public:
J3DAnmTransform* getAnm() { return mpAnm; }
void changeAnm(J3DAnmTransform* anm) { mpAnm = anm; }
- u8 getPlayMode() { return mFrameCtrl.getAttribute(); }
+ int getPlayMode() { return mFrameCtrl.getAttribute(); }
void setPlayMode(int mode) { mFrameCtrl.setAttribute(mode); }
BOOL isStop() { return mFrameCtrl.checkState(1) || mFrameCtrl.getRate() == 0.0f; }
bool isLoop() { return mFrameCtrl.checkState(2); }