Skip to content

Commit

Permalink
audio docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicdcer committed Nov 10, 2024
1 parent 976fb57 commit af6f109
Show file tree
Hide file tree
Showing 4 changed files with 270 additions and 253 deletions.
8 changes: 4 additions & 4 deletions include/sf64audio_provisional.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ 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 13 frames
#define DMEM_1CH_SIZE (13 * SAMPLES_PER_FRAME * SAMPLE_SIZE)
// The length of one left/right 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)

Expand Down Expand Up @@ -840,7 +840,7 @@ typedef struct {
typedef struct {
/* 0x00 */ AudioTableBase base;
/* 0x10 */ AudioTableEntry entries[]; // (dynamic size)
} AudioTable; // size >= 0x20
} AudioTable; // size >= 0x20

typedef struct SampleDma {
/* 0x00 */ u8* ramAddr;
Expand Down Expand Up @@ -1020,7 +1020,7 @@ typedef struct {
#define SEQ_BYTE2(seqId) (((seqId) & (0xFF << 16)) >> 13 & 0xFFFF)

// audio_synthesis
void func_80008780(f32*, s32, f32*);
void AudioSynth_HartleyTransform(f32*, s32, f32*);
Acmd* AudioSynth_Update(Acmd* aList, s32* cmdCount, s16* aiBufStart, s32 aiBufLen);

// audio_effects
Expand Down
24 changes: 12 additions & 12 deletions linker_scripts/us/rev1/symbol_addrs_audio.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,25 +222,25 @@ sAudioResetMsg = 0x8015661C;


// functions
func_800080C0 = 0x800080C0;
func_80008364 = 0x80008364;
func_80008780 = 0x80008780;
AudioSynth_InitNextRingBuf = 0x800080C0;
AudioSynth_InverseDiscreteCosineTransform = 0x80008364;
AudioSynth_HartleyTransform = 0x80008780;
func_80009124 = 0x80009124;
func_80009504 = 0x80009504;
func_8000967C = 0x8000967C;
func_800097A8 = 0x800097A8;
func_800098DC = 0x800098DC;
func_80009984 = 0x80009984;
func_80009A2C = 0x80009A2C;
func_80009AAC = 0x80009AAC;
AudioSynth_LoadRingBufferPart = 0x800098DC;
AudioSynth_SaveRingBufferPart = 0x80009984;
AudioSynth_DisableSampleStates = 0x80009A2C;
AudioSynth_SyncSampleStates = 0x80009AAC;
AudioSynth_Update = 0x80009B64;
func_80009D78 = 0x80009D78;
func_8000A128 = 0x8000A128;
func_8000A25C = 0x8000A25C;
AudioSynth_LoadReverbSamples = 0x80009D78;
AudioSynth_SaveReverbSamples = 0x8000A128;
AudioSynth_DoOneAudioUpdate = 0x8000A25C;
AudioSynth_ProcessNote = 0x8000A700;
AudioSynth_LoadWaveSamples = 0x8000B3F0;
func_8000B480 = 0x8000B480;
func_8000B51C = 0x8000B51C;
AudioSynth_FinalResample = 0x8000B480;
AudioSynth_ProcessEnvelope = 0x8000B51C;
AudioSynth_ApplyHaasEffect = 0x8000B98C;


Expand Down
2 changes: 1 addition & 1 deletion src/audio/audio_general.c
Original file line number Diff line number Diff line change
Expand Up @@ -2241,7 +2241,7 @@ void Audio_AnalyzeFrequencies(f32* buffer0, f32* buffer1, s32 length, f32* buffe
buff1half1 = buffer1;

// FFT buffer 1 using buffer 2
func_80008780(buffer1, length, buffer2);
AudioSynth_HartleyTransform(buffer1, length, buffer2);

// handle i = 0 case
buff0fromStart[0] = buff1half1[0];
Expand Down
Loading

0 comments on commit af6f109

Please sign in to comment.