diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2022-10-03 15:26:26 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-03 18:26:26 -0400 |
| commit | 4913395dbd1a33d794028ceb82579b4baffe954d (patch) | |
| tree | fde72809184e4365eae205b26b14d5fee5698dcd /include/JSystem/JKernel | |
| parent | 03094905214e54b97414be8e6049abe491f3ff16 (diff) | |
d_camera / m_Do_ext / d_particle + minor various wip (#210)
Diffstat (limited to 'include/JSystem/JKernel')
| -rw-r--r-- | include/JSystem/JKernel/JKRArchive.h | 2 | ||||
| -rw-r--r-- | include/JSystem/JKernel/JKRCompArchive.h | 10 | ||||
| -rw-r--r-- | include/JSystem/JKernel/JKRExpHeap.h | 56 | ||||
| -rw-r--r-- | include/JSystem/JKernel/JKRHeap.h | 12 |
4 files changed, 47 insertions, 33 deletions
diff --git a/include/JSystem/JKernel/JKRArchive.h b/include/JSystem/JKernel/JKRArchive.h index 977a166ea8..c9767d3a7e 100644 --- a/include/JSystem/JKernel/JKRArchive.h +++ b/include/JSystem/JKernel/JKRArchive.h @@ -135,8 +135,6 @@ public: u32 getMountMode() const { return mMountMode; } SDIFileEntry* findNameResource(const char*) const; - -protected: bool isSameName(CArcName&, u32, u16) const; SDIDirEntry* findResType(u32) const; SDIDirEntry* findDirectory(const char*, u32) const; diff --git a/include/JSystem/JKernel/JKRCompArchive.h b/include/JSystem/JKernel/JKRCompArchive.h index f6c8d89388..3becd55f1f 100644 --- a/include/JSystem/JKernel/JKRCompArchive.h +++ b/include/JSystem/JKernel/JKRCompArchive.h @@ -22,7 +22,15 @@ public: private: /* 0x00 */ // vtable /* 0x04 */ // JKRArchive - u8 unk[36]; + /* 0x5C */ int field_0x5c; + /* 0x60 */ int field_0x60; + /* 0x64 */ int field_0x64; + /* 0x68 */ int field_0x68; + /* 0x6C */ int field_0x6c; + /* 0x70 */ JKRDvdFile* field_0x70; + /* 0x74 */ u32 mSizeOfMemPart; + /* 0x78 */ u32 mSizeOfAramPart; + /* 0x7C */ int field_0x7c; }; #endif /* JKRCOMPARCHIVE_H */ diff --git a/include/JSystem/JKernel/JKRExpHeap.h b/include/JSystem/JKernel/JKRExpHeap.h index d0ae61b76e..faccd6431c 100644 --- a/include/JSystem/JKernel/JKRExpHeap.h +++ b/include/JSystem/JKernel/JKRExpHeap.h @@ -6,6 +6,10 @@ class JKRExpHeap : public JKRHeap { public: + enum EAllocMode { + ALLOC_MODE_1 = 1, + }; + class CMemBlock { friend class JKRExpHeap; @@ -18,25 +22,25 @@ public: int free(JKRExpHeap* heap); static CMemBlock* getHeapBlock(void* ptr); - void newGroupId(u8 groupId) { this->mGroupId = groupId; } - bool isValid() const { return this->mMagic == 'HM'; } - bool _isTempMemBlock() const { return (this->mFlags & 0x80) ? true : false; } - int getAlignment() const { return this->mFlags & 0x7f; } + void newGroupId(u8 groupId) { mGroupId = groupId; } + bool isValid() const { return mMagic == 'HM'; } + bool _isTempMemBlock() const { return (mFlags & 0x80) ? true : false; } + int getAlignment() const { return mFlags & 0x7f; } void* getContent() const { return (void*)(this + 1); } - CMemBlock* getPrevBlock() const { return this->mPrev; } - CMemBlock* getNextBlock() const { return this->mNext; } - u32 getSize() const { return this->size; } - u8 getGroupId() const { return this->mGroupId; } + CMemBlock* getPrevBlock() const { return mPrev; } + CMemBlock* getNextBlock() const { return mNext; } + u32 getSize() const { return size; } + u8 getGroupId() const { return mGroupId; } static CMemBlock* getBlock(void* data) { return (CMemBlock*)((u32)data + -0x10); } private: - u16 mMagic; - u8 mFlags; // a|bbbbbbb a=temporary b=alignment - u8 mGroupId; - u32 size; - CMemBlock* mPrev; - CMemBlock* mNext; - }; + /* 0x0 */ u16 mMagic; + /* 0x2 */ u8 mFlags; // a|bbbbbbb a=temporary b=alignment + /* 0x3 */ u8 mGroupId; + /* 0x4 */ u32 size; + /* 0x8 */ CMemBlock* mPrev; + /* 0xC */ CMemBlock* mNext; + }; // Size: 0x10 friend class CMemBlock; protected: @@ -57,7 +61,11 @@ protected: public: s32 getUsedSize(u8 groupId) const; s32 getTotalUsedSize(void) const; + CMemBlock* getHeadUsedList() const { return mHeadUsedList; } + void setAllocationMode(EAllocMode mode) { + mAllocMode = mode; + } public: /* vt[04] */ virtual u32 getHeapType(); /* override */ @@ -81,17 +89,17 @@ public: /* vt[22] */ virtual bool state_compare(JKRHeap::TState const& r1, JKRHeap::TState const& r2) const; /* override */ - u8 field_0x6c; - u8 mCurrentGroupId; - bool field_0x6e; + /* 0x6C */ u8 mAllocMode; + /* 0x6D */ u8 mCurrentGroupId; + /* 0x6E */ bool field_0x6e; private: - void* field_0x70; - u32 field_0x74; - CMemBlock* mHeadFreeList; - CMemBlock* mTailFreeList; - CMemBlock* mHeadUsedList; - CMemBlock* mTailUsedList; + /* 0x70 */ void* field_0x70; + /* 0x74 */ u32 field_0x74; + /* 0x78 */ CMemBlock* mHeadFreeList; + /* 0x7C */ CMemBlock* mTailFreeList; + /* 0x80 */ CMemBlock* mHeadUsedList; + /* 0x84 */ CMemBlock* mTailUsedList; public: static JKRExpHeap* createRoot(int maxHeaps, bool errorFlag); diff --git a/include/JSystem/JKernel/JKRHeap.h b/include/JSystem/JKernel/JKRHeap.h index 38aba619a0..927ee8d6e8 100644 --- a/include/JSystem/JKernel/JKRHeap.h +++ b/include/JSystem/JKernel/JKRHeap.h @@ -14,12 +14,12 @@ class JKRHeap : public JKRDisposer { public: class TState { public: - u32 mUsedSize; - u32 mCheckCode; - u32 mBuf; - u32 field_0xc; - JKRHeap* mHeap; - u32 mId; + /* 0x00 */ u32 mUsedSize; + /* 0x04 */ u32 mCheckCode; + /* 0x08 */ u32 mBuf; + /* 0x0C */ u32 field_0xc; + /* 0x10 */ JKRHeap* mHeap; + /* 0x14 */ u32 mId; public: u32 getUsedSize() const { return mUsedSize; } |
