1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-16 21:05:12 +00:00

Fix various non matching issues and introduce #ifdef NON_EQUIVALENT instead of #if 0 (#207)

This commit is contained in:
Roman971 2020-06-14 05:29:59 +02:00 committed by GitHub
parent 031d946db7
commit 06fc61c83d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 297 additions and 1307 deletions

View file

@ -292,9 +292,9 @@ s32 func_800E7744(s32 instrument, s32 bankId, s32 instId, UnkInstrument* arg3) {
return 0;
}
#if 0
// This code is SM64 PAL's version with changes made to build here (and a couple legitimate changes made in the function).
// This function needs massive work, hence why it is not set for NON_MATCHING
#ifdef NON_EQUIVALENT
// This code is SM64 PAL's version with changes made to build here (and a couple legitimate changes made in the
// function). This function needs massive work, hence why it is not set for NON_MATCHING
void Audio_SeqChanLayerDecayRelease(SequenceChannelLayer* seqLayer, s32 target) {
Note* note;
NoteAttributes* attributes;
@ -302,7 +302,7 @@ void Audio_SeqChanLayerDecayRelease(SequenceChannelLayer* seqLayer, s32 target)
if (seqLayer == NO_LAYER) {
return;
}
seqLayer->unusedEu0b8 = 0;
if (seqLayer->note == NULL) {
@ -317,7 +317,8 @@ void Audio_SeqChanLayerDecayRelease(SequenceChannelLayer* seqLayer, s32 target)
}
if (note->playbackState.parentLayer != seqLayer) {
if (note->playbackState.parentLayer == NO_LAYER && note->playbackState.wantedParentLayer == NO_LAYER && note->playbackState.prevParentLayer == seqLayer && target != 6) {
if (note->playbackState.parentLayer == NO_LAYER && note->playbackState.wantedParentLayer == NO_LAYER &&
note->playbackState.prevParentLayer == seqLayer && target != 6) {
note->playbackState.adsr.fadeOutVel = gAudioContext.gAudioBufferParameters.updatesPerFrameInv;
note->playbackState.adsr.adsrAction.action |= 0x10;
}
@ -341,11 +342,14 @@ void Audio_SeqChanLayerDecayRelease(SequenceChannelLayer* seqLayer, s32 target)
} else {
note->playbackState.adsr.adsrAction.action |= 0x20;
if (seqLayer->adsr.releaseRate == 0) {
note->playbackState.adsr.fadeOutVel = seqLayer->seqChannel->adsr.releaseRate * gAudioContext.gAudioBufferParameters.unkUpdatesPerFrameScaled;
note->playbackState.adsr.fadeOutVel = seqLayer->seqChannel->adsr.releaseRate *
gAudioContext.gAudioBufferParameters.unkUpdatesPerFrameScaled;
} else {
note->playbackState.adsr.fadeOutVel = seqLayer->adsr.releaseRate * gAudioContext.gAudioBufferParameters.unkUpdatesPerFrameScaled;
note->playbackState.adsr.fadeOutVel =
seqLayer->adsr.releaseRate * gAudioContext.gAudioBufferParameters.unkUpdatesPerFrameScaled;
}
note->playbackState.adsr.sustain = ((f32) (s32) (seqLayer->seqChannel->adsr.sustain) * note->playbackState.adsr.current) / 256.0f;
note->playbackState.adsr.sustain =
((f32)(s32)(seqLayer->seqChannel->adsr.sustain) * note->playbackState.adsr.current) / 256.0f;
}
}