From 5ed5f196d9ea284e789790ea15c1c37f993609fb Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Wed, 25 Sep 2024 10:25:49 +0200 Subject: [PATCH] [headers] audio functions to z64audio.h and z64ocarina.h (#2223) * [headers] audio functions to z64audio.h and z64ocarina.h * bss --- include/functions.h | 198 -------------------- include/z64audio.h | 195 +++++++++++++++++++ include/z64ocarina.h | 11 ++ src/code/main.c | 2 +- src/code/z_camera.c | 2 +- src/code/z_collision_check.c | 2 +- src/overlays/actors/ovl_Fishing/z_fishing.c | 2 +- 7 files changed, 210 insertions(+), 202 deletions(-) diff --git a/include/functions.h b/include/functions.h index e8ff3d5b81..4d7a70ab61 100644 --- a/include/functions.h +++ b/include/functions.h @@ -890,204 +890,6 @@ void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line void DebugArena_FreeDebug(void* ptr, const char* file, int line); void DebugArena_Display(void); #endif -Acmd* AudioSynth_Update(Acmd* cmdStart, s32* cmdCnt, s16* aiStart, s32 aiBufLen); -void AudioHeap_DiscardFont(s32 fontId); -void AudioHeap_ReleaseNotesForFont(s32 fontId); -void AudioHeap_DiscardSequence(s32 seqId); -void AudioHeap_WritebackDCache(void* ramAddr, u32 size); -void* AudioHeap_AllocZeroedAttemptExternal(AudioAllocPool* pool, u32 size); -void* AudioHeap_AllocAttemptExternal(AudioAllocPool* pool, u32 size); -void* AudioHeap_AllocDmaMemory(AudioAllocPool* pool, u32 size); -void* AudioHeap_AllocDmaMemoryZeroed(AudioAllocPool* pool, u32 size); -void* AudioHeap_AllocZeroed(AudioAllocPool* pool, u32 size); -void* AudioHeap_Alloc(AudioAllocPool* pool, u32 size); -void AudioHeap_InitPool(AudioAllocPool* pool, void* ramAddr, u32 size); -void AudioHeap_PopPersistentCache(s32 tableType); -void AudioHeap_InitMainPools(s32 initPoolSize); -void* AudioHeap_AllocCached(s32 tableType, s32 size, s32 cache, s32 id); -void* AudioHeap_SearchCaches(s32 tableType, s32 cache, s32 id); -void* AudioHeap_SearchRegularCaches(s32 tableType, s32 cache, s32 id); -void AudioHeap_LoadFilter(s16* filter, s32 lowPassCutoff, s32 highPassCutoff); -s32 AudioHeap_ResetStep(void); -void AudioHeap_Init(void); -void* AudioHeap_SearchPermanentCache(s32 tableType, s32 id); -void* AudioHeap_AllocPermanent(s32 tableType, s32 id, u32 size); -void* AudioHeap_AllocSampleCache(u32 size, s32 fontId, void* sampleAddr, s8 medium, s32 cache); -void AudioHeap_ApplySampleBankCache(s32 sampleBankId); -void AudioLoad_DecreaseSampleDmaTtls(void); -void* AudioLoad_DmaSampleData(u32 devAddr, u32 size, s32 arg2, u8* dmaIndexRef, s32 medium); -void AudioLoad_InitSampleDmaBuffers(s32 numNotes); -s32 AudioLoad_IsFontLoadComplete(s32 fontId); -s32 AudioLoad_IsSeqLoadComplete(s32 seqId); -void AudioLoad_SetFontLoadStatus(s32 fontId, s32 loadStatus); -void AudioLoad_SetSeqLoadStatus(s32 seqId, s32 loadStatus); -void AudioLoad_SyncLoadSeqParts(s32 seqId, s32 arg1); -s32 AudioLoad_SyncLoadInstrument(s32 fontId, s32 instId, s32 drumId); -void AudioLoad_AsyncLoadSeq(s32 seqId, s32 arg1, s32 retData, OSMesgQueue* retQueue); -void AudioLoad_AsyncLoadSampleBank(s32 sampleBankId, s32 arg1, s32 retData, OSMesgQueue* retQueue); -void AudioLoad_AsyncLoadFont(s32 fontId, s32 arg1, s32 retData, OSMesgQueue* retQueue); -u8* AudioLoad_GetFontsForSequence(s32 seqId, u32* outNumFonts); -void AudioLoad_DiscardSeqFonts(s32 seqId); -s32 AudioLoad_SyncInitSeqPlayer(s32 playerIdx, s32 seqId, s32 arg2); -s32 AudioLoad_SyncInitSeqPlayerSkipTicks(s32 playerIdx, s32 seqId, s32 skipTicks); -void AudioLoad_ProcessLoads(s32 resetStatus); -void AudioLoad_SetDmaHandler(DmaHandler callback); -void AudioLoad_Init(void* heap, u32 heapSize); -void AudioLoad_InitSlowLoads(void); -s32 AudioLoad_SlowLoadSample(s32 fontId, s32 instId, s8* status); -s32 AudioLoad_SlowLoadSeq(s32 seqId, u8* ramAddr, s8* status); -void AudioLoad_InitAsyncLoads(void); -void AudioLoad_LoadPermanentSamples(void); -void AudioLoad_ScriptLoad(s32 tableType, s32 id, s8* status); -void AudioLoad_ProcessScriptLoads(void); -void AudioLoad_InitScriptLoads(void); - -AudioTask* AudioThread_Update(void); -void AudioThread_QueueCmdF32(u32 opArgs, f32 data); -void AudioThread_QueueCmdS32(u32 opArgs, s32 data); -void AudioThread_QueueCmdS8(u32 opArgs, s8 data); -void AudioThread_QueueCmdU16(u32 opArgs, u16 data); -s32 AudioThread_ScheduleProcessCmds(void); -u32 func_800E5E20(u32* out); -u8* AudioThread_GetFontsForSequence(s32 seqId, u32* outNumFonts); -s32 func_800E5EDC(void); -s32 AudioThread_ResetAudioHeap(s32 specId); -void AudioThread_PreNMIInternal(void); -s32 func_800E6680(void); -u32 AudioThread_NextRandom(void); -void AudioThread_InitMesgQueues(void); - -void Audio_InvalDCache(void* buf, s32 size); -void Audio_WritebackDCache(void* buf, s32 size); -s32 osAiSetNextBuffer(void*, u32); -void Audio_InitNoteSub(Note* note, NoteSubEu* sub, NoteSubAttributes* attrs); -void Audio_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput); -void Audio_NoteInit(Note* note); -void Audio_NoteDisable(Note* note); -void Audio_ProcessNotes(void); -TunedSample* Audio_GetInstrumentTunedSample(Instrument* instrument, s32 semitone); -Instrument* Audio_GetInstrumentInner(s32 fontId, s32 instId); -Drum* Audio_GetDrum(s32 fontId, s32 drumId); -SoundEffect* Audio_GetSoundEffect(s32 fontId, s32 sfxId); -s32 Audio_SetFontInstrument(s32 instrumentType, s32 fontId, s32 index, void* value); -void Audio_SeqLayerDecayRelease(SequenceLayer* layer, s32 target); -void Audio_SeqLayerNoteDecay(SequenceLayer* layer); -void Audio_SeqLayerNoteRelease(SequenceLayer* layer); -s32 Audio_BuildSyntheticWave(Note* note, SequenceLayer* layer, s32 waveId); -void Audio_InitSyntheticWave(Note* note, SequenceLayer* layer); -void Audio_InitNoteList(AudioListItem* list); -void Audio_InitNoteLists(NotePool* pool); -void Audio_InitNoteFreeList(void); -void Audio_NotePoolClear(NotePool* pool); -void Audio_NotePoolFill(NotePool* pool, s32 count); -void Audio_AudioListPushFront(AudioListItem* list, AudioListItem* item); -void Audio_AudioListRemove(AudioListItem* item); -Note* Audio_FindNodeWithPrioLessThan(AudioListItem* list, s32 limit); -void Audio_NoteInitForLayer(Note* note, SequenceLayer* layer); -void func_800E82C0(Note* note, SequenceLayer* layer); -void Audio_NoteReleaseAndTakeOwnership(Note* note, SequenceLayer* layer); -Note* Audio_AllocNoteFromDisabled(NotePool* pool, SequenceLayer* layer); -Note* Audio_AllocNoteFromDecaying(NotePool* pool, SequenceLayer* layer); -Note* Audio_AllocNoteFromActive(NotePool* pool, SequenceLayer* layer); -Note* Audio_AllocNote(SequenceLayer* layer); -void Audio_NoteInitAll(void); -void Audio_SequenceChannelProcessSound(SequenceChannel* channel, s32 recalculateVolume, s32 applyBend); -void Audio_SequencePlayerProcessSound(SequencePlayer* seqPlayer); -f32 Audio_GetPortamentoFreqScale(Portamento* portamento); -s16 Audio_GetVibratoPitchChange(VibratoState* vib); -f32 Audio_GetVibratoFreqScale(VibratoState* vib); -void Audio_NoteVibratoUpdate(Note* note); -void Audio_NoteVibratoInit(Note* note); -void Audio_NotePortamentoInit(Note* note); -void Audio_AdsrInit(AdsrState* adsr, EnvelopePoint* envelope, s16* volOut); -f32 Audio_AdsrUpdate(AdsrState* adsr); -void AudioSeq_SequenceChannelDisable(SequenceChannel* channel); -void AudioSeq_SequencePlayerDisableAsFinished(SequencePlayer* seqPlayer); -void AudioSeq_SequencePlayerDisable(SequencePlayer* seqPlayer); -void AudioSeq_AudioListPushBack(AudioListItem* list, AudioListItem* item); -void* AudioSeq_AudioListPopBack(AudioListItem* list); -void AudioSeq_ProcessSequences(s32 arg0); -void AudioSeq_SkipForwardSequence(SequencePlayer* seqPlayer); -void AudioSeq_ResetSequencePlayer(SequencePlayer* seqPlayer); -void AudioSeq_InitSequencePlayerChannels(s32 playerIdx); -void AudioSeq_InitSequencePlayers(void); -void AudioOcarina_Start(u16 ocarinaFlags); -void AudioOcarina_SetInstrument(u8 ocarinaInstrumentId); -void AudioOcarina_SetPlaybackSong(s8 songIndexPlusOne, s8 playbackState); -void AudioOcarina_SetRecordingState(u8 recordingState); -OcarinaStaff* AudioOcarina_GetRecordingStaff(void); -OcarinaStaff* AudioOcarina_GetPlayingStaff(void); -OcarinaStaff* AudioOcarina_GetPlaybackStaff(void); -void AudioOcarina_MemoryGameInit(u8 minigameRound); -s32 AudioOcarina_MemoryGameNextNote(void); -void AudioOcarina_PlayLongScarecrowSong(void); -void AudioDebug_Draw(GfxPrint* printer); -void AudioDebug_ScrPrt(const char* str, u16 num); -void Audio_Update(void); -void Audio_SetSfxProperties(u8 bankId, u8 entryIdx, u8 channelIndex); -void Audio_PlayCutsceneEffectsSequence(u8 csEffectType); -void func_800F4010(Vec3f* pos, u16 sfxId, f32); -void Audio_PlaySfxRandom(Vec3f* pos, u16 baseSfxId, u8 randLim); -void func_800F4138(Vec3f* pos, u16 sfxId, f32); -void func_800F4190(Vec3f* pos, u16 sfxId); -void func_800F436C(Vec3f* pos, u16 sfxId, f32 arg2); -void func_800F4414(Vec3f* pos, u16 sfxId, f32); -void func_800F44EC(s8 arg0, s8 arg1); -void func_800F4524(Vec3f* pos, u16 sfxId, s8 arg2); -void func_800F4254(Vec3f* pos, u8 level); -void Audio_PlaySfxRiver(Vec3f* pos, f32 freqScale); -void Audio_PlaySfxWaterfall(Vec3f* pos, f32 freqScale); -void Audio_SetBgmVolumeOffDuringFanfare(void); -void Audio_SetBgmVolumeOnDuringFanfare(void); -void Audio_SetMainBgmVolume(u8 targetVol, u8 volFadeTimer); -void Audio_SetGanonsTowerBgmVolumeLevel(u8 ganonsTowerLevel); -void Audio_LowerMainBgmVolume(u8 volume); -void Audio_PlaySfxIncreasinglyTransposed(Vec3f* pos, s16 sfxId, u8* semitones); -void Audio_ResetIncreasingTranspose(void); -void Audio_PlaySfxTransposed(Vec3f* pos, u16 sfxId, s8 semitone); -void func_800F4C58(Vec3f* pos, u16 sfxId, u8); -void func_800F4E30(Vec3f* pos, f32); -void Audio_ClearSariaBgm(void); -void Audio_ClearSariaBgmAtPos(Vec3f* pos); -void Audio_PlaySariaBgm(Vec3f* pos, u16 seqId, u16 distMax); -void Audio_ClearSariaBgm2(void); -void Audio_PlayMorningSceneSequence(u16 seqId); -void Audio_PlaySceneSequence(u16 seqId); -void Audio_SetMainBgmTempoFreqAfterFanfare(f32 scaleTempoAndFreq, u8 duration); -void Audio_PlayWindmillBgm(void); -void Audio_SetFastTempoForTimedMinigame(void); -void Audio_PlaySequenceInCutscene(u16 seqId); -void Audio_StopSequenceInCutscene(u16 seqId); -s32 Audio_IsSequencePlaying(u16 seqId); -void func_800F5ACC(u16 seqId); -void func_800F5B58(void); -void func_800F5BF0(u8 natureAmbienceId); -void Audio_PlayFanfare(u16); -void func_800F5C2C(void); -void Audio_PlaySequenceWithSeqPlayerIO(u8 seqPlayerIndex, u16 seqId, u8 fadeInDuration, s8 ioPort, s8 ioData); -void Audio_SetSequenceMode(u8 seqMode); -void Audio_SetBgmEnemyVolume(f32 dist); -void Audio_UpdateMalonSinging(f32 dist, u16 seqId); -void func_800F64E0(u8 arg0); -void Audio_ToggleMalonSinging(u8 malonSingingDisabled); -void Audio_SetEnvReverb(s8 reverb); -void Audio_SetCodeReverb(s8 reverb); -void func_800F6700(s8 audioSetting); -void Audio_SetBaseFilter(u8); -void Audio_SetExtraFilter(u8); -void Audio_SetCutsceneFlag(s8 flag); -void Audio_PlaySfxIfNotInCutscene(u16 sfxId); -void func_800F6964(u16); -void Audio_StopBgmAndFanfare(u16 fadeOutDuration); -void func_800F6B3C(void); -void func_800F6BDC(void); -void Audio_PreNMI(void); -void Audio_SetNatureAmbienceChannelIO(u8 channelIdxRange, u8 ioPort, u8 ioData); -void Audio_PlayNatureAmbienceSequence(u8 natureAmbienceId); -void Audio_Init(void); -void Audio_InitSound(void); -void func_800F7170(void); -void func_800F71BC(s32 arg0); void RcpUtils_PrintRegisterStatus(void); void RcpUtils_Reset(void); diff --git a/include/z64audio.h b/include/z64audio.h index a86c805d0e..86e2860db6 100644 --- a/include/z64audio.h +++ b/include/z64audio.h @@ -3,6 +3,9 @@ #include "ultra64.h" #include "sequence.h" +#include "z64math.h" + +struct GfxPrint; typedef void (*AudioCustomUpdateFunction)(void); @@ -1021,4 +1024,196 @@ typedef struct AudioHeapInitSizes { /* 0x08 */ u32 permanentPoolSize; } AudioHeapInitSizes; // size = 0xC +// TODO these prototypes should be sorted into the relevant audio header files + +Acmd* AudioSynth_Update(Acmd* cmdStart, s32* cmdCnt, s16* aiStart, s32 aiBufLen); +void AudioHeap_DiscardFont(s32 fontId); +void AudioHeap_ReleaseNotesForFont(s32 fontId); +void AudioHeap_DiscardSequence(s32 seqId); +void AudioHeap_WritebackDCache(void* ramAddr, u32 size); +void* AudioHeap_AllocZeroedAttemptExternal(AudioAllocPool* pool, u32 size); +void* AudioHeap_AllocAttemptExternal(AudioAllocPool* pool, u32 size); +void* AudioHeap_AllocDmaMemory(AudioAllocPool* pool, u32 size); +void* AudioHeap_AllocDmaMemoryZeroed(AudioAllocPool* pool, u32 size); +void* AudioHeap_AllocZeroed(AudioAllocPool* pool, u32 size); +void* AudioHeap_Alloc(AudioAllocPool* pool, u32 size); +void AudioHeap_InitPool(AudioAllocPool* pool, void* ramAddr, u32 size); +void AudioHeap_PopPersistentCache(s32 tableType); +void AudioHeap_InitMainPools(s32 initPoolSize); +void* AudioHeap_AllocCached(s32 tableType, s32 size, s32 cache, s32 id); +void* AudioHeap_SearchCaches(s32 tableType, s32 cache, s32 id); +void* AudioHeap_SearchRegularCaches(s32 tableType, s32 cache, s32 id); +void AudioHeap_LoadFilter(s16* filter, s32 lowPassCutoff, s32 highPassCutoff); +s32 AudioHeap_ResetStep(void); +void AudioHeap_Init(void); +void* AudioHeap_SearchPermanentCache(s32 tableType, s32 id); +void* AudioHeap_AllocPermanent(s32 tableType, s32 id, u32 size); +void* AudioHeap_AllocSampleCache(u32 size, s32 fontId, void* sampleAddr, s8 medium, s32 cache); +void AudioHeap_ApplySampleBankCache(s32 sampleBankId); +void AudioLoad_DecreaseSampleDmaTtls(void); +void* AudioLoad_DmaSampleData(u32 devAddr, u32 size, s32 arg2, u8* dmaIndexRef, s32 medium); +void AudioLoad_InitSampleDmaBuffers(s32 numNotes); +s32 AudioLoad_IsFontLoadComplete(s32 fontId); +s32 AudioLoad_IsSeqLoadComplete(s32 seqId); +void AudioLoad_SetFontLoadStatus(s32 fontId, s32 loadStatus); +void AudioLoad_SetSeqLoadStatus(s32 seqId, s32 loadStatus); +void AudioLoad_SyncLoadSeqParts(s32 seqId, s32 arg1); +s32 AudioLoad_SyncLoadInstrument(s32 fontId, s32 instId, s32 drumId); +void AudioLoad_AsyncLoadSeq(s32 seqId, s32 arg1, s32 retData, OSMesgQueue* retQueue); +void AudioLoad_AsyncLoadSampleBank(s32 sampleBankId, s32 arg1, s32 retData, OSMesgQueue* retQueue); +void AudioLoad_AsyncLoadFont(s32 fontId, s32 arg1, s32 retData, OSMesgQueue* retQueue); +u8* AudioLoad_GetFontsForSequence(s32 seqId, u32* outNumFonts); +void AudioLoad_DiscardSeqFonts(s32 seqId); +s32 AudioLoad_SyncInitSeqPlayer(s32 playerIdx, s32 seqId, s32 arg2); +s32 AudioLoad_SyncInitSeqPlayerSkipTicks(s32 playerIdx, s32 seqId, s32 skipTicks); +void AudioLoad_ProcessLoads(s32 resetStatus); +void AudioLoad_SetDmaHandler(DmaHandler callback); +void AudioLoad_Init(void* heap, u32 heapSize); +void AudioLoad_InitSlowLoads(void); +s32 AudioLoad_SlowLoadSample(s32 fontId, s32 instId, s8* status); +s32 AudioLoad_SlowLoadSeq(s32 seqId, u8* ramAddr, s8* status); +void AudioLoad_InitAsyncLoads(void); +void AudioLoad_LoadPermanentSamples(void); +void AudioLoad_ScriptLoad(s32 tableType, s32 id, s8* status); +void AudioLoad_ProcessScriptLoads(void); +void AudioLoad_InitScriptLoads(void); + +AudioTask* AudioThread_Update(void); +void AudioThread_QueueCmdF32(u32 opArgs, f32 data); +void AudioThread_QueueCmdS32(u32 opArgs, s32 data); +void AudioThread_QueueCmdS8(u32 opArgs, s8 data); +void AudioThread_QueueCmdU16(u32 opArgs, u16 data); +s32 AudioThread_ScheduleProcessCmds(void); +u32 func_800E5E20(u32* out); +u8* AudioThread_GetFontsForSequence(s32 seqId, u32* outNumFonts); +s32 func_800E5EDC(void); +s32 AudioThread_ResetAudioHeap(s32 specId); +void AudioThread_PreNMIInternal(void); +s32 func_800E6680(void); +u32 AudioThread_NextRandom(void); +void AudioThread_InitMesgQueues(void); + +void Audio_InvalDCache(void* buf, s32 size); +void Audio_WritebackDCache(void* buf, s32 size); +s32 osAiSetNextBuffer(void*, u32); +void Audio_InitNoteSub(Note* note, NoteSubEu* sub, NoteSubAttributes* attrs); +void Audio_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput); +void Audio_NoteInit(Note* note); +void Audio_NoteDisable(Note* note); +void Audio_ProcessNotes(void); +TunedSample* Audio_GetInstrumentTunedSample(Instrument* instrument, s32 semitone); +Instrument* Audio_GetInstrumentInner(s32 fontId, s32 instId); +Drum* Audio_GetDrum(s32 fontId, s32 drumId); +SoundEffect* Audio_GetSoundEffect(s32 fontId, s32 sfxId); +s32 Audio_SetFontInstrument(s32 instrumentType, s32 fontId, s32 index, void* value); +void Audio_SeqLayerDecayRelease(SequenceLayer* layer, s32 target); +void Audio_SeqLayerNoteDecay(SequenceLayer* layer); +void Audio_SeqLayerNoteRelease(SequenceLayer* layer); +s32 Audio_BuildSyntheticWave(Note* note, SequenceLayer* layer, s32 waveId); +void Audio_InitSyntheticWave(Note* note, SequenceLayer* layer); +void Audio_InitNoteList(AudioListItem* list); +void Audio_InitNoteLists(NotePool* pool); +void Audio_InitNoteFreeList(void); +void Audio_NotePoolClear(NotePool* pool); +void Audio_NotePoolFill(NotePool* pool, s32 count); +void Audio_AudioListPushFront(AudioListItem* list, AudioListItem* item); +void Audio_AudioListRemove(AudioListItem* item); +Note* Audio_FindNodeWithPrioLessThan(AudioListItem* list, s32 limit); +void Audio_NoteInitForLayer(Note* note, SequenceLayer* layer); +void func_800E82C0(Note* note, SequenceLayer* layer); +void Audio_NoteReleaseAndTakeOwnership(Note* note, SequenceLayer* layer); +Note* Audio_AllocNoteFromDisabled(NotePool* pool, SequenceLayer* layer); +Note* Audio_AllocNoteFromDecaying(NotePool* pool, SequenceLayer* layer); +Note* Audio_AllocNoteFromActive(NotePool* pool, SequenceLayer* layer); +Note* Audio_AllocNote(SequenceLayer* layer); +void Audio_NoteInitAll(void); +void Audio_SequenceChannelProcessSound(SequenceChannel* channel, s32 recalculateVolume, s32 applyBend); +void Audio_SequencePlayerProcessSound(SequencePlayer* seqPlayer); +f32 Audio_GetPortamentoFreqScale(Portamento* portamento); +s16 Audio_GetVibratoPitchChange(VibratoState* vib); +f32 Audio_GetVibratoFreqScale(VibratoState* vib); +void Audio_NoteVibratoUpdate(Note* note); +void Audio_NoteVibratoInit(Note* note); +void Audio_NotePortamentoInit(Note* note); +void Audio_AdsrInit(AdsrState* adsr, EnvelopePoint* envelope, s16* volOut); +f32 Audio_AdsrUpdate(AdsrState* adsr); +void AudioSeq_SequenceChannelDisable(SequenceChannel* channel); +void AudioSeq_SequencePlayerDisableAsFinished(SequencePlayer* seqPlayer); +void AudioSeq_SequencePlayerDisable(SequencePlayer* seqPlayer); +void AudioSeq_AudioListPushBack(AudioListItem* list, AudioListItem* item); +void* AudioSeq_AudioListPopBack(AudioListItem* list); +void AudioSeq_ProcessSequences(s32 arg0); +void AudioSeq_SkipForwardSequence(SequencePlayer* seqPlayer); +void AudioSeq_ResetSequencePlayer(SequencePlayer* seqPlayer); +void AudioSeq_InitSequencePlayerChannels(s32 playerIdx); +void AudioSeq_InitSequencePlayers(void); + +void AudioDebug_Draw(struct GfxPrint* printer); +void AudioDebug_ScrPrt(const char* str, u16 num); +void Audio_Update(void); +void Audio_SetSfxProperties(u8 bankId, u8 entryIdx, u8 channelIndex); +void Audio_PlayCutsceneEffectsSequence(u8 csEffectType); +void func_800F4010(Vec3f* pos, u16 sfxId, f32); +void Audio_PlaySfxRandom(Vec3f* pos, u16 baseSfxId, u8 randLim); +void func_800F4138(Vec3f* pos, u16 sfxId, f32); +void func_800F4190(Vec3f* pos, u16 sfxId); +void func_800F436C(Vec3f* pos, u16 sfxId, f32 arg2); +void func_800F4414(Vec3f* pos, u16 sfxId, f32); +void func_800F44EC(s8 arg0, s8 arg1); +void func_800F4524(Vec3f* pos, u16 sfxId, s8 arg2); +void func_800F4254(Vec3f* pos, u8 level); +void Audio_PlaySfxRiver(Vec3f* pos, f32 freqScale); +void Audio_PlaySfxWaterfall(Vec3f* pos, f32 freqScale); +void Audio_SetBgmVolumeOffDuringFanfare(void); +void Audio_SetBgmVolumeOnDuringFanfare(void); +void Audio_SetMainBgmVolume(u8 targetVol, u8 volFadeTimer); +void Audio_SetGanonsTowerBgmVolumeLevel(u8 ganonsTowerLevel); +void Audio_LowerMainBgmVolume(u8 volume); +void Audio_PlaySfxIncreasinglyTransposed(Vec3f* pos, s16 sfxId, u8* semitones); +void Audio_ResetIncreasingTranspose(void); +void Audio_PlaySfxTransposed(Vec3f* pos, u16 sfxId, s8 semitone); +void func_800F4C58(Vec3f* pos, u16 sfxId, u8); +void func_800F4E30(Vec3f* pos, f32); +void Audio_ClearSariaBgm(void); +void Audio_ClearSariaBgmAtPos(Vec3f* pos); +void Audio_PlaySariaBgm(Vec3f* pos, u16 seqId, u16 distMax); +void Audio_ClearSariaBgm2(void); +void Audio_PlayMorningSceneSequence(u16 seqId); +void Audio_PlaySceneSequence(u16 seqId); +void Audio_SetMainBgmTempoFreqAfterFanfare(f32 scaleTempoAndFreq, u8 duration); +void Audio_PlayWindmillBgm(void); +void Audio_SetFastTempoForTimedMinigame(void); +void Audio_PlaySequenceInCutscene(u16 seqId); +void Audio_StopSequenceInCutscene(u16 seqId); +s32 Audio_IsSequencePlaying(u16 seqId); +void func_800F5ACC(u16 seqId); +void func_800F5B58(void); +void func_800F5BF0(u8 natureAmbienceId); +void Audio_PlayFanfare(u16); +void func_800F5C2C(void); +void Audio_PlaySequenceWithSeqPlayerIO(u8 seqPlayerIndex, u16 seqId, u8 fadeInDuration, s8 ioPort, s8 ioData); +void Audio_SetSequenceMode(u8 seqMode); +void Audio_SetBgmEnemyVolume(f32 dist); +void Audio_UpdateMalonSinging(f32 dist, u16 seqId); +void func_800F64E0(u8 arg0); +void Audio_ToggleMalonSinging(u8 malonSingingDisabled); +void Audio_SetEnvReverb(s8 reverb); +void Audio_SetCodeReverb(s8 reverb); +void func_800F6700(s8 audioSetting); +void Audio_SetBaseFilter(u8); +void Audio_SetExtraFilter(u8); +void Audio_SetCutsceneFlag(s8 flag); +void Audio_PlaySfxIfNotInCutscene(u16 sfxId); +void func_800F6964(u16); +void Audio_StopBgmAndFanfare(u16 fadeOutDuration); +void func_800F6B3C(void); +void func_800F6BDC(void); +void Audio_PreNMI(void); +void Audio_SetNatureAmbienceChannelIO(u8 channelIdxRange, u8 ioPort, u8 ioData); +void Audio_PlayNatureAmbienceSequence(u8 natureAmbienceId); +void Audio_Init(void); +void Audio_InitSound(void); +void func_800F7170(void); +void func_800F71BC(s32 arg0); + #endif diff --git a/include/z64ocarina.h b/include/z64ocarina.h index 917b1b83f4..afad53811b 100644 --- a/include/z64ocarina.h +++ b/include/z64ocarina.h @@ -177,4 +177,15 @@ typedef struct OcarinaStaff { /* 0x2 */ u8 pos; // "locate" } OcarinaStaff; // size = 0x3 +void AudioOcarina_Start(u16 ocarinaFlags); +void AudioOcarina_SetInstrument(u8 ocarinaInstrumentId); +void AudioOcarina_SetPlaybackSong(s8 songIndexPlusOne, s8 playbackState); +void AudioOcarina_SetRecordingState(u8 recordingState); +OcarinaStaff* AudioOcarina_GetRecordingStaff(void); +OcarinaStaff* AudioOcarina_GetPlayingStaff(void); +OcarinaStaff* AudioOcarina_GetPlaybackStaff(void); +void AudioOcarina_MemoryGameInit(u8 minigameRound); +s32 AudioOcarina_MemoryGameNextNote(void); +void AudioOcarina_PlayLongScarecrowSong(void); + #endif diff --git a/src/code/main.c b/src/code/main.c index 2adf795176..ba53239c8f 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -23,7 +23,7 @@ extern struct IrqMgr gIrqMgr; #endif #pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \ - "ntsc-1.2:164" + "ntsc-1.2:163" extern u8 _buffersSegmentEnd[]; diff --git a/src/code/z_camera.c b/src/code/z_camera.c index eeba153abc..346e334504 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -3638,7 +3638,7 @@ s32 Camera_KeepOn3(Camera* camera) { } #pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ - "ntsc-1.2:108" + "ntsc-1.2:107" s32 Camera_KeepOn4(Camera* camera) { static Vec3f D_8015BD50; diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 1f6bb36cd2..27629dd829 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -5,7 +5,7 @@ #include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h" -#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:224" +#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:216" typedef s32 (*ColChkResetFunc)(PlayState*, Collider*); typedef void (*ColChkApplyFunc)(PlayState*, CollisionCheckContext*, Collider*); diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index 91ba0690bd..da24becbc8 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -16,7 +16,7 @@ #include "cic6105.h" #endif -#pragma increment_block_number "gc-eu:129 gc-eu-mq:129 gc-jp:131 gc-jp-ce:131 gc-jp-mq:131 gc-us:131 gc-us-mq:131" +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:130 gc-jp-ce:130 gc-jp-mq:130 gc-us:130 gc-us-mq:130" #define FLAGS ACTOR_FLAG_4