|
SpaghettiKart
|
#include <libultraship.h>#include "mixer.h"#include <macros.h>#include "audio/synthesis.h"#include "audio/heap.h"#include "audio/data.h"#include "audio/load.h"#include "audio/seqplayer.h"#include "audio/internal.h"#include "audio/external.h"#include "port/Engine.h"#include <libultra/abi.h>Data Structures | |
| struct | VolumeChange |
Macros | |
| #define | aSetLoadBufferPair(pkt, c, off) |
| #define | aSetSaveBufferPair(pkt, c, d, off) |
Functions | |
| u64 * | process_envelope (u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s32 nSamples, u16 inBuf, s32 headsetPanSettings, u32 flags) |
| void | prepare_reverb_ring_buffer (s32 chunkLen, u32 updateIndex, s32 reverbIndex) |
| Acmd * | synthesis_load_reverb_ring_buffer (Acmd *acmd, u16 addr, u16 srcOffset, s32 len, s32 reverbIndex) |
| Acmd * | synthesis_save_reverb_ring_buffer (Acmd *acmd, u16 addr, u16 destOffset, s32 len, s32 reverbIndex) |
| void | func_800B6FB4 (s32 updateIndexStart, s32 noteIndex) |
| void | synthesis_load_note_subs_eu (s32 updateIndex) |
| Acmd * | synthesis_execute (Acmd *acmd, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) |
| Acmd * | synthesis_resample_and_mix_reverb (Acmd *acmd, s32 bufLen, s16 reverbIndex, s16 updateIndex) |
| Acmd * | synthesis_save_reverb_samples (Acmd *acmd, s16 reverbIndex, s16 updateIndex) |
| Acmd * | synthesis_do_one_audio_update (s16 *aiBuf, s32 bufLen, Acmd *acmd, s32 updateIndex) |
| Acmd * | load_wave_samples (Acmd *acmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s32 nSamplesToLoad) |
| Acmd * | final_resample (Acmd *acmd, struct NoteSynthesisState *synthesisState, s32 count, u16 pitch, u16 dmemIn, u32 flags) |
| Acmd * | note_apply_headset_pan_effects (Acmd *acmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *note, s32 bufLen, s32 flags, s32 leftRight) |
| Acmd * | note_apply_surround_effect (Acmd *cmd, struct Note *note, s32 bufLen) |
Variables | |
| struct SynthesisReverb | gSynthesisReverbs [4] |
| u8 | sAudioSynthesisPad [0x10] |
| char | synthesisAudioString0 [] = "Terminate-Canceled Channel %d,Phase %d\n" |
| char | synthesisAudioString1 [] = "Copy %d\n" |
| char | synthesisAudioString2 [] = "%d->%d\n" |
| char | synthesisAudioString3 [] = "pitch %x: delaybytes %d : olddelay %d\n" |
| char | synthesisAudioString4 [] = "cont %x: delaybytes %d : olddelay %d\n" |
| #define aSetLoadBufferPair | ( | pkt, | |
| c, | |||
| off ) |
| #define aSetSaveBufferPair | ( | pkt, | |
| c, | |||
| d, | |||
| off ) |
| Acmd * final_resample | ( | Acmd * | acmd, |
| struct NoteSynthesisState * | synthesisState, | ||
| s32 | count, | ||
| u16 | pitch, | ||
| u16 | dmemIn, | ||
| u32 | flags ) |
| void func_800B6FB4 | ( | s32 | updateIndexStart, |
| s32 | noteIndex ) |
| Acmd * load_wave_samples | ( | Acmd * | acmd, |
| struct NoteSubEu * | noteSubEu, | ||
| struct NoteSynthesisState * | synthesisState, | ||
| s32 | nSamplesToLoad ) |
| Acmd * note_apply_headset_pan_effects | ( | Acmd * | acmd, |
| struct NoteSubEu * | noteSubEu, | ||
| struct NoteSynthesisState * | note, | ||
| s32 | bufLen, | ||
| s32 | flags, | ||
| s32 | leftRight ) |
| Acmd * note_apply_surround_effect | ( | Acmd * | cmd, |
| struct Note * | note, | ||
| s32 | bufLen ) |
Apply surround sound effect using matrix encoding based on depth position. Uses surroundEffectIndex (0x00-0x7F) calculated from Z position: 0x00-0x3F: Sound in front (0 = far front, 0x3F = at camera) - less rear effect 0x40-0x7F: Sound behind (0x40 = at camera, 0x7F = far behind) - more rear effect
This creates a rear channel effect by phase-inverting and mixing based on pan and depth.
| void prepare_reverb_ring_buffer | ( | s32 | chunkLen, |
| u32 | updateIndex, | ||
| s32 | reverbIndex ) |
| u64 * process_envelope | ( | u64 * | cmd, |
| struct NoteSubEu * | noteSubEu, | ||
| struct NoteSynthesisState * | synthesisState, | ||
| s32 | nSamples, | ||
| u16 | inBuf, | ||
| s32 | headsetPanSettings, | ||
| u32 | flags ) |
| Acmd * synthesis_do_one_audio_update | ( | s16 * | aiBuf, |
| s32 | bufLen, | ||
| Acmd * | acmd, | ||
| s32 | updateIndex ) |
| Acmd * synthesis_execute | ( | Acmd * | acmd, |
| s32 * | writtenCmds, | ||
| s16 * | aiBuf, | ||
| s32 | bufLen ) |
| void synthesis_load_note_subs_eu | ( | s32 | updateIndex | ) |
| Acmd * synthesis_load_reverb_ring_buffer | ( | Acmd * | acmd, |
| u16 | addr, | ||
| u16 | srcOffset, | ||
| s32 | len, | ||
| s32 | reverbIndex ) |
| Acmd * synthesis_resample_and_mix_reverb | ( | Acmd * | acmd, |
| s32 | bufLen, | ||
| s16 | reverbIndex, | ||
| s16 | updateIndex ) |
| Acmd * synthesis_save_reverb_ring_buffer | ( | Acmd * | acmd, |
| u16 | addr, | ||
| u16 | destOffset, | ||
| s32 | len, | ||
| s32 | reverbIndex ) |
| Acmd * synthesis_save_reverb_samples | ( | Acmd * | acmd, |
| s16 | reverbIndex, | ||
| s16 | updateIndex ) |
| struct SynthesisReverb gSynthesisReverbs[4] |
| u8 sAudioSynthesisPad[0x10] |
| char synthesisAudioString0[] = "Terminate-Canceled Channel %d,Phase %d\n" |
Given that (almost) all of these are format strings, it is highly likely that they are meant to be used in some sort of printf variant. But I don't care to try and figure out which function gets which string(s) So I've place them all here instead.
| char synthesisAudioString1[] = "Copy %d\n" |
| char synthesisAudioString2[] = "%d->%d\n" |
| char synthesisAudioString3[] = "pitch %x: delaybytes %d : olddelay %d\n" |
| char synthesisAudioString4[] = "cont %x: delaybytes %d : olddelay %d\n" |