mirror of
https://github.com/zeldaret/tp
synced 2026-08-16 05:09:22 -04:00
JAudio naming pass (#3139)
* struct JASWaveArc forward declare fix * JASAramStream::THeader improvement * sizeof/offsetof unhardcodings * JAudio field name/comment pass HUGE thanks to XAYRGA for their work documenting JAudio file formats * Some more names * More names * More minor names * Attempt to fix regressions
This commit is contained in:
committed by
GitHub
parent
3f24f432fe
commit
853a6addb4
@@ -10,17 +10,17 @@
|
||||
*/
|
||||
struct JAISeqData {
|
||||
JAISeqData(const void* param_0, u32 param_1) {
|
||||
field_0x0 = (void*)param_0;
|
||||
field_0x4 = param_1;
|
||||
mBase = (void*)param_0;
|
||||
mOffset = param_1;
|
||||
}
|
||||
|
||||
void set(const void* param_0, u32 param_1) {
|
||||
field_0x0 = (void*)param_0;
|
||||
field_0x4 = param_1;
|
||||
mBase = (void*)param_0;
|
||||
mOffset = param_1;
|
||||
}
|
||||
|
||||
/* 0x00 */ void* field_0x0;
|
||||
/* 0x04 */ u32 field_0x4;
|
||||
/* 0x00 */ void* mBase;
|
||||
/* 0x04 */ u32 mOffset;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -29,10 +29,10 @@ struct JAISeqData {
|
||||
*/
|
||||
struct JAISeqDataRegion {
|
||||
bool intersects(const JAISeqData& seqData) const {
|
||||
if ((uintptr_t)addr + size < (uintptr_t)seqData.field_0x0) {
|
||||
if ((uintptr_t)addr + size < (uintptr_t)seqData.mBase) {
|
||||
return false;
|
||||
}
|
||||
if ((uintptr_t)seqData.field_0x0 + seqData.field_0x4 < (uintptr_t)addr) {
|
||||
if ((uintptr_t)seqData.mBase + seqData.mOffset < (uintptr_t)addr) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -17,6 +17,8 @@ namespace JASDsp {
|
||||
*/
|
||||
class JASAramStream {
|
||||
public:
|
||||
static const int CHANNEL_MAX = 6;
|
||||
|
||||
typedef void (*StreamCallback)(u32, JASAramStream*, void*);
|
||||
|
||||
enum CallbackType {
|
||||
@@ -32,29 +34,30 @@ public:
|
||||
};
|
||||
|
||||
struct Header {
|
||||
/* 0x00 */ u32 tag;
|
||||
/* 0x04 */ u8 field_0x4[5];
|
||||
/* 0x00 */ u32 tag; // 'STRM'
|
||||
/* 0x04 */ u32 soundBlockSize;
|
||||
/* 0x08 */ u8 field_0x08;
|
||||
/* 0x09 */ u8 format;
|
||||
/* 0x0A */ u8 bits;
|
||||
/* 0x0A */ u16 bits;
|
||||
/* 0x0C */ u16 channels;
|
||||
/* 0x0E */ u16 loop;
|
||||
/* 0x10 */ int field_0x10;
|
||||
/* 0x14 */ u8 field_0x14[4];
|
||||
/* 0x10 */ int mSampleRate;
|
||||
/* 0x14 */ u32 mSampleCount; // unused
|
||||
/* 0x18 */ int loop_start;
|
||||
/* 0x1C */ int loop_end;
|
||||
/* 0x20 */ u32 block_size;
|
||||
/* 0x24 */ u8 field_0x24[4];
|
||||
/* 0x28 */ u8 field_0x28;
|
||||
/* 0x29 */ u8 field_0x29[0x17];
|
||||
/* 0x24 */ u8 _unused2[4];
|
||||
/* 0x28 */ u8 mVolume;
|
||||
/* 0x29 */ u8 _unused3[0x17];
|
||||
}; // Size: 0x40
|
||||
|
||||
struct BlockHeader {
|
||||
/* 0x00 */ u32 tag;
|
||||
/* 0x04 */ u32 field_0x4;
|
||||
/* 0x00 */ u32 tag; // 'BLCK'
|
||||
/* 0x04 */ u32 mSize;
|
||||
/* 0x08 */ struct {
|
||||
s16 field_0x0;
|
||||
s16 field_0x2;
|
||||
} field_0x8[6];
|
||||
s16 mpLast;
|
||||
s16 mpPenult;
|
||||
} mAdpcmContinuationData[CHANNEL_MAX];
|
||||
}; // Size: 0x20
|
||||
|
||||
static void initSystem(u32, u32);
|
||||
@@ -128,14 +131,12 @@ public:
|
||||
|
||||
static u32 getBlockSize() { return sBlockSize; }
|
||||
|
||||
static const int CHANNEL_MAX = 6;
|
||||
|
||||
/* 0x000 */ OSMessageQueue field_0x000;
|
||||
/* 0x020 */ OSMessageQueue field_0x020;
|
||||
/* 0x040 */ void* field_0x040[16];
|
||||
/* 0x080 */ void* field_0x080[4];
|
||||
/* 0x090 */ JASChannel* mChannels[CHANNEL_MAX];
|
||||
/* 0x0A8 */ JASChannel* field_0x0a8;
|
||||
/* 0x0A8 */ JASChannel* mInitialChannel;
|
||||
/* 0x0AC */ bool field_0x0ac;
|
||||
/* 0x0AD */ bool field_0x0ad;
|
||||
/* 0x0AE */ u8 field_0x0ae;
|
||||
@@ -157,17 +158,17 @@ public:
|
||||
/* 0x124 */ int field_0x124;
|
||||
/* 0x128 */ u16 field_0x128;
|
||||
/* 0x12C */ int field_0x12c;
|
||||
/* 0x130 */ s16 field_0x130[CHANNEL_MAX];
|
||||
/* 0x13C */ s16 field_0x13c[CHANNEL_MAX];
|
||||
/* 0x148 */ int field_0x148;
|
||||
/* 0x14C */ u32 field_0x14c;
|
||||
/* 0x130 */ s16 mpLasts[CHANNEL_MAX];
|
||||
/* 0x13C */ s16 mpPenults[CHANNEL_MAX];
|
||||
/* 0x148 */ int mAramAddress;
|
||||
/* 0x14C */ u32 mAramSize;
|
||||
/* 0x150 */ StreamCallback mCallback;
|
||||
/* 0x154 */ void* mCallbackData;
|
||||
/* 0x158 */ u16 field_0x158;
|
||||
/* 0x158 */ u16 mFormat;
|
||||
/* 0x15A */ u16 mChannelNum;
|
||||
/* 0x15C */ u32 mBufCount;
|
||||
/* 0x160 */ u32 field_0x160;
|
||||
/* 0x164 */ u32 field_0x164;
|
||||
/* 0x160 */ u32 mAramBlocksPerChannel;
|
||||
/* 0x164 */ u32 mSampleRate;
|
||||
/* 0x168 */ bool mLoop;
|
||||
/* 0x16C */ u32 mLoopStart;
|
||||
/* 0x170 */ u32 mLoopEnd;
|
||||
@@ -177,7 +178,7 @@ public:
|
||||
/* 0x194 */ f32 mChannelPan[CHANNEL_MAX];
|
||||
/* 0x1AC */ f32 mChannelFxMix[CHANNEL_MAX];
|
||||
/* 0x1C4 */ f32 mChannelDolby[CHANNEL_MAX];
|
||||
/* 0x1DC */ u16 field_0x1dc[CHANNEL_MAX];
|
||||
/* 0x1DC */ u16 mMixConfig[CHANNEL_MAX];
|
||||
|
||||
static JASTaskThread* sLoadThread;
|
||||
static u8* sReadBuffer;
|
||||
|
||||
@@ -12,19 +12,19 @@ namespace JASBNKParser {
|
||||
struct TFileHeader {
|
||||
/* 0x0 */ int id;
|
||||
/* 0x4 */ u32 mSize;
|
||||
/* 0x8 */ u8 _08[4];
|
||||
/* 0x8 */ u32 mGlobalId;
|
||||
/* 0xC */ u32 mVersion;
|
||||
};
|
||||
|
||||
namespace Ver1 {
|
||||
struct TOsc {
|
||||
/* 0x00 */ u32 id;
|
||||
/* 0x00 */ u32 id; // "Osci"
|
||||
/* 0x04 */ u8 mTarget;
|
||||
/* 0x08 */ f32 _08;
|
||||
/* 0x0C */ u32 mTableOffset;
|
||||
/* 0x10 */ u32 _10;
|
||||
/* 0x14 */ f32 mScale;
|
||||
/* 0x18 */ f32 _18;
|
||||
/* 0x08 */ f32 mRate;
|
||||
/* 0x0C */ u32 mAttackEnvelopeOffset;
|
||||
/* 0x10 */ u32 mReleaseEnvelopeOffset;
|
||||
/* 0x14 */ f32 mScale; // width
|
||||
/* 0x18 */ f32 mVertex;
|
||||
};
|
||||
|
||||
struct TPercData {
|
||||
@@ -36,7 +36,7 @@ namespace JASBNKParser {
|
||||
};
|
||||
|
||||
struct TChunk {
|
||||
/* 0x0 */ u32 mID;
|
||||
/* 0x0 */ u32 mID; // Magic
|
||||
/* 0x4 */ u32 mSize;
|
||||
};
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace JASBNKParser {
|
||||
};
|
||||
|
||||
struct TOffsetData {
|
||||
/* 0x000 */ u8 field_0x20[4];
|
||||
/* 0x000 */ u32 mMagic; // 'BANK'
|
||||
/* 0x004 */ TOffset<TInst> mInstOffset[0x80];
|
||||
/* 0x204 */ u8 field_0x204[0x190];
|
||||
/* 0x394 */ TOffset<TPerc> mPercOffset[12];
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef JASCHANNEL_H
|
||||
#define JASCHANNEL_H
|
||||
|
||||
#include "JSystem/JAudio2/JASDspInterface.h"
|
||||
#include "JSystem/JAudio2/JASHeapCtrl.h"
|
||||
#include "JSystem/JAudio2/JASLfo.h"
|
||||
#include "JSystem/JAudio2/JASOscillator.h"
|
||||
@@ -45,6 +46,9 @@ public:
|
||||
/* 0x14 */ f32 mDolby;
|
||||
};
|
||||
|
||||
#define CHANNEL_WAVE 0
|
||||
#define CHANNEL_OSCILLATOR 2
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jaudio
|
||||
*
|
||||
@@ -52,7 +56,7 @@ public:
|
||||
class JASChannel : public JASPoolAllocObject_MultiThreaded<JASChannel> {
|
||||
public:
|
||||
typedef void (*Callback)(u32, JASChannel*, JASDsp::TChannel*, void*);
|
||||
static const int BUSOUT_CPUCH = 6;
|
||||
static const int BUSOUT_CPUCH = DSP_OUTPUT_CHANNELS;
|
||||
static const int OSC_NUM = 2;
|
||||
|
||||
enum CallbackType {
|
||||
@@ -153,10 +157,14 @@ public:
|
||||
/* 0xD4 */ u32 mKeySweepCount;
|
||||
/* 0xD8 */ u32 mSkipSamples;
|
||||
struct {
|
||||
u32 field_0x0;
|
||||
JASWaveInfo field_0x4;
|
||||
u32 mChannelType; // CHANNEL_WAVE or CHANNEL_OSCILLATOR
|
||||
JASWaveInfo mWaveInfo;
|
||||
} field_0xdc;
|
||||
int field_0x104;
|
||||
union {
|
||||
u32 mWaveAramAddress;
|
||||
u32 mOscillatorSomething;
|
||||
u32 field_0x104;
|
||||
};
|
||||
|
||||
static OSMessageQueue sBankDisposeMsgQ;
|
||||
static OSMessage sBankDisposeMsg[16];
|
||||
|
||||
@@ -5,9 +5,14 @@
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jaudio
|
||||
*
|
||||
* Responsible for allocating and prioritizing the available hardware DSP channels.
|
||||
*/
|
||||
struct JASDSPChannel {
|
||||
/**
|
||||
* Callback used to update DSP channel information on a regular basis.
|
||||
* Parameters are a CallbackType, hardware channel, and specified user data.
|
||||
* Return -1 to immediately abort playback.
|
||||
*/
|
||||
typedef s32 (*Callback)(u32, JASDsp::TChannel*, void*);
|
||||
|
||||
enum Status {
|
||||
@@ -17,9 +22,24 @@ struct JASDSPChannel {
|
||||
};
|
||||
|
||||
enum CallbackType {
|
||||
/**
|
||||
* Fired on a regular basis during play to update parameters.
|
||||
*/
|
||||
/* 0 */ CB_PLAY,
|
||||
|
||||
/**
|
||||
* Fired once, when the channel starts playing.
|
||||
*/
|
||||
/* 1 */ CB_START,
|
||||
|
||||
/**
|
||||
* Fired once, when the channel naturally finishes playing.
|
||||
*/
|
||||
/* 2 */ CB_STOP,
|
||||
|
||||
/**
|
||||
* Fired once, if the channel is abruptly stopped due to an error or prioritization.
|
||||
*/
|
||||
/* 3 */ CB_DROP,
|
||||
};
|
||||
|
||||
@@ -46,9 +66,13 @@ struct JASDSPChannel {
|
||||
static JASDSPChannel* sDspChannels;
|
||||
|
||||
/* 0x00 */ s32 mStatus;
|
||||
|
||||
/**
|
||||
* Priority of this DSP channel. Used to
|
||||
*/
|
||||
/* 0x04 */ s16 mPriority;
|
||||
/* 0x08 */ u32 mFlags;
|
||||
/* 0x0C */ u32 field_0xc;
|
||||
/* 0x0C */ u32 mUpdateCounter;
|
||||
/* 0x10 */ Callback mCallback;
|
||||
/* 0x14 */ void* mCallbackData;
|
||||
/* 0x18 */ JASDsp::TChannel* mChannel;
|
||||
|
||||
@@ -4,6 +4,16 @@
|
||||
#include <cstdint>
|
||||
#include <types.h>
|
||||
|
||||
/**
|
||||
* Amount of separate audio channels (i.e. individual playbacks, voices) the DSP can mix at once.
|
||||
*/
|
||||
#define DSP_CHANNELS 64
|
||||
|
||||
/**
|
||||
* Amount of audio channels the DSP can calculate outputs for.
|
||||
*/
|
||||
#define DSP_OUTPUT_CHANNELS 6 // Presumed 5.1 surround
|
||||
|
||||
struct JASWaveInfo;
|
||||
|
||||
namespace JASDsp {
|
||||
@@ -30,6 +40,24 @@ namespace JASDsp {
|
||||
u16 field_0x10[8];
|
||||
} FxBuf;
|
||||
|
||||
struct OutputChannelConfig {
|
||||
u16 mBusConnect;
|
||||
u16 mTargetVolume;
|
||||
u16 mCurrentVolume;
|
||||
|
||||
/**
|
||||
* Gets upper 8 bits cleared when audio volume is changed mid-playback.
|
||||
* Presumed to be some kind of progress used by the DSP to calculate position between
|
||||
* mTargetVolume and mCurrentVolume.
|
||||
*/
|
||||
u16 mVolumeProgress;
|
||||
};
|
||||
|
||||
/**
|
||||
* DSP memory for each playback channel ("voice").
|
||||
* The DSP can read and write this memory. It is used as configuration, feedback,
|
||||
* and working memory.
|
||||
*/
|
||||
struct TChannel {
|
||||
void init();
|
||||
void playStart();
|
||||
@@ -37,67 +65,83 @@ namespace JASDsp {
|
||||
void replyFinishRequest();
|
||||
void forceStop();
|
||||
bool isActive() const;
|
||||
|
||||
/**
|
||||
* Check whether the DSP has finished playing this channel.
|
||||
*/
|
||||
bool isFinish() const;
|
||||
void setWaveInfo(JASWaveInfo const&, u32, u32);
|
||||
void setOscInfo(u32);
|
||||
void initAutoMixer();
|
||||
void setAutoMixer(u16, u8, u8, u8, u8);
|
||||
void setPitch(u16);
|
||||
void setMixerInitVolume(u8, s16);
|
||||
void setMixerVolume(u8, s16);
|
||||
void setMixerInitVolume(u8 outputChannel, s16 volume);
|
||||
void setMixerVolume(u8 outputChannel, s16 volume);
|
||||
void setPauseFlag(u8);
|
||||
|
||||
/**
|
||||
* Flushes backing memory of channel out of the data cache.
|
||||
*/
|
||||
void flush();
|
||||
void initFilter();
|
||||
void setFilterMode(u16);
|
||||
void setIIRFilterParam(s16*);
|
||||
void setFIR8FilterParam(s16*);
|
||||
void setDistFilter(s16);
|
||||
void setBusConnect(u8, u8);
|
||||
void setBusConnect(u8 outputChannel, u8 param_1);
|
||||
|
||||
/* 0x000 */ u16 mIsActive;
|
||||
/* 0x002 */ u16 mIsFinished;
|
||||
/* 0x004 */ u16 mPitch;
|
||||
/* 0x006 */ short field_0x006;
|
||||
/* 0x006 */ short _unused1;
|
||||
/* 0x008 */ u16 field_0x008;
|
||||
/* 0x00A */ u8 field_0x00A[0x00C - 0x00A];
|
||||
/* 0x00A */ u8 _unused2[0x00C - 0x00A];
|
||||
/* 0x00C */ s16 mPauseFlag;
|
||||
/* 0x00E */ short field_0x00E;
|
||||
/* 0x010 */ u16 field_0x010[1][4]; // array size unknown
|
||||
/* 0x018 */ u8 field_0x018[0x050 - 0x018];
|
||||
/* 0x050 */ u16 field_0x050;
|
||||
/* 0x052 */ u16 field_0x052;
|
||||
/* 0x054 */ u16 field_0x054;
|
||||
/* 0x056 */ u16 field_0x056;
|
||||
/* 0x058 */ u16 field_0x058;
|
||||
/* 0x05A */ u8 field_0x05A[0x060 - 0x05A];
|
||||
/* 0x060 */ short field_0x060;
|
||||
/* 0x062 */ u8 field_0x062[0x064 - 0x062];
|
||||
/* 0x064 */ u16 field_0x064;
|
||||
/* 0x066 */ short field_0x066;
|
||||
/* 0x068 */ int field_0x068;
|
||||
/* 0x06C */ u8 field_0x06C[0x070 - 0x06C];
|
||||
/* 0x070 */ int field_0x070;
|
||||
/* 0x00E */ short _unused3;
|
||||
/* 0x010 */ OutputChannelConfig mOutputChannels[DSP_OUTPUT_CHANNELS];
|
||||
/* 0x040 */ u8 _unused4[0x050 - 0x040];
|
||||
/* 0x050 */ u16 mAutoMixerPanDolby; // pan is upper 8 bits, dolby lower 8.
|
||||
/* 0x052 */ u16 mAutoMixerFxMix;
|
||||
/* 0x054 */ u16 mAutoMixerInitVolume;
|
||||
/* 0x056 */ u16 mAutoMixerVolume;
|
||||
/* 0x058 */ u16 mAutoMixerBeenSet;
|
||||
/* 0x05A */ u8 _unused5[0x060 - 0x05A];
|
||||
/* 0x060 */ short field_0x060; // Only cleared to zero, presumed used by DSP.
|
||||
/* 0x062 */ u8 _unused6[0x064 - 0x062];
|
||||
/* 0x064 */ u16 mSamplesPerBlock;
|
||||
/* 0x066 */ short field_0x066; // Only cleared to zero, presumed used by DSP.
|
||||
/* 0x068 */ int mSamplePosition; // Only ever initialized by code, name is guess.
|
||||
/* 0x06C */ u8 _unused7[0x070 - 0x06C];
|
||||
/* 0x070 */ int mAramStreamPosition; // Seems written by DSP, used for audio streaming.
|
||||
/* 0x074 */ int field_0x074;
|
||||
/* 0x078 */ short field_0x078[4];
|
||||
/* 0x080 */ short field_0x080[20];
|
||||
/* 0x0A8 */ short field_0x0a8[4];
|
||||
/* 0x0B0 */ u16 field_0x0b0[16];
|
||||
/* 0x0D0 */ u8 field_0x0D0[0x100 - 0x0D0];
|
||||
/* 0x100 */ u16 field_0x100;
|
||||
/* 0x078 */ short field_0x078[4]; // Only cleared to zero, presumed used by DSP.
|
||||
/* 0x080 */ short field_0x080[20]; // Only cleared to zero, presumed used by DSP.
|
||||
/* 0x0A8 */ short field_0x0a8[4]; // Only cleared to zero, presumed used by DSP.
|
||||
/* 0x0B0 */ u16 field_0x0b0[16]; // Only cleared to zero, presumed used by DSP.
|
||||
/* 0x0D0 */ u8 _unused8[0x100 - 0x0D0];
|
||||
/* 0x100 */ u16 mBytesPerBlock;
|
||||
/* 0x102 */ u16 field_0x102;
|
||||
/* 0x104 */ s16 field_0x104;
|
||||
/* 0x106 */ s16 field_0x106;
|
||||
|
||||
/**
|
||||
* Used for decoding ADPCM data around loop edges.
|
||||
*/
|
||||
/* 0x104 */ s16 mpLast;
|
||||
|
||||
/**
|
||||
* Used for decoding ADPCM data around loop edges.
|
||||
*/
|
||||
/* 0x106 */ s16 mpPenult;
|
||||
/* 0x108 */ u16 mFilterMode;
|
||||
/* 0x10A */ u16 mForcedStop;
|
||||
/* 0x10C */ int field_0x10c;
|
||||
/* 0x110 */ u32 field_0x110;
|
||||
/* 0x114 */ u32 field_0x114;
|
||||
/* 0x118 */ u32 field_0x118;
|
||||
/* 0x11C */ int field_0x11c;
|
||||
/* 0x110 */ u32 mLoopStartSample;
|
||||
/* 0x114 */ u32 mEndSample;
|
||||
/* 0x118 */ u32 mWaveAramAddress;
|
||||
/* 0x11C */ int mSampleCount;
|
||||
/* 0x120 */ s16 fir_filter_params[8];
|
||||
/* 0x130 */ u8 field_0x130[0x148 - 0x130];
|
||||
/* 0x130 */ u8 _unused9[0x148 - 0x130];
|
||||
/* 0x148 */ s16 iir_filter_params[8];
|
||||
/* 0x158 */ u8 field_0x158[0x180 - 0x158];
|
||||
/* 0x158 */ u8 _unused10[0x180 - 0x158];
|
||||
};
|
||||
|
||||
void boot(void (*)(void*));
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
|
||||
#include "JSystem/JAudio2/JASCallback.h"
|
||||
|
||||
#define JAS_OUTPUT_MONO OS_SOUND_MODE_MONO
|
||||
#define JAS_OUTPUT_STEREO OS_SOUND_MODE_STEREO
|
||||
#define JAS_OUTPUT_SURROUND 2
|
||||
|
||||
typedef s32 (*DriverCallback)(void*);
|
||||
|
||||
namespace JASDriver {
|
||||
|
||||
@@ -8,10 +8,21 @@
|
||||
*
|
||||
*/
|
||||
struct JASOscillator {
|
||||
enum EnvelopeMode {
|
||||
/* 0x0 */ ENVELOPE_LINEAR,
|
||||
/* 0x1 */ ENVELOPE_SQUARE,
|
||||
/* 0x2 */ ENVELOPE_SQUARE_ROOT,
|
||||
/* 0x3 */ ENVELOPE_SAMPLE_CELL,
|
||||
|
||||
ENVELOPE_LOOP = 0xD,
|
||||
ENVELOPE_HOLD = 0xE,
|
||||
ENVELOPE_STOP = 0xF,
|
||||
};
|
||||
|
||||
struct Point {
|
||||
/* 0x0 */ s16 _0;
|
||||
/* 0x2 */ s16 _2;
|
||||
/* 0x4 */ s16 _4;
|
||||
/* 0x0 */ s16 mEnvelopeMode; // EnvelopeMode
|
||||
/* 0x2 */ s16 mTime;
|
||||
/* 0x4 */ s16 mValue;
|
||||
};
|
||||
|
||||
struct EffectParams {
|
||||
@@ -36,11 +47,11 @@ struct JASOscillator {
|
||||
|
||||
struct Data {
|
||||
/* 0x00 */ u32 mTarget;
|
||||
/* 0x04 */ f32 _04;
|
||||
/* 0x04 */ f32 mRate;
|
||||
/* 0x08 */ const Point* mTable;
|
||||
/* 0x0C */ const Point* rel_table;
|
||||
/* 0x10 */ f32 mScale;
|
||||
/* 0x14 */ f32 _14;
|
||||
/* 0x10 */ f32 mScale; // aka width
|
||||
/* 0x14 */ f32 mVertex;
|
||||
};
|
||||
|
||||
enum Target {
|
||||
@@ -74,9 +85,9 @@ struct JASOscillator {
|
||||
/* 0x08 */ f32 _08;
|
||||
/* 0x0C */ f32 _0C;
|
||||
/* 0x10 */ f32 _10;
|
||||
/* 0x14 */ u16 _14;
|
||||
/* 0x14 */ u16 mCurPoint;
|
||||
/* 0x16 */ u16 mDirectRelease;
|
||||
/* 0x18 */ u8 _18;
|
||||
/* 0x18 */ u8 mEnvelopeMode; // EnvelopeMode
|
||||
/* 0x1A */ u16 _1A;
|
||||
/* 0x1C */ int _1C;
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ public:
|
||||
enum BranchCondition {};
|
||||
|
||||
struct CmdInfo {
|
||||
s32 (JASSeqParser::*field_0x0)(JASTrack*, u32*);
|
||||
u16 field_0xc;
|
||||
u16 field_0xe;
|
||||
s32 (JASSeqParser::*mHandler)(JASTrack*, u32*);
|
||||
u16 mParameterCount;
|
||||
u16 mParameterTypes;
|
||||
};
|
||||
|
||||
virtual ~JASSeqParser() {}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <types.h>
|
||||
|
||||
#define JAS_SEQ_STACK_SIZE 8
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jaudio
|
||||
*
|
||||
@@ -19,55 +21,55 @@ public:
|
||||
int readMidiValue();
|
||||
|
||||
void jump(u32 param_1) {
|
||||
field_0x04 = field_0x00 + param_1;
|
||||
mCurPos = mBase + param_1;
|
||||
}
|
||||
|
||||
void jump(void* param_1) {
|
||||
field_0x04 = (u8*)param_1;
|
||||
mCurPos = (u8*)param_1;
|
||||
}
|
||||
|
||||
u32 get24(u32 param_0) const {
|
||||
return (*(u32*)(field_0x00 + param_0 - 1)) & 0xffffff;
|
||||
return (*(u32*)(mBase + param_0 - 1)) & 0xffffff;
|
||||
}
|
||||
|
||||
u32* getBase() { return (u32*)field_0x00; }
|
||||
void* getAddr(u32 param_0) { return field_0x00 + param_0; }
|
||||
u8 getByte(u32 param_0) const { return *(field_0x00 + param_0); }
|
||||
u16 get16(u32 param_0) const { return *(u16*)(field_0x00 + param_0); }
|
||||
u32 get32(u32 param_0) const { return *(u32*)(field_0x00 + param_0); }
|
||||
u8* getCur() { return field_0x04; }
|
||||
u32 readByte() { return *field_0x04++; }
|
||||
u32* getBase() { return (u32*)mBase; }
|
||||
void* getAddr(u32 param_0) { return mBase + param_0; }
|
||||
u8 getByte(u32 param_0) const { return *(mBase + param_0); }
|
||||
u16 get16(u32 param_0) const { return *(u16*)(mBase + param_0); }
|
||||
u32 get32(u32 param_0) const { return *(u32*)(mBase + param_0); }
|
||||
u8* getCur() { return mCurPos; }
|
||||
u32 readByte() { return *mCurPos++; }
|
||||
u32 read16() {
|
||||
#ifdef __MWERKS__
|
||||
return *((u16*)field_0x04)++;
|
||||
return *((u16*)mCurPos)++;
|
||||
#else
|
||||
u16* value = (u16*)field_0x04;
|
||||
field_0x04 += 2;
|
||||
u16* value = (u16*)mCurPos;
|
||||
mCurPos += 2;
|
||||
return *value;
|
||||
#endif
|
||||
}
|
||||
u32 read24() {
|
||||
field_0x04--;
|
||||
mCurPos--;
|
||||
#ifdef __MWERKS__
|
||||
return (*((u32*)field_0x04)++) & 0x00ffffff;
|
||||
return (*((u32*)mCurPos)++) & 0x00ffffff;
|
||||
#else
|
||||
u32* value = (u32*)field_0x04;
|
||||
field_0x04 += 4;
|
||||
u32* value = (u32*)mCurPos;
|
||||
mCurPos += 4;
|
||||
return (*value) & 0x00ffffff;
|
||||
#endif
|
||||
}
|
||||
u16 getLoopCount() const {
|
||||
if (field_0x08 == 0) {
|
||||
if (mCurStackDepth == 0) {
|
||||
return 0;
|
||||
}
|
||||
return field_0x2c[field_0x08 - 1];
|
||||
return mLoopCount[mCurStackDepth - 1];
|
||||
}
|
||||
|
||||
/* 0x00 */ u8* field_0x00;
|
||||
/* 0x04 */ u8* field_0x04;
|
||||
/* 0x08 */ u32 field_0x08;
|
||||
/* 0x0C */ u16* field_0x0c[8];
|
||||
/* 0x2C */ u16 field_0x2c[8];
|
||||
/* 0x00 */ u8* mBase;
|
||||
/* 0x04 */ u8* mCurPos;
|
||||
/* 0x08 */ u32 mCurStackDepth;
|
||||
/* 0x0C */ u16* mReturnAddr[JAS_SEQ_STACK_SIZE];
|
||||
/* 0x2C */ u16 mLoopCount[JAS_SEQ_STACK_SIZE];
|
||||
};
|
||||
|
||||
#endif /* JASSEQREADER_H */
|
||||
|
||||
@@ -19,12 +19,12 @@ public:
|
||||
u32 checkImport(u32) const;
|
||||
u32 checkExport(u32) const;
|
||||
|
||||
u16 get(u32 param_0) const { return field_0x4[param_0]; }
|
||||
void set(u32 param_0, u16 param_1) { field_0x4[param_0] = param_1; }
|
||||
u16 get(u32 param_0) const { return mPortValues[param_0]; }
|
||||
void set(u32 param_0, u16 param_1) { mPortValues[param_0] = param_1; }
|
||||
|
||||
u16 field_0x0;
|
||||
u16 field_0x2;
|
||||
u16 field_0x4[MAX_PORTS];
|
||||
u16 mPortValues[MAX_PORTS];
|
||||
};
|
||||
|
||||
#endif /* JASTRACKPORT_H */
|
||||
|
||||
@@ -31,26 +31,28 @@ public:
|
||||
|
||||
struct TWave {
|
||||
/* 0x00 */ u8 _00;
|
||||
/* 0x01 */ u8 _01;
|
||||
/* 0x02 */ u8 _02;
|
||||
/* 0x04 */ f32 _04;
|
||||
/* 0x08 */ u32 mOffset;
|
||||
/* 0x0C */ u32 _0C;
|
||||
/* 0x10 */ u32 _10;
|
||||
/* 0x14 */ u32 _14;
|
||||
/* 0x18 */ u32 _18;
|
||||
/* 0x1C */ u32 _1C;
|
||||
/* 0x20 */ s16 _20;
|
||||
/* 0x22 */ s16 _22;
|
||||
/* 0x01 */ u8 mWaveFormat;
|
||||
/* 0x02 */ u8 mBaseKey;
|
||||
/* 0x04 */ f32 mSampleRate;
|
||||
/* 0x08 */ u32 mAWOffsetStart;
|
||||
/* 0x0C */ u32 mAWOffsetEnd;
|
||||
/* 0x10 */ u32 mLoopFlags;
|
||||
/* 0x14 */ u32 mLoopStartSample;
|
||||
/* 0x18 */ u32 mLoopEndSample;
|
||||
/* 0x1C */ u32 mSampleCount;
|
||||
/* 0x20 */ s16 mpLast;
|
||||
/* 0x22 */ s16 mpPenult;
|
||||
};
|
||||
|
||||
struct TWaveArchive {
|
||||
/* 0x00 */ char mFileName[0x74]; // unknown length
|
||||
/* 0x00 */ char mFileName[0x70];
|
||||
/* 0x70 */ u32 mWaveCount;
|
||||
/* 0x74 */ TOffset<TWave> mWaveOffsets[0];
|
||||
};
|
||||
|
||||
struct TWaveArchiveBank {
|
||||
/* 0x0 */ u8 _00[8];
|
||||
/* 0x0 */ u32 mMagic; // 'WINF'
|
||||
/* 0x0 */ u32 mArchiveCounts;
|
||||
/* 0x8 */ TOffset<TWaveArchive> mArchiveOffsets[0];
|
||||
};
|
||||
|
||||
@@ -66,14 +68,17 @@ public:
|
||||
};
|
||||
|
||||
struct TCtrlGroup {
|
||||
/* 0x0 */ u8 _00[8];
|
||||
/* 0x0 */ u32 mMagic; // 'WBCT'
|
||||
/* 0x4 */ u32 mUnknown;
|
||||
/* 0x8 */ u32 mGroupCount;
|
||||
/* 0xC */ TOffset<TCtrlScene> mCtrlSceneOffsets[0];
|
||||
};
|
||||
|
||||
/** @fabricated */
|
||||
struct THeader {
|
||||
/* 0x00 */ u8 _00[0xC];
|
||||
/* 0x00 */ u32 mMagic; // 'WSYS'
|
||||
/* 0x04 */ u32 mSize;
|
||||
/* 0x08 */ u32 mId;
|
||||
/* 0x0C */ u32 mWaveTableSize;
|
||||
/* 0x10 */ TOffset<TWaveArchiveBank> mArchiveBankOffset;
|
||||
/* 0x14 */ TOffset<TCtrlGroup> mCtrlGroupOffset;
|
||||
|
||||
@@ -3,7 +3,12 @@
|
||||
|
||||
#include <types.h>
|
||||
|
||||
class JASWaveArc;
|
||||
struct JASWaveArc;
|
||||
|
||||
#define WAVE_FORMAT_ADPCM4 0
|
||||
#define WAVE_FORMAT_ADPCM2 1
|
||||
#define WAVE_FORMAT_PCM8 2
|
||||
#define WAVE_FORMAT_PCM16 3
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jaudio
|
||||
@@ -11,21 +16,21 @@ class JASWaveArc;
|
||||
*/
|
||||
struct JASWaveInfo {
|
||||
JASWaveInfo() {
|
||||
field_0x01 = 0x3c;
|
||||
mBaseKey = 0x3c;
|
||||
field_0x20 = &one;
|
||||
}
|
||||
|
||||
/* 0x00 */ u8 field_0x00;
|
||||
/* 0x01 */ u8 field_0x01;
|
||||
/* 0x02 */ u8 field_0x02;
|
||||
/* 0x04 */ f32 field_0x04;
|
||||
/* 0x08 */ int field_0x08;
|
||||
/* 0x0C */ int field_0x0c;
|
||||
/* 0x10 */ u32 field_0x10;
|
||||
/* 0x14 */ int field_0x14;
|
||||
/* 0x18 */ int field_0x18;
|
||||
/* 0x1C */ s16 field_0x1c;
|
||||
/* 0x1E */ s16 field_0x1e;
|
||||
/* 0x00 */ u8 mWaveFormat;
|
||||
/* 0x01 */ u8 mBaseKey;
|
||||
/* 0x02 */ u8 mLoopFlag;
|
||||
/* 0x04 */ f32 mSampleRate;
|
||||
/* 0x08 */ int mOffsetStart;
|
||||
/* 0x0C */ int mOffsetLength;
|
||||
/* 0x10 */ u32 mLoopStartSample;
|
||||
/* 0x14 */ int mLoopEndSample;
|
||||
/* 0x18 */ int mSampleCount;
|
||||
/* 0x1C */ s16 mpLast;
|
||||
/* 0x1E */ s16 mpPenult;
|
||||
/* 0x20 */ const u32* field_0x20;
|
||||
|
||||
static u32 one;
|
||||
|
||||
@@ -21,7 +21,7 @@ public:
|
||||
/* 0x10 */ int audioThreadPriority_;
|
||||
/* 0x14 */ int dvdThreadId_;
|
||||
/* 0x18 */ int audioThreadId_;
|
||||
/* 0x1C */ int field_0x1c;
|
||||
/* 0x1C */ int mJasTrackPoolSize;
|
||||
/* 0x20 */ int field_0x20;
|
||||
/* 0x24 */ int aramBlockSize_;
|
||||
/* 0x28 */ int aramChannelNum_;
|
||||
@@ -38,10 +38,10 @@ public:
|
||||
JAU_JAIInitializer();
|
||||
void initJAInterface();
|
||||
|
||||
int field_0x0;
|
||||
int field_0x4;
|
||||
int field_0x8;
|
||||
int field_0xc;
|
||||
int mJaiSePoolSize;
|
||||
int mJaiSeqPoolSize;
|
||||
int mJaiStreamPoolSize;
|
||||
int mJaiSoundChildPoolSize;
|
||||
};
|
||||
|
||||
#endif /* JAUINITIALIZER_H */
|
||||
|
||||
@@ -11,11 +11,11 @@ struct JAISeqDataRegion;
|
||||
*
|
||||
*/
|
||||
struct JAUSeqCollectionData {
|
||||
s8 field_0x0;
|
||||
s8 field_0x1;
|
||||
u16 field_0x2;
|
||||
u32 field_0x4;
|
||||
u32 field_0x8;
|
||||
s8 mMagic1; // 'S'
|
||||
s8 mMagic2; // 'C'
|
||||
u16 mNumSoundCategories;
|
||||
u32 mSectionSize;
|
||||
u32 mTableOffsets[0]; // VLA
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -29,12 +29,12 @@ public:
|
||||
bool getSeqData(int, int, JAISeqData*);
|
||||
bool getSeqDataRegion(JAISeqDataRegion*);
|
||||
|
||||
bool isValid() const { return field_0x8; }
|
||||
bool isValid() const { return mHeader; }
|
||||
|
||||
/* 0x00 */ u16 field_0x0;
|
||||
/* 0x04 */ const u32* field_0x4;
|
||||
/* 0x08 */ const JAUSeqCollectionData* field_0x8;
|
||||
/* 0x0C */ int field_0xc;
|
||||
/* 0x00 */ u16 mNumSoundCategories;
|
||||
/* 0x04 */ const u32* mTableOffsets;
|
||||
/* 0x08 */ const JAUSeqCollectionData* mHeader;
|
||||
/* 0x0C */ u32 mSectionSize;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
SeqDataReturnValue getSeqData(JAISoundID, JAISeqData*);
|
||||
~JAUSeqDataMgr_SeqCollection();
|
||||
|
||||
const void* getResource() const { return field_0x4; }
|
||||
const void* getResource() const { return mTableOffsets; }
|
||||
void init(const void* param_1) { JAUSeqCollection::init(param_1); }
|
||||
|
||||
/* 0x14 */ JAISeqDataUser* user_;
|
||||
|
||||
@@ -48,13 +48,13 @@ template <size_t MAX_CHUNKS_>
|
||||
class JAUStreamStaticAramMgr_ : public JAUStreamAramMgrBase_<MAX_CHUNKS_> {
|
||||
public:
|
||||
JAUStreamStaticAramMgr_() { field_0x4c = 0; }
|
||||
virtual void* newStreamAram(u32* param_0) {
|
||||
virtual void* newStreamAram(u32* size) {
|
||||
for (u32 i = 0; i < field_0x4c; i++) {
|
||||
if (this->field_0x4.test(i)) {
|
||||
continue;
|
||||
}
|
||||
this->field_0x4.set(i, true);
|
||||
*param_0 = this->mHeaps[i].getSize();
|
||||
*size = this->mHeaps[i].getSize();
|
||||
return this->mHeaps[i].getBase();
|
||||
}
|
||||
return NULL;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <types.h>
|
||||
|
||||
void DSPReleaseHalt2(u32 msg);
|
||||
void DsetupTable(u32 param_0, u32 param_1, u32 param_2, u32 param_3, u32 param_4);
|
||||
void DsetupTable(u32 channelCount, u32 channelBufferAddress, u32 param_2, u32 param_3, u32 param_4);
|
||||
void DsetMixerLevel(f32 level);
|
||||
void DsyncFrame2ch(u32 param_0, u32 param_1, u32 param_2);
|
||||
void DsyncFrame4ch(u32 param_0, u32 param_1, u32 param_2, u32 param_3, u32 param_4);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <types.h>
|
||||
|
||||
void DspBoot(void (*)(void*));
|
||||
void DspBoot(void (*requestCallback)(void*));
|
||||
void DspFinishWork(u16 param_0);
|
||||
int DSPSendCommands2(u32* msgs, u32 param_1, void (*param_2)(u16));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user