diff options
| author | lepelog <lepelog@users.noreply.github.com> | 2021-06-02 14:13:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-02 08:13:31 -0400 |
| commit | b728ec1ef544571b02ef5fe05f418b9935c2b071 (patch) | |
| tree | d9eff34f05e9f50033a1361745a98571f7354346 /include/JSystem | |
| parent | e915df66c806bdff65aa243649f7abfe6cc19227 (diff) | |
J3duclip, fop_actor_mng and related stuff (#131)
* J3DUClipper sinit
* sincosTable_ etc
* decompile JMATrigonometric sinit
* f_op_actor_mng
* move f_op_actor_mng and parts of mDo_ext
* J3DSys sinit
* f_op_scene_req
* failed matching attempt for decodeSZS__9JKRDecompFPUcPUcUlUl
* mX -> x
* fix mCull and fopAcM_prm_class members
* fix a few function parameters
* move missing NON_MATCHING
* remove some unneeded data
* turns out that data was not unused
* remove unused asm
* readd asm deleted by accident
Diffstat (limited to 'include/JSystem')
| -rw-r--r-- | include/JSystem/J3DGraphBase/J3DSys.h | 28 | ||||
| -rw-r--r-- | include/JSystem/J3DU/J3DUClipper.h | 22 | ||||
| -rw-r--r-- | include/JSystem/JKernel/JKRExpHeap.h | 9 | ||||
| -rw-r--r-- | include/JSystem/JKernel/JKRSolidHeap.h | 3 | ||||
| -rw-r--r-- | include/JSystem/JMath/JMATrigonometric.h | 32 | ||||
| -rw-r--r-- | include/JSystem/JMath/JMath.h | 4 |
6 files changed, 89 insertions, 9 deletions
diff --git a/include/JSystem/J3DGraphBase/J3DSys.h b/include/JSystem/J3DGraphBase/J3DSys.h index 73cef8bde9..9320bcdd02 100644 --- a/include/JSystem/J3DGraphBase/J3DSys.h +++ b/include/JSystem/J3DGraphBase/J3DSys.h @@ -1,6 +1,7 @@ #ifndef J3DSYS_H #define J3DSYS_H +#include "dolphin/mtx/mtx.h" #include "dolphin/types.h" // Perhaps move to a new J3DEnum.h? @@ -9,4 +10,31 @@ enum J3DError { kJ3DError_Alloc = 4, }; +struct _GXTexCacheSize {}; + +struct J3DSys { + Mtx mMtx; + u8 _30[0x11C - 0x30]; + /* 8030FDE8 */ J3DSys(); + /* 8030FEC0 */ void loadPosMtxIndx(int, u16) const; + /* 8030FEE4 */ void loadNrmMtxIndx(int, u16) const; + /* 8030FF0C */ void setTexCacheRegion(_GXTexCacheSize); + /* 803100BC */ void drawInit(); + /* 8031073C */ void reinitGX(); + /* 8031079C */ void reinitGenMode(); + /* 803107E8 */ void reinitLighting(); + /* 80310894 */ void reinitTransform(); + /* 80310998 */ void reinitTexture(); + /* 80310A3C */ void reinitTevStages(); + /* 80310D44 */ void reinitIndStages(); + /* 80310E3C */ void reinitPixelProc(); + + static u8 mCurrentMtx[48]; + static f32 mCurrentS[3]; + static f32 mParentS[3]; + static u8 sTexCoordScaleTable[64 + 4 /* padding */]; +}; + +extern J3DSys j3dSys; + #endif /* J3DSYS_H */ diff --git a/include/JSystem/J3DU/J3DUClipper.h b/include/JSystem/J3DU/J3DUClipper.h index d9d67d386a..072bbe337a 100644 --- a/include/JSystem/J3DU/J3DUClipper.h +++ b/include/JSystem/J3DU/J3DUClipper.h @@ -1,6 +1,28 @@ #ifndef J3DUCLIPPER_H #define J3DUCLIPPER_H +#include "dolphin/mtx/vec.h" #include "dolphin/types.h" +class J3DUClipper { +public: + J3DUClipper() { init(); } + virtual ~J3DUClipper() {} + /* 80273778 */ void init(); + /* 8027378C */ void calcViewFrustum(); + /* 802738FC */ u32 clip(f32 const (*)[4], Vec, f32) const; + /* 80273A44 */ u32 clip(f32 const (*)[4], Vec*, Vec*) const; + +private: + Vec _04; + Vec _10; + Vec _1C; + Vec _28; + u8 _34[0x4C - 0x34]; + f32 mFovY; + f32 mAspect; + f32 mNear; + f32 mFar; +}; + #endif /* J3DUCLIPPER_H */ diff --git a/include/JSystem/JKernel/JKRExpHeap.h b/include/JSystem/JKernel/JKRExpHeap.h index 57fad0b8f6..dcadbef8d4 100644 --- a/include/JSystem/JKernel/JKRExpHeap.h +++ b/include/JSystem/JKernel/JKRExpHeap.h @@ -75,8 +75,9 @@ public: /* vt[22] */ virtual bool state_compare(JKRHeap::TState const&, JKRHeap::TState const&) const; /* override */ + u8 field_0x6c; + private: - u32 field_0x6c; u32 field_0x70; u32 field_0x74; CMemBlock* mHeadFreeList; @@ -85,9 +86,9 @@ private: CMemBlock* mTailUsedList; public: - static void createRoot(int, bool); - static void create(u32, JKRHeap*, bool); - static void create(void*, u32, JKRHeap*, bool); + static JKRExpHeap* createRoot(int, bool); + static JKRExpHeap* create(u32, JKRHeap*, bool); + static JKRExpHeap* create(void*, u32, JKRHeap*, bool); }; #endif /* JKREXPHEAP_H */ diff --git a/include/JSystem/JKernel/JKRSolidHeap.h b/include/JSystem/JKernel/JKRSolidHeap.h index c190314459..a61e8cc78b 100644 --- a/include/JSystem/JKernel/JKRSolidHeap.h +++ b/include/JSystem/JKernel/JKRSolidHeap.h @@ -18,7 +18,6 @@ protected: JKRSolidHeap(void*, u32, JKRHeap*, bool); virtual ~JKRSolidHeap(); - s32 adjustSize(void); void* allocFromHead(u32, int); void* allocFromTail(u32, int); @@ -54,6 +53,8 @@ private: /* 0x78 */ Unknown* field_0x78; public: + s32 adjustSize(void); + static JKRSolidHeap* create(u32, JKRHeap*, bool); }; diff --git a/include/JSystem/JMath/JMATrigonometric.h b/include/JSystem/JMath/JMATrigonometric.h index e47f6ef294..79d3798ed2 100644 --- a/include/JSystem/JMath/JMATrigonometric.h +++ b/include/JSystem/JMath/JMATrigonometric.h @@ -3,4 +3,36 @@ #include "dolphin/types.h" +namespace std { +template <typename A1, typename B1> +struct pair { + A1 a1; + B1 b1; + pair() { + a1 = A1(); + b1 = B1(); + } +}; +} // namespace std + +struct TSinCosTable { + std::pair<f32, f32> table[0x2000]; +}; + +struct TAtanTable { + f32 table[1025]; + u8 pad[0x1C]; +}; + +struct TAsinAcosTable { + f32 table[1025]; + u8 pad[0x1C]; +}; + +namespace JMath { +extern TSinCosTable sincosTable_; +extern TAtanTable atanTable_; +extern TAsinAcosTable asinAcosTable_; +}; // namespace JMath + #endif /* JMATRIGONOMETRIC_H */ diff --git a/include/JSystem/JMath/JMath.h b/include/JSystem/JMath/JMath.h index 228c129d1c..802d24f2aa 100644 --- a/include/JSystem/JMath/JMath.h +++ b/include/JSystem/JMath/JMath.h @@ -3,8 +3,4 @@ #include "dolphin/types.h" -struct JMath { - static u8 sincosTable_[65536]; -}; - #endif /* JMATH_H */ |
