diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2022-12-19 11:06:32 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-19 12:06:32 -0700 |
| commit | ca71275bbecc7db9a4eeca3a6ac4215b66de4318 (patch) | |
| tree | c2851f8cec211216fe0cb6a31a0260a62fc3bf53 /include/JSystem | |
| parent | 1114b13da81ab0b52fd4bb56a32f32331a21e581 (diff) | |
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
Diffstat (limited to 'include/JSystem')
| -rw-r--r-- | include/JSystem/J3DGraphAnimator/J3DAnimation.h | 14 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphAnimator/J3DModelData.h | 1 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphBase/J3DMaterial.h | 2 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphBase/J3DShapeMtx.h | 1 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphLoader/J3DAnmLoader.h | 2 | ||||
| -rw-r--r-- | include/JSystem/JAudio2/JAISeMgr.h | 4 | ||||
| -rw-r--r-- | include/JSystem/JKernel/JKRArchive.h | 7 | ||||
| -rw-r--r-- | include/JSystem/JKernel/JKRDvdFile.h | 2 | ||||
| -rw-r--r-- | include/JSystem/JKernel/JKRSolidHeap.h | 2 | ||||
| -rw-r--r-- | include/JSystem/JMath/JMath.h | 12 | ||||
| -rw-r--r-- | include/JSystem/JParticle/JPAMath.h | 4 | ||||
| -rw-r--r-- | include/JSystem/JParticle/JPAParticle.h | 4 | ||||
| -rw-r--r-- | include/JSystem/JStudio/JStudio/functionvalue.h | 4 | ||||
| -rw-r--r-- | include/JSystem/JStudio/JStudio/jstudio-control.h | 2 | ||||
| -rw-r--r-- | include/JSystem/JSupport/JSUList.h | 2 | ||||
| -rw-r--r-- | include/JSystem/JUtility/JUTConsole.h | 3 | ||||
| -rw-r--r-- | include/JSystem/JUtility/JUTDirectFile.h | 9 | ||||
| -rw-r--r-- | include/JSystem/JUtility/JUTFader.h | 2 |
18 files changed, 60 insertions, 17 deletions
diff --git a/include/JSystem/J3DGraphAnimator/J3DAnimation.h b/include/JSystem/J3DGraphAnimator/J3DAnimation.h index 4daebd16ec..8fcde1731e 100644 --- a/include/JSystem/J3DGraphAnimator/J3DAnimation.h +++ b/include/JSystem/J3DGraphAnimator/J3DAnimation.h @@ -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; diff --git a/include/JSystem/J3DGraphAnimator/J3DModelData.h b/include/JSystem/J3DGraphAnimator/J3DModelData.h index bc4c2ba9a6..51d8f08e8c 100644 --- a/include/JSystem/J3DGraphAnimator/J3DModelData.h +++ b/include/JSystem/J3DGraphAnimator/J3DModelData.h @@ -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); } diff --git a/include/JSystem/J3DGraphBase/J3DMaterial.h b/include/JSystem/J3DGraphBase/J3DMaterial.h index c9c21cfd40..3e6b822823 100644 --- a/include/JSystem/J3DGraphBase/J3DMaterial.h +++ b/include/JSystem/J3DGraphBase/J3DMaterial.h @@ -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; diff --git a/include/JSystem/J3DGraphBase/J3DShapeMtx.h b/include/JSystem/J3DGraphBase/J3DShapeMtx.h index 1b745e5fc1..2496c9b8a3 100644 --- a/include/JSystem/J3DGraphBase/J3DShapeMtx.h +++ b/include/JSystem/J3DGraphBase/J3DShapeMtx.h @@ -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: diff --git a/include/JSystem/J3DGraphLoader/J3DAnmLoader.h b/include/JSystem/J3DGraphLoader/J3DAnmLoader.h index 0c6a6a8474..c9ec70a8ab 100644 --- a/include/JSystem/J3DGraphLoader/J3DAnmLoader.h +++ b/include/JSystem/J3DGraphLoader/J3DAnmLoader.h @@ -3,7 +3,7 @@ #include "dolphin/types.h" -enum J3DAnmLoaderDataBaseFlag { UNK_FLAG0 }; +enum J3DAnmLoaderDataBaseFlag { J3DLOADER_UNK_FLAG0 }; struct J3DAnmBase; diff --git a/include/JSystem/JAudio2/JAISeMgr.h b/include/JSystem/JAudio2/JAISeMgr.h index c52af94cf7..45bf084cd4 100644 --- a/include/JSystem/JAudio2/JAISeMgr.h +++ b/include/JSystem/JAudio2/JAISeMgr.h @@ -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; diff --git a/include/JSystem/JKernel/JKRArchive.h b/include/JSystem/JKernel/JKRArchive.h index c9767d3a7e..b339fb71ef 100644 --- a/include/JSystem/JKernel/JKRArchive.h +++ b/include/JSystem/JKernel/JKRArchive.h @@ -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: diff --git a/include/JSystem/JKernel/JKRDvdFile.h b/include/JSystem/JKernel/JKRDvdFile.h index 4a9daa94e7..ecb722531a 100644 --- a/include/JSystem/JKernel/JKRDvdFile.h +++ b/include/JSystem/JKernel/JKRDvdFile.h @@ -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; diff --git a/include/JSystem/JKernel/JKRSolidHeap.h b/include/JSystem/JKernel/JKRSolidHeap.h index a61e8cc78b..f3058bb029 100644 --- a/include/JSystem/JKernel/JKRSolidHeap.h +++ b/include/JSystem/JKernel/JKRSolidHeap.h @@ -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 */ diff --git a/include/JSystem/JMath/JMath.h b/include/JSystem/JMath/JMath.h index 71bad19d43..5b6b2c5978 100644 --- a/include/JSystem/JMath/JMath.h +++ b/include/JSystem/JMath/JMath.h @@ -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; diff --git a/include/JSystem/JParticle/JPAMath.h b/include/JSystem/JParticle/JPAMath.h index 3c0e94b43c..abad96a07d 100644 --- a/include/JSystem/JParticle/JPAMath.h +++ b/include/JSystem/JParticle/JPAMath.h @@ -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 */ diff --git a/include/JSystem/JParticle/JPAParticle.h b/include/JSystem/JParticle/JPAParticle.h index 979d41b3dd..dc4f2127ed 100644 --- a/include/JSystem/JParticle/JPAParticle.h +++ b/include/JSystem/JParticle/JPAParticle.h @@ -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; diff --git a/include/JSystem/JStudio/JStudio/functionvalue.h b/include/JSystem/JStudio/JStudio/functionvalue.h index 35d849e27c..9db6ffee4f 100644 --- a/include/JSystem/JStudio/JStudio/functionvalue.h +++ b/include/JSystem/JStudio/JStudio/functionvalue.h @@ -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; }; diff --git a/include/JSystem/JStudio/JStudio/jstudio-control.h b/include/JSystem/JStudio/JStudio/jstudio-control.h index b2cd99f6b8..e5c742b97f 100644 --- a/include/JSystem/JStudio/JStudio/jstudio-control.h +++ b/include/JSystem/JStudio/JStudio/jstudio-control.h @@ -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; diff --git a/include/JSystem/JSupport/JSUList.h b/include/JSystem/JSupport/JSUList.h index c1deabae92..6adb0bc74b 100644 --- a/include/JSystem/JSupport/JSUList.h +++ b/include/JSystem/JSupport/JSUList.h @@ -147,7 +147,7 @@ public: T* operator->() { return this->getObject(); } -private: +// private: JSULink<T>* mLink; }; diff --git a/include/JSystem/JUtility/JUTConsole.h b/include/JSystem/JUtility/JUTConsole.h index 8ed869395d..c1c2a5adfa 100644 --- a/include/JSystem/JUtility/JUTConsole.h +++ b/include/JSystem/JUtility/JUTConsole.h @@ -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); diff --git a/include/JSystem/JUtility/JUTDirectFile.h b/include/JSystem/JUtility/JUTDirectFile.h index 840f796d7d..b0f956ff23 100644 --- a/include/JSystem/JUtility/JUTDirectFile.h +++ b/include/JSystem/JUtility/JUTDirectFile.h @@ -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 */ diff --git a/include/JSystem/JUtility/JUTFader.h b/include/JSystem/JUtility/JUTFader.h index 3615612ee1..af3c2fba73 100644 --- a/include/JSystem/JUtility/JUTFader.h +++ b/include/JSystem/JUtility/JUTFader.h @@ -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; }; |
