mirror of
https://github.com/HackerN64/HackerOoT.git
synced 2026-01-21 10:37:37 -08:00
Merge remote-tracking branch 'decomp/main' into decomp_merge
This commit is contained in:
6
Makefile
6
Makefile
@@ -591,7 +591,7 @@ $(shell mkdir -p $(foreach dir, \
|
||||
endif
|
||||
|
||||
$(BUILD_DIR)/src/boot/build.o: CPP_DEFINES += -DBUILD_CREATOR="\"$(BUILD_CREATOR)\"" -DBUILD_DATE="\"$(BUILD_DATE)\"" -DBUILD_TIME="\"$(BUILD_TIME)\""
|
||||
$(BUILD_DIR)/src/audio/lib/seqplayer.o: CPP_DEFINES += -DMML_VERSION=MML_VERSION_OOT
|
||||
$(BUILD_DIR)/src/audio/internal/seqplayer.o: CPP_DEFINES += -DMML_VERSION=MML_VERSION_OOT
|
||||
|
||||
ifeq ($(COMPILER),gcc)
|
||||
# Note that if adding additional assets directories for modding reasons these flags must also be used there
|
||||
@@ -918,7 +918,7 @@ $(BUILD_DIR)/src/%.o: src/%.c
|
||||
$(V)$(POSTPROCESS_OBJ) $@
|
||||
$(V)$(OBJDUMP_CMD)
|
||||
|
||||
$(BUILD_DIR)/src/audio/session_init.o: src/audio/session_init.c $(BUILD_DIR)/assets/audio/soundfont_sizes.h $(BUILD_DIR)/assets/audio/sequence_sizes.h
|
||||
$(BUILD_DIR)/src/audio/game/session_init.o: src/audio/game/session_init.c $(BUILD_DIR)/assets/audio/soundfont_sizes.h $(BUILD_DIR)/assets/audio/sequence_sizes.h
|
||||
$(call print_two_args,Compiling:,$<,$@)
|
||||
$(V)$(CC_CHECK) $< -o $@
|
||||
$(V)$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $(@:.o=.tmp) $<
|
||||
@@ -1046,7 +1046,7 @@ $(BUILD_DIR)/assets/audio/soundfonts/%.c $(BUILD_DIR)/assets/audio/soundfonts/%.
|
||||
-include $(SOUNDFONT_DEP_FILES)
|
||||
|
||||
$(BUILD_DIR)/assets/audio/soundfonts/%.o: $(BUILD_DIR)/assets/audio/soundfonts/%.c $(BUILD_DIR)/assets/audio/soundfonts/%.name
|
||||
$(CC_CHECK) -I include/audio $< -o $@
|
||||
$(CPP) $(MIPS_BUILTIN_DEFS) $(CPPFLAGS) -x assembler-with-cpp $(INC) -I include/audio -MD -MF $(@:.o=.d) -MT $@ $< -o /dev/null
|
||||
# compile c to unlinked object
|
||||
$(V)$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -I include/audio -o $(@:.o=.tmp) $<
|
||||
# partial link
|
||||
|
||||
33
spec/spec
33
spec/spec
@@ -684,31 +684,30 @@ beginseg
|
||||
#if OOT_VERSION < NTSC_1_1 || !PLATFORM_N64
|
||||
pad_text
|
||||
#endif
|
||||
include "$(BUILD_DIR)/src/audio/lib/data.o"
|
||||
include "$(BUILD_DIR)/src/audio/lib/synthesis.o"
|
||||
include "$(BUILD_DIR)/src/audio/lib/heap.o"
|
||||
include "$(BUILD_DIR)/src/audio/lib/load.o"
|
||||
include "$(BUILD_DIR)/src/audio/lib/thread.o"
|
||||
include "$(BUILD_DIR)/src/audio/lib/dcache.o"
|
||||
include "$(BUILD_DIR)/src/audio/lib/aisetnextbuf.o"
|
||||
include "$(BUILD_DIR)/src/audio/internal/data.o"
|
||||
include "$(BUILD_DIR)/src/audio/internal/synthesis.o"
|
||||
include "$(BUILD_DIR)/src/audio/internal/heap.o"
|
||||
include "$(BUILD_DIR)/src/audio/internal/load.o"
|
||||
include "$(BUILD_DIR)/src/audio/internal/thread.o"
|
||||
include "$(BUILD_DIR)/src/audio/internal/os.o"
|
||||
#if OOT_PAL_N64
|
||||
pad_text
|
||||
pad_text
|
||||
pad_text
|
||||
#endif
|
||||
include "$(BUILD_DIR)/src/audio/lib/playback.o"
|
||||
include "$(BUILD_DIR)/src/audio/lib/effects.o"
|
||||
include "$(BUILD_DIR)/src/audio/lib/seqplayer.o"
|
||||
include "$(BUILD_DIR)/src/audio/general.o"
|
||||
include "$(BUILD_DIR)/src/audio/internal/playback.o"
|
||||
include "$(BUILD_DIR)/src/audio/internal/effects.o"
|
||||
include "$(BUILD_DIR)/src/audio/internal/seqplayer.o"
|
||||
include "$(BUILD_DIR)/src/audio/game/general.o"
|
||||
#if !PLATFORM_N64 && !DEBUG_FEATURES
|
||||
pad_text
|
||||
#endif
|
||||
include "$(BUILD_DIR)/src/audio/sfx_params.o"
|
||||
include "$(BUILD_DIR)/src/audio/sfx.o"
|
||||
include "$(BUILD_DIR)/src/audio/sequence.o"
|
||||
include "$(BUILD_DIR)/src/audio/data.o"
|
||||
include "$(BUILD_DIR)/src/audio/session_config.o"
|
||||
include "$(BUILD_DIR)/src/audio/session_init.o"
|
||||
include "$(BUILD_DIR)/src/audio/game/sfx_params.o"
|
||||
include "$(BUILD_DIR)/src/audio/game/sfx.o"
|
||||
include "$(BUILD_DIR)/src/audio/game/sequence.o"
|
||||
include "$(BUILD_DIR)/src/audio/game/data.o"
|
||||
include "$(BUILD_DIR)/src/audio/game/session_config.o"
|
||||
include "$(BUILD_DIR)/src/audio/game/session_init.o"
|
||||
|
||||
// libu64
|
||||
#if PLATFORM_N64
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,23 @@
|
||||
/**
|
||||
* Original Filename: os.c
|
||||
*/
|
||||
|
||||
#include "ultra64.h"
|
||||
#include "z64audio.h"
|
||||
|
||||
void Audio_InvalDCache(void* buf, s32 size) {
|
||||
OSIntMask prevMask = osSetIntMask(OS_IM_NONE);
|
||||
|
||||
osInvalDCache(buf, size);
|
||||
osSetIntMask(prevMask);
|
||||
}
|
||||
|
||||
void Audio_WritebackDCache(void* buf, s32 size) {
|
||||
OSIntMask prevMask = osSetIntMask(OS_IM_NONE);
|
||||
|
||||
osWritebackDCache(buf, size);
|
||||
osSetIntMask(prevMask);
|
||||
}
|
||||
|
||||
/**
|
||||
* Submits an audio buffer to be consumed by the Audio DAC. The audio interface can queue a second DMA while another
|
||||
@@ -1,5 +1,6 @@
|
||||
/**
|
||||
* @file audio_seqplayer.c
|
||||
* original name: track.c
|
||||
*
|
||||
* Manages audio sequence players, interprets and executes sequence instructions used to write .seq files
|
||||
*
|
||||
@@ -163,6 +164,8 @@ u8 sSeqInstructionArgsTable[] = {
|
||||
* Read and return the argument from the sequence script for a control flow instruction.
|
||||
* Control flow instructions (>= ASEQ_OP_CONTROL_FLOW_FIRST) can only have 0 or 1 args.
|
||||
* @return the argument value for a control flow instruction, or 0 if there is no argument
|
||||
*
|
||||
* original name: Convert_Com
|
||||
*/
|
||||
u16 AudioSeq_GetScriptControlFlowArgument(SeqScriptState* state, u8 cmd) {
|
||||
u8 highBits = sSeqInstructionArgsTable[cmd - 0xB0];
|
||||
@@ -184,6 +187,8 @@ u16 AudioSeq_GetScriptControlFlowArgument(SeqScriptState* state, u8 cmd) {
|
||||
/**
|
||||
* Read and execute the control flow sequence instructions
|
||||
* @return number of frames until next instruction. -1 signals termination
|
||||
*
|
||||
* original name: Common_Com
|
||||
*/
|
||||
s32 AudioSeq_HandleScriptFlowControl(SequencePlayer* seqPlayer, SeqScriptState* state, s32 cmd, s32 cmdArg) {
|
||||
switch (cmd) {
|
||||
@@ -255,6 +260,9 @@ s32 AudioSeq_HandleScriptFlowControl(SequencePlayer* seqPlayer, SeqScriptState*
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_InitSubTrack
|
||||
*/
|
||||
void AudioSeq_InitSequenceChannel(SequenceChannel* channel) {
|
||||
s32 i;
|
||||
|
||||
@@ -310,6 +318,9 @@ void AudioSeq_InitSequenceChannel(SequenceChannel* channel) {
|
||||
Audio_InitNoteLists(&channel->notePool);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_EntryNoteTrack
|
||||
*/
|
||||
s32 AudioSeq_SeqChannelSetLayer(SequenceChannel* channel, s32 layerIndex) {
|
||||
SequenceLayer* layer;
|
||||
s32 pad;
|
||||
@@ -357,6 +368,9 @@ s32 AudioSeq_SeqChannelSetLayer(SequenceChannel* channel, s32 layerIndex) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_ReleaseNoteTrack
|
||||
*/
|
||||
void AudioSeq_SeqLayerDisable(SequenceLayer* layer) {
|
||||
if (layer != NULL) {
|
||||
if (layer->channel != &gAudioCtx.sequenceChannelNone && layer->channel->seqPlayer->finished == 1) {
|
||||
@@ -369,6 +383,9 @@ void AudioSeq_SeqLayerDisable(SequenceLayer* layer) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_CloseNoteTrack
|
||||
*/
|
||||
void AudioSeq_SeqLayerFree(SequenceChannel* channel, s32 layerIndex) {
|
||||
SequenceLayer* layer = channel->layers[layerIndex];
|
||||
|
||||
@@ -379,6 +396,9 @@ void AudioSeq_SeqLayerFree(SequenceChannel* channel, s32 layerIndex) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_ReleaseSubTrack
|
||||
*/
|
||||
void AudioSeq_SequenceChannelDisable(SequenceChannel* channel) {
|
||||
s32 i;
|
||||
|
||||
@@ -391,6 +411,9 @@ void AudioSeq_SequenceChannelDisable(SequenceChannel* channel) {
|
||||
channel->finished = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_AllocSub
|
||||
*/
|
||||
void AudioSeq_SequencePlayerSetupChannels(SequencePlayer* seqPlayer, u16 channelBits) {
|
||||
SequenceChannel* channel;
|
||||
s32 i;
|
||||
@@ -406,6 +429,9 @@ void AudioSeq_SequencePlayerSetupChannels(SequencePlayer* seqPlayer, u16 channel
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_DeAllocSub
|
||||
*/
|
||||
void AudioSeq_SequencePlayerDisableChannels(SequencePlayer* seqPlayer, u16 channelBitsUnused) {
|
||||
SequenceChannel* channel;
|
||||
s32 i;
|
||||
@@ -418,6 +444,9 @@ void AudioSeq_SequencePlayerDisableChannels(SequencePlayer* seqPlayer, u16 chann
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_OpenSub
|
||||
*/
|
||||
void AudioSeq_SequenceChannelEnable(SequencePlayer* seqPlayer, u8 channelIndex, void* script) {
|
||||
SequenceChannel* channel = seqPlayer->channels[channelIndex];
|
||||
s32 i;
|
||||
@@ -435,11 +464,17 @@ void AudioSeq_SequenceChannelEnable(SequencePlayer* seqPlayer, u8 channelIndex,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_ReleaseGroup_Force
|
||||
*/
|
||||
void AudioSeq_SequencePlayerDisableAsFinished(SequencePlayer* seqPlayer) {
|
||||
seqPlayer->finished = true;
|
||||
AudioSeq_SequencePlayerDisable(seqPlayer);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_ReleaseGroup
|
||||
*/
|
||||
void AudioSeq_SequencePlayerDisable(SequencePlayer* seqPlayer) {
|
||||
s32 finished = 0;
|
||||
|
||||
@@ -478,6 +513,9 @@ void AudioSeq_SequencePlayerDisable(SequencePlayer* seqPlayer) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_AddList
|
||||
*/
|
||||
void AudioSeq_AudioListPushBack(AudioListItem* list, AudioListItem* item) {
|
||||
if (item->prev == NULL) {
|
||||
list->prev->next = item;
|
||||
@@ -489,6 +527,9 @@ void AudioSeq_AudioListPushBack(AudioListItem* list, AudioListItem* item) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_GetList
|
||||
*/
|
||||
void* AudioSeq_AudioListPopBack(AudioListItem* list) {
|
||||
AudioListItem* item = list->prev;
|
||||
|
||||
@@ -504,6 +545,9 @@ void* AudioSeq_AudioListPopBack(AudioListItem* list) {
|
||||
return item->u.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_InitNoteList
|
||||
*/
|
||||
void AudioSeq_InitLayerFreelist(void) {
|
||||
s32 i;
|
||||
|
||||
@@ -519,10 +563,16 @@ void AudioSeq_InitLayerFreelist(void) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_ReadByteData
|
||||
*/
|
||||
u8 AudioSeq_ScriptReadU8(SeqScriptState* state) {
|
||||
return *(state->pc++);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_ReadWordData
|
||||
*/
|
||||
s16 AudioSeq_ScriptReadS16(SeqScriptState* state) {
|
||||
s16 ret = *(state->pc++) << 8;
|
||||
|
||||
@@ -530,6 +580,9 @@ s16 AudioSeq_ScriptReadS16(SeqScriptState* state) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_ReadLengthData
|
||||
*/
|
||||
u16 AudioSeq_ScriptReadCompressedU16(SeqScriptState* state) {
|
||||
u16 ret = *(state->pc++);
|
||||
|
||||
@@ -540,6 +593,9 @@ u16 AudioSeq_ScriptReadCompressedU16(SeqScriptState* state) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_NoteSeq
|
||||
*/
|
||||
void AudioSeq_SeqLayerProcessScript(SequenceLayer* layer) {
|
||||
s32 cmd;
|
||||
|
||||
@@ -581,6 +637,9 @@ void AudioSeq_SeqLayerProcessScript(SequenceLayer* layer) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __Stop_Note
|
||||
*/
|
||||
void AudioSeq_SeqLayerProcessScriptStep1(SequenceLayer* layer) {
|
||||
if (!layer->continuousNotes) {
|
||||
Audio_SeqLayerNoteDecay(layer);
|
||||
@@ -595,6 +654,9 @@ void AudioSeq_SeqLayerProcessScriptStep1(SequenceLayer* layer) {
|
||||
layer->notePropertiesNeedInit = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __SetChannel
|
||||
*/
|
||||
s32 AudioSeq_SeqLayerProcessScriptStep5(SequenceLayer* layer, s32 sameTunedSample) {
|
||||
Note* note;
|
||||
|
||||
@@ -633,6 +695,9 @@ s32 AudioSeq_SeqLayerProcessScriptStep5(SequenceLayer* layer, s32 sameTunedSampl
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __Command_Seq
|
||||
*/
|
||||
s32 AudioSeq_SeqLayerProcessScriptStep2(SequenceLayer* layer) {
|
||||
SequenceChannel* channel = layer->channel;
|
||||
SeqScriptState* state = &layer->scriptState;
|
||||
@@ -789,6 +854,9 @@ s32 AudioSeq_SeqLayerProcessScriptStep2(SequenceLayer* layer) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __SetVoice
|
||||
*/
|
||||
s32 AudioSeq_SeqLayerProcessScriptStep4(SequenceLayer* layer, s32 cmd) {
|
||||
s32 sameTunedSample = true;
|
||||
s32 instOrWave;
|
||||
@@ -997,6 +1065,9 @@ s32 AudioSeq_SeqLayerProcessScriptStep4(SequenceLayer* layer, s32 cmd) {
|
||||
return sameTunedSample;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __SetNote
|
||||
*/
|
||||
s32 AudioSeq_SeqLayerProcessScriptStep3(SequenceLayer* layer, s32 cmd) {
|
||||
SeqScriptState* state = &layer->scriptState;
|
||||
u16 delay;
|
||||
@@ -1110,6 +1181,9 @@ s32 AudioSeq_SeqLayerProcessScriptStep3(SequenceLayer* layer, s32 cmd) {
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_PriorityChanger
|
||||
*/
|
||||
void AudioSeq_SetChannelPriorities(SequenceChannel* channel, u8 priority) {
|
||||
if ((priority & 0xF) != 0) {
|
||||
channel->notePriority = priority & 0xF;
|
||||
@@ -1121,6 +1195,9 @@ void AudioSeq_SetChannelPriorities(SequenceChannel* channel, u8 priority) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_ProgramChanger
|
||||
*/
|
||||
u8 AudioSeq_GetInstrument(SequenceChannel* channel, u8 instId, Instrument** instOut, AdsrSettings* adsr) {
|
||||
Instrument* inst = Audio_GetInstrumentInner(channel->fontId, instId);
|
||||
|
||||
@@ -1140,6 +1217,9 @@ u8 AudioSeq_GetInstrument(SequenceChannel* channel, u8 instId, Instrument** inst
|
||||
return instId;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SubVoiceSet
|
||||
*/
|
||||
void AudioSeq_SetInstrument(SequenceChannel* channel, u8 instId) {
|
||||
if (instId >= 0x80) {
|
||||
// Synthetic Waves
|
||||
@@ -1165,10 +1245,16 @@ void AudioSeq_SetInstrument(SequenceChannel* channel, u8 instId) {
|
||||
channel->hasInstrument = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SubVolumeSet
|
||||
*/
|
||||
void AudioSeq_SequenceChannelSetVolume(SequenceChannel* channel, u8 volume) {
|
||||
channel->volume = (s32)volume / 127.0f;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SubSeq
|
||||
*/
|
||||
void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
|
||||
s32 i;
|
||||
u8* data;
|
||||
@@ -1728,6 +1814,9 @@ exit_loop:
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_GroupSeq
|
||||
*/
|
||||
void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
|
||||
u8 cmd;
|
||||
u8 cmdLowBits;
|
||||
@@ -2055,6 +2144,9 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_MySeqMain
|
||||
*/
|
||||
void AudioSeq_ProcessSequences(s32 arg0) {
|
||||
SequencePlayer* seqPlayer;
|
||||
u32 i;
|
||||
@@ -2072,6 +2164,9 @@ void AudioSeq_ProcessSequences(s32 arg0) {
|
||||
Audio_ProcessNotes();
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_SeqSkip
|
||||
*/
|
||||
void AudioSeq_SkipForwardSequence(SequencePlayer* seqPlayer) {
|
||||
while (seqPlayer->skipTicks > 0) {
|
||||
AudioSeq_SequencePlayerProcessSequence(seqPlayer);
|
||||
@@ -2080,6 +2175,9 @@ void AudioSeq_SkipForwardSequence(SequencePlayer* seqPlayer) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_InitMySeq
|
||||
*/
|
||||
void AudioSeq_ResetSequencePlayer(SequencePlayer* seqPlayer) {
|
||||
s32 i;
|
||||
|
||||
@@ -2107,6 +2205,9 @@ void AudioSeq_ResetSequencePlayer(SequencePlayer* seqPlayer) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_AssignSubTrack
|
||||
*/
|
||||
void AudioSeq_InitSequencePlayerChannels(s32 playerIdx) {
|
||||
SequenceChannel* channel;
|
||||
SequencePlayer* seqPlayer = &gAudioCtx.seqPlayers[playerIdx];
|
||||
@@ -2129,6 +2230,9 @@ void AudioSeq_InitSequencePlayerChannels(s32 playerIdx) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __InitGroup
|
||||
*/
|
||||
void AudioSeq_InitSequencePlayer(SequencePlayer* seqPlayer) {
|
||||
s32 i;
|
||||
s32 j;
|
||||
@@ -2154,6 +2258,9 @@ void AudioSeq_InitSequencePlayer(SequencePlayer* seqPlayer) {
|
||||
AudioSeq_ResetSequencePlayer(seqPlayer);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_InitPlayer
|
||||
*/
|
||||
void AudioSeq_InitSequencePlayers(void) {
|
||||
s32 i;
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* Original Filename: sub_sys.c
|
||||
*/
|
||||
|
||||
#include "array_count.h"
|
||||
#include "audiothread_cmd.h"
|
||||
#include "ultra64.h"
|
||||
@@ -27,6 +31,8 @@ static AudioTask* sWaitingAudioTask = NULL;
|
||||
|
||||
/**
|
||||
* This is Audio_Update for the audio thread
|
||||
*
|
||||
* original name: CreateAudioTask (note: function is heavily modified in Animal Crossing)
|
||||
*/
|
||||
AudioTask* AudioThread_UpdateImpl(void) {
|
||||
#if OOT_VERSION < PAL_1_0 || !PLATFORM_N64
|
||||
@@ -200,6 +206,9 @@ AudioTask* AudioThread_UpdateImpl(void) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_AudioSysProcess
|
||||
*/
|
||||
void AudioThread_ProcessGlobalCmd(AudioCmd* cmd) {
|
||||
s32 i;
|
||||
s32 pad[3];
|
||||
@@ -325,6 +334,9 @@ void AudioThread_ProcessGlobalCmd(AudioCmd* cmd) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __Nas_GroupFadeOut
|
||||
*/
|
||||
void AudioThread_SetFadeOutTimer(s32 seqPlayerIndex, s32 fadeTimer) {
|
||||
SequencePlayer* seqPlayer = &gAudioCtx.seqPlayers[seqPlayerIndex];
|
||||
|
||||
@@ -337,6 +349,9 @@ void AudioThread_SetFadeOutTimer(s32 seqPlayerIndex, s32 fadeTimer) {
|
||||
seqPlayer->fadeTimer = fadeTimer;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __Nas_GroupFadeIn
|
||||
*/
|
||||
void AudioThread_SetFadeInTimer(s32 seqPlayerIndex, s32 fadeTimer) {
|
||||
SequencePlayer* seqPlayer;
|
||||
|
||||
@@ -350,6 +365,9 @@ void AudioThread_SetFadeInTimer(s32 seqPlayerIndex, s32 fadeTimer) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_AudioPortInit
|
||||
*/
|
||||
void AudioThread_InitMesgQueuesImpl(void) {
|
||||
gAudioCtx.threadCmdWritePos = 0;
|
||||
gAudioCtx.threadCmdReadPos = 0;
|
||||
@@ -365,6 +383,9 @@ void AudioThread_InitMesgQueuesImpl(void) {
|
||||
osCreateMesgQueue(gAudioCtx.audioResetQueueP, gAudioCtx.audioResetMsgBuf, ARRAY_COUNT(gAudioCtx.audioResetMsgBuf));
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_PortSet
|
||||
*/
|
||||
void AudioThread_QueueCmd(u32 opArgs, void** data) {
|
||||
AudioCmd* cmd = &gAudioCtx.threadCmdBuf[gAudioCtx.threadCmdWritePos & 0xFF];
|
||||
|
||||
@@ -378,26 +399,41 @@ void AudioThread_QueueCmd(u32 opArgs, void** data) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_SetF32
|
||||
*/
|
||||
void AudioThread_QueueCmdF32(u32 opArgs, f32 data) {
|
||||
AudioThread_QueueCmd(opArgs, (void**)&data);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_SetS32
|
||||
*/
|
||||
void AudioThread_QueueCmdS32(u32 opArgs, s32 data) {
|
||||
AudioThread_QueueCmd(opArgs, (void**)&data);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_SetS8
|
||||
*/
|
||||
void AudioThread_QueueCmdS8(u32 opArgs, s8 data) {
|
||||
u32 uData = data << 0x18;
|
||||
|
||||
AudioThread_QueueCmd(opArgs, (void**)&uData);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_SetU16
|
||||
*/
|
||||
void AudioThread_QueueCmdU16(u32 opArgs, u16 data) {
|
||||
u32 uData = data << 0x10;
|
||||
|
||||
AudioThread_QueueCmd(opArgs, (void**)&uData);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_SendStart
|
||||
*/
|
||||
s32 AudioThread_ScheduleProcessCmds(void) {
|
||||
static s32 D_801304E8 = 0;
|
||||
s32 ret;
|
||||
@@ -419,11 +455,17 @@ s32 AudioThread_ScheduleProcessCmds(void) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_FlushPort
|
||||
*/
|
||||
void AudioThread_ResetCmdQueue(void) {
|
||||
gAudioCtx.threadCmdQueueFinished = false;
|
||||
gAudioCtx.threadCmdReadPos = gAudioCtx.threadCmdWritePos;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_Process1Command
|
||||
*/
|
||||
void AudioThread_ProcessCmd(AudioCmd* cmd) {
|
||||
SequencePlayer* seqPlayer;
|
||||
u16 threadCmdChannelMask;
|
||||
@@ -461,6 +503,9 @@ void AudioThread_ProcessCmd(AudioCmd* cmd) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_AudioPortProcess
|
||||
*/
|
||||
void AudioThread_ProcessCmds(u32 msg) {
|
||||
static u8 sCurCmdRdPos = 0;
|
||||
AudioCmd* cmd;
|
||||
@@ -508,6 +553,9 @@ void Audio_GetSampleBankIdsOfFont(s32 fontId, u32* sampleBankId1, u32* sampleBan
|
||||
*sampleBankId2 = gAudioCtx.soundFontList[fontId].sampleBankId2;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_CheckSpecChange
|
||||
*/
|
||||
s32 func_800E5EDC(void) {
|
||||
s32 pad;
|
||||
s32 specId;
|
||||
@@ -521,6 +569,9 @@ s32 func_800E5EDC(void) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __ClearSpecChangeQ
|
||||
*/
|
||||
void func_800E5F34(void) {
|
||||
// macro?
|
||||
// clang-format off
|
||||
@@ -528,6 +579,9 @@ void func_800E5F34(void) {
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_StartSpecChange
|
||||
*/
|
||||
s32 AudioThread_ResetAudioHeap(s32 specId) {
|
||||
s32 resetStatus;
|
||||
OSMesg msg;
|
||||
@@ -553,6 +607,9 @@ s32 AudioThread_ResetAudioHeap(s32 specId) {
|
||||
return AudioThread_ScheduleProcessCmds();
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_StartReset
|
||||
*/
|
||||
void AudioThread_PreNMIInternal(void) {
|
||||
gAudioCtx.resetTimer = 1;
|
||||
if (gAudioContextInitialized) {
|
||||
@@ -561,6 +618,9 @@ void AudioThread_PreNMIInternal(void) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_ReadSubPort
|
||||
*/
|
||||
s8 AudioThread_GetChannelIO(s32 seqPlayerIndex, s32 channelIndex, s32 ioPort) {
|
||||
SequencePlayer* seqPlayer = &gAudioCtx.seqPlayers[seqPlayerIndex];
|
||||
SequenceChannel* channel;
|
||||
@@ -573,6 +633,9 @@ s8 AudioThread_GetChannelIO(s32 seqPlayerIndex, s32 channelIndex, s32 ioPort) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_ReadGrpPort
|
||||
*/
|
||||
s8 AudioThread_GetSeqPlayerIO(s32 seqPlayerIndex, s32 ioPort) {
|
||||
return gAudioCtx.seqPlayers[seqPlayerIndex].seqScriptIO[ioPort];
|
||||
}
|
||||
@@ -585,6 +648,9 @@ void AudioThread_ResetExternalPool(void) {
|
||||
gAudioCtx.externalPool.startRamAddr = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __SetGrpParam
|
||||
*/
|
||||
void AudioThread_ProcessSeqPlayerCmd(SequencePlayer* seqPlayer, AudioCmd* cmd) {
|
||||
f32 fadeVolume;
|
||||
|
||||
@@ -665,6 +731,9 @@ void AudioThread_ProcessSeqPlayerCmd(SequencePlayer* seqPlayer, AudioCmd* cmd) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: __SetSubParam
|
||||
*/
|
||||
void AudioThread_ProcessChannelCmd(SequenceChannel* channel, AudioCmd* cmd) {
|
||||
switch (cmd->op) {
|
||||
case AUDIOCMD_OP_CHANNEL_SET_VOL_SCALE:
|
||||
@@ -771,6 +840,9 @@ void AudioThread_Noop2Cmd(u32 arg0, s32 arg1) {
|
||||
AUDIOCMD_GLOBAL_NOOP_2(0, 0, arg1, arg0);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_WaitVsync
|
||||
*/
|
||||
void AudioThread_WaitForAudioTask(void) {
|
||||
osRecvMesg(gAudioCtx.taskStartQueueP, NULL, OS_MESG_NOBLOCK);
|
||||
osRecvMesg(gAudioCtx.taskStartQueueP, NULL, OS_MESG_BLOCK);
|
||||
@@ -824,6 +896,9 @@ void func_800E66A0(void) {
|
||||
func_800E66C0(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_SilenceCheck_Inner
|
||||
*/
|
||||
s32 func_800E66C0(s32 flags) {
|
||||
s32 phi_v1;
|
||||
NotePlaybackState* playbackState;
|
||||
@@ -860,6 +935,9 @@ s32 func_800E66C0(s32 flags) {
|
||||
return phi_v1;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nap_GetRandom
|
||||
*/
|
||||
u32 AudioThread_NextRandom(void) {
|
||||
static u32 sAudioRandom = 0x12345678;
|
||||
|
||||
@@ -869,6 +947,9 @@ u32 AudioThread_NextRandom(void) {
|
||||
return sAudioRandom;
|
||||
}
|
||||
|
||||
/**
|
||||
* original name: Nas_InitGAudio
|
||||
*/
|
||||
void AudioThread_InitMesgQueues(void) {
|
||||
AudioThread_InitMesgQueuesImpl();
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
#include "ultra64.h"
|
||||
#include "z64audio.h"
|
||||
|
||||
void Audio_InvalDCache(void* buf, s32 size) {
|
||||
OSIntMask prevMask = osSetIntMask(OS_IM_NONE);
|
||||
|
||||
osInvalDCache(buf, size);
|
||||
osSetIntMask(prevMask);
|
||||
}
|
||||
|
||||
void Audio_WritebackDCache(void* buf, s32 size) {
|
||||
OSIntMask prevMask = osSetIntMask(OS_IM_NONE);
|
||||
|
||||
osWritebackDCache(buf, size);
|
||||
osSetIntMask(prevMask);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user