diff options
| author | Tortuga veloz <danielcampora@outlook.es> | 2025-03-12 14:20:15 +0100 |
|---|---|---|
| committer | Alejandro Asenjo Nitti <96613413+sonicdcer@users.noreply.github.com> | 2025-03-24 02:50:18 -0400 |
| commit | 798f6fbe1febdf77d22a15f8b98b19dbf0c363c9 (patch) | |
| tree | 9d78a163ab94a3bfe3dc404d737a177133c693c1 /include | |
| parent | 94553db6c146d01aa7bcf8ed24069acaac0de3db (diff) | |
Add 6-channel audio support.
Diffstat (limited to 'include')
| -rw-r--r-- | include/sf64audio_provisional.h | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/include/sf64audio_provisional.h b/include/sf64audio_provisional.h index 952af4dc..4ca35ea6 100644 --- a/include/sf64audio_provisional.h +++ b/include/sf64audio_provisional.h @@ -52,10 +52,14 @@ typedef void (*AudioCustomUpdateFunction)(void); // Samples are processed in groups of 16 called a "frame" #define SAMPLES_PER_FRAME ADPCMFSIZE -// The length of one left/right channel is 12 frames +#define MAX_NUM_AUDIO_CHANNELS 6 + +// The length of one channel is 12 frames #define DMEM_1CH_SIZE (12 * SAMPLES_PER_FRAME * SAMPLE_SIZE) // Both left and right channels #define DMEM_2CH_SIZE (2 * DMEM_1CH_SIZE) +// 6 channels +#define DMEM_6CH_SIZE (6 * DMEM_1CH_SIZE) #define AIBUF_LEN (170 * SAMPLES_PER_FRAME) // number of samples #define AIBUF_SIZE (AIBUF_LEN * SAMPLE_SIZE) // number of bytes @@ -399,7 +403,8 @@ typedef struct { typedef struct { /* 0x00 */ u8 strongLeft : 1; /* 0x00 */ u8 strongRight : 1; - /* 0x00 */ u8 bit2 : 2; + /* 0x00 */ u8 is_voice : 1; + /* 0x00 */ u8 is_sfx : 1; /* 0x00 */ u8 unused : 2; /* 0x00 */ u8 usesHeadsetPanEffects : 1; /* 0x00 */ u8 stereoHeadsetEffects : 1; @@ -428,7 +433,8 @@ typedef struct SequenceChannel { /* 0x00 */ u8 hasInstrument : 1; /* 0x00 */ u8 stereoHeadsetEffects : 1; /* 0x00 */ u8 largeNotes : 1; // notes specify duration and velocity - /* 0x00 */ u8 unused : 1; + /* 0x00 */ u8 is_voice : 1; + /* 0x00 */ u8 is_sfx : 1; union { struct { /* 0x4 */ char pad_4 : 1; @@ -551,8 +557,12 @@ typedef struct { /* 0x0C */ NoteSynthesisBuffers* synthesisBuffers; /* 0x10 */ s16 curVolLeft; /* 0x12 */ s16 curVolRight; - /* 0x14 */ char unk_14[0xC]; -} NoteSynthesisState; // size = 0x20 + /* 0x14 */ s16 curVolCenter; + /* 0x16 */ s16 curVolLfe; + /* 0x18 */ s16 curVolRLeft; + /* 0x1A */ s16 curVolRRight; + /* 0x1C */ char unk_14[0xC]; +} NoteSynthesisState; // size = 0x1E typedef struct { /* 0x00 */ struct SequenceChannel* channel; @@ -609,9 +619,13 @@ typedef struct { /* 0x05 */ u8 reverb; /* 0x06 */ u16 panVolLeft; /* 0x08 */ u16 panVolRight; - /* 0x0A */ u16 resampleRate; - /* 0x0C */ Sample** waveSampleAddr; -} NoteSubEu; // size = 0x10 + /* 0x0A */ u16 panVolCenter; + /* 0x0C */ u16 panVolLfe; + /* 0x0E */ u16 panVolRLeft; + /* 0x10 */ u16 panVolRRight; + /* 0x12 */ u16 resampleRate; + /* 0x14 */ Sample** waveSampleAddr; +} NoteSubEu; // size = 0x16 typedef struct Note { /* 0x00 */ AudioListItem listItem; |
