summaryrefslogtreecommitdiff
path: root/include/JSystem
diff options
context:
space:
mode:
authorhatal175 <hatal175@users.noreply.github.com>2023-07-24 01:30:24 +0300
committerGitHub <noreply@github.com>2023-07-23 15:30:24 -0700
commitcb8bf4a4892ece541bf57bcd82accbf1af581f1f (patch)
tree702e7af1963aca8755f9fc66809917aac99a53da /include/JSystem
parent6d9f00cb46619aad3a2b52ff13263506c107af92 (diff)
More JSystem borrowing (#383)
Diffstat (limited to 'include/JSystem')
-rw-r--r--include/JSystem/JKernel/JKRAram.h13
-rw-r--r--include/JSystem/JKernel/JKRAramHeap.h3
-rw-r--r--include/JSystem/JKernel/JKRCompArchive.h6
-rw-r--r--include/JSystem/JKernel/JKRExpHeap.h2
-rw-r--r--include/JSystem/JKernel/JKRHeap.h2
-rw-r--r--include/JSystem/JKernel/JKRSolidHeap.h2
-rw-r--r--include/JSystem/JParticle/JPAKeyBlock.h9
-rw-r--r--include/JSystem/JParticle/JPAMath.h1
-rw-r--r--include/JSystem/JStudio/JStudio/fvb-data-parse.h1
-rw-r--r--include/JSystem/JStudio/JStudio/stb-data-parse.h6
-rw-r--r--include/JSystem/JUtility/JUTConsole.h1
-rw-r--r--include/JSystem/JUtility/JUTGraphFifo.h2
12 files changed, 36 insertions, 12 deletions
diff --git a/include/JSystem/JKernel/JKRAram.h b/include/JSystem/JKernel/JKRAram.h
index 5fd1b7820e..6ec1a901be 100644
--- a/include/JSystem/JKernel/JKRAram.h
+++ b/include/JSystem/JKernel/JKRAram.h
@@ -21,7 +21,6 @@ public:
u32 getAudioMemSize() const { return mAudioMemorySize; }
u32 getGraphMemory() const { return mGraphMemoryPtr; }
u32 getGraphMemSize() const { return mGraphMemorySize; }
-
//private:
/* 0x00 */ // vtable
/* 0x04 */ // JKRThread
@@ -38,8 +37,8 @@ public:
static JKRAram* create(u32, u32, long, long, long);
static void checkOkAddress(u8*, u32, JKRAramBlock*, u32);
static void changeGroupIdIfNeed(u8*, int);
- static void mainRamToAram(u8*, u32, u32, JKRExpandSwitch, u32, JKRHeap*, int, u32*);
- static void aramToMainRam(u32, u8*, u32, JKRExpandSwitch, u32, JKRHeap*, int, u32*);
+ static JKRAramBlock* mainRamToAram(u8*, u32, u32, JKRExpandSwitch, u32, JKRHeap*, int, u32*);
+ static u8* aramToMainRam(u32, u8*, u32, JKRExpandSwitch, u32, JKRHeap*, int, u32*);
static void dump(void);
static JKRAram* getManager() { return sAramObject; }
@@ -73,11 +72,19 @@ inline void* JKRAllocFromAram(u32 size, JKRAramHeap::EAllocMode allocMode) {
return JKRAram::getAramHeap()->alloc(size, allocMode);
}
+inline void JKRFreeToAram(JKRAramBlock* block) {
+ JKRAram::getAramHeap()->free(block);
+}
+
inline void JKRAramToMainRam(u32 p1, u8* p2, u32 p3, JKRExpandSwitch p4, u32 p5, JKRHeap* p6,
int p7, u32* p8) {
JKRAram::aramToMainRam(p1, p2, p3, p4, p5, p6, p7, p8);
}
+inline JKRAramBlock *JKRMainRamToAram(u8 *buf, u32 bufSize, u32 alignedSize, JKRExpandSwitch expandSwitch, u32 fileSize, JKRHeap *heap, int id, u32 *pSize) {
+ return JKRAram::mainRamToAram(buf, bufSize, alignedSize, expandSwitch, fileSize, heap, id, pSize);
+}
+
// void JKRDecompressFromAramToMainRam(u32, void*, u32, u32, u32, u32*);
#endif /* JKRARAM_H */
diff --git a/include/JSystem/JKernel/JKRAramHeap.h b/include/JSystem/JKernel/JKRAramHeap.h
index 48293cba8d..23a80a78c2 100644
--- a/include/JSystem/JKernel/JKRAramHeap.h
+++ b/include/JSystem/JKernel/JKRAramHeap.h
@@ -27,6 +27,9 @@ public:
u32 getTotalFreeSize(void);
// u32 getUsedSize(void);
void dump(void);
+ void free(JKRAramBlock *block) {
+ delete block;
+ }
u8 getCurrentGroupID() const { return mGroupId; }
diff --git a/include/JSystem/JKernel/JKRCompArchive.h b/include/JSystem/JKernel/JKRCompArchive.h
index 74490ddfef..d4c17d44b2 100644
--- a/include/JSystem/JKernel/JKRCompArchive.h
+++ b/include/JSystem/JKernel/JKRCompArchive.h
@@ -25,12 +25,12 @@ public:
private:
/* 0x00 */ // vtable
/* 0x04 */ // JKRArchive
- /* 0x5C */ int field_0x5c;
+ /* 0x5C */ int mCompression;
/* 0x60 */ EMountDirection mMountDirection;
/* 0x64 */ int field_0x64;
- /* 0x68 */ JKRAramBlock* field_0x68;
+ /* 0x68 */ JKRAramBlock* mAramPart;
/* 0x6C */ int field_0x6c;
- /* 0x70 */ JKRDvdFile* field_0x70;
+ /* 0x70 */ JKRDvdFile* mDvdFile;
/* 0x74 */ u32 mSizeOfMemPart;
/* 0x78 */ u32 mSizeOfAramPart;
/* 0x7C */ int field_0x7c;
diff --git a/include/JSystem/JKernel/JKRExpHeap.h b/include/JSystem/JKernel/JKRExpHeap.h
index faccd6431c..c8bbca2fb3 100644
--- a/include/JSystem/JKernel/JKRExpHeap.h
+++ b/include/JSystem/JKernel/JKRExpHeap.h
@@ -85,7 +85,7 @@ public:
/* vt[18] */ virtual s32 do_getTotalFreeSize(); /* override */
/* vt[19] */ virtual s32 do_changeGroupID(u8 newGroupID); /* override */
/* vt[20] */ virtual u8 do_getCurrentGroupId(); /* override */
- /* vt[21] */ virtual void state_register(JKRHeap::TState* p, u32 id) const; /* override */
+ /* vt[21] */ virtual u32 state_register(JKRHeap::TState* p, u32 id) const; /* override */
/* vt[22] */ virtual bool state_compare(JKRHeap::TState const& r1,
JKRHeap::TState const& r2) const; /* override */
diff --git a/include/JSystem/JKernel/JKRHeap.h b/include/JSystem/JKernel/JKRHeap.h
index c12504d42f..20d72621a6 100644
--- a/include/JSystem/JKernel/JKRHeap.h
+++ b/include/JSystem/JKernel/JKRHeap.h
@@ -77,7 +77,7 @@ public:
/* vt[18] */ virtual s32 do_getTotalFreeSize() = 0;
/* vt[19] */ virtual s32 do_changeGroupID(u8 newGroupID);
/* vt[20] */ virtual u8 do_getCurrentGroupId();
- /* vt[21] */ virtual void state_register(JKRHeap::TState* p, u32 id) const;
+ /* vt[21] */ virtual u32 state_register(JKRHeap::TState* p, u32 id) const;
/* vt[22] */ virtual bool state_compare(JKRHeap::TState const& r1, JKRHeap::TState const& r2) const;
/* vt[23] */ virtual void state_dump(JKRHeap::TState const& p) const;
diff --git a/include/JSystem/JKernel/JKRSolidHeap.h b/include/JSystem/JKernel/JKRSolidHeap.h
index f3058bb029..89a326945a 100644
--- a/include/JSystem/JKernel/JKRSolidHeap.h
+++ b/include/JSystem/JKernel/JKRSolidHeap.h
@@ -40,7 +40,7 @@ public:
/* vt[17] */ virtual void* do_getMaxFreeBlock(void); /* override */
/* vt[18] */ virtual s32 do_getTotalFreeSize(void); /* override */
- /* vt[21] */ virtual void state_register(JKRHeap::TState*, u32) const; /* override */
+ /* vt[21] */ virtual u32 state_register(JKRHeap::TState*, u32) const; /* override */
/* vt[22] */ virtual bool state_compare(JKRHeap::TState const&,
JKRHeap::TState const&) const; /* override */
diff --git a/include/JSystem/JParticle/JPAKeyBlock.h b/include/JSystem/JParticle/JPAKeyBlock.h
index 701b252ea0..2f29e74acf 100644
--- a/include/JSystem/JParticle/JPAKeyBlock.h
+++ b/include/JSystem/JParticle/JPAKeyBlock.h
@@ -3,4 +3,13 @@
#include "dolphin/types.h"
+struct JPAKeyBlock {
+ /* 8027D730 */ JPAKeyBlock(u8 const*);
+ /* 8027D740 */ void calc(f32);
+
+ const u8* mDataStart;
+ const f32* field_0x4;
+};
+
+
#endif /* JPAKEYBLOCK_H */
diff --git a/include/JSystem/JParticle/JPAMath.h b/include/JSystem/JParticle/JPAMath.h
index abad96a07d..7bb10f6101 100644
--- a/include/JSystem/JParticle/JPAMath.h
+++ b/include/JSystem/JParticle/JPAMath.h
@@ -7,5 +7,6 @@
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);
+void JPACalcKeyAnmValue(f32 param_0, u16 param_1, f32 const* param_2);
#endif /* JPAMATH_H */
diff --git a/include/JSystem/JStudio/JStudio/fvb-data-parse.h b/include/JSystem/JStudio/JStudio/fvb-data-parse.h
index 93e6ba3b11..16b3627827 100644
--- a/include/JSystem/JStudio/JStudio/fvb-data-parse.h
+++ b/include/JSystem/JStudio/JStudio/fvb-data-parse.h
@@ -39,6 +39,7 @@ public:
/* 0x04 */ u32 u32Size;
/* 0x08 */ u32 u32Type;
/* 0x0C */ const void* pContent;
+ /* 0x10 */ const void* next;
};
TParse_TParagraph(const void* content) : TParseData_aligned<4>(content) {}
diff --git a/include/JSystem/JStudio/JStudio/stb-data-parse.h b/include/JSystem/JStudio/JStudio/stb-data-parse.h
index b21486fcfb..3c99071395 100644
--- a/include/JSystem/JStudio/JStudio/stb-data-parse.h
+++ b/include/JSystem/JStudio/JStudio/stb-data-parse.h
@@ -65,10 +65,10 @@ public:
struct TParse_TParagraph_data : public TParseData_aligned<4> {
struct TData {
- /* 0x00 */ u8 _0;
- /* 0x04 */ u32 _4;
+ /* 0x00 */ u8 status;
+ /* 0x04 */ u32 dataSize;
/* 0x08 */ u32 _8;
- /* 0x0C */ const void* _c;
+ /* 0x0C */ const void* fileCount;
/* 0x10 */ const void* _10;
};
diff --git a/include/JSystem/JUtility/JUTConsole.h b/include/JSystem/JUtility/JUTConsole.h
index 1fe9467b99..3fa010ded3 100644
--- a/include/JSystem/JUtility/JUTConsole.h
+++ b/include/JSystem/JUtility/JUTConsole.h
@@ -148,6 +148,7 @@ extern "C" JUTConsole* JUTGetWarningConsole();
extern "C" void JUTReportConsole_f_va(const char*, va_list);
extern "C" void JUTReportConsole_f(const char*, ...);
extern "C" void JUTWarningConsole(const char* message);
+extern "C" void JUTWarningConsole_f(const char* message, ...);
extern "C" void JUTReportConsole(const char* message);
#endif /* JUTCONSOLE_H */
diff --git a/include/JSystem/JUtility/JUTGraphFifo.h b/include/JSystem/JUtility/JUTGraphFifo.h
index 8dae2c7b90..e7c925663a 100644
--- a/include/JSystem/JUtility/JUTGraphFifo.h
+++ b/include/JSystem/JUtility/JUTGraphFifo.h
@@ -32,4 +32,6 @@ private:
/* 0x10 */ u8 field_0x10[0xC];
};
+inline void JUTCreateFifo(u32 bufSize) { new JUTGraphFifo(bufSize); }
+
#endif /* JUTGRAPHFIFO_H */