big d_a_alink pass (#214)

* d_a_alink pass1 wip

* more d_a_alink work

* remove asm

* more daalink work

* 20% dol code decompiled

* fixed some nonmatchings for building

* a few daalink functions and labeling some HIO data
This commit is contained in:
TakaRikka
2022-12-19 11:06:32 -08:00
committed by GitHub
parent 1114b13da8
commit ca71275bbe
727 changed files with 15610 additions and 33013 deletions
@@ -31,6 +31,7 @@ public:
void SetHit() { field_0x4c |= 16; }
u32 ChkHit() const { return field_0x4c & 16; }
void SetCross(const cXyz& pos) { mLin.SetEnd(pos); }
cXyz& i_GetCross() { return mLin.GetEnd(); }
cM3dGLin* GetLinP() { return &mLin; }
bool ChkBackFlag() const { return mBackFlag; }
bool ChkFrontFlag() const { return mFrontFlag; }
+11
View File
@@ -11,6 +11,11 @@
#include "f_op/f_op_actor.h"
#include "global.h"
enum CcG_Tg_HitMark {
CcG_Tg_UNK_MARK_6 = 6,
CcG_Tg_UNK_MARK_8 = 8,
};
class cCcD_PntAttr;
class cCcD_CpsAttr;
class cCcD_TriAttr;
@@ -341,6 +346,7 @@ public:
u32 MskType(u32 msk) const { return mType & msk; }
void SetType(u32 type) { mType = type; }
void SetAtp(int atp) { mAtp = atp; }
void ClrSet() { OffSPrmBit(1); }
protected:
/* 0x10 */ int mType;
@@ -361,6 +367,7 @@ public:
void SetType(u32 type) { mType = type; }
u32 GetGrp() const { return MskSPrm(0x1E); }
bool ChkSet() const { return MskSPrm(1); }
void ClrSet() { OffSPrmBit(1); }
private:
/* 0x10 */ int mType;
@@ -429,6 +436,10 @@ public:
void OffCoSetBit() { mObjCo.ClrSet(); }
void SetTgType(u32 type) { mObjTg.SetType(type); }
void OnTgSPrmBit(u32 flag) { mObjTg.OnSPrmBit(flag); }
void OffAtSetBit() { mObjAt.ClrSet(); }
void OnTgSetBit() { mObjTg.OnSPrmBit(1); }
void OffTgSetBit() { mObjTg.ClrSet(); }
void OnCoSetBit() { mObjCo.OnSPrmBit(1); }
}; // Size = 0x40
+31 -31
View File
@@ -4,47 +4,46 @@
#include "MSL_C/math.h"
#include "SSystem/SComponent/c_xyz.h"
#include "dolphin/mtx/mtx.h"
#include "dolphin/types.h"
inline bool cLib_IsZero(f32 f) {
return fabsf(f) < 8e-11f;
inline bool cLib_IsZero(f32 value) {
return fabsf(value) < 8e-11f;
}
void cLib_memCpy(void* dst, const void* src, unsigned long size);
void cLib_memSet(void* ptr, int value, unsigned long size);
float cLib_addCalc(float*, float, float, float, float);
void cLib_addCalc2(float*, float, float, float);
void cLib_addCalc0(float*, float, float);
float cLib_addCalcPos(cXyz*, const cXyz&, float, float, float);
float cLib_addCalcPosXZ(cXyz*, const cXyz&, float, float, float);
void cLib_addCalcPos2(cXyz*, const cXyz&, float, float);
void cLib_addCalcPosXZ2(cXyz*, const cXyz&, float, float);
short cLib_addCalcAngleS(short*, short, short, short, short);
void cLib_addCalcAngleS2(short*, short, short, short);
f32 cLib_addCalc(f32* o_value, f32 target, f32 scale, f32 maxStep, f32 minStep);
void cLib_addCalc2(f32* o_value, f32 target, f32 scale, f32 maxStep);
void cLib_addCalc0(f32* o_value, f32 scale, f32 maxStep);
f32 cLib_addCalcPos(cXyz* o_value, cXyz const& target, f32 scale, f32 maxStep, f32 minStep);
f32 cLib_addCalcPosXZ(cXyz* o_value, cXyz const& target, f32 scale, f32 maxStep, f32 minStep);
void cLib_addCalcPos2(cXyz* o_value, cXyz const& target, f32 scale, f32 maxStep);
void cLib_addCalcPosXZ2(cXyz* o_value, cXyz const& target, f32 scale, f32 maxStep);
s16 cLib_addCalcAngleS(s16* o_value, s16 target, s16 scale, s16 maxStep, s16 minStep);
void cLib_addCalcAngleS2(s16* o_value, s16 target, s16 scale, s16 maxStep);
int cLib_chaseUC(unsigned char*, unsigned char, unsigned char);
int cLib_chaseS(short*, short, short);
int cLib_chaseF(float* value, float target, float step);
int cLib_chasePos(cXyz*, const cXyz&, float);
int cLib_chasePosXZ(cXyz*, const cXyz&, float);
int cLib_chaseAngleS(short*, short, short);
int cLib_chaseUC(u8* o_value, u8 target, u8 step);
int cLib_chaseS(s16* o_value, s16 target, s16 step);
int cLib_chaseF(f32* o_value, f32 target, f32 step);
int cLib_chasePos(cXyz* o_value, cXyz const& target, f32 step);
int cLib_chasePosXZ(cXyz* o_value, cXyz const& target, f32 step);
int cLib_chaseAngleS(s16* o_value, s16 target, s16 step);
s16 cLib_targetAngleY(const Vec* lhs, const Vec* rhs);
s16 cLib_targetAngleY(const Vec& lhs, const Vec& rhs);
short cLib_targetAngleX(const cXyz*, const cXyz*);
s16 cLib_targetAngleX(const cXyz*, const cXyz*);
void cLib_offsetPos(cXyz*, const cXyz*, short, const cXyz*);
void cLib_offsetPos(cXyz* pDest, cXyz const* pSrc, s16 angle, cXyz const* vec);
s32 cLib_distanceAngleS(s16 x, s16 y);
inline void cLib_offBit(u8& pVar, u8 pBit) {
pVar &= ~pBit;
inline void cLib_offBit(u8& value, u8 bit) {
value &= ~bit;
}
inline void cLib_onBit(u8& pVar, u8 pBit) {
pVar |= pBit;
inline void cLib_onBit(u8& value, u8 bit) {
value |= bit;
}
inline u8 cLib_checkBit(u8& pVar, u8 pBit) {
return pVar & pBit;
inline u8 cLib_checkBit(u8& value, u8 bit) {
return value & bit;
}
template <typename T>
@@ -53,11 +52,12 @@ inline T cLib_minMaxLimit(T val, T min, T max) {
if (val < min) {
ret = min;
} else {
ret = max;
if (val <= max) {
ret = val;
if (val > max) {
val = max;
}
ret = val;
}
return ret;
}
@@ -65,8 +65,8 @@ template <typename T>
T cLib_calcTimer(T* val);
void MtxInit(void);
void MtxTrans(float, float, float, unsigned char);
void MtxScale(float, float, float, unsigned char);
void MtxTrans(f32, f32, f32, u8);
void MtxScale(f32, f32, f32, u8);
void MtxPosition(cXyz*, cXyz*);
void MtxPush(void);
Mtx* MtxPull(void);
+4 -3
View File
@@ -24,15 +24,16 @@ public:
virtual ~cM3dGCyl() {}
void Set(const cM3dGCylS&);
void Set(const cXyz&, f32, f32);
void SetC(const cXyz&);
void SetH(f32);
void SetR(f32);
void SetC(const cXyz& pos);
void SetH(f32 h);
void SetR(f32 r);
bool cross(const cM3dGSph*, cXyz*) const;
bool cross(const cM3dGCyl*, cXyz*) const;
void calcMinMax(cXyz*, cXyz*);
const cXyz& GetCP(void) const { return mCenter; }
f32 GetR(void) const { return mRadius; }
f32 GetH(void) const { return mHeight; }
cXyz& GetC() { return mCenter; }
bool Cross(const cM3dGCps* cps, cXyz* xyz) const { return cM3d_Cross_CpsCyl(*cps, *this, xyz); }
bool Cross(const cM3dGTri& tri, cXyz* xyz) const { return cM3d_Cross_CylTri(this, &tri, xyz); }
+1
View File
@@ -25,6 +25,7 @@ public:
cXyz& GetStartP(void) { return mStart; }
const cXyz& GetEndP(void) const { return mEnd; }
cXyz& GetEndP(void) { return mEnd; }
cXyz& GetEnd() { return mEnd; }
}; // Size = 0x1C
STATIC_ASSERT(0x1C == sizeof(cM3dGLin));
+8
View File
@@ -29,4 +29,12 @@ inline s16 cM_deg2s(f32 val) {
return val * 182.04445f;
}
inline f32 cM_fsin(f32 v) {
return JMASSin(cM_rad2s(v));
}
inline f32 cM_sht2d(f32 v) {
return v * 0.005493164f;
}
#endif /* C_MATH_H */
+1 -5
View File
@@ -54,11 +54,7 @@ struct cXyz : Vec {
z -= f;
}
void operator-=(const Vec& other) { PSVECSubtract(this, &other, this); }
void operator+=(const Vec& vec) {
x += vec.x;
y += vec.y;
z += vec.z;
}
void operator+=(const Vec& other) { PSVECAdd(this, &other, this); }
void operator*=(f32 scale) { PSVECScale(this, this, scale); }
/* 80266C6C */ cXyz getCrossProduct(Vec const&) const;
/* 80266CBC */ cXyz outprod(Vec const&) const;