mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-19 13:03:33 -04:00
JAudio field name/comment pass
HUGE thanks to XAYRGA for their work documenting JAudio file formats
This commit is contained in:
@@ -3,6 +3,16 @@
|
||||
|
||||
#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 {
|
||||
@@ -29,6 +39,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();
|
||||
@@ -36,67 +64,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*));
|
||||
|
||||
Reference in New Issue
Block a user