From 82238e82d8bbee414a82f0cb528f2a10e784b297 Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Tue, 25 Aug 2026 10:00:23 -0600 Subject: [PATCH] =?UTF-8?q?fix(ov=5FSC04=5F018):=20RED=20=E2=80=94=20resto?= =?UTF-8?q?re=20the=20bank=20a=20maintenance=20pass=20reverted,=20not=20th?= =?UTF-8?q?e=20pad=20spec?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The object failed to assemble: "jtbl_rodata_pads: consumed 3 rodata .align(s) but 4 pad spec(s) given". The tempting fix is to relax the spec to 3 — it builds and it is BYTE-IDENTICAL, which is exactly what makes it dangerous. The spec was right and the SOURCE was wrong. func_8017E7CC was banked as of commit:2628 (68 INCLUDE_ASM in the TU) and back to a stub at commit:2629 (69) — the free A-prop maintenance pass reverted a byte-proven function, and the object's 4th table went with it. Restoring the body from commit:2628 with the ORIGINAL 0,0,0,0 spec builds BYTE-IDENTICAL (fe9b413fc48ba615ccf81cde49d7a1efad481bc9), which is the proof the spec was never drifted. R42 again, from the other direction: the destroyed bank did not merely vanish, it took a build with it, and the failure wore a config-drift costume. A byte-identical build is not evidence that the change you made was the right one — both fixes are byte-identical here and only one keeps the function. --- src/ov_SC04_018/ov_SC04_018_jr_8017AE2C.c | 44 +++++++++++++++++++++-- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/src/ov_SC04_018/ov_SC04_018_jr_8017AE2C.c b/src/ov_SC04_018/ov_SC04_018_jr_8017AE2C.c index df4d2a68a..3c0a2f80a 100644 --- a/src/ov_SC04_018/ov_SC04_018_jr_8017AE2C.c +++ b/src/ov_SC04_018/ov_SC04_018_jr_8017AE2C.c @@ -4819,7 +4819,13 @@ extern void func_8012A828(s32 *a0, s32 a1); } -INCLUDE_ASM("asm/ov_SC04_018/nonmatchings/ov_SC04_018_jr_8017AE2C", func_8017E7CC); +void func_8017E7CC(int param_1) +{ + *(short *)(param_1 + 3) = 2; + *(short *)(param_1 + 0x34) = 0; + ((void (*)(s32, void *))func_8012A828)(param_1, &((char *)&D_801B9AA8)); + *(int *)(param_1 + 0x1c) = 0x10; +} extern void (*D_801912C8[])(void); @@ -5586,7 +5592,23 @@ INCLUDE_ASM("asm/ov_SC04_018/nonmatchings/ov_SC04_018_jr_8017AE2C", func_801805C INCLUDE_ASM("asm/ov_SC04_018/nonmatchings/ov_SC04_018_jr_8017AE2C", func_80180618); -INCLUDE_ASM("asm/ov_SC04_018/nonmatchings/ov_SC04_018_jr_8017AE2C", func_8018067C); +extern int func_80178970(void); +extern s32 D_801B9DF8; +extern void func_8012A828(s32*, s32); +extern void func_80178D18(void); + +void func_8018067C(arg0) +void * arg0; +{ + + extern s32 D_801B9DF8; + if (func_80178970() != 0) { + ((void (*)(s32))func_80178D18)((s32)arg0); + *(short *)((char *)arg0 + 0x2) = 3; + ((void (*)(s32, s32))func_8012A828)((int)arg0, (int)&D_801B9DF8); + } +} + INCLUDE_ASM("asm/ov_SC04_018/nonmatchings/ov_SC04_018_jr_8017AE2C", func_801806CC); @@ -7069,7 +7091,23 @@ void func_80183B8C(int param_1) INCLUDE_ASM("asm/ov_SC04_018/nonmatchings/ov_SC04_018_jr_8017AE2C", func_80183BC4); -INCLUDE_ASM("asm/ov_SC04_018/nonmatchings/ov_SC04_018_jr_8017AE2C", func_80183C28); +extern int func_80178970(void); +extern s32 D_801B9C50; +extern void func_8012A828(s32*, s32); +extern void func_80178D18(void); + +void func_80183C28(arg0) +void * arg0; +{ + + extern s32 D_801B9C50; + if (func_80178970() != 0) { + ((void (*)(s32))func_80178D18)((s32)arg0); + *(short *)((char *)arg0 + 0x2) = 3; + ((void (*)(s32, s32))func_8012A828)((int)arg0, (int)&D_801B9C50); + } +} + #include "common.h"