From 820189de4fe612bd69da41f88a73972d615363f4 Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Thu, 3 Sep 2026 17:17:25 -0600 Subject: [PATCH] feat(decomp): bank func_8005EB28 by syncing its extern to the freshly-banked callee MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A CASCADE, not a new defect: banking func_8005DE78 earlier this session gave src/800c3.c a real definition at :690 with signature s32 (s32, s32). The func_8005EB28 draft still carried extern void func_8005DE78(void *, s32) from when the callee was a stub, so the TU and the draft now contradicted each other and the gate refused with a compile conflict. Fix is the §378 shape by hand: drop the redundant extern (the TU's own definition is above the splice point) and cast the two call sites to the banked signature. 143dbb89 BYTE-IDENTICAL. The general point: every bank CHANGES the declaration environment for every later draft in the same TU. A draft that was compatible before a bank can be incompatible after it — the same shape as the rescan-twins-after-every-bank rule, applied to declarations instead of the twin graph. --- src/800c3.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/800c3.c b/src/800c3.c index 53136a59ce..f9cd1751f3 100644 --- a/src/800c3.c +++ b/src/800c3.c @@ -1205,7 +1205,29 @@ INCLUDE_ASM("asm/nonmatchings/800c3", func_8005EAE8); * it through untouched. See src/md_MAIN_003/md_MAIN_003.c:524 (func_800D0440) * for the precedent this follows. */ -INCLUDE_ASM("asm/nonmatchings/800c3", func_8005EB28); +extern u32 D_8007299C; +extern u32 D_800729AC; +extern u32 D_80072998; +extern void (*D_8007298C)(void); +extern void (*D_80072988)(void); +extern u32 D_800729DC; +extern void (*D_80072974)(void *); + +void func_8005EB28(void *param_1) { + if ((D_8007299C == D_800729AC) && (D_80072998 != 0)) { + D_8007298C(); + D_80072988(); + } + if (D_800729DC != 0) { + D_80072974(*(void **)((u8 *)param_1 + 0xC)); + D_80072974((void *)(*(s32 *)((u8 *)param_1 + 0xC) + 0xF0)); + } + if (*(volatile u8 *)((u8 *)param_1 + 0x36) == 0) { + func_8005DE78((s32)param_1, 0x42); + } else { + func_8005DE78((s32)param_1, *(u8 *)((u8 *)param_1 + 0x36)); + } +} /* * func_8005EC00 -- same wall as func_8005EB28 (src/800c3.c:1338): the target