mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-17 20:42:23 +00:00
Match func_800DC910
This commit is contained in:
parent
b97a369236
commit
86a5beb260
12 changed files with 460 additions and 1403 deletions
|
@ -914,8 +914,8 @@ void Audio_InitHeap(void) {
|
|||
reverb->sound.sample = &reverb->sample;
|
||||
reverb->sample.loop = &reverb->loop;
|
||||
reverb->sound.tuning = 1.0f;
|
||||
reverb->sample.bits4 = 4;
|
||||
reverb->sample.bits2 = 0;
|
||||
reverb->sample.codec = 4;
|
||||
reverb->sample.medium = 0;
|
||||
reverb->sample.size = reverb->windowSize * 2;
|
||||
reverb->sample.sampleAddr = (u8*)reverb->leftRingBuf;
|
||||
reverb->loop.start = 0;
|
||||
|
@ -1181,7 +1181,7 @@ void func_800E0BB4(UnkHeapEntry* entry, AudioBankSample* sample) {
|
|||
if (sample != NULL) {
|
||||
if (sample->sampleAddr == entry->unk_08) {
|
||||
sample->sampleAddr = entry->unk_0C;
|
||||
sample->bits2 = entry->unk_01;
|
||||
sample->medium = entry->unk_01;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1251,7 +1251,7 @@ void func_800E0E0C(Struct_800E0E0C* arg0, AudioBankSample* sample) {
|
|||
u8* sampleAddr = sample->sampleAddr;
|
||||
if (start <= sampleAddr && sampleAddr < end) {
|
||||
sample->sampleAddr = sampleAddr - start + arg0->unk_4;
|
||||
sample->bits2 = arg0->unk_C & 0xFF;
|
||||
sample->medium = arg0->unk_C & 0xFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ void func_800E11F0(void) {
|
|||
gAudioContext.unk_2628 = 0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/audio_load/func_800E12DC.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/audio_load/Audio_DmaSampleData.s")
|
||||
|
||||
void func_800E1618(s32 arg0) {
|
||||
SampleDmaReq* temp_s0;
|
||||
|
@ -268,18 +268,18 @@ s32 func_800E1C78(AudioBankSample* sample, s32 arg1) {
|
|||
void* sampleAddr;
|
||||
|
||||
if (sample->unk_bits25 == 1) {
|
||||
if (sample->bits2 != 0) {
|
||||
sampleAddr = func_800E05C4(sample->size, arg1, (void*)sample->sampleAddr, sample->bits2, 1);
|
||||
if (sample->medium != 0) {
|
||||
sampleAddr = func_800E05C4(sample->size, arg1, (void*)sample->sampleAddr, sample->medium, 1);
|
||||
if (sampleAddr == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (sample->bits2 == 1) {
|
||||
if (sample->medium == 1) {
|
||||
func_800E2BCC(sample->sampleAddr, sampleAddr, sample->size, gAudioContext.audioTable->header.unk_02);
|
||||
} else {
|
||||
Audio_DMAFastCopy(sample->sampleAddr, sampleAddr, sample->size, sample->bits2);
|
||||
Audio_DMAFastCopy(sample->sampleAddr, sampleAddr, sample->size, sample->medium);
|
||||
}
|
||||
sample->bits2 = 0;
|
||||
sample->medium = 0;
|
||||
sample->sampleAddr = sampleAddr;
|
||||
}
|
||||
}
|
||||
|
@ -1055,7 +1055,7 @@ s32 Audio_SyncLoadSample(s32 arg0, s32 arg1, u8* isDone) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (sample->bits2 == 0) {
|
||||
if (sample->medium == 0) {
|
||||
*isDone = 2;
|
||||
return 0;
|
||||
}
|
||||
|
@ -1067,10 +1067,10 @@ s32 Audio_SyncLoadSample(s32 arg0, s32 arg1, u8* isDone) {
|
|||
|
||||
syncLoad->sample = *sample;
|
||||
syncLoad->isDone = isDone;
|
||||
syncLoad->ramAddr = func_800E05C4(sample->size, arg0, sample->sampleAddr, sample->bits2, 0);
|
||||
syncLoad->ramAddr = func_800E05C4(sample->size, arg0, sample->sampleAddr, sample->medium, 0);
|
||||
|
||||
if (syncLoad->ramAddr == NULL) {
|
||||
if (sample->bits2 == 1 || sample->bits4 == 2) {
|
||||
if (sample->medium == 1 || sample->codec == 2) {
|
||||
*isDone = 0;
|
||||
return -1;
|
||||
} else {
|
||||
|
@ -1083,7 +1083,7 @@ s32 Audio_SyncLoadSample(s32 arg0, s32 arg1, u8* isDone) {
|
|||
syncLoad->size = ALIGN16(sample->size);
|
||||
syncLoad->unk_10 = syncLoad->ramAddr;
|
||||
syncLoad->devAddr = sample->sampleAddr;
|
||||
syncLoad->unk_00 = sample->bits2;
|
||||
syncLoad->unk_00 = sample->medium;
|
||||
syncLoad->unk_01 = arg0;
|
||||
syncLoad->unk_02 = arg1;
|
||||
if (syncLoad->unk_00 == 1) {
|
||||
|
@ -1136,7 +1136,7 @@ void func_800E3678(AudioSyncLoad* syncLoad) {
|
|||
|
||||
syncLoad->sample = *sample;
|
||||
sample->sampleAddr = syncLoad->unk_10;
|
||||
sample->bits2 = 0;
|
||||
sample->medium = 0;
|
||||
}
|
||||
|
||||
void Audio_ProcessSyncLoads(s32 resetStatus) {
|
||||
|
@ -1430,14 +1430,14 @@ void Audio_SampleReloc(AudioBankSound* sound, u32 arg1, RelocInfo* arg2) {
|
|||
if (sample->size != 0 && sample->unk_bits25 != 1) {
|
||||
sample->loop = RELOC(sample->loop, arg1);
|
||||
sample->book = RELOC(sample->book, arg1);
|
||||
switch (sample->bits2) {
|
||||
switch (sample->medium) {
|
||||
case 0:
|
||||
sample->sampleAddr = RELOC(sample->sampleAddr, arg2->unk_08);
|
||||
sample->bits2 = arg2->unk_10;
|
||||
sample->medium = arg2->unk_10;
|
||||
break;
|
||||
case 1:
|
||||
sample->sampleAddr = RELOC(sample->sampleAddr, arg2->unk_0C);
|
||||
sample->bits2 = arg2->unk_14;
|
||||
sample->medium = arg2->unk_14;
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
|
@ -1445,7 +1445,7 @@ void Audio_SampleReloc(AudioBankSound* sound, u32 arg1, RelocInfo* arg2) {
|
|||
}
|
||||
|
||||
sample->unk_bits25 = 1;
|
||||
if (sample->unk_bits26 && (sample->bits2 != 0)) {
|
||||
if (sample->unk_bits26 && (sample->medium != 0)) {
|
||||
gAudioContext.unk_B68[gAudioContext.unk_1768++] = sample;
|
||||
}
|
||||
}
|
||||
|
@ -1483,9 +1483,9 @@ s32 func_800E4590(s32 resetStatus) {
|
|||
sp4C >>= 0x18;
|
||||
|
||||
if (gAudioContext.unk_0D54[sp4C + 1].unk_10 == 0) {
|
||||
if ((temp_v0_3->sampleAddr + temp_v0_3->size + temp_v0_3->bits2) ==
|
||||
if ((temp_v0_3->sampleAddr + temp_v0_3->size + temp_v0_3->medium) ==
|
||||
gAudioContext.unk_0D54[sp4C + 1].unk_00) {
|
||||
temp_v0_3->bits2 = 0;
|
||||
temp_v0_3->medium = 0;
|
||||
temp_v0_3->sampleAddr = temp_v0_3->loop;
|
||||
}
|
||||
gAudioContext.unk_0D54[sp4C + 1].unk_10 = 1;
|
||||
|
@ -1497,14 +1497,14 @@ s32 func_800E4590(s32 resetStatus) {
|
|||
continue;
|
||||
} else {
|
||||
temp_v0_3 = gAudioContext.unk_0D54[gAudioContext.unk_176C].sample;
|
||||
if (&temp_v0_3->sampleAddr[temp_v0_3->size + temp_v0_3->bits2] !=
|
||||
if (&temp_v0_3->sampleAddr[temp_v0_3->size + temp_v0_3->medium] !=
|
||||
gAudioContext.unk_0D54[gAudioContext.unk_176C].unk_00) {
|
||||
gAudioContext.unk_0D54[gAudioContext.unk_176C].unk_10 = 1;
|
||||
gAudioContext.unk_176C--;
|
||||
continue;
|
||||
} else {
|
||||
Audio_InitAsyncReq(temp_v0_3->sampleAddr, gAudioContext.unk_0D54[gAudioContext.unk_176C].unk_08,
|
||||
temp_v0_3->size, temp_v0_3->bits2, (temp_a2_2 >> 0xC) + 1,
|
||||
temp_v0_3->size, temp_v0_3->medium, (temp_a2_2 >> 0xC) + 1,
|
||||
&gAudioContext.unk_1E78, gAudioContext.unk_0D54[gAudioContext.unk_176C].pad);
|
||||
break;
|
||||
}
|
||||
|
@ -1569,7 +1569,7 @@ s32 func_800E478C(s32 bankId, AudioBankSample** sampleList) {
|
|||
void func_800E48C0(AudioBankSound* sound) {
|
||||
AudioBankSample* sample = sound->sample;
|
||||
|
||||
if ((sample->size != 0) && (sample->unk_bits26) && (sample->bits2)) {
|
||||
if ((sample->size != 0) && (sample->unk_bits26) && (sample->medium)) {
|
||||
gAudioContext.unk_B68[gAudioContext.unk_1768++] = sample;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ void Audio_NoteSetVelPanReverb(Note* note, NoteSubEu* sub, Reverb* reverb) {
|
|||
|
||||
vel = reverb->velocity;
|
||||
pan = reverb->pan;
|
||||
reverbVol = reverb->reverb;
|
||||
reverbVol = reverb->vol;
|
||||
sp24 = reverb->reverbBits.s;
|
||||
|
||||
sub->bitField0.s = note->noteSubEu.bitField0.s;
|
||||
|
@ -38,7 +38,7 @@ void Audio_NoteSetVelPanReverb(Note* note, NoteSubEu* sub, Reverb* reverb) {
|
|||
|
||||
sub->headsetPanLeft = gHeadsetPanQuantization[smallPanIndex];
|
||||
sub->headsetPanRight = gHeadsetPanQuantization[0x3f - smallPanIndex];
|
||||
sub->bitField1.s.hasTwoAdpcmParts = true;
|
||||
sub->bitField1.s.usesHeadsetPanEffects2 = true;
|
||||
|
||||
volLeft = gHeadsetPanVolume[pan];
|
||||
volRight = gHeadsetPanVolume[0x7f - pan];
|
||||
|
@ -46,7 +46,7 @@ void Audio_NoteSetVelPanReverb(Note* note, NoteSubEu* sub, Reverb* reverb) {
|
|||
strongLeft = strongRight = 0;
|
||||
sub->headsetPanRight = 0;
|
||||
sub->headsetPanLeft = 0;
|
||||
sub->bitField1.s.hasTwoAdpcmParts = false;
|
||||
sub->bitField1.s.usesHeadsetPanEffects2 = false;
|
||||
|
||||
volLeft = gStereoPanVolume[pan];
|
||||
volRight = gStereoPanVolume[0x7f - pan];
|
||||
|
@ -97,7 +97,7 @@ void Audio_NoteSetVelPanReverb(Note* note, NoteSubEu* sub, Reverb* reverb) {
|
|||
sub->unk_2 = reverb->unk_1;
|
||||
sub->unk_14 = reverb->unk_10;
|
||||
sub->unk_07 = reverb->unk_14;
|
||||
sub->unk_10 = reverb->unk_16;
|
||||
sub->unk_0E = reverb->unk_16;
|
||||
sub->reverbVol = reverbVol;
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ void Audio_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput)
|
|||
f32 resamplingRate = 0.0f;
|
||||
|
||||
if (resamplingRateInput < 2.0f) {
|
||||
noteSubEu->bitField1.s.isSyntheticWave = false;
|
||||
noteSubEu->bitField1.s.hasTwoAdpcmParts = false;
|
||||
|
||||
if (1.99998f < resamplingRateInput) {
|
||||
resamplingRate = 1.99998f;
|
||||
|
@ -114,7 +114,7 @@ void Audio_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput)
|
|||
}
|
||||
|
||||
} else {
|
||||
noteSubEu->bitField1.s.isSyntheticWave = true;
|
||||
noteSubEu->bitField1.s.hasTwoAdpcmParts = true;
|
||||
if (3.99996f < resamplingRateInput) {
|
||||
resamplingRate = 1.99998f;
|
||||
} else {
|
||||
|
@ -253,7 +253,7 @@ void Audio_ProcessNotes(void) {
|
|||
reverb.frequency = attributes->freqScale;
|
||||
reverb.velocity = attributes->velocity;
|
||||
reverb.pan = attributes->pan;
|
||||
reverb.reverb = attributes->reverb;
|
||||
reverb.vol = attributes->reverb;
|
||||
reverb.reverbBits = attributes->reverbBits;
|
||||
reverb.unk_1 = attributes->unk_1;
|
||||
reverb.unk_10 = attributes->unk_10;
|
||||
|
@ -272,7 +272,7 @@ void Audio_ProcessNotes(void) {
|
|||
} else {
|
||||
reverb.reverbBits = layer->reverbBits;
|
||||
}
|
||||
reverb.reverb = channel->reverb;
|
||||
reverb.vol = channel->reverb;
|
||||
reverb.unk_1 = channel->unk_0C;
|
||||
reverb.unk_10 = channel->unk_CC;
|
||||
reverb.unk_14 = channel->unk_0F;
|
||||
|
@ -767,12 +767,12 @@ void Audio_NoteInitForLayer(Note* note, SequenceChannelLayer* seqLayer) {
|
|||
sub->sound.audioBankSound = seqLayer->sound;
|
||||
|
||||
if (instId >= 0x80 && instId < 0xC0) {
|
||||
sub->bitField1.s.bit2 = true;
|
||||
sub->bitField1.s.isSyntheticWave = true;
|
||||
} else {
|
||||
sub->bitField1.s.bit2 = false;
|
||||
sub->bitField1.s.isSyntheticWave = false;
|
||||
}
|
||||
|
||||
if (sub->bitField1.s.bit2) {
|
||||
if (sub->bitField1.s.isSyntheticWave) {
|
||||
Audio_BuildSyntheticWave(note, seqLayer, instId);
|
||||
}
|
||||
|
||||
|
|
|
@ -427,8 +427,8 @@ void func_800E9ED8(SequenceChannelLayer* layer) {
|
|||
}
|
||||
|
||||
s32 func_800E9F64(SequenceChannelLayer* layer, s32 arg1) {
|
||||
if (!layer->stopSomething && layer->sound != NULL && layer->sound->sample->bits4 == 2 &&
|
||||
layer->sound->sample->bits2 != 0) {
|
||||
if (!layer->stopSomething && layer->sound != NULL && layer->sound->sample->codec == 2 &&
|
||||
layer->sound->sample->medium != 0) {
|
||||
layer->stopSomething = true;
|
||||
return -1;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -792,10 +792,10 @@ s32 func_800E66C0(s32 arg0) {
|
|||
if (temp_a2->adsr.action.s.state != 0) {
|
||||
if (arg0 >= 2) {
|
||||
sound = temp_a3->sound.audioBankSound;
|
||||
if (sound == NULL || temp_a3->bitField1.s.bit2) {
|
||||
if (sound == NULL || temp_a3->bitField1.s.isSyntheticWave) {
|
||||
continue;
|
||||
}
|
||||
if (sound->sample->bits2 == 0) {
|
||||
if (sound->sample->medium == 0) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue