JASChannelMgr and JASBankMgr OK

This commit is contained in:
LagoLunatic
2026-08-28 20:42:59 -04:00
parent e5b3616f36
commit e9f0482395
17 changed files with 467 additions and 132 deletions
+5 -3
View File
@@ -11,17 +11,19 @@ namespace JASystem {
class TBank {
public:
TBank() {
field_0x4 = 0;
mWaveBank = 0;
}
virtual ~TBank() {}
virtual TInst* getInst(int) const = 0;
virtual u32 getType() const = 0;
static JKRHeap* getCurrentHeap();
void assignWaveBank(const TWaveBank* waveBank) { mWaveBank = waveBank; }
const TWaveBank* getWaveBank() const { return mWaveBank; }
static JKRHeap* getCurrentHeap();
static JKRHeap* sCurrentHeap;
/* 0x04 */ TWaveBank* field_0x4;
/* 0x04 */ const TWaveBank* mWaveBank;
};
}
+4 -3
View File
@@ -15,12 +15,13 @@ namespace JASystem {
const JASystem::TWaveInfo* getWaveInfo() const {
return &mWaveInfo;
}
const void* getWavePtr() const {
intptr_t getWavePtr() const {
JUT_ASSERT(77, mHeap);
if (!mHeap->mBase) {
void* base = mHeap->getBase();
if (base == NULL) {
return NULL;
}
return (u8*)mHeap->mBase + mWaveInfo.mWavePtrOffs;
return (intptr_t)base + mWaveInfo.mWavePtrOffs;
}
/* 0x04 */ JASystem::TWaveInfo mWaveInfo;
+1 -1
View File
@@ -11,7 +11,7 @@ namespace JASystem {
namespace TGlobalChannel {
TChannel* getChannelHandle(u32);
void init();
int alloc(TChannelMgr*, u32);
u32 alloc(TChannelMgr*, u32);
int release(TChannel*);
int releaseAll(TChannelMgr*);
+7 -12
View File
@@ -31,7 +31,7 @@ namespace JASystem {
} mParts;
};
TChannel() : field_0x4(NULL), field_0x8(NULL), field_0x20(NULL), field_0x24(NULL), field_0xd8(this) {
TChannel() : field_0x4(NULL), field_0x8(NULL), field_0x20(NULL), mNext(NULL), field_0xd8(this) {
for (int i = 0; i < 4; i++) {
osc[i] = NULL;
}
@@ -74,9 +74,7 @@ namespace JASystem {
u8 getNoteOnPriority() const { return field_0x48; }
u8 getReleasePriority() const { return field_0x48 >> 8; }
u8 getLifeTimePriority() const { return field_0x48 >> 0x10; }
// TODO
void setSkipSamples(u32) {}
void setSkipSamples(u32 samples) { mSkipSamples = samples; }
/* 0x00 */ u8 field_0x0;
/* 0x01 */ u8 field_0x1;
@@ -86,11 +84,11 @@ namespace JASystem {
/* 0x08 */ TChannel** field_0x8;
/* 0x0C */ u8 field_0xc;
/* 0x10 */ Driver::Wave_* field_0x10;
/* 0x14 */ int field_0x14;
/* 0x14 */ u32 field_0x14; // TODO: sometimes used as an intptr, sometimes not...?
/* 0x18 */ int field_0x18;
/* 0x1C */ int field_0x1c;
/* 0x20 */ TDSPChannel* field_0x20;
/* 0x24 */ TChannel* field_0x24;
/* 0x24 */ TChannel* mNext;
/* 0x28 */ BOOL (*field_0x28)(TChannel*, u32);
/* 0x2C */ u32 (*field_0x2c)(TChannel*, u32);
/* 0x30 */ int field_0x30;
@@ -103,10 +101,7 @@ namespace JASystem {
/* 0x58 */ f32 field_0x58;
/* 0x5C */ f32 field_0x5c;
/* 0x60 */ u8 mCalcTypes[3]; // Pan, FxMix, ?
/* 0x64 */ Driver::PanMatrix_ mPanPower;
/* 0x70 */ Driver::PanMatrix_ mPanVec;
/* 0x7C */ Driver::PanMatrix_ mFxmixVec;
/* 0x88 */ Driver::PanMatrix_ mDolbyVec;
/* 0x64 */ Driver::PanMatrix_ field_0x6c[4]; // PanPower, PanVec, FxmixVec, DolbyVec?
/* 0x94 */ f32 field_0x94;
/* 0x98 */ f32 field_0x98;
/* 0x9C */ f32 field_0x9c;
@@ -118,11 +113,11 @@ namespace JASystem {
/* 0xB0 */ MixConfig mMixConfigs[6];
/* 0xBC */ u16 field_0xbc[6];
/* 0xC8 */ u16 field_0xc8;
/* 0xCC */ int field_0xcc;
/* 0xCC */ u32 field_0xcc;
/* 0xD0 */ int field_0xd0;
/* 0xD4 */ int field_0xd4;
/* 0xD8 */ JSULink<TChannel> field_0xd8;
/* 0xE8 */ u32 field_0xe8;
/* 0xE8 */ u32 mSkipSamples;
};
}
+2 -2
View File
@@ -19,11 +19,11 @@ namespace JASystem {
void addListTail(TChannel*, u32);
TChannel* getListHead(u32);
int cutList(TChannel*);
void receiveAllChannels(TChannelMgr*);
int receiveAllChannels(TChannelMgr*);
int checkLimitStart(u32);
void checkLimitStop(TChannel*, u32);
/* 0x00 */ u32 field_0x0;
/* 0x00 */ u32 mManagedChannels;
/* 0x04 */ u32 field_0x4;
/* 0x08 */ TChannel* field_0x8;
/* 0x0C */ TChannel* field_0xc;
+3 -2
View File
@@ -27,8 +27,9 @@ namespace JASystem {
JASystem::Kernel::THeap* getTailHeap();
u32 getTailOffset();
u32 getCurOffset();
bool isAllocated() { return mBase; }
void* getBase() { return mBase; }
bool isAllocated() const { return mBase != NULL; }
/* 0x00 */ JSUTree<THeap> mTree;
/* 0x1C */ OSMutex mMutex;
+4 -3
View File
@@ -13,11 +13,12 @@ namespace JASystem {
TWaveHandle() { mHeap = NULL; }
~TWaveHandle();
const TWaveInfo* getWaveInfo() const { return &mWaveInfo; }
const void* getWavePtr() const {
if (mHeap->mBase == NULL) {
intptr_t getWavePtr() const {
void* base = mHeap->getBase();
if (base == NULL) {
return NULL;
}
return (u8*)mHeap->mBase + mWaveInfo.mWavePtrOffs;
return (intptr_t)base + mWaveInfo.mWavePtrOffs;
}
/* 0x04 */ TWaveInfo mWaveInfo;
+9 -1
View File
@@ -30,11 +30,19 @@ namespace JASystem {
void setEntryNum(s32);
void setFileName(const char*);
// fake struct name
struct loadToAramCallbackMsg {
JASystem::TWaveArc* mpWaveArc;
s32 mEntryNum;
uintptr_t mBase;
u32 field_0xc;
};
/* 0x04 */ Kernel::THeap mHeap;
/* 0x4C */ int field_0x4c;
/* 0x50 */ OSMutex mMutex;
/* 0x68 */ int field_0x68;
/* 0x6C */ int mFileNo;
/* 0x6C */ s32 mEntryNum;
/* 0x70 */ int mSize;
/* 0x74 */ int field_0x74;
};
+1 -1
View File
@@ -29,7 +29,7 @@ namespace JASystem {
public:
virtual ~TWaveHandle() {}
virtual const TWaveInfo* getWaveInfo() const = 0;
virtual const void* getWavePtr() const = 0;
virtual intptr_t getWavePtr() const = 0;
};
class TWaveBank {