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
@@ -278,6 +278,13 @@ STATIC_ASSERT(sizeof(J3DAnmColorFullData) == 0x34);
class J3DAnmBase {
public:
J3DAnmBase(s16 i_frameMax) {
mAttribute = 0;
field_0x5 = 0;
mFrameMax = i_frameMax;
mFrame = 0.0f;
}
virtual ~J3DAnmBase();
u8 getAttribute() const { return mAttribute; }
@@ -287,6 +294,7 @@ public:
private:
/* 0x4 */ u8 mAttribute;
/* 0x5 */ u8 field_0x5;
/* 0x6 */ s16 mFrameMax;
/* 0x8 */ f32 mFrame;
}; // Size: 0xC
@@ -539,7 +547,7 @@ class J3DAnmCluster : public J3DAnmBase {
public:
/* 8032BCAC */ virtual ~J3DAnmCluster();
/* 8032BF44 */ virtual s32 getKind() const;
/* 8032BF4C */ virtual void getWeight(u16) const;
/* 8032BF4C */ virtual f32 getWeight(u16) const;
private:
/* 0x0C */ f32* field_0xc;
@@ -549,7 +557,7 @@ class J3DAnmClusterFull : public J3DAnmCluster {
public:
/* 8032BCAC */ virtual ~J3DAnmClusterFull();
/* 8032BF44 */ virtual s32 getKind() const;
/* 8032BF4C */ virtual void getWeight(u16) const;
/* 8032BF4C */ virtual f32 getWeight(u16) const;
private:
/* 0x10 */ int field_0x10;
@@ -559,7 +567,7 @@ class J3DAnmClusterKey : public J3DAnmCluster {
public:
/* 8032C044 */ virtual ~J3DAnmClusterKey();
/* 8032C0B0 */ virtual s32 getKind() const;
/* 8032A218 */ virtual void getWeight(u16) const;
/* 8032A218 */ virtual f32 getWeight(u16) const;
private:
/* 0x10 */ int field_0x10;
@@ -47,6 +47,7 @@ public:
bool isLocked() { return mMaterialTable.isLocked(); }
void entryTexMtxAnimator(J3DAnmTextureSRTKey* anm) { mMaterialTable.entryTexMtxAnimator(anm); }
void entryTevRegAnimator(J3DAnmTevRegKey* anm) { mMaterialTable.entryTevRegAnimator(anm); }
void entryTexNoAnimator(J3DAnmTexPattern* anm) { mMaterialTable.entryTexNoAnimator(anm); }
int removeTexNoAnimator(J3DAnmTexPattern* anm) {
return mMaterialTable.removeTexNoAnimator(anm);
}
@@ -61,6 +61,8 @@ public:
}
J3DNBTScale* getNBTScale() const { return mTexGenBlock->getNBTScale(); }
void setTevColor(u32 i, const J3DGXColorS10* i_color) { mTevBlock->setTevColor(i, i_color); }
public:
/* 0x04 */ J3DMaterial* mNext;
/* 0x08 */ J3DShape* mShape;
@@ -50,6 +50,7 @@ public:
static void setCurrentPipeline(u32 pipeline) { sCurrentPipeline = pipeline; }
static void setLODFlag(u8 flag) { struct_804515B0[1] = flag; }
static u8 getLODFlag() { return struct_804515B0[1]; }
static void resetMtxLoadCache();
private:
@@ -3,7 +3,7 @@
#include "dolphin/types.h"
enum J3DAnmLoaderDataBaseFlag { UNK_FLAG0 };
enum J3DAnmLoaderDataBaseFlag { J3DLOADER_UNK_FLAG0 };
struct J3DAnmBase;
+4
View File
@@ -39,6 +39,8 @@ public:
/* 8029F8B0 */ virtual bool isUsingSeqData(JAISeqDataRegion const&);
/* 8029F91C */ virtual void releaseSeqData(JAISeqDataRegion const&);
JAISoundParamsMove* getParams() { return &mParams; }
/* 0x04 */ JASNonCopyable field_0x4;
/* 0x08 */ JAISoundParamsMove mParams;
/* 0x58 */ JSUList<JAISe> mSeList;
@@ -66,6 +68,8 @@ public:
/* 802A0168 */ virtual bool isUsingSeqData(JAISeqDataRegion const&);
/* 802A01D8 */ virtual void releaseSeqData(JAISeqDataRegion const&);
JAISeCategoryMgr* getCategory(int categoryIndex) { return &mCategoryMgrs[categoryIndex]; }
private:
/* 0x008 */ JAIAudience* mAudience;
/* 0x00C */ JAISeqDataMgr* mSeqDataMgr;
+3 -4
View File
@@ -62,7 +62,7 @@ public:
u32 name_offset;
u16 field_0x8;
u16 num_entries;
s32 first_file_index;
u32 first_file_index;
};
struct SDIFileEntry {
@@ -163,8 +163,9 @@ public:
/* vt[19] */ virtual u32 getExpandSize(SDIFileEntry*) const;
u32 countFile() const { return mArcInfoBlock->num_file_entries; }
s32 countDirectory() const { return mArcInfoBlock->num_nodes; }
protected:
public:
/* 0x00 */ // vtable
/* 0x04 */ // JKRFileLoader
/* 0x38 */ JKRHeap* mHeap;
@@ -173,8 +174,6 @@ protected:
/* 0x40 */ s32 mEntryNum;
/* 0x44 */ SArcDataInfo* mArcInfoBlock;
/* 0x48 */ SDIDirEntry* mNodes;
public:
/* 0x4C */ SDIFileEntry* mFiles;
protected:
+1 -1
View File
@@ -31,7 +31,7 @@ public:
/* vt[07] */ virtual s32 getFileSize(void) const; /* override */
/* vt[08] */ virtual bool open(s32);
private:
// private:
/* 0x00 */ // vtable
/* 0x04 */ // JKRFile
/* 0x1C */ OSMutex mMutex1;
+1 -1
View File
@@ -21,7 +21,7 @@ protected:
void* allocFromHead(u32, int);
void* allocFromTail(u32, int);
s32 getUsedSize() { return mSize - getTotalFreeSize(); }
static s32 getUsedSize(JKRSolidHeap* heap) { return heap->mSize - heap->getTotalFreeSize(); }
public:
/* vt[04] */ virtual u32 getHeapType(void); /* override */
+11 -1
View File
@@ -11,9 +11,19 @@ inline f32 JMAFastReciprocal(f32 value) {
return __fres(value);
}
inline float __frsqrtes(register double f) {
register float out;
// clang-format off
asm {
frsqrte out, f
}
// clang-format on
return out;
}
inline f32 JMAFastSqrt(f32 input) {
if (input > 0.0f) {
f64 tmp = __frsqrte(input);
f32 tmp = __frsqrtes(input);
return tmp * input;
}
return input;
+3 -1
View File
@@ -2,8 +2,10 @@
#define JPAMATH_H
#include "dolphin/mtx/mtx.h"
#include "dolphin/types.h"
#include "JSystem/JGeometry.h"
void JPAGetXYZRotateMtx(s16 x, s16 y, s16 z, Mtx dst);
void JPASetRMtxTVecfromMtx(f32 const (*param_0)[4], f32 (*param_1)[4],
JGeometry::TVec3<f32>* param_2);
#endif /* JPAMATH_H */
+4
View File
@@ -9,6 +9,7 @@
#include "JSystem/JParticle/JPADynamicsBlock.h"
#include "JSystem/JParticle/JPAResource.h"
#include "JSystem/JParticle/JPAMath.h"
class JKRHeap;
class JPABaseEmitter;
@@ -205,6 +206,7 @@ public:
enum {
JPAEmtrStts_StopEmit = 0x01,
JPAEmtrStts_StopCalc = 0x02,
JPAEmtrStts_StopDraw = 0x04,
JPAEmtrStts_FirstEmit = 0x10,
JPAEmtrStts_RateStepEmit = 0x20,
JPAEmtrStts_Immortal = 0x40,
@@ -234,6 +236,7 @@ public:
u8 getDrawTimes() const { return mDrawTimes; }
void setRate(f32 rate) { mRate = rate; }
void setEmitterCallBackPtr(JPAEmitterCallBack* ptr) { mpEmtrCallBack = ptr; }
void setGlobalRTMatrix(const Mtx m) { JPASetRMtxTVecfromMtx(m, mGlobalRot, &mGlobalTrs); }
f32 get_r_f() { return mRndm.get_rndm_f(); }
f32 get_r_zp() { return mRndm.get_rndm_zp(); }
@@ -251,6 +254,7 @@ public:
void quitImmortalEmitter() { clearStatus(JPAEmtrStts_Immortal); }
void stopCalcEmitter() { setStatus(JPAEmtrStts_StopCalc); }
void playCalcEmitter() { clearStatus(JPAEmtrStts_StopCalc); }
void stopDrawParticle() { setStatus(JPAEmtrStts_StopDraw); }
public:
/* 0x00 */ Vec mLocalScl;
@@ -167,7 +167,7 @@ private:
f64 fValue_;
};
class TFunctionValue_composite : TFunctionValue, TFunctionValueAttribute_refer {
class TFunctionValue_composite : public TFunctionValue, public TFunctionValueAttribute_refer {
public:
struct TData {
TData(void* data) : u32data((u32)data) {}
@@ -216,7 +216,7 @@ public:
const TData* data_getData() const { return &data; }
void data_setData(const TData& dat) { data = dat; }
private:
// private:
UnkFunc pfn_;
TData data;
};
@@ -68,6 +68,8 @@ public:
transform_setOrigin_TxyzRy(xyz, rotY);
}
void setSecondPerFrame(double param_0) { mSecondPerFrame = param_0; }
/* 0x58 */ f64 mSecondPerFrame;
/* 0x60 */ fvb::TControl fvb_Control;
/* 0x74 */ ctb::TControl ctb_Control;
+1 -1
View File
@@ -147,7 +147,7 @@ public:
T* operator->() { return this->getObject(); }
private:
// private:
JSULink<T>* mLink;
};
+2 -1
View File
@@ -19,7 +19,8 @@ public:
enum OutputFlag {
/* 0x0 */ OUTPUT_NONE,
/* 0x1 */ OUTPUT_OSREPORT,
/* 0x2 */ OUTPUT_CONSOLE
/* 0x2 */ OUTPUT_CONSOLE,
/* 0x3 */ OUTPUT_OSR_AND_CONSOLE,
};
/* 802E73E4 */ static JUTConsole* create(unsigned int, void*, u32);
+9
View File
@@ -3,4 +3,13 @@
#include "dolphin/types.h"
struct JUTDirectFile {
/* 802E8730 */ void fetch32byte();
/* 802E87F8 */ JUTDirectFile();
/* 802E881C */ ~JUTDirectFile();
/* 802E8860 */ bool fopen(char const*);
/* 802E88FC */ bool fclose();
/* 802E8958 */ int fgets(void*, int);
};
#endif /* JUTDIRECTFILE_H */
+1 -1
View File
@@ -30,7 +30,7 @@ public:
/* 0x0A */ u16 field_0xa;
/* 0x0C */ JUtility::TColor mColor;
/* 0x10 */ JGeometry::TBox2<f32> mBox;
/* 0x20 */ EStatus mEStatus;
/* 0x20 */ int mEStatus;
/* 0x24 */ u32 field_0x24;
};