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
This commit is contained in:
hatal175
2023-08-06 06:12:26 +03:00
committed by GitHub
parent 8b34c0210f
commit dc985026fa
79 changed files with 519 additions and 2705 deletions
+2 -2
View File
@@ -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);
+56
View File
@@ -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 */
+28
View File
@@ -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 */
+2
View File
@@ -5,6 +5,8 @@
struct JASOscillator {
struct Point {};
struct Data {
/* 0x00 */ u32 _00;
/* 0x04 */ f32 _04;
+13 -9
View File
@@ -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;
+6
View File
@@ -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;
};
+1 -1
View File
@@ -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;
+4
View File
@@ -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;
+1 -1
View File
@@ -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);
+11 -2
View File
@@ -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*);
+3 -2
View File
@@ -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;