JAudio2 debug (#3006)

This commit is contained in:
Jcw87
2025-12-27 14:23:15 -08:00
committed by GitHub
parent ce41820bf0
commit 038b8fd62f
39 changed files with 629 additions and 297 deletions
+5 -1
View File
@@ -111,7 +111,11 @@ public:
virtual bool isUsingSeqData(const JAISeqDataRegion& seqDataRegion);
virtual int releaseSeqData(const JAISeqDataRegion& seqDataRegion);
JAISeCategoryMgr* getCategory(int index) { return &mCategoryMgrs[index]; }
JAISeCategoryMgr* getCategory(int categoryIndex) {
JUT_ASSERT(222, categoryIndex >= 0);
JUT_ASSERT(223, categoryIndex < NUM_CATEGORIES);
return &mCategoryMgrs[categoryIndex];
}
JAIAudience* getAudience() { return mAudience; }
JAIAudience* getAudience(int index) {
if (index >= 0 && index < NUM_CATEGORIES) {
+2 -1
View File
@@ -12,7 +12,7 @@ class JAISoundChild;
* @ingroup jsystem-jaudio
*
*/
class JAISeq : public JASPoolAllocObject<JAISeq>, public JAISound, public JSULink<JAISeq> {
class JAISeq : public JAISound, public JSULink<JAISeq>, public JASPoolAllocObject<JAISeq> {
public:
static const int NUM_CHILDREN = 32;
@@ -53,6 +53,7 @@ public:
void JAISeqMgr_mixOut_(const JASSoundParams& params, JAISoundActivity activity);
const JAISeqData& getSeqData() const { return inner_.mSeqData; }
s32 getCategory() const { return inner_.field_0x39c; }
/* 0x0A8 */ TInner inner_;
/* 0x3A8 */ JAISoundStrategyMgr__unknown<JAISeq>* field_0x3a8;
+2 -2
View File
@@ -14,8 +14,8 @@ struct JAISeqData {
field_0x4 = param_1;
}
void set(void* param_0, u32 param_1) {
field_0x0 = param_0;
void set(const void* param_0, u32 param_1) {
field_0x0 = (void*)param_0;
field_0x4 = param_1;
}
+31 -1
View File
@@ -6,6 +6,36 @@
#include "JSystem/JUtility/JUTAssert.h"
#include "global.h"
class JAISound;
/**
* @ingroup jsystem-jaudio
*
*/
class JAISoundHandle {
public:
JAISoundHandle() {sound_ = NULL;};
~JAISoundHandle() { releaseSound(); }
bool isSoundAttached() const { return sound_ != NULL; }
JAISound* getSound() {
JUT_ASSERT(41, sound_ != NULL);
return sound_;
}
JAISound* operator->() const {
JUT_ASSERT(58, sound_ != NULL);
return sound_;
}
operator bool() const { return isSoundAttached(); }
void releaseSound();
JAISound* sound_;
};
/**
* @ingroup jsystem-jaudio
*
@@ -63,7 +93,7 @@ struct JAISoundStatus_ {
bool isMute() const { return field_0x0.flags.mute; }
bool isPaused() const { return field_0x0.flags.paused; }
void pauseWhenOut() {
field_0x1.flags.flag6 = 1;
field_0x1.flags.flag3 = 1;
}
/* 0x0 */ union {
-28
View File
@@ -7,34 +7,6 @@
class JAISound;
class JAISoundID;
/**
* @ingroup jsystem-jaudio
*
*/
class JAISoundHandle {
public:
JAISoundHandle() {sound_ = NULL;};
~JAISoundHandle() { releaseSound(); }
bool isSoundAttached() const { return sound_ != NULL; }
JAISound* getSound() {
JUT_ASSERT(41, sound_ != NULL);
return sound_;
}
JAISound* operator->() const {
JUT_ASSERT(58, sound_ != NULL);
return sound_;
}
operator bool() const { return isSoundAttached(); }
void releaseSound();
JAISound* sound_;
};
/**
* @ingroup jsystem-jaudio
*
+1 -1
View File
@@ -11,7 +11,7 @@ class JAIStreamMgr;
* @ingroup jsystem-jaudio
*
*/
class JAIStream : public JASPoolAllocObject<JAIStream>, public JAISound, public JSULink<JAIStream> {
class JAIStream : public JAISound, public JSULink<JAIStream>, public JASPoolAllocObject<JAIStream> {
public:
struct TInner {
JASAramStream aramStream_;
+3 -1
View File
@@ -17,6 +17,7 @@ enum JASMixMode {
namespace JASDriver {
typedef s16* (*MixCallback)(s32);
typedef void (*MixFunc)(s16*, u32, MixCallback);
typedef void (*DSPBufCallback)(s16*, u32);
void initAI(void (*)(void));
void startDMA();
@@ -27,6 +28,7 @@ namespace JASDriver {
void readDspBuffer(s16*, u32);
void finishDSPFrame();
void registerMixCallback(MixCallback, JASMixMode);
void registDSPBufCallback(DSPBufCallback);
f32 getDacRate();
u32 getSubFrames();
u32 getDacSize();
@@ -48,7 +50,7 @@ namespace JASDriver {
extern s32 sDspDacWriteBuffer;
extern s32 sDspDacReadBuffer;
extern s32 sDspStatus;
extern void (*sDspDacCallback)(s16*, u32);
extern DSPBufCallback sDspDacCallback;
extern s16* lastRspMadep;
extern void (*dacCallbackFunc)(s16*, u32);
extern MixCallback extMixCallback;
+2 -2
View File
@@ -18,8 +18,8 @@ struct JASAudioReseter {
/* 0x0 */ u32 field_0x0;
/* 0x4 */ f32 mDSPLevel;
/* 0x8 */ s32 mIsDone;
/* 0xC */ bool field_0xc;
/* 0x8 */ s32 mDoneFlag;
/* 0xC */ bool mThreadStopFlag;
}; // Size: 0x10
#endif /* JASAUDIORESETER_H */
+4 -1
View File
@@ -132,7 +132,10 @@ namespace JASBNKParser {
JASBank* createBank(void const*, JKRHeap*);
JASBasicBank* createBasicBank(void const*, JKRHeap*);
inline u32 getBankNumber(const void* param_0) { return ((u32*)param_0)[2]; }
inline u32 getBankNumber(const void* param_0) {
u32* ptr = (u32*)param_0;
return ptr[2];
}
extern u32 sUsedHeapSize;
};
+5 -5
View File
@@ -10,9 +10,9 @@
*/
struct JASBasicWaveBank : public JASWaveBank {
struct TWaveHandle : public JASWaveHandle {
int getWavePtr() const;
TWaveHandle() { mHeap = NULL; }
const JASWaveInfo* getWaveInfo() const { return &field_0x4; }
virtual int getWavePtr() const;
virtual const JASWaveInfo* getWaveInfo() const { return &field_0x4; }
bool compareHeap(JASHeap* heap) const { return mHeap == heap;}
/* 0x04 */ JASWaveInfo field_0x4;
@@ -31,10 +31,10 @@ struct JASBasicWaveBank : public JASWaveBank {
struct TWaveGroup : JASWaveArc {
TWaveGroup();
~TWaveGroup();
virtual ~TWaveGroup();
void setWaveCount(u32, JKRHeap*);
void onLoadDone();
void onEraseDone();
virtual void onLoadDone();
virtual void onEraseDone();
u32 getWaveID(int) const;
/* 0x74 */ JASBasicWaveBank* mBank;
+3
View File
@@ -38,6 +38,9 @@ struct JASDSPChannel {
static void updateAll();
static int killActiveChannel();
static JASDSPChannel* getHandle(u32);
static u32 getNumUse();
static u32 getNumFree();
static u32 getNumBreak();
static JASDSPChannel* sDspChannels;
+8 -6
View File
@@ -19,14 +19,14 @@ namespace JASDsp {
};
typedef struct {
s16 field_0x0;
s16 field_0x2;
u16 field_0x0;
u16 field_0x2;
s16* field_0x4;
s16 field_0x8;
u16 field_0x8;
s16 field_0xa;
s16 field_0xc;
u16 field_0xc;
s16 field_0xe;
s16 field_0x10[8];
u16 field_0x10[8];
} FxBuf;
struct TChannel {
@@ -63,7 +63,7 @@ namespace JASDsp {
/* 0x00E */ short field_0x00E;
/* 0x010 */ u16 field_0x010[1][4]; // array size unknown
/* 0x018 */ u8 field_0x018[0x050 - 0x018];
/* 0x050 */ short field_0x050;
/* 0x050 */ u16 field_0x050;
/* 0x052 */ u16 field_0x052;
/* 0x054 */ u16 field_0x054;
/* 0x056 */ u16 field_0x056;
@@ -106,11 +106,13 @@ namespace JASDsp {
void setDSPMixerLevel(f32);
f32 getDSPMixerLevel();
TChannel* getDSPHandle(int);
TChannel* getDSPHandleNc(int);
void setFilterTable(s16*, s16*, u32);
void flushBuffer();
void invalChannelAll();
void initBuffer();
int setFXLine(u8, s16*, JASDsp::FxlineConfig_*);
BOOL changeFXLineParam(u8, u8, u32);
extern u8 const DSPADPCM_FILTER[64];
extern u32 const DSPRES_FILTER[320];
+1
View File
@@ -8,6 +8,7 @@ typedef s32 (*DriverCallback)(void*);
namespace JASDriver {
void setDSPLevel(f32);
u16 getChannelLevel_dsp();
f32 getChannelLevel();
f32 getDSPLevel();
void setOutputMode(u32);
u32 getOutputMode();
@@ -31,4 +31,23 @@ public:
/* 0x0C */ JAUSection* mSection;
};
class JAUAudioArcLoader_withoutCopy : public JAUAudioArcInterpreter {
virtual void readWS(u32, void const*, u32);
virtual void readBNK(u32, void const*);
virtual void readBSC(void const*, u32);
virtual void readBST(void const*, u32);
virtual void readBSTN(void const*, u32);
virtual void readBMS(u32, void const*, u32);
virtual void readBMS_fromArchive(u32);
virtual void newVoiceBank(u32, u32);
virtual void newDynamicSeqBlock(u32);
virtual void readBSFT(void const*);
virtual void beginBNKList(u32, u32);
virtual void endBNKList();
virtual void readMaxSeCategory(int, int, int);
virtual ~JAUAudioArcLoader_withoutCopy() {}
/* 0x0C */ JAUSection* mSection;
};
#endif /* JAUAUDIOARCLOADER_H */
+8 -2
View File
@@ -64,7 +64,12 @@ public:
bool isBuilding() const { return field_0x2c; }
bool isOpen() const;
JAUSectionHeap* asSectionHeap() { return (JAUSection*)sectionHeap_ == this ? sectionHeap_ : NULL; }
JAUSectionHeap* asSectionHeap() {
if ((JAUSection*)sectionHeap_ == this) {
return sectionHeap_;
}
return NULL;
}
const TSectionData& getSectionData() const { return data_; }
JKRHeap* getHeap_();
@@ -99,6 +104,7 @@ public:
u32 releaseIdleDynamicSeqDataBlock();
JAUSectionHeap(JKRSolidHeap*, bool, s32);
JAUSection* getOpenSection();
JAUSection* getSection(int);
bool setSeqDataUser(JAISeqDataUser*);
bool newDynamicSeqBlock(u32);
SeqDataReturnValue getSeqData(JAISoundID, JAISeqData*);
@@ -123,7 +129,7 @@ public:
};
inline JKRHeap* JAUSection::getHeap_() { return sectionHeap_->mHeap; }
inline bool JAUSection::isOpen() const { return this == sectionHeap_->getOpenSection(); }
inline bool JAUSection::isOpen() const { return sectionHeap_->getOpenSection() == this; }
JAUSectionHeap* JAUNewSectionHeap(bool);
+1 -1
View File
@@ -29,7 +29,7 @@ public:
bool getSeqData(int, int, JAISeqData*);
bool getSeqDataRegion(JAISeqDataRegion*);
bool isValid() { return field_0x8; }
bool isValid() const { return field_0x8; }
/* 0x00 */ u16 field_0x0;
/* 0x04 */ const u32* field_0x4;
+1 -1
View File
@@ -17,7 +17,7 @@ struct JAUSeqDataBlock {
/* 0x00 */ JSULink<JAUSeqDataBlock> field_0x0;
/* 0x10 */ JAISoundID field_0x10;
/* 0x14 */ JAISeqDataRegion field_0x14;
/* 0x14 */ JAISeqDataRegion region;
/* 0x1C */ int field_0x1c;
};
+3 -3
View File
@@ -4,8 +4,8 @@
#include "JSystem/JAudio2/JAIStreamDataMgr.h"
struct BinaryStreamFileTable {
/* 0x0 */ char mIdentifier[4];
/* 0x4 */ int mNumFiles;
/* 0x0 */ u8 mIdentifier[4];
/* 0x4 */ u32 mNumFiles;
/* 0x8 */ int mFilePathOffsets[];
};
@@ -16,7 +16,7 @@ struct BinaryStreamFileTable {
struct JAUStreamFileTable {
JAUStreamFileTable();
void init(void const*);
int getNumFiles() const;
u32 getNumFiles() const;
const char* getFilePath(int) const;
bool isValid() { return mData; }
+1
View File
@@ -65,6 +65,7 @@ public:
bool setErrorFlag(bool errorFlag);
bool isSubHeap(JKRHeap* heap) const;
void* getAltAramStartAdr();
/* vt[03] */ virtual void callAllDisposer();
/* vt[04] */ virtual u32 getHeapType() = 0;