1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-10 17:00:19 +00:00
This commit is contained in:
zelda2774 2021-08-25 23:09:24 +02:00
parent 6c76c1875d
commit 1b057824f7
7 changed files with 120 additions and 150 deletions

View file

@ -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))
@ -87,7 +87,7 @@ typedef struct {
/* 0x00 */ u32 start;
/* 0x04 */ u32 end;
/* 0x08 */ u32 count;
/*?0x0C */ char unk_0C[0x4];
/* 0x0C */ char unk_0C[0x4];
/* 0x10 */ s16 state[16]; // only exists if count != 0. 8-byte aligned
} AdpcmLoop; // size = 0x30 (or 0x10)
@ -98,16 +98,11 @@ typedef struct {
} AdpcmBook;
typedef struct {
union{
struct {
/* 0x00 */ u32 codec : 4;
/* 0x00 */ u32 medium : 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;
@ -119,17 +114,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 {
@ -173,7 +167,7 @@ typedef struct {
} SynthesisReverb; // size = 0x2C8
typedef struct {
/*?0x00 */ u8 loaded;
/* 0x00 */ u8 loaded;
/* 0x01 */ u8 normalRangeLo;
/* 0x02 */ u8 normalRangeHi;
/* 0x03 */ u8 releaseRate;
@ -186,7 +180,7 @@ typedef struct {
typedef struct {
/* 0x00 */ u8 releaseRate;
/* 0x01 */ u8 pan;
/*?0x02 */ u8 loaded;
/* 0x02 */ u8 loaded;
/* 0x04 */ AudioBankSound sound;
/* 0x14 */ AdsrEnvelope* envelope;
} Drum; // size >= 0x14
@ -212,38 +206,21 @@ typedef struct {
// 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;
@ -251,7 +228,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;
@ -261,7 +237,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;
@ -332,36 +308,31 @@ typedef struct {
/* 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 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;
@ -392,9 +363,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];
@ -402,7 +373,7 @@ typedef struct SequenceChannel {
/* 0x7C */ AdsrSettings adsr;
/* 0x84 */ NotePool notePool;
/* 0xC4 */ s8 soundScriptIO[8]; // bridge between sound script and audio lib
/* 0xCC */ s16* unk_CC;
/* 0xCC */ s16* filter;
/* 0xD0 */ ReverbBits reverbBits;
} SequenceChannel; // size = 0xD4
@ -520,33 +491,33 @@ typedef struct {
/* 0x00 */ u8 stereoHeadsetEffects : 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 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;
/* 0x0C */ u16 resamplingRateFixedPoint;
/* 0x0E */ u16 unk_0E;
/* 0x10 */ union {
AudioBankSound* audioBankSound;
s16* samples;
} 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
@ -577,8 +548,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];
@ -624,7 +595,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
@ -1017,7 +988,7 @@ typedef struct {
/* 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