mirror of
https://github.com/zeldaret/oot
synced 2026-05-22 22:44:26 -04:00
Comment more original names for audio functions from animal crossing (#2721)
* Comment more original names for audio functions from animal crossing * Drop delayparam, not original
This commit is contained in:
@@ -586,6 +586,7 @@ typedef struct NotePlaybackState {
|
||||
/* 0x6C */ VibratoState vibratoState;
|
||||
} NotePlaybackState; // size = 0x88
|
||||
|
||||
// JAudio: "commonch"
|
||||
typedef struct NoteSubEu {
|
||||
struct {
|
||||
/* 0x00 */ volatile u8 enabled : 1;
|
||||
@@ -622,6 +623,7 @@ typedef struct NoteSubEu {
|
||||
/* 0x18 */ char pad_18[0x8];
|
||||
} NoteSubEu; // size = 0x20
|
||||
|
||||
// JAudio: "channel"
|
||||
typedef struct Note {
|
||||
/* 0x00 */ AudioListItem listItem;
|
||||
/* 0x10 */ NoteSynthesisState synthesisState;
|
||||
@@ -737,12 +739,14 @@ typedef struct AudioSampleCache {
|
||||
/* 0x290 */ s32 numEntries;
|
||||
} AudioSampleCache; // size = 0x294
|
||||
|
||||
// JAudio: Persistent <-> "stay"
|
||||
typedef struct AudioPersistentCache {
|
||||
/* 0x00*/ u32 numEntries;
|
||||
/* 0x04*/ AudioAllocPool pool;
|
||||
/* 0x14*/ AudioCacheEntry entries[16];
|
||||
} AudioPersistentCache; // size = 0xD4
|
||||
|
||||
// JAudio: Temporary <-> "auto"
|
||||
typedef struct AudioTemporaryCache {
|
||||
/* 0x00*/ u32 nextSide;
|
||||
/* 0x04*/ AudioAllocPool pool;
|
||||
|
||||
@@ -1386,6 +1386,8 @@ void AudioOcarina_MapNotesToScarecrowButtons(u8 noteSongIndex) {
|
||||
* - ocarina action (only used to make flags != 0)
|
||||
* bitmask 0x80000000:
|
||||
* - unused (only used to make flags != 0)
|
||||
*
|
||||
* original name: Na_StartOcarinaSinglePlayCheck2
|
||||
*/
|
||||
void AudioOcarina_Start(u16 ocarinaFlags) {
|
||||
u8 i;
|
||||
@@ -1752,6 +1754,8 @@ void AudioOcarina_EnableInput(u8 inputEnabled) {
|
||||
* Resets ocarina properties based on the ocarina instrument id
|
||||
* If ocarina instrument id is "OCARINA_INSTRUMENT_OFF", turn off the ocarina
|
||||
* For all ocarina instrument ids, turn the ocarina on with the instrument id
|
||||
*
|
||||
* original name possibly Na_StopOcarinaMode
|
||||
*/
|
||||
void AudioOcarina_SetInstrument(u8 ocarinaInstrumentId) {
|
||||
if (sOcarinaInstrumentId == ocarinaInstrumentId) {
|
||||
@@ -1786,6 +1790,9 @@ void AudioOcarina_SetInstrument(u8 ocarinaInstrumentId) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name possibly Na_StartOcarinaBgm
|
||||
*/
|
||||
void AudioOcarina_SetPlaybackSong(s8 songIndexPlusOne, s8 playbackState) {
|
||||
if (songIndexPlusOne == 0) {
|
||||
sPlaybackState = 0;
|
||||
@@ -3232,6 +3239,9 @@ void Audio_ClearSariaBgm2(void) {
|
||||
sSariaBgmPtr = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Na_StartMorinigBgm
|
||||
*/
|
||||
void Audio_PlayMorningSceneSequence(u16 seqId) {
|
||||
Audio_PlaySceneSequence(seqId);
|
||||
// Writing a value of 1 to ioPort 0 will be used by
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#include "attributes.h"
|
||||
#include "audio.h"
|
||||
|
||||
/**
|
||||
* original name: __Nas_CallWaveProcess_Sub
|
||||
*/
|
||||
void Audio_SequenceChannelProcessSound(SequenceChannel* channel, s32 recalculateVolume, s32 applyBend) {
|
||||
f32 channelVolume;
|
||||
f32 chanFreqScale;
|
||||
@@ -50,6 +53,9 @@ void Audio_SequenceChannelProcessSound(SequenceChannel* channel, s32 recalculate
|
||||
channel->changes.asByte = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_MainCtrl
|
||||
*/
|
||||
void Audio_SequencePlayerProcessSound(SequencePlayer* seqPlayer) {
|
||||
s32 i;
|
||||
|
||||
@@ -85,6 +91,9 @@ void Audio_SequencePlayerProcessSound(SequencePlayer* seqPlayer) {
|
||||
seqPlayer->recalculateVolume = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SweepCalculator
|
||||
*/
|
||||
f32 Audio_GetPortamentoFreqScale(Portamento* portamento) {
|
||||
u32 loResCur;
|
||||
f32 portamentoFreq;
|
||||
@@ -102,6 +111,9 @@ f32 Audio_GetPortamentoFreqScale(Portamento* portamento) {
|
||||
return portamentoFreq;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_ModTableRead
|
||||
*/
|
||||
s16 Audio_GetVibratoPitchChange(VibratoState* vib) {
|
||||
s32 index;
|
||||
|
||||
@@ -110,6 +122,9 @@ s16 Audio_GetVibratoPitchChange(VibratoState* vib) {
|
||||
return vib->curve[index];
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_Modulator
|
||||
*/
|
||||
f32 Audio_GetVibratoFreqScale(VibratoState* vib) {
|
||||
static f32 D_80130510 = 0.0f;
|
||||
static s32 D_80130514 = 0;
|
||||
@@ -174,6 +189,9 @@ f32 Audio_GetVibratoFreqScale(VibratoState* vib) {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_ChannelModulation
|
||||
*/
|
||||
void Audio_NoteVibratoUpdate(Note* note) {
|
||||
if (note->playbackState.portamento.mode != 0) {
|
||||
note->playbackState.portamentoFreqScale = Audio_GetPortamentoFreqScale(¬e->playbackState.portamento);
|
||||
@@ -183,6 +201,9 @@ void Audio_NoteVibratoUpdate(Note* note) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_ChannelModInit
|
||||
*/
|
||||
void Audio_NoteVibratoInit(Note* note) {
|
||||
VibratoState* vib;
|
||||
SequenceChannel* channel;
|
||||
@@ -211,11 +232,17 @@ void Audio_NoteVibratoInit(Note* note) {
|
||||
vib->delay = channel->vibratoDelay;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SweepInit
|
||||
*/
|
||||
void Audio_NotePortamentoInit(Note* note) {
|
||||
note->playbackState.portamentoFreqScale = 1.0f;
|
||||
note->playbackState.portamento = note->playbackState.parentLayer->portamento;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_EnvInit
|
||||
*/
|
||||
void Audio_AdsrInit(AdsrState* adsr, EnvelopePoint* envelope, s16* volOut) {
|
||||
adsr->action.asByte = 0;
|
||||
adsr->delay = 0;
|
||||
@@ -227,6 +254,9 @@ void Audio_AdsrInit(AdsrState* adsr, EnvelopePoint* envelope, s16* volOut) {
|
||||
// removed, but the function parameter was forgotten and remains.)
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_EnvProcess
|
||||
*/
|
||||
f32 Audio_AdsrUpdate(AdsrState* adsr) {
|
||||
u8 state = adsr->action.s.state;
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* original filename: memory.c
|
||||
*/
|
||||
#include "alignment.h"
|
||||
#include "ultra64.h"
|
||||
#include "versions.h"
|
||||
@@ -14,6 +17,8 @@ void AudioHeap_DiscardSampleBanks(void);
|
||||
|
||||
/**
|
||||
* Effectively scales `ticksPerUpdateInv` by the reciprocal of `scaleInv`
|
||||
*
|
||||
* original name: __CalcRelf
|
||||
*/
|
||||
f32 AudioHeap_CalculateAdsrDecay(f32 scaleInv) {
|
||||
return (256.0f * gAudioCtx.audioBufferParameters.ticksPerUpdateInvScaled) / scaleInv;
|
||||
@@ -21,6 +26,8 @@ f32 AudioHeap_CalculateAdsrDecay(f32 scaleInv) {
|
||||
|
||||
/**
|
||||
* Initialize the decay rate table used for decaying notes as part of adsr
|
||||
*
|
||||
* original name: MakeReleaseTable
|
||||
*/
|
||||
void AudioHeap_InitAdsrDecayTable(void) {
|
||||
s32 i;
|
||||
@@ -46,6 +53,9 @@ void AudioHeap_InitAdsrDecayTable(void) {
|
||||
gAudioCtx.adsrDecayTable[0] = 0.0f;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_ResetIDtable
|
||||
*/
|
||||
void AudioHeap_ResetLoadStatus(void) {
|
||||
s32 i;
|
||||
|
||||
@@ -68,6 +78,9 @@ void AudioHeap_ResetLoadStatus(void) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_ForceStopChannel
|
||||
*/
|
||||
void AudioHeap_DiscardFont(s32 fontId) {
|
||||
s32 i;
|
||||
|
||||
@@ -86,6 +99,9 @@ void AudioHeap_DiscardFont(s32 fontId) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_ForceReleaseChannel
|
||||
*/
|
||||
void AudioHeap_ReleaseNotesForFont(s32 fontId) {
|
||||
s32 i;
|
||||
|
||||
@@ -103,6 +119,9 @@ void AudioHeap_ReleaseNotesForFont(s32 fontId) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_ForceStopSeq
|
||||
*/
|
||||
void AudioHeap_DiscardSequence(s32 seqId) {
|
||||
s32 i;
|
||||
|
||||
@@ -115,6 +134,8 @@ void AudioHeap_DiscardSequence(s32 seqId) {
|
||||
|
||||
/**
|
||||
* Perform a writeback from the data cache to the ram.
|
||||
*
|
||||
* original name: Nas_CacheOff
|
||||
*/
|
||||
void AudioHeap_WritebackDCache(void* ramAddr, u32 size) {
|
||||
Audio_WritebackDCache(ramAddr, size);
|
||||
@@ -124,6 +145,8 @@ void AudioHeap_WritebackDCache(void* ramAddr, u32 size) {
|
||||
* Attempt to allocate space externally to the audio heap. If no external pool is available,
|
||||
* then allocate space on the pool provided in the argument.
|
||||
* The newly allocated space is zero'ed
|
||||
*
|
||||
* original name: Nas_2ndHeapAlloc_CL
|
||||
*/
|
||||
void* AudioHeap_AllocZeroedAttemptExternal(AudioAllocPool* pool, u32 size) {
|
||||
void* ramAddr = NULL;
|
||||
@@ -137,6 +160,9 @@ void* AudioHeap_AllocZeroedAttemptExternal(AudioAllocPool* pool, u32 size) {
|
||||
return ramAddr;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_2ndHeapAlloc
|
||||
*/
|
||||
void* AudioHeap_AllocAttemptExternal(AudioAllocPool* pool, u32 size) {
|
||||
void* ramAddr = NULL;
|
||||
|
||||
@@ -149,6 +175,9 @@ void* AudioHeap_AllocAttemptExternal(AudioAllocPool* pool, u32 size) {
|
||||
return ramAddr;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_NcHeapAlloc
|
||||
*/
|
||||
void* AudioHeap_AllocDmaMemory(AudioAllocPool* pool, u32 size) {
|
||||
void* ramAddr = AudioHeap_Alloc(pool, size);
|
||||
|
||||
@@ -158,6 +187,9 @@ void* AudioHeap_AllocDmaMemory(AudioAllocPool* pool, u32 size) {
|
||||
return ramAddr;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_NcHeapAlloc_CL
|
||||
*/
|
||||
void* AudioHeap_AllocDmaMemoryZeroed(AudioAllocPool* pool, u32 size) {
|
||||
void* ramAddr;
|
||||
|
||||
@@ -170,6 +202,8 @@ void* AudioHeap_AllocDmaMemoryZeroed(AudioAllocPool* pool, u32 size) {
|
||||
|
||||
/**
|
||||
* Allocates space on a pool contained within the heap and sets all the allocated space to 0
|
||||
*
|
||||
* original name: Nas_HeapAlloc_CL
|
||||
*/
|
||||
void* AudioHeap_AllocZeroed(AudioAllocPool* pool, u32 size) {
|
||||
u8* ramAddr = AudioHeap_Alloc(pool, size);
|
||||
@@ -184,6 +218,9 @@ void* AudioHeap_AllocZeroed(AudioAllocPool* pool, u32 size) {
|
||||
return ramAddr;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_HeapAlloc
|
||||
*/
|
||||
void* AudioHeap_Alloc(AudioAllocPool* pool, u32 size) {
|
||||
u32 aligned = ALIGN16(size);
|
||||
u8* ramAddr = pool->curRamAddr;
|
||||
@@ -200,6 +237,8 @@ void* AudioHeap_Alloc(AudioAllocPool* pool, u32 size) {
|
||||
/**
|
||||
* Initialize a pool to allocate memory from the specified address, up to the specified size.
|
||||
* Store the metadata of this pool in AudioAllocPool* pool
|
||||
*
|
||||
* original name: Nas_HeapInit
|
||||
*/
|
||||
void AudioHeap_InitPool(AudioAllocPool* pool, void* ramAddr, u32 size) {
|
||||
pool->curRamAddr = pool->startRamAddr = (u8*)ALIGN16((u32)ramAddr);
|
||||
@@ -207,12 +246,18 @@ void AudioHeap_InitPool(AudioAllocPool* pool, void* ramAddr, u32 size) {
|
||||
pool->numEntries = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SzStayClear
|
||||
*/
|
||||
void AudioHeap_InitPersistentCache(AudioPersistentCache* persistent) {
|
||||
persistent->pool.numEntries = 0;
|
||||
persistent->numEntries = 0;
|
||||
persistent->pool.curRamAddr = persistent->pool.startRamAddr;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SzAutoClear
|
||||
*/
|
||||
void AudioHeap_InitTemporaryCache(AudioTemporaryCache* temporary) {
|
||||
temporary->pool.numEntries = 0;
|
||||
temporary->pool.curRamAddr = temporary->pool.startRamAddr;
|
||||
@@ -223,11 +268,17 @@ void AudioHeap_InitTemporaryCache(AudioTemporaryCache* temporary) {
|
||||
temporary->entries[1].id = -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SzCustomClear
|
||||
*/
|
||||
void AudioHeap_ResetPool(AudioAllocPool* pool) {
|
||||
pool->numEntries = 0;
|
||||
pool->curRamAddr = pool->startRamAddr;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SzStayDelete
|
||||
*/
|
||||
void AudioHeap_PopPersistentCache(s32 tableType) {
|
||||
AudioCache* loadedCache;
|
||||
AudioAllocPool* persistentPool;
|
||||
@@ -274,6 +325,9 @@ void AudioHeap_PopPersistentCache(s32 tableType) {
|
||||
persistent->numEntries--;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SzHeapReset
|
||||
*/
|
||||
void AudioHeap_InitMainPools(s32 initPoolSize) {
|
||||
AudioHeap_InitPool(&gAudioCtx.initPool, gAudioCtx.audioHeap, initPoolSize);
|
||||
AudioHeap_InitPool(&gAudioCtx.sessionPool, gAudioCtx.audioHeap + initPoolSize,
|
||||
@@ -281,6 +335,9 @@ void AudioHeap_InitMainPools(s32 initPoolSize) {
|
||||
gAudioCtx.externalPool.startRamAddr = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SzHeapDivide
|
||||
*/
|
||||
void AudioHeap_InitSessionPools(AudioSessionPoolSplit* split) {
|
||||
gAudioCtx.sessionPool.curRamAddr = gAudioCtx.sessionPool.startRamAddr;
|
||||
AudioHeap_InitPool(&gAudioCtx.miscPool, AudioHeap_Alloc(&gAudioCtx.sessionPool, split->miscPoolSize),
|
||||
@@ -289,6 +346,9 @@ void AudioHeap_InitSessionPools(AudioSessionPoolSplit* split) {
|
||||
split->cachePoolSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SzDataDivide
|
||||
*/
|
||||
void AudioHeap_InitCachePools(AudioCachePoolSplit* split) {
|
||||
gAudioCtx.cachePool.curRamAddr = gAudioCtx.cachePool.startRamAddr;
|
||||
AudioHeap_InitPool(&gAudioCtx.persistentCommonPool,
|
||||
@@ -299,6 +359,9 @@ void AudioHeap_InitCachePools(AudioCachePoolSplit* split) {
|
||||
split->temporaryCommonPoolSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SzStayDivide
|
||||
*/
|
||||
void AudioHeap_InitPersistentPoolsAndCaches(AudioCommonPoolSplit* split) {
|
||||
gAudioCtx.persistentCommonPool.curRamAddr = gAudioCtx.persistentCommonPool.startRamAddr;
|
||||
AudioHeap_InitPool(&gAudioCtx.seqCache.persistent.pool,
|
||||
@@ -313,6 +376,9 @@ void AudioHeap_InitPersistentPoolsAndCaches(AudioCommonPoolSplit* split) {
|
||||
AudioHeap_InitPersistentCache(&gAudioCtx.sampleBankCache.persistent);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SzAutoDivide
|
||||
*/
|
||||
void AudioHeap_InitTemporaryPoolsAndCaches(AudioCommonPoolSplit* split) {
|
||||
gAudioCtx.temporaryCommonPool.curRamAddr = gAudioCtx.temporaryCommonPool.startRamAddr;
|
||||
AudioHeap_InitPool(&gAudioCtx.seqCache.temporary.pool,
|
||||
@@ -327,6 +393,9 @@ void AudioHeap_InitTemporaryPoolsAndCaches(AudioCommonPoolSplit* split) {
|
||||
AudioHeap_InitTemporaryCache(&gAudioCtx.sampleBankCache.temporary);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SzHeapAlloc
|
||||
*/
|
||||
void* AudioHeap_AllocCached(s32 tableType, s32 size, s32 cache, s32 id) {
|
||||
AudioCache* loadedCache;
|
||||
AudioTemporaryCache* temporaryCache;
|
||||
@@ -595,6 +664,9 @@ void* AudioHeap_AllocCached(s32 tableType, s32 size, s32 cache, s32 id) {
|
||||
return loadedCache->persistent.entries[loadedCache->persistent.numEntries++].ramAddr;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SzCacheCheck
|
||||
*/
|
||||
void* AudioHeap_SearchCaches(s32 tableType, s32 cache, s32 id) {
|
||||
void* ramAddr;
|
||||
|
||||
@@ -609,6 +681,9 @@ void* AudioHeap_SearchCaches(s32 tableType, s32 cache, s32 id) {
|
||||
return AudioHeap_SearchRegularCaches(tableType, cache, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __Nas_SzCacheCheck_Inner
|
||||
*/
|
||||
void* AudioHeap_SearchRegularCaches(s32 tableType, s32 cache, s32 id) {
|
||||
u32 i;
|
||||
AudioCache* loadedCache;
|
||||
@@ -655,6 +730,9 @@ void* AudioHeap_SearchRegularCaches(s32 tableType, s32 cache, s32 id) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_InitFilterCoef
|
||||
*/
|
||||
void func_800DF1D8(f32 p, f32 q, u16* out) {
|
||||
// With the bug below fixed, this mysterious unused function computes two recurrences
|
||||
// out[0..7] = a_i, out[8..15] = b_i, where
|
||||
@@ -683,6 +761,9 @@ void func_800DF1D8(f32 p, f32 q, u16* out) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_ClearFilter
|
||||
*/
|
||||
void AudioHeap_ClearFilter(s16* filter) {
|
||||
s32 i;
|
||||
|
||||
@@ -691,6 +772,9 @@ void AudioHeap_ClearFilter(s16* filter) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SetLPFilter
|
||||
*/
|
||||
void AudioHeap_LoadLowPassFilter(s16* filter, s32 cutoff) {
|
||||
s32 i;
|
||||
s16* ptr = &gLowPassFilterData[8 * cutoff];
|
||||
@@ -700,6 +784,9 @@ void AudioHeap_LoadLowPassFilter(s16* filter, s32 cutoff) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SetHPFilter
|
||||
*/
|
||||
void AudioHeap_LoadHighPassFilter(s16* filter, s32 cutoff) {
|
||||
s32 i;
|
||||
s16* ptr = &gHighPassFilterData[8 * (cutoff - 1)];
|
||||
@@ -709,6 +796,9 @@ void AudioHeap_LoadHighPassFilter(s16* filter, s32 cutoff) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SetBPFilter
|
||||
*/
|
||||
void AudioHeap_LoadFilter(s16* filter, s32 lowPassCutoff, s32 highPassCutoff) {
|
||||
s32 i;
|
||||
|
||||
@@ -729,9 +819,15 @@ void AudioHeap_LoadFilter(s16* filter, s32 lowPassCutoff, s32 highPassCutoff) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __DownDelay
|
||||
*/
|
||||
void AudioHeap_UpdateReverb(SynthesisReverb* reverb) {
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __Nas_DelayDown
|
||||
*/
|
||||
void AudioHeap_UpdateReverbs(void) {
|
||||
s32 count;
|
||||
s32 i;
|
||||
@@ -752,6 +848,8 @@ void AudioHeap_UpdateReverbs(void) {
|
||||
|
||||
/**
|
||||
* Clear the current Audio Interface Buffer
|
||||
*
|
||||
* original name: __Nas_DacClear
|
||||
*/
|
||||
void AudioHeap_ClearCurrentAiBuffer(void) {
|
||||
s32 curAiBufferIndex = gAudioCtx.curAiBufIndex;
|
||||
@@ -764,6 +862,9 @@ void AudioHeap_ClearCurrentAiBuffer(void) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SpecChange
|
||||
*/
|
||||
s32 AudioHeap_ResetStep(void) {
|
||||
s32 i;
|
||||
s32 j;
|
||||
@@ -842,6 +943,9 @@ s32 AudioHeap_ResetStep(void) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __Nas_MemoryReconfig
|
||||
*/
|
||||
void AudioHeap_Init(void) {
|
||||
s32 pad1[4];
|
||||
s16* ramAddr;
|
||||
@@ -1068,6 +1172,9 @@ void AudioHeap_Init(void) {
|
||||
osSetIntMask(intMask);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: EmemOnCheck
|
||||
*/
|
||||
void* AudioHeap_SearchPermanentCache(s32 tableType, s32 id) {
|
||||
s32 i;
|
||||
|
||||
@@ -1079,6 +1186,9 @@ void* AudioHeap_SearchPermanentCache(s32 tableType, s32 id) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: EmemAlloc
|
||||
*/
|
||||
void* AudioHeap_AllocPermanent(s32 tableType, s32 id, u32 size) {
|
||||
void* ramAddr;
|
||||
s32 index = gAudioCtx.permanentPool.numEntries;
|
||||
@@ -1099,6 +1209,9 @@ void* AudioHeap_AllocPermanent(s32 tableType, s32 id, u32 size) {
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_Alloc_Single
|
||||
*/
|
||||
void* AudioHeap_AllocSampleCache(u32 size, s32 fontId, void* sampleAddr, s8 medium, s32 cache) {
|
||||
SampleCacheEntry* entry;
|
||||
|
||||
@@ -1120,6 +1233,8 @@ void* AudioHeap_AllocSampleCache(u32 size, s32 fontId, void* sampleAddr, s8 medi
|
||||
/**
|
||||
* Initializes the persistent and temporary caches used for individual samples. Will attempt to use heap space available
|
||||
* on the external pool. If no external pool is provided, then default to using space on the misc pool.
|
||||
*
|
||||
* original name: Nas_Init_Single
|
||||
*/
|
||||
void AudioHeap_InitSampleCaches(u32 persistentSampleCacheSize, u32 temporarySampleCacheSize) {
|
||||
void* ramAddr;
|
||||
@@ -1140,6 +1255,9 @@ void AudioHeap_InitSampleCaches(u32 persistentSampleCacheSize, u32 temporarySamp
|
||||
gAudioCtx.temporarySampleCache.numEntries = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __Nas_Alloc_Single_Auto_Inner
|
||||
*/
|
||||
SampleCacheEntry* AudioHeap_AllocTemporarySampleCacheEntry(u32 size) {
|
||||
u8* allocAfter;
|
||||
u8* allocBefore;
|
||||
@@ -1225,6 +1343,9 @@ SampleCacheEntry* AudioHeap_AllocTemporarySampleCacheEntry(u32 size) {
|
||||
return entry;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __SearchBank
|
||||
*/
|
||||
void AudioHeap_UnapplySampleCacheForFont(SampleCacheEntry* entry, s32 fontId) {
|
||||
Drum* drum;
|
||||
Instrument* inst;
|
||||
@@ -1261,6 +1382,9 @@ void AudioHeap_UnapplySampleCacheForFont(SampleCacheEntry* entry, s32 fontId) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __KillSwMember
|
||||
*/
|
||||
void AudioHeap_DiscardSampleCacheEntry(SampleCacheEntry* entry) {
|
||||
s32 numFonts;
|
||||
s32 sampleBankId1;
|
||||
@@ -1282,6 +1406,9 @@ void AudioHeap_DiscardSampleCacheEntry(SampleCacheEntry* entry) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __RomAddrSet
|
||||
*/
|
||||
void AudioHeap_UnapplySampleCache(SampleCacheEntry* entry, Sample* sample) {
|
||||
if (sample != NULL) {
|
||||
if (sample->sampleAddr == entry->allocatedAddr) {
|
||||
@@ -1291,6 +1418,9 @@ void AudioHeap_UnapplySampleCache(SampleCacheEntry* entry, Sample* sample) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __Nas_Alloc_Single_Stay_Inner
|
||||
*/
|
||||
SampleCacheEntry* AudioHeap_AllocPersistentSampleCacheEntry(u32 size) {
|
||||
AudioSampleCache* cache;
|
||||
SampleCacheEntry* entry;
|
||||
@@ -1310,6 +1440,9 @@ SampleCacheEntry* AudioHeap_AllocPersistentSampleCacheEntry(u32 size) {
|
||||
return entry;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __Do_EmemKill
|
||||
*/
|
||||
void AudioHeap_DiscardSampleCacheForFont(SampleCacheEntry* entry, s32 sampleBankId1, s32 sampleBankId2, s32 fontId) {
|
||||
if ((entry->sampleBankId == sampleBankId1) || (entry->sampleBankId == sampleBankId2) ||
|
||||
(entry->sampleBankId == 0)) {
|
||||
@@ -1317,6 +1450,9 @@ void AudioHeap_DiscardSampleCacheForFont(SampleCacheEntry* entry, s32 sampleBank
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Emem_KillSwMember
|
||||
*/
|
||||
void AudioHeap_DiscardSampleCaches(void) {
|
||||
s32 numFonts;
|
||||
s32 sampleBankId1;
|
||||
@@ -1354,6 +1490,9 @@ typedef struct StorageChange {
|
||||
u8 newMedium;
|
||||
} StorageChange;
|
||||
|
||||
/**
|
||||
* original name: __RestoreAddr
|
||||
*/
|
||||
void AudioHeap_ChangeStorage(StorageChange* change, Sample* sample) {
|
||||
if (sample != NULL) {
|
||||
u32 startAddr = change->oldAddr;
|
||||
@@ -1368,14 +1507,23 @@ void AudioHeap_ChangeStorage(StorageChange* change, Sample* sample) {
|
||||
|
||||
void AudioHeap_ApplySampleBankCacheInternal(s32 apply, s32 sampleBankId);
|
||||
|
||||
/**
|
||||
* original name: DirtyWave
|
||||
*/
|
||||
void AudioHeap_DiscardSampleBank(s32 sampleBankId) {
|
||||
AudioHeap_ApplySampleBankCacheInternal(false, sampleBankId);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: EntryWave
|
||||
*/
|
||||
void AudioHeap_ApplySampleBankCache(s32 sampleBankId) {
|
||||
AudioHeap_ApplySampleBankCacheInternal(true, sampleBankId);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __ExchangeWave
|
||||
*/
|
||||
void AudioHeap_ApplySampleBankCacheInternal(s32 apply, s32 sampleBankId) {
|
||||
AudioTable* sampleBankTable;
|
||||
AudioTableEntry* entry;
|
||||
@@ -1464,6 +1612,9 @@ void AudioHeap_ApplySampleBankCacheInternal(s32 apply, s32 sampleBankId) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Dirty_AllWave
|
||||
*/
|
||||
void AudioHeap_DiscardSampleBanks(void) {
|
||||
AudioCache* cache;
|
||||
AudioPersistentCache* persistent;
|
||||
|
||||
@@ -118,7 +118,7 @@ void AudioLoad_DecreaseSampleDmaTtls(void) {
|
||||
}
|
||||
|
||||
/**
|
||||
* original name:Nas_WaveDmaCallBack
|
||||
* original name: Nas_WaveDmaCallBack
|
||||
*/
|
||||
void* AudioLoad_DmaSampleData(u32 devAddr, u32 size, s32 arg2, u8* dmaIndexRef, s32 medium) {
|
||||
s32 pad1;
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
/**
|
||||
* original filename: channel.c
|
||||
*/
|
||||
#include "ultra64.h"
|
||||
#include "audio.h"
|
||||
|
||||
/**
|
||||
* original name: Nas_smzSetParam
|
||||
*/
|
||||
void Audio_InitNoteSub(Note* note, NoteSubEu* sub, NoteSubAttributes* attrs) {
|
||||
f32 volLeft;
|
||||
f32 volRight;
|
||||
@@ -106,6 +112,9 @@ void Audio_InitNoteSub(Note* note, NoteSubEu* sub, NoteSubAttributes* attrs) {
|
||||
sub->reverbVol = reverbVol;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_smzSetPitch
|
||||
*/
|
||||
void Audio_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput) {
|
||||
f32 resamplingRate = 0.0f;
|
||||
|
||||
@@ -124,6 +133,9 @@ void Audio_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput)
|
||||
noteSubEu->resamplingRateFixedPoint = (s32)(resamplingRate * 32768.0f);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_StartVoice
|
||||
*/
|
||||
void Audio_NoteInit(Note* note) {
|
||||
if (note->playbackState.parentLayer->adsr.decayIndex == 0) {
|
||||
Audio_AdsrInit(¬e->playbackState.adsr, note->playbackState.parentLayer->channel->adsr.envelope,
|
||||
@@ -138,6 +150,9 @@ void Audio_NoteInit(Note* note) {
|
||||
note->noteSubEu = gDefaultNoteSub;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_StopVoice
|
||||
*/
|
||||
void Audio_NoteDisable(Note* note) {
|
||||
if (note->noteSubEu.bitField0.needsInit == true) {
|
||||
note->noteSubEu.bitField0.needsInit = false;
|
||||
@@ -152,6 +167,9 @@ void Audio_NoteDisable(Note* note) {
|
||||
note->playbackState.adsr.current = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_UpdateChannel
|
||||
*/
|
||||
void Audio_ProcessNotes(void) {
|
||||
s32 pad[2];
|
||||
NoteAttributes* attrs;
|
||||
@@ -295,6 +313,9 @@ void Audio_ProcessNotes(void) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: NoteToVoice
|
||||
*/
|
||||
TunedSample* Audio_GetInstrumentTunedSample(Instrument* instrument, s32 semitone) {
|
||||
TunedSample* tunedSample;
|
||||
|
||||
@@ -308,6 +329,9 @@ TunedSample* Audio_GetInstrumentTunedSample(Instrument* instrument, s32 semitone
|
||||
return tunedSample;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: ProgToVp
|
||||
*/
|
||||
Instrument* Audio_GetInstrumentInner(s32 fontId, s32 instId) {
|
||||
Instrument* inst;
|
||||
|
||||
@@ -334,6 +358,9 @@ Instrument* Audio_GetInstrumentInner(s32 fontId, s32 instId) {
|
||||
return inst;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: PercToPp
|
||||
*/
|
||||
Drum* Audio_GetDrum(s32 fontId, s32 drumId) {
|
||||
Drum* drum;
|
||||
|
||||
@@ -362,6 +389,9 @@ Drum* Audio_GetDrum(s32 fontId, s32 drumId) {
|
||||
return drum;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: VpercToVep
|
||||
*/
|
||||
SoundEffect* Audio_GetSoundEffect(s32 fontId, s32 sfxId) {
|
||||
SoundEffect* soundEffect;
|
||||
|
||||
@@ -396,6 +426,9 @@ SoundEffect* Audio_GetSoundEffect(s32 fontId, s32 sfxId) {
|
||||
return soundEffect;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: OverwriteBank
|
||||
*/
|
||||
s32 Audio_SetFontInstrument(s32 instrumentType, s32 fontId, s32 index, void* value) {
|
||||
if (fontId == 0xFF) {
|
||||
return -1;
|
||||
@@ -431,6 +464,9 @@ s32 Audio_SetFontInstrument(s32 instrumentType, s32 fontId, s32 index, void* val
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __Nas_Release_Channel_Main
|
||||
*/
|
||||
void Audio_SeqLayerDecayRelease(SequenceLayer* layer, s32 target) {
|
||||
Note* note;
|
||||
NoteAttributes* attrs;
|
||||
@@ -523,10 +559,16 @@ void Audio_SeqLayerDecayRelease(SequenceLayer* layer, s32 target) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_Release_Channel
|
||||
*/
|
||||
void Audio_SeqLayerNoteDecay(SequenceLayer* layer) {
|
||||
Audio_SeqLayerDecayRelease(layer, ADSR_STATE_DECAY);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_Release_Channel_Force
|
||||
*/
|
||||
void Audio_SeqLayerNoteRelease(SequenceLayer* layer) {
|
||||
Audio_SeqLayerDecayRelease(layer, ADSR_STATE_RELEASE);
|
||||
}
|
||||
@@ -597,12 +639,18 @@ void Audio_InitSyntheticWave(Note* note, SequenceLayer* layer) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __Nas_InitList
|
||||
*/
|
||||
void Audio_InitNoteList(AudioListItem* list) {
|
||||
list->prev = list;
|
||||
list->next = list;
|
||||
list->u.count = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_InitChNode
|
||||
*/
|
||||
void Audio_InitNoteLists(NotePool* pool) {
|
||||
Audio_InitNoteList(&pool->disabled);
|
||||
Audio_InitNoteList(&pool->decaying);
|
||||
@@ -614,6 +662,9 @@ void Audio_InitNoteLists(NotePool* pool) {
|
||||
pool->active.pool = pool;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_InitChannelList
|
||||
*/
|
||||
void Audio_InitNoteFreeList(void) {
|
||||
s32 i;
|
||||
|
||||
@@ -625,6 +676,9 @@ void Audio_InitNoteFreeList(void) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_DeAllocAllVoices
|
||||
*/
|
||||
void Audio_NotePoolClear(NotePool* pool) {
|
||||
s32 i;
|
||||
AudioListItem* source;
|
||||
@@ -665,6 +719,9 @@ void Audio_NotePoolClear(NotePool* pool) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_AllocVoices
|
||||
*/
|
||||
void Audio_NotePoolFill(NotePool* pool, s32 count) {
|
||||
s32 i;
|
||||
s32 j;
|
||||
@@ -712,6 +769,9 @@ void Audio_NotePoolFill(NotePool* pool, s32 count) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_AddListHead
|
||||
*/
|
||||
void Audio_AudioListPushFront(AudioListItem* list, AudioListItem* item) {
|
||||
// add 'item' to the front of the list given by 'list', if it's not in any list
|
||||
if (item->prev == NULL) {
|
||||
@@ -724,6 +784,9 @@ void Audio_AudioListPushFront(AudioListItem* list, AudioListItem* item) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_CutList
|
||||
*/
|
||||
void Audio_AudioListRemove(AudioListItem* item) {
|
||||
// remove 'item' from the list it's in, if any
|
||||
if (item->prev != NULL) {
|
||||
@@ -733,6 +796,9 @@ void Audio_AudioListRemove(AudioListItem* item) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __Nas_GetLowerPrio
|
||||
*/
|
||||
Note* Audio_FindNodeWithPrioLessThan(AudioListItem* list, s32 limit) {
|
||||
AudioListItem* cur = list->next;
|
||||
AudioListItem* best;
|
||||
@@ -758,6 +824,9 @@ Note* Audio_FindNodeWithPrioLessThan(AudioListItem* list, s32 limit) {
|
||||
return best->u.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_EntryTrack
|
||||
*/
|
||||
void Audio_NoteInitForLayer(Note* note, SequenceLayer* layer) {
|
||||
s32 pad[3];
|
||||
s16 instId;
|
||||
@@ -796,12 +865,18 @@ void Audio_NoteInitForLayer(Note* note, SequenceLayer* layer) {
|
||||
sub->bitField1.reverbIndex = layer->channel->reverbIndex & 3;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __Nas_InterTrack
|
||||
*/
|
||||
void func_800E82C0(Note* note, SequenceLayer* layer) {
|
||||
// similar to Audio_NoteReleaseAndTakeOwnership, hard to say what the difference is
|
||||
Audio_SeqLayerNoteRelease(note->playbackState.parentLayer);
|
||||
note->playbackState.wantedParentLayer = layer;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __Nas_InterReleaseTrack
|
||||
*/
|
||||
void Audio_NoteReleaseAndTakeOwnership(Note* note, SequenceLayer* layer) {
|
||||
note->playbackState.wantedParentLayer = layer;
|
||||
note->playbackState.priority = layer->channel->notePriority;
|
||||
@@ -828,6 +903,9 @@ Note* Audio_AllocNoteFromDecaying(NotePool* pool, SequenceLayer* layer) {
|
||||
return note;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __Nas_ChLookRelWait
|
||||
*/
|
||||
Note* Audio_AllocNoteFromActive(NotePool* pool, SequenceLayer* layer) {
|
||||
Note* rNote;
|
||||
Note* aNote;
|
||||
@@ -863,6 +941,9 @@ Note* Audio_AllocNoteFromActive(NotePool* pool, SequenceLayer* layer) {
|
||||
return rNote;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_AllocationOnRequest
|
||||
*/
|
||||
Note* Audio_AllocNote(SequenceLayer* layer) {
|
||||
Note* note;
|
||||
u32 policy = layer->channel->noteAllocPolicy;
|
||||
@@ -926,6 +1007,9 @@ null_return:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_ChannelInit
|
||||
*/
|
||||
void Audio_NoteInitAll(void) {
|
||||
Note* note;
|
||||
s32 i;
|
||||
|
||||
+102
-24
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* original name: driver.c
|
||||
*/
|
||||
#include "alignment.h"
|
||||
#include "ultra64.h"
|
||||
#include "audio.h"
|
||||
@@ -59,6 +62,9 @@ u8 sNumSamplesPerWavePeriod[] = {
|
||||
WAVE_SAMPLE_COUNT / 8, // 8th harmonic
|
||||
};
|
||||
|
||||
/**
|
||||
* original name: Nas_CpuFX
|
||||
*/
|
||||
void AudioSynth_InitNextRingBuf(s32 chunkLen, s32 updateIndex, s32 reverbIndex) {
|
||||
ReverbRingBufferItem* bufItem;
|
||||
s32 pad[3];
|
||||
@@ -130,6 +136,9 @@ void AudioSynth_InitNextRingBuf(s32 chunkLen, s32 updateIndex, s32 reverbIndex)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __Nas_PushDrvReg
|
||||
*/
|
||||
void func_800DB03C(s32 updateIndex) {
|
||||
NoteSubEu* subEu;
|
||||
NoteSubEu* subEu2;
|
||||
@@ -150,6 +159,9 @@ void func_800DB03C(s32 updateIndex) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_smzAudioFrame
|
||||
*/
|
||||
Acmd* AudioSynth_Update(Acmd* cmdStart, s32* cmdCnt, s16* aiStart, s32 aiBufLen) {
|
||||
s32 chunkLen;
|
||||
s16* aiBufP;
|
||||
@@ -200,6 +212,9 @@ Acmd* AudioSynth_Update(Acmd* cmdStart, s32* cmdCnt, s16* aiStart, s32 aiBufLen)
|
||||
return cmdP;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __Nas_WaveTerminateProcess
|
||||
*/
|
||||
void func_800DB2C0(s32 updateIndex, s32 noteIndex) {
|
||||
NoteSubEu* noteSubEu;
|
||||
s32 i;
|
||||
@@ -214,6 +229,9 @@ void func_800DB2C0(s32 updateIndex, s32 noteIndex) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_LoadAux2nd
|
||||
*/
|
||||
Acmd* AudioSynth_LoadRingBuffer1AtTemp(Acmd* cmd, SynthesisReverb* reverb, s16 updateIndex) {
|
||||
ReverbRingBufferItem* bufItem = &reverb->items[reverb->curFrame][updateIndex];
|
||||
|
||||
@@ -225,6 +243,9 @@ Acmd* AudioSynth_LoadRingBuffer1AtTemp(Acmd* cmd, SynthesisReverb* reverb, s16 u
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SaveAux2nd
|
||||
*/
|
||||
Acmd* AudioSynth_SaveRingBuffer1AtTemp(Acmd* cmd, SynthesisReverb* reverb, s16 updateIndex) {
|
||||
ReverbRingBufferItem* bufItem = &reverb->items[reverb->curFrame][updateIndex];
|
||||
|
||||
@@ -238,6 +259,8 @@ Acmd* AudioSynth_SaveRingBuffer1AtTemp(Acmd* cmd, SynthesisReverb* reverb, s16 u
|
||||
|
||||
/**
|
||||
* Leak some audio from the left reverb channel into the right reverb channel and vice versa (pan)
|
||||
*
|
||||
* original name: Nas_CrossMix
|
||||
*/
|
||||
Acmd* AudioSynth_LeakReverb(Acmd* cmd, SynthesisReverb* reverb) {
|
||||
aDMEMMove(cmd++, DMEM_WET_LEFT_CH, DMEM_WET_SCRATCH, DMEM_1CH_SIZE);
|
||||
@@ -246,6 +269,9 @@ Acmd* AudioSynth_LeakReverb(Acmd* cmd, SynthesisReverb* reverb) {
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_LoadAuxBufferC
|
||||
*/
|
||||
Acmd* func_800DB4E4(Acmd* cmd, s32 aiBufLen, SynthesisReverb* reverb, s16 updateIndex) {
|
||||
ReverbRingBufferItem* item = &reverb->items[reverb->curFrame][updateIndex];
|
||||
s16 offsetA;
|
||||
@@ -266,6 +292,9 @@ Acmd* func_800DB4E4(Acmd* cmd, s32 aiBufLen, SynthesisReverb* reverb, s16 update
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SaveAuxBufferCH
|
||||
*/
|
||||
Acmd* func_800DB680(Acmd* cmd, SynthesisReverb* reverb, s16 updateIndex) {
|
||||
ReverbRingBufferItem* bufItem = &reverb->items[reverb->curFrame][updateIndex];
|
||||
|
||||
@@ -291,6 +320,9 @@ Acmd* func_800DB680(Acmd* cmd, SynthesisReverb* reverb, s16 updateIndex) {
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_LoadAuxBufferCH
|
||||
*/
|
||||
Acmd* func_800DB828(Acmd* cmd, s32 aiBufLen, SynthesisReverb* reverb, s16 updateIndex) {
|
||||
ReverbRingBufferItem* item = &reverb->items[reverb->curFrame][updateIndex];
|
||||
s16 offsetA;
|
||||
@@ -315,6 +347,8 @@ Acmd* func_800DB828(Acmd* cmd, s32 aiBufLen, SynthesisReverb* reverb, s16 update
|
||||
|
||||
/**
|
||||
* Apply a filter (convolution) to each reverb channel.
|
||||
*
|
||||
* original name: Nas_DelayFilter
|
||||
*/
|
||||
Acmd* AudioSynth_FilterReverb(Acmd* cmd, s32 size, SynthesisReverb* reverb) {
|
||||
if (reverb->filterLeft != NULL) {
|
||||
@@ -329,6 +363,9 @@ Acmd* AudioSynth_FilterReverb(Acmd* cmd, s32 size, SynthesisReverb* reverb) {
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SendLine
|
||||
*/
|
||||
Acmd* AudioSynth_MaybeMixRingBuffer1(Acmd* cmd, SynthesisReverb* reverb, s32 updateIndex) {
|
||||
SynthesisReverb* temp_a3;
|
||||
|
||||
@@ -341,43 +378,43 @@ Acmd* AudioSynth_MaybeMixRingBuffer1(Acmd* cmd, SynthesisReverb* reverb, s32 upd
|
||||
return cmd;
|
||||
}
|
||||
|
||||
void func_800DBB94(void) {
|
||||
void AudioSynth_Stub_800DBB94(void) {
|
||||
}
|
||||
|
||||
void AudioSynth_ClearBuffer(Acmd* cmd, s32 dmem, s32 size) {
|
||||
aClearBuffer(cmd, dmem, size);
|
||||
}
|
||||
|
||||
void func_800DBBBC(void) {
|
||||
void AudioSynth_Stub_800DBBBC(void) {
|
||||
}
|
||||
|
||||
void func_800DBBC4(void) {
|
||||
void AudioSynth_Stub_800DBBC4(void) {
|
||||
}
|
||||
|
||||
void func_800DBBCC(void) {
|
||||
void AudioSynth_Stub_800DBBCC(void) {
|
||||
}
|
||||
|
||||
void AudioSynth_Mix(Acmd* cmd, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
|
||||
aMix(cmd, arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
||||
void func_800DBC08(void) {
|
||||
void AudioSynth_Stub_800DBC08(void) {
|
||||
}
|
||||
|
||||
void func_800DBC10(void) {
|
||||
void AudioSynth_Stub_800DBC10(void) {
|
||||
}
|
||||
|
||||
void func_800DBC18(void) {
|
||||
void AudioSynth_Stub_800DBC18(void) {
|
||||
}
|
||||
|
||||
void AudioSynth_SetBuffer(Acmd* cmd, s32 flags, s32 dmemIn, s32 dmemOut, u32 size) {
|
||||
aSetBuffer(cmd, flags, dmemIn, dmemOut, size);
|
||||
}
|
||||
|
||||
void func_800DBC54(void) {
|
||||
void AudioSynth_Stub_800DBC54(void) {
|
||||
}
|
||||
|
||||
void func_800DBC5C(void) {
|
||||
void AudioSynth_Stub_800DBC5C(void) {
|
||||
}
|
||||
|
||||
// possible fake match?
|
||||
@@ -386,16 +423,16 @@ void AudioSynth_DMemMove(Acmd* cmd, s32 dmemIn, s32 dmemOut, u32 size) {
|
||||
cmd->words.w1 = _SHIFTL(dmemOut, 16, 16) | _SHIFTL(size, 0, 16);
|
||||
}
|
||||
|
||||
void func_800DBC90(void) {
|
||||
void AudioSynth_Stub_800DBC90(void) {
|
||||
}
|
||||
|
||||
void func_800DBC98(void) {
|
||||
void AudioSynth_Stub_800DBC98(void) {
|
||||
}
|
||||
|
||||
void func_800DBCA0(void) {
|
||||
void AudioSynth_Stub_800DBCA0(void) {
|
||||
}
|
||||
|
||||
void func_800DBCA8(void) {
|
||||
void AudioSynth_Stub_800DBCA8(void) {
|
||||
}
|
||||
|
||||
void AudioSynth_InterL(Acmd* cmd, s32 dmemIn, s32 dmemOut, s32 numSamples) {
|
||||
@@ -407,7 +444,7 @@ void AudioSynth_EnvSetup1(Acmd* cmd, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
|
||||
aEnvSetup1(cmd, arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
||||
void func_800DBD08(void) {
|
||||
void AudioSynth_Stub_800DBD08(void) {
|
||||
}
|
||||
|
||||
void AudioSynth_LoadBuffer(Acmd* cmd, s32 dmemDest, s32 size, void* addrSrc) {
|
||||
@@ -423,13 +460,13 @@ void AudioSynth_EnvSetup2(Acmd* cmd, s32 volLeft, s32 volRight) {
|
||||
cmd->words.w1 = _SHIFTL(volLeft, 16, 16) | _SHIFTL(volRight, 0, 16);
|
||||
}
|
||||
|
||||
void func_800DBD7C(void) {
|
||||
void AudioSynth_Stub_800DBD7C(void) {
|
||||
}
|
||||
|
||||
void func_800DBD84(void) {
|
||||
void AudioSynth_Stub_800DBD84(void) {
|
||||
}
|
||||
|
||||
void func_800DBD8C(void) {
|
||||
void AudioSynth_Stub_800DBD8C(void) {
|
||||
}
|
||||
|
||||
void AudioSynth_S8Dec(Acmd* cmd, s32 flags, s16* state) {
|
||||
@@ -446,16 +483,16 @@ void AudioSynth_UnkCmd19(Acmd* cmd, s32 arg1, s32 arg2, s32 size, s32 arg4) {
|
||||
cmd->words.w1 = _SHIFTL(arg1, 16, 16) | _SHIFTL(arg2, 0, 16);
|
||||
}
|
||||
|
||||
void func_800DBE18(void) {
|
||||
void AudioSynth_Stub_800DBE18(void) {
|
||||
}
|
||||
|
||||
void func_800DBE20(void) {
|
||||
void AudioSynth_Stub_800DBE20(void) {
|
||||
}
|
||||
|
||||
void func_800DBE28(void) {
|
||||
void AudioSynth_Stub_800DBE28(void) {
|
||||
}
|
||||
|
||||
void func_800DBE30(void) {
|
||||
void AudioSynth_Stub_800DBE30(void) {
|
||||
}
|
||||
|
||||
void AudioSynth_UnkCmd3(Acmd* cmd, s32 arg1, s32 arg2, s32 size) {
|
||||
@@ -463,13 +500,13 @@ void AudioSynth_UnkCmd3(Acmd* cmd, s32 arg1, s32 arg2, s32 size) {
|
||||
cmd->words.w1 = _SHIFTL(arg1, 16, 16) | _SHIFTL(arg2, 0, 16);
|
||||
}
|
||||
|
||||
void func_800DBE5C(void) {
|
||||
void AudioSynth_Stub_800DBE5C(void) {
|
||||
}
|
||||
|
||||
void func_800DBE64(void) {
|
||||
void AudioSynth_Stub_800DBE64(void) {
|
||||
}
|
||||
|
||||
void func_800DBE6C(void) {
|
||||
void AudioSynth_Stub_800DBE6C(void) {
|
||||
}
|
||||
|
||||
void AudioSynth_LoadFilterBuffer(Acmd* cmd, s32 flags, s32 buf, void* addr) {
|
||||
@@ -480,6 +517,9 @@ void AudioSynth_LoadFilterSize(Acmd* cmd, s32 size, void* addr) {
|
||||
aFilter(cmd, 2, size, addr);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_LoadAuxBuffer1
|
||||
*/
|
||||
Acmd* AudioSynth_LoadRingBuffer1(Acmd* cmd, s32 aiBufLen, SynthesisReverb* reverb, s16 updateIndex) {
|
||||
ReverbRingBufferItem* ringBufferItem = &reverb->items[reverb->curFrame][updateIndex];
|
||||
|
||||
@@ -494,6 +534,9 @@ Acmd* AudioSynth_LoadRingBuffer1(Acmd* cmd, s32 aiBufLen, SynthesisReverb* rever
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_LoadAuxBuffer1_B
|
||||
*/
|
||||
Acmd* AudioSynth_LoadRingBuffer2(Acmd* cmd, s32 aiBufLen, SynthesisReverb* reverb, s16 updateIndex) {
|
||||
ReverbRingBufferItem* bufItem = &reverb->items2[reverb->curFrame][updateIndex];
|
||||
|
||||
@@ -505,23 +548,35 @@ Acmd* AudioSynth_LoadRingBuffer2(Acmd* cmd, s32 aiBufLen, SynthesisReverb* rever
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __LoadAuxBuf
|
||||
*/
|
||||
Acmd* AudioSynth_LoadRingBufferPart(Acmd* cmd, u16 dmem, u16 startPos, s32 size, SynthesisReverb* reverb) {
|
||||
aLoadBuffer(cmd++, &reverb->leftRingBuf[startPos], dmem, size);
|
||||
aLoadBuffer(cmd++, &reverb->rightRingBuf[startPos], dmem + DMEM_1CH_SIZE, size);
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __SaveAuxBuf
|
||||
*/
|
||||
Acmd* AudioSynth_SaveRingBufferPart(Acmd* cmd, u16 dmem, u16 startPos, s32 size, SynthesisReverb* reverb) {
|
||||
aSaveBuffer(cmd++, dmem, &reverb->leftRingBuf[startPos], size);
|
||||
aSaveBuffer(cmd++, dmem + DMEM_1CH_SIZE, &reverb->rightRingBuf[startPos], size);
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SaveBufferAuto
|
||||
*/
|
||||
Acmd* AudioSynth_SaveBufferOffset(Acmd* cmd, u16 dmem, u16 offset, s32 size, s16* buf) {
|
||||
aSaveBuffer(cmd++, dmem, &buf[offset], size);
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_LoadAuxBuffer_B
|
||||
*/
|
||||
Acmd* AudioSynth_MaybeLoadRingBuffer2(Acmd* cmd, s32 aiBufLen, SynthesisReverb* reverb, s16 updateIndex) {
|
||||
if (reverb->downsampleRate == 1) {
|
||||
cmd = AudioSynth_LoadRingBuffer2(cmd, aiBufLen, reverb, updateIndex);
|
||||
@@ -530,6 +585,9 @@ Acmd* AudioSynth_MaybeLoadRingBuffer2(Acmd* cmd, s32 aiBufLen, SynthesisReverb*
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_LoadAuxBuffer
|
||||
*/
|
||||
Acmd* AudioSynth_LoadReverbSamples(Acmd* cmd, s32 aiBufLen, SynthesisReverb* reverb, s16 updateIndex) {
|
||||
// Sets DMEM_WET_{LEFT,RIGHT}_CH, clobbers DMEM_TEMP
|
||||
if (reverb->downsampleRate == 1) {
|
||||
@@ -544,6 +602,9 @@ Acmd* AudioSynth_LoadReverbSamples(Acmd* cmd, s32 aiBufLen, SynthesisReverb* rev
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SaveAuxBuffer
|
||||
*/
|
||||
Acmd* AudioSynth_SaveReverbSamples(Acmd* cmd, SynthesisReverb* reverb, s16 updateIndex) {
|
||||
ReverbRingBufferItem* bufItem = &reverb->items[reverb->curFrame][updateIndex];
|
||||
|
||||
@@ -570,6 +631,9 @@ Acmd* AudioSynth_SaveReverbSamples(Acmd* cmd, SynthesisReverb* reverb, s16 updat
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SaveAuxBuffer_B
|
||||
*/
|
||||
Acmd* AudioSynth_SaveRingBuffer2(Acmd* cmd, SynthesisReverb* reverb, s16 updateIndex) {
|
||||
ReverbRingBufferItem* bufItem = &reverb->items2[reverb->curFrame][updateIndex];
|
||||
|
||||
@@ -581,6 +645,9 @@ Acmd* AudioSynth_SaveRingBuffer2(Acmd* cmd, SynthesisReverb* reverb, s16 updateI
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_DriveRsp
|
||||
*/
|
||||
Acmd* AudioSynth_DoOneAudioUpdate(s16* aiBuf, s32 aiBufLen, Acmd* cmd, s32 updateIndex) {
|
||||
u8 noteIndices[0x5C];
|
||||
s16 count;
|
||||
@@ -707,6 +774,9 @@ Acmd* AudioSynth_DoOneAudioUpdate(s16* aiBuf, s32 aiBufLen, Acmd* cmd, s32 updat
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SynthMain
|
||||
*/
|
||||
Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisState* synthState, s16* aiBuf,
|
||||
s32 aiBufLen, Acmd* cmd, s32 updateIndex) {
|
||||
s32 pad1[3];
|
||||
@@ -1146,6 +1216,9 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisS
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_Synth_Resample
|
||||
*/
|
||||
Acmd* AudioSynth_FinalResample(Acmd* cmd, NoteSynthesisState* synthState, s32 size, u16 pitch, u16 inpDmem,
|
||||
s32 resampleFlags) {
|
||||
if (pitch == 0) {
|
||||
@@ -1157,6 +1230,9 @@ Acmd* AudioSynth_FinalResample(Acmd* cmd, NoteSynthesisState* synthState, s32 si
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_Synth_Envelope
|
||||
*/
|
||||
Acmd* AudioSynth_ProcessEnvelope(Acmd* cmd, NoteSubEu* noteSubEu, NoteSynthesisState* synthState, s32 aiBufLen,
|
||||
u16 dmemSrc, s32 haasEffectDelaySide, s32 flags) {
|
||||
u32 dmemDests;
|
||||
@@ -1285,6 +1361,8 @@ Acmd* AudioSynth_LoadWaveSamples(Acmd* cmd, NoteSubEu* noteSubEu, NoteSynthesisS
|
||||
* The Haas Effect gives directionality to sound by applying a small (< 35ms) delay to either the left or right channel.
|
||||
* The delay is small enough that the sound is still perceived as one sound, but the channel that is not delayed will
|
||||
* reach our ear first and give a sense of directionality. The sound is directed towards the opposite side of the delay.
|
||||
*
|
||||
* original name: Nas_Synth_Delay
|
||||
*/
|
||||
Acmd* AudioSynth_ApplyHaasEffect(Acmd* cmd, NoteSubEu* noteSubEu, NoteSynthesisState* synthState, s32 size, s32 flags,
|
||||
s32 haasEffectDelaySide) {
|
||||
|
||||
@@ -888,6 +888,9 @@ s32 func_800E6590(s32 seqPlayerIndex, s32 channelIndex, s32 layerIndex) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name possibly "Nap_SilenceCheck"
|
||||
*/
|
||||
s32 func_800E6680(void) {
|
||||
return func_800E66C0(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user