From 53fad0d03107f7fa06f36c0aed48b33657dc809d Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Mon, 31 Aug 2026 23:18:43 -0600 Subject: [PATCH] =?UTF-8?q?feat(decomp):=20ov=5FSC04=5F010/func=5F8017D6CC?= =?UTF-8?q?=20=E2=80=94=20the=20self-caller=20cast=20lever,=20byte-verifie?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The §376 class's real blocker: after fix_arity_callers no-protos the conflicting forward decl, the draft's definition becomes the prototype in scope and the TU's own call site fails with 'too few arguments'. Casting THAT call site to a 0-arg function pointer is byte-neutral (gcc-2.7.2 folds a cast of a known symbol back to a direct jal, §20) and banks the function. --- src/ov_SC04_010/ov_SC04_010_jr_8017BEBC.c | 25 +++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/ov_SC04_010/ov_SC04_010_jr_8017BEBC.c b/src/ov_SC04_010/ov_SC04_010_jr_8017BEBC.c index 9a6b6e343..9fd3fcdc0 100644 --- a/src/ov_SC04_010/ov_SC04_010_jr_8017BEBC.c +++ b/src/ov_SC04_010/ov_SC04_010_jr_8017BEBC.c @@ -3569,7 +3569,28 @@ s32 func_8017D6C4(void *a0) } -INCLUDE_ASM("asm/ov_SC04_010/nonmatchings/ov_SC04_010_jr_8017BEBC", func_8017D6CC); + +void func_8017D6CC(void *a0) +{ + extern u8 D_8018F598[]; + + if (*(s16 *)(a0 + 0xFE) != 0) { + D_8018F598[2] += 0x10; + D_8018F598[1] += 0xC; + D_8018F598[0] += 4; + if (D_8018F598[2] >= 0xF0) { + *(s16 *)(a0 + 0xFE) = 0; + } + } else { + D_8018F598[2] -= 0x10; + D_8018F598[1] -= 0xC; + D_8018F598[0] -= 4; + if (D_8018F598[2] < 0x61) { + *(u16 *)(a0 + 0xFE) += 1; + } + } +} + extern s32 func_8012C588(s32 a0, s32 a1); void func_8017D7A0(u8 *a0) { @@ -3692,7 +3713,7 @@ void func_8017DA58(s32 a0) { extern void func_8017D6CC(); void func_8017DB20(void) { - func_8017D6CC(); + ((void (*)(void))func_8017D6CC)(); }