From 90cfb678d92c497007d0072442b8689e9d35aaec Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Sun, 30 Aug 2026 21:55:32 -0600 Subject: [PATCH] =?UTF-8?q?feat(decomp):=20worker=20gate=20=E2=80=94=20+1?= =?UTF-8?q?=20fns=20x0=20propagated=20(fleet=2099.1%)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/overlays.mk | 1 + config/splat.ov_SC02_037.yaml | 2 +- src/ov_SC02_037/ov_SC02_037_jr_801555F4.c | 94 ++++++++++++++++++++++- 3 files changed, 95 insertions(+), 2 deletions(-) diff --git a/config/overlays.mk b/config/overlays.mk index 7a1a2cb9fd..ea85612cd0 100644 --- a/config/overlays.mk +++ b/config/overlays.mk @@ -5038,6 +5038,7 @@ build/src/ov_SC02_037/ov_SC02_037_jr_80131340.o: JTBL_PADS := 0,0,4 # §8e pads build/src/ov_SC02_037/ov_SC02_037_jr_80135A4C.o: JTBL_PADS := 0,4 # §8e pads (jtbl_carve.py) tables=+0x0,+0x18 build/src/ov_SC02_037/ov_SC02_037_jr_8013F350.o: JTBL_PADS := 0,0,4,0,4,0,4 # §8e pads (jtbl_carve.py) tables=+0x0,+0x20,+0x38,+0x58,+0x70,+0x90,+0xa8 build/src/ov_SC02_037/ov_SC02_037_jr_801549F8.o: JTBL_PADS := 0,0 # §8e pads (jtbl_carve.py) tables=+0x0,+0x6c +build/src/ov_SC02_037/ov_SC02_037_jr_801555F4.o: JTBL_PADS := 0,0 # §8e pads (jtbl_carve.py) tables=+0x0,+0x20 build/src/ov_SC02_037/ov_SC02_037_jr_801594E8.o: JTBL_PADS := 0,0 # §8e pads (jtbl_carve.py) tables=+0x0,+0x20 build/src/ov_SC02_037/ov_SC02_037_jr_80159C84.o: JTBL_PADS := 0,4 # §8e pads (jtbl_carve.py) tables=+0x0,+0x20 build/src/ov_SC02_037/ov_SC02_037_jr_8015A3C8.o: JTBL_PADS := 0,4,4,4 # §8e pads (jtbl_carve.py) tables=+0x0,+0x20,+0x40,+0x60 diff --git a/config/splat.ov_SC02_037.yaml b/config/splat.ov_SC02_037.yaml index c0b72eb49d..5651eee8d9 100644 --- a/config/splat.ov_SC02_037.yaml +++ b/config/splat.ov_SC02_037.yaml @@ -129,7 +129,7 @@ segments: - [0x9fab8, data, tail7] - [0x9fabc, .rodata, ov_SC02_037_jr_801549F8] # Phase-26 §8 jtbl-rodata carve (jtbl_carve.py) - [0x9fb4c, .rodata, ov_SC02_037_jr_801555F4] # Phase-26 §8 jtbl-rodata carve (jtbl_carve.py) - - [0x9fb6c, data, tail8] + - [0x9fb90, data, tail8] - [0x9fb94, .rodata, ov_SC02_037_jr_801594E8] # Phase-26 §8 jtbl-rodata carve (jtbl_carve.py) - [0x9fc14, .rodata, ov_SC02_037_jr_80159C84] # Phase-26 §8 jtbl-rodata carve (jtbl_carve.py) - [0x9fc48, data, tail9] diff --git a/src/ov_SC02_037/ov_SC02_037_jr_801555F4.c b/src/ov_SC02_037/ov_SC02_037_jr_801555F4.c index 1aa839f88f..998ab986ea 100644 --- a/src/ov_SC02_037/ov_SC02_037_jr_801555F4.c +++ b/src/ov_SC02_037/ov_SC02_037_jr_801555F4.c @@ -2765,7 +2765,99 @@ void func_80158880(s32 *param) { } -INCLUDE_ASM("asm/ov_SC02_037/nonmatchings/ov_SC02_037_jr_801555F4", func_801588CC); +// @class: plumbing +// @stuck: none — MATCH (122 ins). switch (D_801C8580) over jtbl_801C7CC4, 9 arms, arm 0 empty. +// +// Integration note (§8b, the lesson recorded above func_80158638 in this same file): +// a previous attempt was already byte-correct in isolation but carried a file-local +// re-declaration of the s32 type, which collides with the one common.h already gives this +// TU — recover_integration's probe named it as the sole blocker. It is dropped here and the +// body is spelled in the TU's own types instead. Callee decls use the fleet-canonical +// spellings and every call site carries an explicit cast, so the body stays independent of +// whichever decl reconcile_tu leaves standing. +// +// (s16) on the func_80159464 return is what reproduces the target's `sll 16; beqz` at +// 0x801589A0 — gcc-2.7.2 folds the sra away for a bare !=0 test. Same trick the banked +// neighbour func_80158FA4 uses on this exact callee. +// +// Arms 2 and 7 are the same source; the differing codegen (beqz-to-SsGetMute vs +// bnez-to-the-store) is purely block placement, and both fall out at closeness 0. + +extern s32 func_800D0CA0(s32); +extern s32 func_8001AAA0(void); +extern s32 SsGetMute(void); +extern s32 func_80159464(void); + +void func_801588CC(s32 param_1) { + + extern void (*D_80185FAC[])(void); + extern s32 D_801C8580; + extern s32 D_801C8584; + extern s32 D_801C8588; + extern s32 D_801C858C; + extern s32 D_801C8590; + s16 sVar1; + + D_80185FAC[*(u16 *)(param_1 + 2)](); + switch (D_801C8580) { + case 0: + break; + case 1: + ((void (*)(s32))func_800D0CA0)(2); + D_801C8588 = 0; + D_801C8584 = 0x46; + D_801C8580 += 1; + break; + case 2: + if (D_801C8584 == 0) { + if (SsGetMute() == 0) { + D_801C8580 += 1; + } + } else { + D_801C8584 -= 1; + } + break; + case 3: + if (((s32 (*)(s32))func_8001AAA0)(0x83) != 0) { + D_801C8580 += 1; + } + break; + case 4: + D_801C858C = 0; + sVar1 = ((s32 (*)(s32))func_80159464)(param_1); + if (sVar1 != 0) { + D_801C8584 = 0xd2; + } else { + D_801C8584 = 1; + } + break; + case 5: + D_801C8584 -= 1; + if (D_801C8584 == -1 || D_801C8590 != 0) { + D_801C8584 = 0; + D_801C8580 += 1; + } + break; + case 6: + ((void (*)(s32))func_800D0CA0)(1); + D_801C8584 = 0x28; + D_801C8580 += 1; + break; + case 7: + if (D_801C8584 == 0) { + if (SsGetMute() == 0) { + D_801C8580 += 1; + } + } else { + D_801C8584 -= 1; + } + break; + case 8: + D_801C8588 = 1; + break; + } +} + DEFINE_func_80158AB4() /* dedup: shared engine-core @0x80158ab4 (src/shared) */