From 1949f562a746ebc2b55dc02a76902d85afbf055f Mon Sep 17 00:00:00 2001 From: Jeod <47716344+JeodC@users.noreply.github.com> Date: Thu, 6 Aug 2026 19:00:43 -0400 Subject: [PATCH 1/4] Add null guards for bundle spawns (#411) --- src/core2/fx/effect_jiggy_spawn.c | 3 +++ src/core2/sprite/rendertex.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/core2/fx/effect_jiggy_spawn.c b/src/core2/fx/effect_jiggy_spawn.c index f50f5fa4f..7a83e79f8 100644 --- a/src/core2/fx/effect_jiggy_spawn.c +++ b/src/core2/fx/effect_jiggy_spawn.c @@ -7,6 +7,9 @@ void func_80347B10(Struct81s *arg0){ Actor *actor; actor = bundle_spawn_f32(BUNDLE_10__JIGGY, arg0->position); + if (actor == NULL) { + return; + } actor->unk54 = 3.0f; func_803333DC(arg0, actor); } diff --git a/src/core2/sprite/rendertex.c b/src/core2/sprite/rendertex.c index 29e33f5bf..df54d589f 100644 --- a/src/core2/sprite/rendertex.c +++ b/src/core2/sprite/rendertex.c @@ -75,6 +75,9 @@ s32 spriteRender1PrimMode; void func_80347DF0(Struct81s *arg0){ Actor *actor; actor = bundle_spawn_f32(arg0->actor_id, arg0->position); + if (actor == NULL) { + return; + } if (!EventSystem_Should(VB_BUNDLE_SPAWN_SET_ACTOR_DATA, false, actor)) { actor->unk54 = 3.0f; func_803333DC(arg0, actor); From 1173346d4d6677049998832b6bd44d5e3a1659c1 Mon Sep 17 00:00:00 2001 From: Jeod <47716344+JeodC@users.noreply.github.com> Date: Thu, 6 Aug 2026 19:09:34 -0400 Subject: [PATCH 2/4] Fix a pointer truncation for the organ minigame firing on a wrong note (#407) --- include/functions.h | 2 +- src/MMM/minigame_organ.c | 7 +++++-- src/MMM/organ_tiles.c | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/functions.h b/include/functions.h index 8222da5b3..23fff6185 100644 --- a/include/functions.h +++ b/include/functions.h @@ -890,7 +890,7 @@ void chTumblar_copyPosition(s32 arg0, Struct68s *arg1, f32 arg2[3]); void chTumblar_checkMMMChecksums(void); // --- MMM/minigame_organ.c --- -int func_80389CE8(s32 arg0, s32 arg1, s32 arg2); +int func_80389CE8(Struct5Fs *arg0, Struct68s *arg1, s32 arg2); s32 func_80389BBC(void); void MMM_func_80389CD8(); void code3420_handleOrganGame(s32 arg0, s32 arg1); diff --git a/src/MMM/minigame_organ.c b/src/MMM/minigame_organ.c index 7333e0340..0b2d0a091 100644 --- a/src/MMM/minigame_organ.c +++ b/src/MMM/minigame_organ.c @@ -280,7 +280,9 @@ void MMM_func_80389CD8() {} void func_80389CE0() {} -int func_80389CE8(s32 arg0, s32 arg1, s32 arg2){ +// [port] pointer truncation +//int func_80389CE8(s32 arg0, s32 arg1, s32 arg2){ +int func_80389CE8(Struct5Fs *arg0, Struct68s *arg1, s32 arg2){ if(Me.state == 3){ if(*Me.unk10 == arg2){ Me.unk0--; @@ -296,7 +298,8 @@ int func_80389CE8(s32 arg0, s32 arg1, s32 arg2){ return 1; }//L80389D6C else{ - func_8028F55C(0xD, func_80351794((Struct68s *)(intptr_t)arg1)); +// func_8028F55C(0xD, func_80351794((Struct68s *)(intptr_t)arg1)); + func_8028F55C(0xD, func_80351794(arg1)); return 2; } } diff --git a/src/MMM/organ_tiles.c b/src/MMM/organ_tiles.c index f9b94b5c5..42d4b2836 100644 --- a/src/MMM/organ_tiles.c +++ b/src/MMM/organ_tiles.c @@ -137,7 +137,8 @@ void func_8038B790(Struct5Fs *arg0, Struct68s *arg1, f32 arg2) { func_80351814(arg1, sp2C); if (func_803518C0(arg1) != 0) { - temp_v0 = func_80389CE8((s32)(intptr_t)arg0, (s32)(intptr_t)arg1, arg0->unk8); +// temp_v0 = func_80389CE8((s32)(intptr_t)arg0, (s32)(intptr_t)arg1, arg0->unk8); + temp_v0 = func_80389CE8(arg0, arg1, arg0->unk8); if (temp_v0 == 0) { func_8038B6FC(arg0, arg1); } From 8d65c259ca78be28db51cc6580a80f5ae7a246c2 Mon Sep 17 00:00:00 2001 From: Jeod <47716344+JeodC@users.noreply.github.com> Date: Thu, 6 Aug 2026 19:09:46 -0400 Subject: [PATCH 3/4] Fix off by one in lifescore (#410) --- src/core2/scorequeue/lifescore.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core2/scorequeue/lifescore.c b/src/core2/scorequeue/lifescore.c index 0dbf6df22..840c840e4 100644 --- a/src/core2/scorequeue/lifescore.c +++ b/src/core2/scorequeue/lifescore.c @@ -35,7 +35,14 @@ struct8s D_80381ED0; /* .code */ s32 func_802FFDE0(s32 arg0){ - return D_8036A260[arg0/4]; +// [port] Off by one +// return D_8036A260[arg0/4]; + s32 idx = arg0/4; + s32 last = (s32)(sizeof(D_8036A260)/sizeof(D_8036A260[0])) - 1; + if (idx > last) { + idx = last; + } + return D_8036A260[idx]; } s32 func_802FFE04(void){ From 70c8ee13a208fd559fe8ba45a1c42942d91306d5 Mon Sep 17 00:00:00 2001 From: Jeod <47716344+JeodC@users.noreply.github.com> Date: Thu, 6 Aug 2026 19:10:18 -0400 Subject: [PATCH 4/4] Fix infinite jiggies when using d-pad transform while collecting (#415) --- src/port/Enhancements/Cheats/Cheats.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/port/Enhancements/Cheats/Cheats.cpp b/src/port/Enhancements/Cheats/Cheats.cpp index 178e3faa8..e547ee054 100644 --- a/src/port/Enhancements/Cheats/Cheats.cpp +++ b/src/port/Enhancements/Cheats/Cheats.cpp @@ -215,11 +215,19 @@ static bool isWishyWashyUnlocked() { return (baanim_getActiveBottlesBonusMask() & BAANIM_WISHYWASHY) != 0; } +static bool jiggyCollectInFlight() { + return baflag_isTrue(BA_FLAG_7_TOUCHING_JIGGY) || bsjig_inJiggyJig((enum bs_e)bs_getState()); +} + // Transformation cycling with D-pad Up/Down // D-pad Up: Cycle forward through transformations (Banjo -> Termite -> ... -> Bee -> [Wishy] -> Banjo) // D-pad Down: Cycle backward through transformations (Banjo -> [Wishy] -> Bee -> ... -> Termite -> Banjo) void RegisterCycleTransform_Init() { COND_HOOK(GameFrameUpdate, EVENT_PRIORITY_NORMAL, CVarGetInteger(CVAR_CYCLE_TRANSFORM, 0), [](IEvent* event) { + if (jiggyCollectInFlight()) { + return; + } + s32 currentTransform = (s32)player_getTransformation(); // D-pad Up: Cycle forward through transformations