mirror of
https://github.com/zeldaret/oot
synced 2026-08-31 09:30:47 -04:00
[ntsc-1.2] Match audio (#2122)
* general.c mostly ok * match remaining audio funcs * comments * Finish matching audio --------- Co-authored-by: engineer124 <engineer124engineer124@gmail.com>
This commit is contained in:
@@ -435,6 +435,14 @@ void AudioSeq_SequencePlayerDisableAsFinished(SequencePlayer* seqPlayer) {
|
||||
}
|
||||
|
||||
void AudioSeq_SequencePlayerDisable(SequencePlayer* seqPlayer) {
|
||||
s32 finished = 0;
|
||||
|
||||
#if PLATFORM_N64
|
||||
if (seqPlayer->finished == 1) {
|
||||
finished = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
AudioSeq_SequencePlayerDisableChannels(seqPlayer, 0xFFFF);
|
||||
Audio_NotePoolClear(&seqPlayer->notePool);
|
||||
if (!seqPlayer->enabled) {
|
||||
@@ -449,6 +457,11 @@ void AudioSeq_SequencePlayerDisable(SequencePlayer* seqPlayer) {
|
||||
}
|
||||
|
||||
if (AudioLoad_IsFontLoadComplete(seqPlayer->defaultFont)) {
|
||||
#if PLATFORM_N64
|
||||
if (finished == 1) {
|
||||
AudioHeap_ReleaseNotesForFont(seqPlayer->defaultFont);
|
||||
}
|
||||
#endif
|
||||
AudioLoad_SetFontLoadStatus(seqPlayer->defaultFont, LOAD_STATUS_MAYBE_DISCARDABLE);
|
||||
}
|
||||
|
||||
|
||||
@@ -643,7 +643,13 @@ Acmd* AudioSynth_DoOneAudioUpdate(s16* aiBuf, s32 aiBufLen, Acmd* cmd, s32 updat
|
||||
aMix(cmd++, DMEM_2CH_SIZE >> 4, reverb->decayRatio + 0x8000, DMEM_WET_LEFT_CH, DMEM_WET_LEFT_CH);
|
||||
|
||||
// Leak reverb between the left and right channels
|
||||
if (reverb->leakRtl != 0 || reverb->leakLtr != 0) {
|
||||
|
||||
#if PLATFORM_N64
|
||||
if (((reverb->leakRtl != 0) || (reverb->leakLtr != 0)) && (gAudioCtx.soundMode != SOUNDMODE_MONO))
|
||||
#else
|
||||
if ((reverb->leakRtl != 0) || (reverb->leakLtr != 0))
|
||||
#endif
|
||||
{
|
||||
cmd = AudioSynth_LeakReverb(cmd, reverb);
|
||||
}
|
||||
|
||||
@@ -778,6 +784,13 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisS
|
||||
nParts = noteSubEu->bitField1.hasTwoParts + 1;
|
||||
samplesLenFixedPoint = (resamplingRateFixedPoint * aiBufLen * 2) + synthState->samplePosFrac;
|
||||
numSamplesToLoad = samplesLenFixedPoint >> 16;
|
||||
|
||||
#if PLATFORM_N64
|
||||
if (numSamplesToLoad == 0) {
|
||||
skipBytes = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
synthState->samplePosFrac = samplesLenFixedPoint & 0xFFFF;
|
||||
|
||||
// Partially-optimized out no-op ifs required for matching. SM64 decomp
|
||||
|
||||
@@ -16,12 +16,19 @@ AudioTask* AudioThread_Update(void) {
|
||||
return AudioThread_UpdateImpl();
|
||||
}
|
||||
|
||||
#if PLATFORM_N64
|
||||
static s32 sMaxAbiCmdCnt = 0x80;
|
||||
static AudioTask* sWaitingAudioTask = NULL;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This is Audio_Update for the audio thread
|
||||
*/
|
||||
AudioTask* AudioThread_UpdateImpl(void) {
|
||||
#if !PLATFORM_N64
|
||||
static s32 sMaxAbiCmdCnt = 0x80;
|
||||
static AudioTask* sWaitingAudioTask = NULL;
|
||||
#endif
|
||||
u32 samplesRemainingInAi;
|
||||
s32 abiCmdCnt;
|
||||
s32 pad;
|
||||
|
||||
Reference in New Issue
Block a user