From ef0bc36a58788f5d5f211da0e808f4cd38d5b2be Mon Sep 17 00:00:00 2001 From: Banjo Kazooie Date: Mon, 9 Jan 2023 14:12:38 -0600 Subject: [PATCH] func_80244190() match --- README.md | 2 +- progress/progress_core1.svg | 6 ++--- progress/progress_total.svg | 4 ++-- src/core1/code_5650.c | 46 ++++++++++++++++++------------------- 4 files changed, 28 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 06414611..6d8af43c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# banjo (97.7919%) +# banjo (97.8170%) diff --git a/progress/progress_core1.svg b/progress/progress_core1.svg index 94ce7dbc..87473591 100644 --- a/progress/progress_core1.svg +++ b/progress/progress_core1.svg @@ -9,7 +9,7 @@ - + @@ -17,7 +17,7 @@ core1 - 96.8520% - 96.8520% + 97.0254% + 97.0254% \ No newline at end of file diff --git a/progress/progress_total.svg b/progress/progress_total.svg index 56815fde..7980b11f 100644 --- a/progress/progress_total.svg +++ b/progress/progress_total.svg @@ -17,7 +17,7 @@ Banjo-Kazooie (us.v10) - 97.7919% - 97.7919% + 97.8170% + 97.8170% \ No newline at end of file diff --git a/src/core1/code_5650.c b/src/core1/code_5650.c index 0f7aeb99..95ef078e 100644 --- a/src/core1/code_5650.c +++ b/src/core1/code_5650.c @@ -10,14 +10,14 @@ void func_80244050(ALEventQueue *arg0, N_AL_Struct81s *arg1, u16 arg2); void func_8024324C(N_ALSndPlayer *arg0); +void func_80244190(N_AL_Struct81s *arg0); // extern ALEventUnknown; /* .bss */ N_ALSndPlayer D_8027EEC0; u16 *D_8027EF14; extern struct { - u8 pad0[4]; - s32 volume[3]; + s32 volume[4]; }D_8027EF18; /* .data */ @@ -156,11 +156,8 @@ s32 func_80244110(u16 *arg0, u16 *arg1) { return var_v1; } - -#ifndef NONMATCHING -#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_5650/func_80244190.s") -#else -void func_80244190(N_AL_Struct81s *arg0) { +void func_80244190(N_AL_Struct81s *arg0) +{ ALMicroTime *temp_a1; s32 prev_volume; s32 temp_t1; @@ -172,32 +169,33 @@ void func_80244190(N_AL_Struct81s *arg0) { ALEnvelope *envelope; N_AL_Struct81s *var_v0; N_AL_Struct81s *var_v1; - - for(var_v0 = D_802758C0.unk0; var_v0 != NULL; var_v0 = (N_AL_Struct81s *)var_v0->node.next){ + for (var_v0 = D_802758C0.unk0; var_v0 != 0; var_v0 = (N_AL_Struct81s *) var_v0->node.next) + { var_v1 = var_v0; - envelope = var_v0->unk8->envelope; + envelope = var_v1->unk8->envelope; temp_a1 = &envelope->attackTime; - D_8027EF18.volume[AL_PHASE_ATTACK] = (s32) envelope->attackVolume; - D_8027EF18.volume[AL_PHASE_DECAY] = (s32) envelope->decayVolume; - while( var_v0->envPhase < AL_PHASE_RELEASE - && var_v0->unk48 >= temp_a1[var_v0->envPhase] - && temp_a1[var_v0->envPhase] != -1 - ){ - var_v0->unk48 -= temp_a1[var_v0->envPhase]; - var_v0->envPhase++; + D_8027EF18.volume[1] = (s32) envelope->attackVolume; + D_8027EF18.volume[2] = (s32) envelope->decayVolume ; + while (((var_v1->envPhase < 3) && (var_v1->unk48 >= temp_a1[var_v1->envPhase])) && (temp_a1[var_v1->envPhase] != (-1))) + { + var_v1->unk48 -= temp_a1[var_v1->envPhase]; + var_v1->envPhase++; } - if (var_v0->envPhase < AL_PHASE_RELEASE) { - if (temp_a1[var_v1->envPhase] != -1) { - var_v0->unk44 = D_8027EF18.volume[var_v0->envPhase - 1] + ((s32) ((D_8027EF18.volume[var_v0->envPhase] - D_8027EF18.volume[var_v0->envPhase - 1]) * var_v0->unk48) / temp_a1[var_v0->envPhase]); + if (var_v1->envPhase < 3){ + if (temp_a1[var_v1->envPhase] != (-1)) { + var_v1->unk44 = D_8027EF18.volume[var_v1->envPhase] + + (D_8027EF18.volume[var_v1->envPhase + 1] - D_8027EF18.volume[var_v1->envPhase]) + * var_v0->unk48 + / temp_a1[var_v1->envPhase]; } else { - var_v0->unk44 = D_8027EF18.volume[var_v0->envPhase - 1]; // + var_v0->unk44 = D_8027EF18.volume[var_v1->envPhase]; } } - var_v0->unk48 += arg0->unk48; + + var_v1->unk48 += arg0->unk48; } } -#endif N_AL_Struct81s *func_8024431C(ALBank *bank, ALSound *sound) { s32 sp24;