From 79006e5f4d5a8834edec6c9e9103669baef1c595 Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Thu, 3 Sep 2026 20:31:27 -0600 Subject: [PATCH] =?UTF-8?q?feat(decomp):=20bank=20main:func=5F8006252C=20(?= =?UTF-8?q?=C2=A7378=20chain=20+=20the=20double=20re-tie)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Took three tools in order, and the first two were wrong: - scope_demote_drafts BROKE it (it aliased D_80078D08 through __asm__ and the build failed) — the clash was never a data extern - the real clash was func_8006252C ITSELF: TU void(void) vs draft s32(void), i.e. self_decl_tu -> cast_self_callers --sync-decls, 4 call sites - then sync_tu_decls closed func_800625DC and func_80062644 The BODY is the interesting part and is now cookbook §482: two INDEPENDENT asm re-ties, ordered, because one barrier fixes one residual and re-creates the other. --- src/800c2_2.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/800c2_2.c b/src/800c2_2.c index 0ced53592c..263273ba29 100644 --- a/src/800c2_2.c +++ b/src/800c2_2.c @@ -93,7 +93,36 @@ void func_800624F4(void) D_80072A24 = 0; } -INCLUDE_ASM("asm/nonmatchings/800c2_2", func_8006252C); +extern void func_8005CF08(void); +extern void func_8005CF18(void); +extern s32 SysDeqIntRP(s32 priority, void *intr); +extern s32 SysEnqIntRP(s32 priority, void *intr); +extern s32 func_800625DC(void); +extern s32 func_80062644(void); +extern s32 D_80078D0C; +extern u8 D_80078D08[]; +extern s32 D_80078D14; + +s32 func_8006252C(void) { + s32 *p; + s32 *q; + s32 pri; + + func_8005CF08(); + pri = 1; + __asm__ __volatile__("" : "=r"(pri) : "0"(pri)); + p = &D_80078D0C; + __asm__ __volatile__("" : "=r"(p) : "0"(p)); + q = p - 1; + p[0] = (s32)func_800625DC; + p[1] = (s32)func_80062644; + *(s32 *)D_80078D08 = 0; + D_80078D14 = 0; + SysDeqIntRP(pri, q); + SysEnqIntRP(1, q); + func_8005CF18(); + return 1; +} extern void func_8005CF08(void); extern void func_8005CF18(void);