1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-17 21:35:11 +00:00

Audio Misc Cleanup 2 (#1303)

* Misc cleanup

* PR Suggestions
This commit is contained in:
engineer124 2022-07-04 12:19:39 -04:00 committed by GitHub
parent 8778bf09b5
commit 66946534a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 72 additions and 77 deletions

View file

@ -333,7 +333,7 @@ void func_800E5584(AudioCmd* cmd) {
break;
case 0xE3:
AudioHeap_PopCache(cmd->asInt);
AudioHeap_PopPersistentCache(cmd->asInt);
break;
default:
@ -596,7 +596,7 @@ s8 func_800E60C4(s32 playerIdx, s32 port) {
}
void Audio_InitExternalPool(void* ramAddr, u32 size) {
AudioHeap_AllocPoolInit(&gAudioContext.externalPool, ramAddr, size);
AudioHeap_InitPool(&gAudioContext.externalPool, ramAddr, size);
}
void Audio_DestroyExternalPool(void) {
@ -834,8 +834,8 @@ void func_800E66A0(void) {
s32 func_800E66C0(s32 arg0) {
s32 phi_v1;
NotePlaybackState* temp_a2;
NoteSubEu* temp_a3;
NotePlaybackState* playbackState;
NoteSubEu* noteSubEu;
s32 i;
Note* note;
TunedSample* tunedSample;
@ -843,13 +843,13 @@ s32 func_800E66C0(s32 arg0) {
phi_v1 = 0;
for (i = 0; i < gAudioContext.numNotes; i++) {
note = &gAudioContext.notes[i];
temp_a2 = &note->playbackState;
playbackState = &note->playbackState;
if (note->noteSubEu.bitField0.enabled) {
temp_a3 = &note->noteSubEu;
if (temp_a2->adsr.action.s.state != 0) {
noteSubEu = &note->noteSubEu;
if (playbackState->adsr.action.s.state != 0) {
if (arg0 >= 2) {
tunedSample = temp_a3->tunedSample;
if (tunedSample == NULL || temp_a3->bitField1.isSyntheticWave) {
tunedSample = noteSubEu->tunedSample;
if (tunedSample == NULL || noteSubEu->bitField1.isSyntheticWave) {
continue;
}
if (tunedSample->sample->medium == MEDIUM_RAM) {
@ -859,8 +859,8 @@ s32 func_800E66C0(s32 arg0) {
phi_v1++;
if ((arg0 & 1) == 1) {
temp_a2->adsr.fadeOutVel = gAudioContext.audioBufferParameters.updatesPerFrameInv;
temp_a2->adsr.action.s.release = 1;
playbackState->adsr.fadeOutVel = gAudioContext.audioBufferParameters.updatesPerFrameInv;
playbackState->adsr.action.s.release = 1;
}
}
}