mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-03 14:34:32 +00:00
audio_synthesis OK + partially documented (#920)
* Match func_800DDB64 * Match func_800DC910 * remove stack comments * Move nop padding to ucode_disas * Partially label audio_synthesis To some extent copied from sm64. * cleanup * Reverb and ReverbBits have nothing to do with reverbs * review * naming * Undo changes to permuter_settings.toml Co-authored-by: zelda2774 <zelda2774@invalid>
This commit is contained in:
parent
430a172183
commit
4444c5ea35
16 changed files with 934 additions and 2123 deletions
|
@ -1891,51 +1891,7 @@ void UCodeDisas_Destroy(UCodeDisas*);
|
|||
void UCodeDisas_Disassemble(UCodeDisas*, Gfx*);
|
||||
void UCodeDisas_RegisterUCode(UCodeDisas*, s32, UCodeInfo*);
|
||||
void UCodeDisas_SetCurUCode(UCodeDisas*, void*);
|
||||
// ? func_800DACC0(?);
|
||||
// ? func_800DB03C(?);
|
||||
Acmd* AudioSynth_Update(Acmd* cmdStart, s32* cmdCnt, s16* aiStart, s32 aiBufLen);
|
||||
// ? func_800DB2C0(?);
|
||||
// ? func_800DB330(?);
|
||||
// ? func_800DB3D8(?);
|
||||
// ? func_800DB480(?);
|
||||
// ? func_800DB4E4(?);
|
||||
// ? func_800DB680(?);
|
||||
// ? func_800DB828(?);
|
||||
// ? func_800DBA40(?);
|
||||
// ? func_800DBAE8(?);
|
||||
// ? func_800DBB9C(?);
|
||||
// ? func_800DBBD4(?);
|
||||
// ? AudioSynth_SetBuffer(?);
|
||||
// ? AudioSynth_DMemMove(?);
|
||||
// ? AudioSynth_InterL(?);
|
||||
// ? func_800DBCD4(?);
|
||||
// ? func_800DBD10(?);
|
||||
// ? AudioSynth_SaveBuffer(?);
|
||||
// ? AudioSynth_EnvSetup2(?);
|
||||
// ? AudioSynth_UnkCmd17(?);
|
||||
// ? AudioSynth_HiLoGain(?);
|
||||
// ? AudioSynth_UnkCmd19(?);
|
||||
// ? AudioSynth_UnkCmd3(?);
|
||||
// ? AudioSynth_SetFilter(?);
|
||||
// ? AudioSynth_SetFilterCount(?);
|
||||
// ? func_800DBEB0(?);
|
||||
// ? func_800DBF5C(?);
|
||||
// ? AudioSynth_LoadRingBuffer(?);
|
||||
// ? AudioSynth_SaveRingBuffer(?);
|
||||
// ? AudioSynth_SaveBuffer(?);
|
||||
// ? func_800DC124(?);
|
||||
// ? func_800DC164(?);
|
||||
// ? func_800DC1D8(?);
|
||||
// ? func_800DC2DC(?);
|
||||
// ? func_800DC384(?);
|
||||
// ? func_800DC910(?);
|
||||
// ? func_800DD62C(?);
|
||||
// ? func_800DD6CC(?);
|
||||
// ? func_800DD9F4(?);
|
||||
// ? func_800DDB64(?);
|
||||
f32 func_800DDE20(f32 arg0);
|
||||
void func_800DDE3C(void);
|
||||
void Audio_ResetLoadStatus(void);
|
||||
void Audio_DiscardBank(s32 bankId);
|
||||
void Audio_DiscardSequence(s32 seqId);
|
||||
void func_800DE238(void* mem, u32 size);
|
||||
|
@ -1980,7 +1936,7 @@ void func_800E0E90(s32 id);
|
|||
void func_800E0EB4(s32 arg0, s32 id);
|
||||
void func_800E1148(void);
|
||||
void func_800E11F0(void);
|
||||
s32 func_800E12DC(s32 arg0, s32 arg1, s32 arg2, u8* arg3, s32 arg4);
|
||||
void* Audio_DmaSampleData(u32 arg0, s32 arg1, s32 arg2, u8* arg3, s32 arg4);
|
||||
void func_800E1618(s32 arg0);
|
||||
s32 Audio_IsBankLoadComplete(s32 bankId);
|
||||
s32 Audio_IsSeqLoadComplete(s32 seqId);
|
||||
|
@ -1993,8 +1949,8 @@ void Audio_AudioTableAsyncLoad(s32 arg0, s32 arg1, s32 arg2, OSMesgQueue* arg3);
|
|||
void Audio_AudioBankAsyncLoad(s32 arg0, s32 arg1, s32 arg2, OSMesgQueue* arg3);
|
||||
u8* func_800E1F38(s32 arg0, u32* arg1);
|
||||
void func_800E1F7C(s32 arg0);
|
||||
s32 func_800E20D4(s32 playerIdx, s32 seqId, s32 arg2);
|
||||
s32 func_800E2124(s32 playerIdx, s32 seqId, s32 arg2);
|
||||
s32 func_800E20D4(s32 playerIndex, s32 seqId, s32 arg2);
|
||||
s32 func_800E2124(s32 playerIndex, s32 seqId, s32 arg2);
|
||||
void Audio_ProcessLoads(s32 resetStatus);
|
||||
void func_800E301C(void* callback);
|
||||
void Audio_ContextInit(void* heap, u32 heapSize);
|
||||
|
@ -2023,7 +1979,7 @@ void Audio_InitMesgQueues(void);
|
|||
void Audio_osInvalDCache(void* buf, s32 size);
|
||||
void Audio_osWritebackDCache(void* mem, s32 size);
|
||||
s32 osAiSetNextBuffer(void*, u32);
|
||||
void Audio_NoteSetVelPanReverb(Note* note, NoteSubEu* sub, Reverb* reverb);
|
||||
void Audio_InitNoteSub(Note* note, NoteSubEu* sub, NoteSubAttributes* attrs);
|
||||
void Audio_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput);
|
||||
void Audio_NoteInit(Note* note);
|
||||
void Audio_NoteDisable(Note* note);
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#define ALIGN16(val) (((val) + 0xF) & ~0xF)
|
||||
#define ALIGN32(val) (((val) + 0x1F) & ~0x1F)
|
||||
#define ALIGN64(val) (((val) + 0x3F) & ~0x3F)
|
||||
#define ALIGN256(val) (((val) + 0xFF) & ~0xFF)
|
||||
|
||||
#define SQ(x) ((x)*(x))
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#define A_LOADBUFF 20
|
||||
#define A_SAVEBUFF 21
|
||||
#define A_ENVSETUP2 22
|
||||
#define A_UNK17 23
|
||||
#define A_S8DEC 23
|
||||
#define A_UNK19 25
|
||||
#define ACMD_SIZE 32
|
||||
|
||||
|
@ -323,11 +323,11 @@ typedef short ENVMIX_STATE[40];
|
|||
_a->words.w1 = _SHIFTL(a3, 16, 16) | _SHIFTL(a4, 0, 16); \
|
||||
}
|
||||
|
||||
#define aUnkCmd17(pkt, a1, a2) \
|
||||
#define aS8Dec(pkt, a1, a2) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = _SHIFTL(A_UNK17, 24, 8) | _SHIFTL(a1, 16, 8); \
|
||||
_a->words.w0 = _SHIFTL(A_S8DEC, 24, 8) | _SHIFTL(a1, 16, 8); \
|
||||
_a->words.w1 = (unsigned int)(a2); \
|
||||
}
|
||||
|
||||
|
@ -339,45 +339,23 @@ typedef short ENVMIX_STATE[40];
|
|||
_a->words.w1 = (unsigned int)(c); \
|
||||
}
|
||||
|
||||
/*
|
||||
#define aEnvMixer(pkt, f, s) \
|
||||
#define aEnvMixer(pkt, dmemi, count, swapLR, x0, x1, x2, x3, m, bits) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = _SHIFTL(A_ENVMIXER, 24, 8) | _SHIFTL(f, 16, 8); \
|
||||
_a->words.w1 = (unsigned int)(s); \
|
||||
}
|
||||
*/
|
||||
|
||||
extern u32 D_801304A0;
|
||||
|
||||
#define aEnvMixer(pkt, dmemi, count, swapLR, x0, x1, x2, x3, m) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = (D_801304A0 | _SHIFTL(dmemi >> 4, 16, 8) | \
|
||||
_a->words.w0 = (bits | _SHIFTL(dmemi >> 4, 16, 8) | \
|
||||
_SHIFTL(count, 8, 8) | _SHIFTL(swapLR, 4, 1) | \
|
||||
_SHIFTL(x0, 3, 1) | _SHIFTL(x1, 2, 1) | \
|
||||
_SHIFTL(x2, 1, 1) | _SHIFTL(x3, 0, 1)); \
|
||||
_a->words.w1 = (unsigned int)(m); \
|
||||
}
|
||||
|
||||
/*
|
||||
#define aInterleave(pkt, l, r) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = _SHIFTL(A_INTERLEAVE, 24, 8); \
|
||||
_a->words.w1 = _SHIFTL(l, 16, 16) | _SHIFTL(r, 0, 16); \
|
||||
}
|
||||
*/
|
||||
|
||||
#define aInterleave(pkt, count, d, l, r) \
|
||||
#define aInterleave(pkt, o, l, r, c) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = (_SHIFTL(A_INTERLEAVE, 24, 8) | \
|
||||
_SHIFTL(count >> 4, 16, 8) | _SHIFTL(d, 0, 16)); \
|
||||
_SHIFTL(c >> 4, 16, 8) | _SHIFTL(o, 0, 16)); \
|
||||
_a->words.w1 = _SHIFTL(l, 16, 16) | _SHIFTL(r, 0, 16); \
|
||||
}
|
||||
|
||||
|
@ -390,16 +368,6 @@ extern u32 D_801304A0;
|
|||
_a->words.w1 = _SHIFTL(dmemi, 16, 16) | _SHIFTL(dmemo, 0, 16); \
|
||||
}
|
||||
|
||||
/*
|
||||
#define aLoadBuffer(pkt, s) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = _SHIFTL(A_LOADBUFF, 24, 8); \
|
||||
_a->words.w1 = (unsigned int)(s); \
|
||||
}
|
||||
*/
|
||||
|
||||
#define aLoadBuffer(pkt, s, d, c) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
|
@ -436,16 +404,6 @@ extern u32 D_801304A0;
|
|||
_a->words.w1 = (unsigned int)(s); \
|
||||
}
|
||||
|
||||
/*
|
||||
#define aSaveBuffer(pkt, s) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
_a->words.w0 = _SHIFTL(A_SAVEBUFF, 24, 8); \
|
||||
_a->words.w1 = (unsigned int)(s); \
|
||||
}
|
||||
*/
|
||||
|
||||
#define aSaveBuffer(pkt, s, d, c) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
|
@ -561,7 +519,7 @@ extern u32 D_801304A0;
|
|||
_a->words.w1 = _SHIFTL(dmemi, 16, 16) | _SHIFTL(dmemo, 0, 16); \
|
||||
}
|
||||
|
||||
#define aResampleZOH(pkt, pitch, pitchAccu) \
|
||||
#define aResampleZoh(pkt, pitch, pitchAccu) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
\
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
/**
|
||||
* Structs in this repository have primarily been imported from the SM64 Decompilation.
|
||||
* Many struct members are wrong; the symbol '?' next to an offset means the member is a guess.
|
||||
* Some struct members may be wrong; the symbol '?' next to an offset means the member is a guess.
|
||||
*/
|
||||
|
||||
#define NO_LAYER ((SequenceChannelLayer*)(-1))
|
||||
|
@ -32,6 +32,9 @@
|
|||
|
||||
#define AIBUF_LEN 0xB00
|
||||
|
||||
#define CODEC_ADPCM 0
|
||||
#define CODEC_S8 1
|
||||
|
||||
struct Note;
|
||||
struct NotePool;
|
||||
struct SequenceChannel;
|
||||
|
@ -73,38 +76,33 @@ typedef struct {
|
|||
} Portamento; // size = 0xC
|
||||
|
||||
typedef struct {
|
||||
/*?0x0 */ s16 delay;
|
||||
/*?0x2 */ s16 arg;
|
||||
} AdsrEnvelope; // size = 0x4?
|
||||
/* 0x0 */ s16 delay;
|
||||
/* 0x2 */ s16 arg;
|
||||
} AdsrEnvelope; // size = 0x4
|
||||
|
||||
typedef struct {
|
||||
/*?0x00 */ u32 start;
|
||||
/* 0x00 */ u32 start;
|
||||
/* 0x04 */ u32 end;
|
||||
/*?0x08 */ u32 count;
|
||||
/*?0x0C */ char unk_0C[0x4];
|
||||
/*?0x10 */ s16 state[16]; // only exists if count != 0. 8-byte aligned
|
||||
} AdpcmLoop; // size = 0x30
|
||||
/* 0x08 */ u32 count;
|
||||
/* 0x0C */ char unk_0C[0x4];
|
||||
/* 0x10 */ s16 state[16]; // only exists if count != 0. 8-byte aligned
|
||||
} AdpcmLoop; // size = 0x30 (or 0x10)
|
||||
|
||||
typedef struct {
|
||||
/*?0x00 */ s32 order;
|
||||
/*?0x04 */ s32 npredictors;
|
||||
/*?0x08 */ s16 book[1]; // size 8 * order * npredictors. 8-byte aligned
|
||||
} AdpcmBook;
|
||||
/* 0x00 */ s32 order;
|
||||
/* 0x04 */ s32 npredictors;
|
||||
/* 0x08 */ s16 book[1]; // size 8 * order * npredictors. 8-byte aligned
|
||||
} AdpcmBook; // size >= 0x8
|
||||
|
||||
typedef struct {
|
||||
union{
|
||||
struct {
|
||||
/* 0x00 */ u32 bits4 : 4;
|
||||
/* 0x00 */ u32 bits2 : 2;
|
||||
/* 0x00 */ u32 unk_bits26 : 1;
|
||||
/* 0x00 */ u32 unk_bits25 : 1;
|
||||
/* 0x01 */ u32 size : 24;
|
||||
};
|
||||
u32 bits;
|
||||
};
|
||||
/* 0x00 */ u32 codec : 4;
|
||||
/* 0x00 */ u32 medium : 2;
|
||||
/* 0x00 */ u32 unk_bits26 : 1;
|
||||
/* 0x00 */ u32 unk_bits25 : 1;
|
||||
/* 0x01 */ u32 size : 24;
|
||||
/* 0x04 */ u8* sampleAddr;
|
||||
/* 0x08 */ AdpcmLoop* loop;
|
||||
/*?0x0C */ AdpcmBook* book;
|
||||
/* 0x0C */ AdpcmBook* book;
|
||||
} AudioBankSample; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
|
@ -113,17 +111,16 @@ typedef struct {
|
|||
} AudioBankSound; // size = 0x8
|
||||
|
||||
typedef struct {
|
||||
/*?0x00 */ s16 numSamplesAfterDownsampling;
|
||||
/*?0x02 */ s16 chunkLen; // never read
|
||||
/* 0x00 */ s16 numSamplesAfterDownsampling; // never read
|
||||
/* 0x02 */ s16 chunkLen; // never read
|
||||
/* 0x04 */ s16* toDownsampleLeft;
|
||||
/* 0x08 */ s16* toDownsampleRight; // data pointed to by left and right are adjacent in memory
|
||||
/*?0x0C */ s32 startPos; // start pos in ring buffer
|
||||
/*?0x10 */ s16 lengthA; // first length in ring buffer (from startPos, at most until end)
|
||||
/*?0x12 */ s16 lengthB; // second length in ring buffer (from pos 0)
|
||||
/* 0x0C */ s32 startPos; // start pos in ring buffer
|
||||
/* 0x10 */ s16 lengthA; // first length in ring buffer (from startPos, at most until end)
|
||||
/* 0x12 */ s16 lengthB; // second length in ring buffer (from pos 0)
|
||||
/* 0x14 */ u16 unk_14;
|
||||
/* 0x16 */ u16 unk_16;
|
||||
/* 0x18 */ u16 unk_18;
|
||||
/* 0x1A */ char unk_1A[2];
|
||||
} ReverbRingBufferItem; // size = 0x1C
|
||||
|
||||
typedef struct {
|
||||
|
@ -138,11 +135,10 @@ typedef struct {
|
|||
/* 0x00A */ s16 unk_0A;
|
||||
/* 0x00C */ u16 unk_0C;
|
||||
/* 0x00E */ u16 unk_0E;
|
||||
/* 0x010 */ s16 unk_10;
|
||||
/* 0x012 */ s16 unk_12;
|
||||
/* 0x010 */ s16 leakRtl;
|
||||
/* 0x012 */ s16 leakLtr;
|
||||
/* 0x014 */ u16 unk_14;
|
||||
/* 0x016 */ s16 unk_16;
|
||||
|
||||
/* 0x018 */ u8 unk_18;
|
||||
/* 0x019 */ u8 unk_19;
|
||||
/* 0x01A */ u8 unk_1A;
|
||||
|
@ -156,20 +152,19 @@ typedef struct {
|
|||
/* 0x034 */ void* unk_34;
|
||||
/* 0x038 */ void* unk_38;
|
||||
/* 0x03C */ void* unk_3C;
|
||||
|
||||
/* 0x040 */ ReverbRingBufferItem items[2][5];
|
||||
/*?0x158 */ ReverbRingBufferItem items2[2][5];
|
||||
/* 0x270 */ s16* unk_270;
|
||||
/* 0x274 */ s16* unk_274;
|
||||
/* 0x278 */ void* unk_278;
|
||||
/* 0x27C */ void* unk_27C;
|
||||
/* 0x158 */ ReverbRingBufferItem items2[2][5];
|
||||
/* 0x270 */ s16* filterLeft;
|
||||
/* 0x274 */ s16* filterRight;
|
||||
/* 0x278 */ s16* filterLeftState;
|
||||
/* 0x27C */ s16* filterRightState;
|
||||
/* 0x280 */ AudioBankSound sound;
|
||||
/* 0x288 */ AudioBankSample sample;
|
||||
/* 0x298 */ AdpcmLoop loop;
|
||||
} SynthesisReverb; // size = 0x2C8
|
||||
|
||||
typedef struct {
|
||||
/*?0x00 */ u8 loaded;
|
||||
/* 0x00 */ u8 loaded;
|
||||
/* 0x01 */ u8 normalRangeLo;
|
||||
/* 0x02 */ u8 normalRangeHi;
|
||||
/* 0x03 */ u8 releaseRate;
|
||||
|
@ -177,15 +172,15 @@ typedef struct {
|
|||
/* 0x08 */ AudioBankSound lowNotesSound;
|
||||
/* 0x10 */ AudioBankSound normalNotesSound;
|
||||
/* 0x18 */ AudioBankSound highNotesSound;
|
||||
} Instrument; // size >= 0x20
|
||||
} Instrument; // size = 0x20
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 releaseRate;
|
||||
/* 0x01 */ u8 pan;
|
||||
/*?0x02 */ u8 loaded;
|
||||
/* 0x02 */ u8 loaded;
|
||||
/* 0x04 */ AudioBankSound sound;
|
||||
/* 0x14 */ AdsrEnvelope* envelope;
|
||||
} Drum; // size >= 0x14
|
||||
} Drum; // size = 0x14
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 numInstruments;
|
||||
|
@ -206,40 +201,23 @@ typedef struct {
|
|||
/* 0x19 */ s8 value;
|
||||
} M64ScriptState; // size = 0x1C
|
||||
|
||||
// Also known as a Group, according to sm64 debug strings.
|
||||
// Also known as a Group, according to debug strings.
|
||||
typedef struct {
|
||||
union {
|
||||
s32 playerState;
|
||||
struct {
|
||||
/* 0x000 */ u8 enabled : 1;
|
||||
/*?0x000 */ u8 finished : 1;
|
||||
/* 0x000 */ u8 muted : 1;
|
||||
/* 0x000 */ u8 seqDmaInProgress : 1;
|
||||
/* 0x000 */ u8 bankDmaInProgress : 1;
|
||||
/*?0x000 */ u8 recalculateVolume : 1;
|
||||
/* 0x000 */ u8 unk_0b2 : 1;
|
||||
/* 0x000 */ u8 unk_0b1 : 1;
|
||||
/* 0x001 */ u8 state;
|
||||
/* 0x002 */ u8 noteAllocPolicy;
|
||||
union {
|
||||
/* 0x003 */ u8 muteBehavior;
|
||||
struct {
|
||||
u8 mute_u00 : 1;
|
||||
u8 mute_u01 : 1;
|
||||
u8 mute_u02 : 1;
|
||||
u8 mute_u03 : 1;
|
||||
u8 mute_u04 : 1;
|
||||
u8 mute_u05 : 1;
|
||||
u8 mute_u06 : 1;
|
||||
u8 mute_u07 : 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
/* 0x000 */ u8 enabled : 1;
|
||||
/* 0x000 */ u8 finished : 1;
|
||||
/* 0x000 */ u8 muted : 1;
|
||||
/* 0x000 */ u8 seqDmaInProgress : 1;
|
||||
/* 0x000 */ u8 bankDmaInProgress : 1;
|
||||
/*?0x000 */ u8 recalculateVolume : 1;
|
||||
/* 0x000 */ u8 unk_0b2 : 1;
|
||||
/* 0x000 */ u8 unk_0b1 : 1;
|
||||
/* 0x001 */ u8 state;
|
||||
/* 0x002 */ u8 noteAllocPolicy;
|
||||
/* 0x003 */ u8 muteBehavior;
|
||||
/* 0x004 */ u8 seqId;
|
||||
/* 0x005 */ u8 defaultBank;
|
||||
/*?0x006 */ u8 loadingBankId;
|
||||
/*?0x007 */ s8 seqVariationEu;
|
||||
/* 0x006 */ u8 unk_06[1];
|
||||
/* 0x007 */ s8 playerIndex;
|
||||
/* 0x008 */ u16 tempo; // tatums per minute
|
||||
/* 0x00A */ u16 tempoAcc;
|
||||
/* 0x00C */ u16 unk_0C;
|
||||
|
@ -247,7 +225,6 @@ typedef struct {
|
|||
/* 0x010 */ u16 delay;
|
||||
/* 0x012 */ u16 fadeTimer;
|
||||
/* 0x014 */ u16 fadeTimerUnkEu;
|
||||
/* 0x016 */ char unk_16[0x2];
|
||||
/* 0x018 */ u8* seqData;
|
||||
/* 0x01C */ f32 fadeVolume;
|
||||
/* 0x020 */ f32 fadeVelocity;
|
||||
|
@ -257,7 +234,7 @@ typedef struct {
|
|||
/* 0x030 */ f32 appliedFadeVolume;
|
||||
/* 0x034 */ f32 unk_34;
|
||||
/* 0x038 */ struct SequenceChannel* channels[16];
|
||||
/*?0x078 */ M64ScriptState scriptState;
|
||||
/* 0x078 */ M64ScriptState scriptState;
|
||||
/* 0x094 */ u8* shortNoteVelocityTable;
|
||||
/* 0x098 */ u8* shortNoteDurationTable;
|
||||
/* 0x09C */ NotePool notePool;
|
||||
|
@ -305,59 +282,54 @@ typedef struct {
|
|||
} AdsrState;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 bit0 : 1;
|
||||
/* 0x00 */ u8 bit1 : 1;
|
||||
/* 0x00 */ u8 bit0 : 1; // unused?
|
||||
/* 0x00 */ u8 bit1 : 1; // unused?
|
||||
/* 0x00 */ u8 bit2 : 2;
|
||||
/* 0x00 */ u8 strongRight : 1;
|
||||
/* 0x00 */ u8 strongLeft : 1;
|
||||
/* 0x00 */ u8 stereoHeadsetEffects : 1;
|
||||
/* 0x00 */ u8 usesHeadsetPanEffects : 1;
|
||||
} ReverbBitsData;
|
||||
} StereoData;
|
||||
|
||||
typedef union {
|
||||
/* 0x00 */ ReverbBitsData s;
|
||||
/* 0x00 */ StereoData s;
|
||||
/* 0x00 */ u8 asByte;
|
||||
} ReverbBits;
|
||||
} Stereo;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 reverb;
|
||||
/* 0x01 */ u8 unk_1;
|
||||
/* 0x02 */ u8 pan;
|
||||
/* 0x03 */ ReverbBits reverbBits;
|
||||
/* 0x03 */ Stereo stereo;
|
||||
/* 0x04 */ u8 unk_4;
|
||||
/* 0x06 */ u16 unk_6;
|
||||
/* 0x08 */ f32 freqScale;
|
||||
/* 0x0C */ f32 velocity;
|
||||
/* 0x10 */ s16* unk_10;
|
||||
/* 0x14 */ s16 unk_14[8];
|
||||
/* 0x10 */ s16* filter;
|
||||
/* 0x14 */ s16 filterBuf[8];
|
||||
} NoteAttributes; // size = 0x24
|
||||
|
||||
// Also known as a SubTrack, according to sm64 debug strings.
|
||||
// Also known as a SubTrack, according to debug strings.
|
||||
// Confusingly, a SubTrack is a container of Tracks.
|
||||
typedef struct SequenceChannel {
|
||||
/* 0x00 */ u8 enabled : 1;
|
||||
/* 0x00 */ u8 finished : 1;
|
||||
/* 0x00 */ u8 stopScript : 1;
|
||||
/* 0x00 */ u8 stopSomething2 : 1; // sets SequenceChannelLayer.stopSomething
|
||||
/* 0x00 */ u8 hasInstrument : 1;
|
||||
/* 0x00 */ u8 stereoHeadsetEffects : 1;
|
||||
/* 0x00 */ u8 largeNotes : 1; // notes specify duration and velocity
|
||||
/* 0x00 */ u8 unused : 1;
|
||||
union {
|
||||
s32 channelState;
|
||||
struct {
|
||||
/* 0x00 */ u8 enabled : 1;
|
||||
/* 0x00 */ u8 finished : 1;
|
||||
/* 0x00 */ u8 stopScript : 1;
|
||||
/* 0x00 */ u8 stopSomething2 : 1; // sets SequenceChannelLayer.stopSomething
|
||||
/* 0x00 */ u8 hasInstrument : 1;
|
||||
/* 0x00 */ u8 stereoHeadsetEffects : 1;
|
||||
/* 0x00 */ u8 largeNotes : 1; // notes specify duration and velocity
|
||||
/* 0x00 */ u8 unused : 1; // still unused?
|
||||
union {
|
||||
struct {
|
||||
/* 0x01 */ u8 freqScale : 1;
|
||||
/* 0x01 */ u8 volume : 1;
|
||||
/* 0x01 */ u8 pan : 1;
|
||||
} s;
|
||||
/* 0x01 */ u8 asByte;
|
||||
} changes;
|
||||
/* 0x02 */ u8 noteAllocPolicy;
|
||||
/* 0x03 */ u8 muteBehavior;
|
||||
};
|
||||
};
|
||||
/* 0x01 */ u8 freqScale : 1;
|
||||
/* 0x01 */ u8 volume : 1;
|
||||
/* 0x01 */ u8 pan : 1;
|
||||
} s;
|
||||
/* 0x01 */ u8 asByte;
|
||||
} changes;
|
||||
/* 0x02 */ u8 noteAllocPolicy;
|
||||
/* 0x03 */ u8 muteBehavior;
|
||||
/* 0x04 */ u8 reverb; // or dry/wet mix
|
||||
/* 0x05 */ u8 notePriority; // 0-3
|
||||
/* 0x06 */ u8 someOtherPriority;
|
||||
|
@ -388,9 +360,9 @@ typedef struct SequenceChannel {
|
|||
/* 0x30 */ s32 pan;
|
||||
/* 0x34 */ f32 appliedVolume;
|
||||
/* 0x38 */ f32 freqScale;
|
||||
/*?0x3C */ u8 (*dynTable)[][2];
|
||||
/* 0x40 */ struct Note* noteUnused; // still unused?
|
||||
/*?0x44 */ struct SequenceChannelLayer* layerUnused; // still unused?
|
||||
/* 0x3C */ u8 (*dynTable)[][2];
|
||||
/* 0x40 */ struct Note* noteUnused;
|
||||
/* 0x44 */ struct SequenceChannelLayer* layerUnused;
|
||||
/* 0x48 */ Instrument* instrument;
|
||||
/* 0x4C */ SequencePlayer* seqPlayer;
|
||||
/* 0x50 */ struct SequenceChannelLayer* layers[4];
|
||||
|
@ -398,11 +370,11 @@ typedef struct SequenceChannel {
|
|||
/* 0x7C */ AdsrSettings adsr;
|
||||
/* 0x84 */ NotePool notePool;
|
||||
/* 0xC4 */ s8 soundScriptIO[8]; // bridge between sound script and audio lib
|
||||
/* 0xCC */ s16* unk_CC;
|
||||
/* 0xD0 */ ReverbBits reverbBits;
|
||||
/* 0xCC */ s16* filter;
|
||||
/* 0xD0 */ Stereo stereo;
|
||||
} SequenceChannel; // size = 0xD4
|
||||
|
||||
// Also known as a Track, according to sm64 debug strings.
|
||||
// Also known as a Track, according to debug strings.
|
||||
typedef struct SequenceChannelLayer {
|
||||
/* 0x00 */ u8 enabled : 1;
|
||||
/* 0x00 */ u8 finished : 1;
|
||||
|
@ -412,7 +384,7 @@ typedef struct SequenceChannelLayer {
|
|||
/* 0x00 */ u8 ignoreDrumPan : 1;
|
||||
/* 0x00 */ u8 bit1 : 1; // "has initialized continuous notes"?
|
||||
/* 0x00 */ u8 notePropertiesNeedInit : 1;
|
||||
/* 0x01 */ ReverbBits reverbBits;
|
||||
/* 0x01 */ Stereo stereo;
|
||||
/* 0x02 */ u8 instOrWave;
|
||||
/* 0x03 */ u8 noteDuration;
|
||||
/* 0x04 */ u8 semitone;
|
||||
|
@ -454,17 +426,17 @@ typedef struct {
|
|||
} NoteSynthesisBuffers; // size = 0x110
|
||||
|
||||
typedef struct {
|
||||
/*?0x00 */ u8 restart;
|
||||
/*?0x01 */ u8 sampleDmaIndex;
|
||||
/*?0x02 */ u8 prevHeadsetPanRight;
|
||||
/*?0x03 */ u8 prevHeadsetPanLeft;
|
||||
/*?0x04 */ u8 samplePosFrac;
|
||||
/* 0x05 */ u8 unk_05;
|
||||
/* 0x06 */ u16 unk_06;
|
||||
/*?0x08 */ s32 samplePosInt;
|
||||
/* 0x00 */ u8 restart;
|
||||
/* 0x01 */ u8 sampleDmaIndex;
|
||||
/* 0x02 */ u8 prevHeadsetPanRight;
|
||||
/* 0x03 */ u8 prevHeadsetPanLeft;
|
||||
/* 0x04 */ u8 reverbVol;
|
||||
/* 0x05 */ u8 numAdpcmParts;
|
||||
/* 0x06 */ u16 samplePosFrac;
|
||||
/* 0x08 */ s32 samplePosInt;
|
||||
/* 0x0C */ NoteSynthesisBuffers* synthesisBuffers;
|
||||
/*?0x10 */ s16 curVolLeft;
|
||||
/*?0x12 */ s16 curVolRight;
|
||||
/* 0x10 */ s16 curVolLeft;
|
||||
/* 0x12 */ s16 curVolRight;
|
||||
/* 0x14 */ u16 unk_14;
|
||||
/* 0x16 */ u16 unk_16;
|
||||
/* 0x18 */ u16 unk_18;
|
||||
|
@ -480,7 +452,7 @@ typedef struct {
|
|||
/* 0x0C */ f32 extent;
|
||||
/* 0x10 */ f32 rate;
|
||||
/* 0x14 */ u8 active;
|
||||
/*!0x16 */ u16 rateChangeTimer;
|
||||
/* 0x16 */ u16 rateChangeTimer;
|
||||
/* 0x18 */ u16 extentChangeTimer;
|
||||
/* 0x1A */ u16 delay;
|
||||
} VibratoState; // size = 0x1C
|
||||
|
@ -495,7 +467,7 @@ typedef struct {
|
|||
/* 0x06 */ s16 adsrVolScale; // unused?
|
||||
/* 0x08 */ f32 portamentoFreqScale;
|
||||
/* 0x0C */ f32 vibratoFreqScale;
|
||||
/*?0x10 */ SequenceChannelLayer* prevParentLayer;
|
||||
/* 0x10 */ SequenceChannelLayer* prevParentLayer;
|
||||
/* 0x14 */ SequenceChannelLayer* parentLayer;
|
||||
/* 0x18 */ SequenceChannelLayer* wantedParentLayer;
|
||||
/* 0x1C */ NoteAttributes attributes;
|
||||
|
@ -510,45 +482,45 @@ typedef struct {
|
|||
/* 0x00 */ vu8 enabled : 1;
|
||||
/* 0x00 */ u8 needsInit : 1;
|
||||
/*?0x00 */ u8 finished : 1;
|
||||
/*?0x00 */ u8 envMixerNeedsInit : 1;
|
||||
/* 0x00 */ u8 unused : 1;
|
||||
/* 0x00 */ u8 stereoStrongRight : 1;
|
||||
/* 0x00 */ u8 stereoStrongLeft : 1;
|
||||
/* 0x00 */ u8 stereoHeadsetEffects : 1;
|
||||
/* 0x00 */ u8 usesHeadsetPanEffects : 1;
|
||||
/*?0x00 */ u8 usesHeadsetPanEffects : 1;
|
||||
} s;
|
||||
/*?0x00 */ u8 asByte;
|
||||
/* 0x00 */ u8 asByte; // likely does not exist
|
||||
} bitField0;
|
||||
union {
|
||||
struct {
|
||||
/*?0x01 */ u8 reverbIndex : 3;
|
||||
/* 0x01 */ u8 reverbIndex : 3;
|
||||
/* 0x01 */ u8 bookOffset : 2;
|
||||
/*?0x01 */ u8 bit2 : 1;
|
||||
/*?0x01 */ u8 isSyntheticWave : 1;
|
||||
/*?0x01 */ u8 hasTwoAdpcmParts : 1;
|
||||
/* 0x01 */ u8 isSyntheticWave : 1;
|
||||
/* 0x01 */ u8 hasTwoAdpcmParts : 1;
|
||||
/* 0x01 */ u8 usesHeadsetPanEffects2 : 1;
|
||||
} s;
|
||||
/*?0x01 */ u8 asByte;
|
||||
/* 0x01 */ u8 asByte; // likely does not exist
|
||||
} bitField1;
|
||||
/* 0x02 */ u8 unk_2;
|
||||
/*?0x03 */ u8 headsetPanRight;
|
||||
/*?0x04 */ u8 headsetPanLeft;
|
||||
/*?0x05 */ u8 reverbVol;
|
||||
/* 0x03 */ u8 headsetPanRight;
|
||||
/* 0x04 */ u8 headsetPanLeft;
|
||||
/* 0x05 */ u8 reverbVol;
|
||||
/* 0x06 */ u8 unk_06;
|
||||
/* 0x07 */ u8 unk_07;
|
||||
/* 0x08 */ u16 targetVolLeft;
|
||||
/* 0x0A */ u16 targetVolRight;
|
||||
/*?0x0C */ u16 resamplingRateFixedPoint; // stored as signed but loaded as u16
|
||||
/* 0x0E */ s16 unk_10;
|
||||
/* 0x0C */ u16 resamplingRateFixedPoint;
|
||||
/* 0x0E */ u16 unk_0E;
|
||||
/* 0x10 */ union {
|
||||
s16* samples;
|
||||
AudioBankSound* audioBankSound;
|
||||
} sound; // not sure if actually a union
|
||||
/* 0x14 */ s16* unk_14;
|
||||
s16* samples; // used for synthetic waves
|
||||
} sound;
|
||||
/* 0x14 */ s16* filter;
|
||||
/* 0x18 */ char pad_18[0x8];
|
||||
} NoteSubEu; // size = 0x20
|
||||
|
||||
typedef struct Note {
|
||||
/* 0x00 */ AudioListItem listItem;
|
||||
/*?0x10 */ NoteSynthesisState synthesisState;
|
||||
/* 0x10 */ NoteSynthesisState synthesisState;
|
||||
/* 0x30 */ NotePlaybackState playbackState;
|
||||
/* 0x90 */ Portamento portamento;
|
||||
/* 0x9C */ VibratoState vibratoState;
|
||||
|
@ -564,8 +536,8 @@ typedef struct {
|
|||
/* 0x06 */ u16 unk_6;
|
||||
/* 0x08 */ u16 unk_8;
|
||||
/* 0x0A */ u16 unk_A;
|
||||
/* 0x0C */ u16 unk_C;
|
||||
/* 0x0E */ u16 unk_E;
|
||||
/* 0x0C */ u16 leakRtl;
|
||||
/* 0x0E */ u16 leakLtr;
|
||||
/* 0x10 */ s8 unk_10;
|
||||
/* 0x12 */ u16 unk_12;
|
||||
/* 0x14 */ s16 unk_14;
|
||||
|
@ -573,8 +545,8 @@ typedef struct {
|
|||
} ReverbSettings; // size = 0x18
|
||||
|
||||
typedef struct {
|
||||
/*?0x00 */ u32 frequency;
|
||||
/*?0x04 */ u8 unk_04;
|
||||
/* 0x00 */ u32 frequency;
|
||||
/* 0x04 */ u8 unk_04;
|
||||
/* 0x05 */ u8 maxSimultaneousNotes;
|
||||
/* 0x06 */ u8 numSequencePlayers;
|
||||
/* 0x07 */ u8 unk_07[0x2];
|
||||
|
@ -620,7 +592,7 @@ typedef struct {
|
|||
} SoundAllocPool; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 *ptr;
|
||||
/* 0x0 */ u8* ptr;
|
||||
/* 0x4 */ u32 size;
|
||||
/* 0x8 */ s16 poolIndex;
|
||||
/* 0xA */ s16 id; // seqId or bankId
|
||||
|
@ -878,7 +850,7 @@ typedef struct {
|
|||
/* 0x0002 */ u16 unk_2;
|
||||
/* 0x0004 */ u16 unk_4;
|
||||
/* 0x0006 */ char unk_0006[0x0A];
|
||||
/* 0x0000 */ s32 unk_0x10;
|
||||
/* 0x0010 */ s16* curLoadedBook;
|
||||
/* 0x0014 */ NoteSubEu* noteSubsEu;
|
||||
/* 0x0018 */ SynthesisReverb synthesisReverbs[4];
|
||||
/* 0x0B38 */ char unk_0B38[0x30];
|
||||
|
@ -1005,17 +977,17 @@ typedef struct {
|
|||
} AudioContext; // size = 0x6450
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 reverb; // i.e. volume
|
||||
/* 0x00 */ u8 reverbVol;
|
||||
/* 0x01 */ u8 unk_1;
|
||||
/* 0x02 */ u8 pan;
|
||||
/* 0x03 */ ReverbBits reverbBits;
|
||||
/* 0x03 */ Stereo stereo;
|
||||
/* 0x04 */ f32 frequency;
|
||||
/* 0x08 */ f32 velocity;
|
||||
/* 0x0C */ char unk_0C[0x4];
|
||||
/* 0x10 */ s16* unk_10;
|
||||
/* 0x10 */ s16* filter;
|
||||
/* 0x14 */ u8 unk_14;
|
||||
/* 0x16 */ u16 unk_16;
|
||||
} Reverb; // size >= 0x18
|
||||
} NoteSubAttributes; // size = 0x18
|
||||
|
||||
typedef struct {
|
||||
/* 0x0000 */ u32 heap;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue