From 17c30f90ab2810237b42374f75090beec56f2139 Mon Sep 17 00:00:00 2001 From: Banjo Kazooie Date: Sat, 15 Oct 2022 18:21:44 -0500 Subject: [PATCH] core1/code_5650.c progress --- README.md | 2 +- include/2.0L/PR/n_libaudio.h | 9 ++++++++- progress/progress_core1.svg | 6 +++--- progress/progress_total.svg | 4 ++-- src/core1/code_5650.c | 27 ++++++++++++--------------- 5 files changed, 26 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 89511745..7cb0a93c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# banjo (90.6988%) +# banjo (90.7255%) diff --git a/include/2.0L/PR/n_libaudio.h b/include/2.0L/PR/n_libaudio.h index 4d6e616a..184aa044 100644 --- a/include/2.0L/PR/n_libaudio.h +++ b/include/2.0L/PR/n_libaudio.h @@ -140,9 +140,15 @@ typedef struct { u8 chan; } N_ALOscEvent; +typedef struct { + union { + s32 i; + f32 f; + }data[2]; +} N_ALGenericEvent; typedef struct { - s16 type; + u16 type; union { ALMIDIEvent midi; ALTempoEvent tempo; @@ -155,6 +161,7 @@ typedef struct { ALSeqpSeqEvent spseq; ALSeqpBankEvent spbank; N_ALOscEvent osc; + N_ALGenericEvent generic; } msg; } N_ALEvent; diff --git a/progress/progress_core1.svg b/progress/progress_core1.svg index a49b97e7..ebebdcb8 100644 --- a/progress/progress_core1.svg +++ b/progress/progress_core1.svg @@ -9,7 +9,7 @@ - + @@ -17,7 +17,7 @@ core1 - 81.8075% - 81.8075% + 81.9915% + 81.9915% \ No newline at end of file diff --git a/progress/progress_total.svg b/progress/progress_total.svg index b0e0956d..d52b64d0 100644 --- a/progress/progress_total.svg +++ b/progress/progress_total.svg @@ -17,7 +17,7 @@ Banjo-Kazooie (us.v10) - 90.6988% - 90.6988% + 90.7255% + 90.7255% \ No newline at end of file diff --git a/src/core1/code_5650.c b/src/core1/code_5650.c index f5464670..674223ea 100644 --- a/src/core1/code_5650.c +++ b/src/core1/code_5650.c @@ -2,6 +2,7 @@ #include "functions.h" #include "variables.h" #include "n_libaudio.h" +#include "n_synth.h" void func_802444C0(N_AL_Struct81s *arg0); void func_80244050(ALEventQueue *arg0, N_AL_Struct81s *arg1, u16 arg2); @@ -195,36 +196,33 @@ void func_80244190(N_AL_Struct81s *arg0) { } #endif -#ifndef NONMATCHING -#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_5650/func_8024431C.s") -#else N_AL_Struct81s *func_8024431C(ALBank *bank, ALSound *sound) { - s32 pad; + s32 sp24; ALKeyMap *sp30; N_AL_Struct81s *temp_s0; OSIntMask mask; - s32 sp24; temp_s0 = D_802758C0.unk8; sp30 = sound->keyMap; if (temp_s0 != NULL) { mask = osSetIntMask(OS_IM_NONE); - D_802758C0.unk8 = (N_AL_Struct81s *) temp_s0->unk0.next; + D_802758C0.unk8 = (N_AL_Struct81s *) temp_s0->node.next; alUnlink((ALLink *)temp_s0); if (D_802758C0.unk0 != NULL) { - temp_s0->unk0.next = D_802758C0.unk0; - temp_s0->unk0.prev = NULL; - D_802758C0.unk0->unk0.prev = temp_s0; + temp_s0->node.next = D_802758C0.unk0; + temp_s0->node.prev = NULL; + D_802758C0.unk0->node.prev = temp_s0; D_802758C0.unk0 = temp_s0; } else { - temp_s0->unk0.prev = NULL; - temp_s0->unk0.next = NULL; + temp_s0->node.prev = NULL; + temp_s0->node.next = NULL; D_802758C0.unk0 = temp_s0; D_802758C0.unk4 = temp_s0; } osSetIntMask(mask); - sp24 = ((sound->envelope->decayTime + 1) == 0) + 0x40; - temp_s0->unk36 = sp24; + sp24 = ((sound->envelope->decayTime + 1) == 0); + // sp24 = sp20 + 0x40; + temp_s0->unk36 = sp24 + 0x40; temp_s0->unk40 = 5; temp_s0->unk38 = 2; temp_s0->unk8 = sound; @@ -239,7 +237,7 @@ N_AL_Struct81s *func_8024431C(ALBank *bank, ALSound *sound) { } else { temp_s0->unk28 = alCents2Ratio(((sp30->keyBase * 0x64) + sp30->detune) - 0x1770); } - if (sp24 != 0x40) { + if (sp24 != 0) { temp_s0->unk3F |= 2; } temp_s0->unk3E = 0; @@ -248,7 +246,6 @@ N_AL_Struct81s *func_8024431C(ALBank *bank, ALSound *sound) { } return temp_s0; } -#endif void func_802444C0(N_AL_Struct81s *arg0){ N_AL_Struct81s *var_v0;