summaryrefslogtreecommitdiff
path: root/include/JSystem
diff options
context:
space:
mode:
authorhatal175 <hatal175@users.noreply.github.com>2023-08-06 06:12:26 +0300
committerGitHub <noreply@github.com>2023-08-05 21:12:26 -0600
commitdc985026fa6545bede38d841b7100eceb34e97e4 (patch)
tree2cc4ea27185775862f14ca64a5e99d401046f40f /include/JSystem
parent8b34c0210f686db96979c9a36aea45e6dda7169a (diff)
Jsystem work (#399)
* Almost match JASBasicInst * JASDrumSet OK * Some JAudio2 struct adjustment * Match JKRHeap::callAllDisposer * JAISe OK * Fix setAutoDelete * JAISound OK * Match a few functions in linklist * Few matches in d_a_e_ym * JUTTexture OK * Work on JUTGamePad * Import JUTResource * Work on JUTResFont::getFontCode
Diffstat (limited to 'include/JSystem')
-rw-r--r--include/JSystem/JAudio2/JAISe.h4
-rw-r--r--include/JSystem/JAudio2/JASBasicInst.h56
-rw-r--r--include/JSystem/JAudio2/JASDrumSet.h28
-rw-r--r--include/JSystem/JAudio2/JASOscillator.h2
-rw-r--r--include/JSystem/JAudio2/JASTrack.h22
-rw-r--r--include/JSystem/JGadget/linklist.h6
-rw-r--r--include/JSystem/JUtility/JUTFont.h2
-rw-r--r--include/JSystem/JUtility/JUTPalette.h4
-rw-r--r--include/JSystem/JUtility/JUTResFont.h2
-rw-r--r--include/JSystem/JUtility/JUTResource.h13
-rw-r--r--include/JSystem/JUtility/JUTTexture.h5
11 files changed, 127 insertions, 17 deletions
diff --git a/include/JSystem/JAudio2/JAISe.h b/include/JSystem/JAudio2/JAISe.h
index 3c28fa464a..1125bcb701 100644
--- a/include/JSystem/JAudio2/JAISe.h
+++ b/include/JSystem/JAudio2/JAISe.h
@@ -26,8 +26,8 @@ public:
/* 0x27c */ JAITempoMgr mTempoMgr;
};
- /* 8029F6D8 */ virtual bool getNumChild() const;
- /* 8029F6E0 */ virtual bool getChild(int);
+ /* 8029F6D8 */ virtual s32 getNumChild() const;
+ /* 8029F6E0 */ virtual JAISoundChild* getChild(int);
/* 8029F6E8 */ virtual void releaseChild(int);
/* 8029F84C */ virtual JASTrack* getTrack();
/* 8029F854 */ virtual JASTrack* getChildTrack(int);
diff --git a/include/JSystem/JAudio2/JASBasicInst.h b/include/JSystem/JAudio2/JASBasicInst.h
index 11463bf472..5c5e622b43 100644
--- a/include/JSystem/JAudio2/JASBasicInst.h
+++ b/include/JSystem/JAudio2/JASBasicInst.h
@@ -2,5 +2,61 @@
#define JASBASICINST_H
#include "dolphin/types.h"
+#include "JSystem/JAudio2/JASOscillator.h"
+#include "JSystem/JAudio2/JASSoundParams.h"
+
+struct JKRHeap;
+struct JASInstParam : public JASSoundParams {
+ JASInstParam() {
+ field_0x14 = NULL;
+ field_0x18 = 0;
+ field_0x1a = 0;
+ field_0x1c = 0;
+ field_0x1d = 0;
+ field_0x1e = 0;
+ }
+
+ JASOscillator::Data** field_0x14;
+ u16 field_0x18;
+ u16 field_0x1a;
+ u8 field_0x1c;
+ u8 field_0x1d;
+ u8 field_0x1e;
+};
+
+struct JASInst {
+ virtual ~JASInst() {}
+ virtual bool getParam(int, int, JASInstParam*) const = 0;
+ virtual u32 getType() const = 0;
+};
+
+struct JASBasicInst : public JASInst {
+ struct TKeymap {
+ /* 80298250 */ ~TKeymap();
+ /* 802982D4 */ TKeymap();
+
+ s32 field_0x0;
+ u16 field_0x4;
+ u16 field_0x6;
+ f32 field_0x8;
+ f32 field_0xc;
+ };
+
+ /* 80298014 */ JASBasicInst();
+ /* 8029819C */ void setKeyRegionCount(u32, JKRHeap*);
+ /* 8029821C */ void setOsc(int, JASOscillator::Data const*);
+ /* 8029822C */ TKeymap* getKeyRegion(int);
+
+ /* 8029807C */ virtual ~JASBasicInst();
+ /* 802980F8 */ virtual bool getParam(int, int, JASInstParam*) const;
+ /* 802982E0 */ virtual u32 getType() const { return 'BSIC'; };
+
+ f32 mVolume;
+ f32 mPitch;
+ JASOscillator::Data const* field_0xc[2];
+ u32 mKeymapCount;
+ TKeymap* mKeymap;
+};
+
#endif /* JASBASICINST_H */
diff --git a/include/JSystem/JAudio2/JASDrumSet.h b/include/JSystem/JAudio2/JASDrumSet.h
index 14349d0842..389b9f6bb2 100644
--- a/include/JSystem/JAudio2/JASDrumSet.h
+++ b/include/JSystem/JAudio2/JASDrumSet.h
@@ -2,5 +2,33 @@
#define JASDRUMSET_H
#include "dolphin/types.h"
+#include "JSystem/JAudio2/JASBasicInst.h"
+
+struct JKRHeap;
+
+struct JASDrumSet : public JASInst {
+ struct TPerc {
+ /* 802984C4 */ TPerc();
+ /* 802984E4 */ void setRelease(u32);
+
+ f32 mVolume;
+ f32 mPitch;
+ f32 mPan;
+ u16 field_0xc;
+ u16 field_0xe;
+ f32 field_0x10;
+ f32 field_0x14;
+ };
+
+ /* 802982EC */ JASDrumSet();
+ /* 80298314 */ virtual ~JASDrumSet();
+ /* 80298370 */ void newPercArray(u8, JKRHeap*);
+ /* 802983CC */ virtual bool getParam(int, int, JASInstParam*) const;
+ /* 802984B4 */ void setPerc(int, JASDrumSet::TPerc*);
+ /* 802984EC */ virtual u32 getType() const;
+
+ TPerc** field_0x4;
+ u8 field_0x8;
+};
#endif /* JASDRUMSET_H */
diff --git a/include/JSystem/JAudio2/JASOscillator.h b/include/JSystem/JAudio2/JASOscillator.h
index 07a4259c67..fce78363b5 100644
--- a/include/JSystem/JAudio2/JASOscillator.h
+++ b/include/JSystem/JAudio2/JASOscillator.h
@@ -5,6 +5,8 @@
struct JASOscillator {
+ struct Point {};
+
struct Data {
/* 0x00 */ u32 _00;
/* 0x04 */ f32 _04;
diff --git a/include/JSystem/JAudio2/JASTrack.h b/include/JSystem/JAudio2/JASTrack.h
index bc5879bdf9..8ac09ae187 100644
--- a/include/JSystem/JAudio2/JASTrack.h
+++ b/include/JSystem/JAudio2/JASTrack.h
@@ -2,6 +2,7 @@
#define JASTRACK_H
#include "JSystem/JAudio2/JASGadget.h"
+#include "JSystem/JAudio2/JASOscillator.h"
struct JASSoundParams;
@@ -15,12 +16,6 @@ struct JASDsp {
static u32 FILTER_MODE_IIR;
};
-struct JASOscillator {
- struct Point {};
-
- struct Data {};
-};
-
struct JASChannel {
/* 8029AAD0 */ void release(u16);
/* 8029AB64 */ void setOscInit(u32, JASOscillator::Data const*);
@@ -126,8 +121,8 @@ struct JASTrack {
int getChannelMgrCount() { return channelMgrCount; }
u8 getStatus() const { return mStatus; }
JASTrack* getChild(u32 index) { return field_0x130[index]; }
- void setAutoDelete(bool param_0) {
- field_0x216 = (param_0 << 4) | field_0x216 & ~0x10;
+ inline void setAutoDelete(u8 param_0) {
+ field_0x216.autoDelete = param_0;
}
/* 0x000 */ u8 field_0x0[0x5c]; // JASSeqCtrl
@@ -154,7 +149,16 @@ struct JASTrack {
/* 0x204 */ short field_0x204[8];
/* 0x214 */ char field_0x214;
/* 0x215 */ u8 mStatus;
- /* 0x216 */ u8 field_0x216;
+ /* 0x216 */ struct {
+ u8 flag0 : 1;
+ u8 flag1 : 1;
+ u8 flag2 : 1;
+ u8 autoDelete : 1;
+ u8 flag4 : 1;
+ u8 flag5 : 1;
+ u8 flag6 : 1;
+ u8 flag7 : 1;
+ } field_0x216;
/* 0x218 */ f32 field_0x218;
/* 0x21C */ f32 field_0x21c;
/* 0x220 */ u32 field_0x220;
diff --git a/include/JSystem/JGadget/linklist.h b/include/JSystem/JGadget/linklist.h
index 09ae30d0d8..f322a59046 100644
--- a/include/JSystem/JGadget/linklist.h
+++ b/include/JSystem/JGadget/linklist.h
@@ -10,6 +10,8 @@ struct TLinkListNode {
mPrev = NULL;
}
+ TLinkListNode* getNext() { return mNext; }
+
/* 0x0 */ TLinkListNode* mNext;
/* 0x4 */ TLinkListNode* mPrev;
}; // Size: 0x8
@@ -18,6 +20,10 @@ struct TNodeLinkList {
struct iterator {
iterator(TLinkListNode* pNode) { node = pNode; }
iterator(const iterator& iter) { *this = iter; }
+ iterator& operator++() {
+ node = node->getNext();
+ return *this;
+ }
TLinkListNode* node;
};
diff --git a/include/JSystem/JUtility/JUTFont.h b/include/JSystem/JUtility/JUTFont.h
index f5617007dd..8aef329401 100644
--- a/include/JSystem/JUtility/JUTFont.h
+++ b/include/JSystem/JUtility/JUTFont.h
@@ -80,7 +80,7 @@ public:
/* 0x2C */ virtual void getWidthEntry(int i_no, TWidth* width) const = 0;
/* 0x30 */ virtual int getCellWidth() const;
/* 0x34 */ virtual s32 getCellHeight() const;
- /* 0x38 */ virtual u16 getFontType() const = 0;
+ /* 0x38 */ virtual int getFontType() const = 0;
/* 0x3C */ virtual ResFONT* getResFont() const = 0;
/* 0x40 */ virtual bool isLeadByte(int a1) const = 0;
diff --git a/include/JSystem/JUtility/JUTPalette.h b/include/JSystem/JUtility/JUTPalette.h
index 9705458d01..19ad39c29f 100644
--- a/include/JSystem/JUtility/JUTPalette.h
+++ b/include/JSystem/JUtility/JUTPalette.h
@@ -28,6 +28,10 @@ public:
/* 802DE95C */ bool load();
u8 getTlutName() const { return mTlutName; }
+ u8 getFormat() const { return mFormat; }
+ u8 getTransparency() const { return mTransparency; }
+ u16 getNumColors() const { return mNumColors; }
+ ResTLUT* getColorTable() const { return mColorTable; }
private:
/* 0x00 */ _GXTlutObj mTlutObj;
diff --git a/include/JSystem/JUtility/JUTResFont.h b/include/JSystem/JUtility/JUTResFont.h
index 401eee9fd4..426429b6f4 100644
--- a/include/JSystem/JUtility/JUTResFont.h
+++ b/include/JSystem/JUtility/JUTResFont.h
@@ -29,7 +29,7 @@ public:
/* 802DFC64 */ virtual void getWidthEntry(int, JUTFont::TWidth*) const;
/* 802DFD0C */ virtual int getCellWidth() const;
/* 802DFD58 */ virtual s32 getCellHeight() const;
- /* 802DDFE0 */ virtual u16 getFontType() const;
+ /* 802DDFE0 */ virtual int getFontType() const;
/* 802DDFD8 */ virtual ResFONT* getResFont() const;
/* 802DFDA4 */ virtual bool isLeadByte(int) const;
/* 802DFF60 */ virtual void loadImage(int, _GXTexMapID);
diff --git a/include/JSystem/JUtility/JUTResource.h b/include/JSystem/JUtility/JUTResource.h
index 3f4846caba..8a6b3120c0 100644
--- a/include/JSystem/JUtility/JUTResource.h
+++ b/include/JSystem/JUtility/JUTResource.h
@@ -8,10 +8,19 @@ class JSUInputStream;
class JUTResReference {
private:
- u8 unk_0x0[0x101];
+ /* 0x001 */ u8 mType;
+ /* 0x002 */ u8 mNameLength;
+ /* 0x003 */ char mName[0x100];
public:
- JUTResReference() { unk_0x0[0] = 0; }
+ enum ResType {
+ RESTYPE_Null = 0,
+ RESTYPE_Unk1 = 1,
+ RESTYPE_Unk2 = 2,
+ RESTYPE_Unk3 = 3,
+ RESTYPE_Unk4 = 4,
+ };
+ JUTResReference() { mType = 0; }
/* 802DE078 */ void* getResource(JSUInputStream*, u32, JKRArchive*);
/* 802DE120 */ void* getResource(void const*, u32, JKRArchive*);
/* 802DE1BC */ void* getResource(u32, JKRArchive*);
diff --git a/include/JSystem/JUtility/JUTTexture.h b/include/JSystem/JUtility/JUTTexture.h
index c9c179af1e..d3e19a1f95 100644
--- a/include/JSystem/JUtility/JUTTexture.h
+++ b/include/JSystem/JUtility/JUTTexture.h
@@ -65,6 +65,7 @@ public:
void setCaptureFlag(bool flag) { mFlags &= 2 | flag; }
u8 getCaptureFlag() const { return mFlags & 1; }
u8 getEmbPaletteDelFlag() const { return mFlags & 2; }
+ void setEmbPaletteDelFlag(bool flag) { mFlags = (mFlags & 1) | (flag << 1);}
u8 getTlutName() const { return mTlutName; }
private:
@@ -77,8 +78,8 @@ private:
/* 0x31 */ u8 mWrapT;
/* 0x32 */ u8 mMinFilter;
/* 0x33 */ u8 mMagFilter;
- /* 0x34 */ s16 mMinLOD;
- /* 0x36 */ s16 mMaxLOD;
+ /* 0x34 */ u16 mMinLOD;
+ /* 0x36 */ u16 mMaxLOD;
/* 0x38 */ s16 mLODBias;
/* 0x3A */ u8 mTlutName;
/* 0x3B */ u8 mFlags;