From df24dc091eb5a9cf64ad5960f0fe353b0e7061ed Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Sat, 15 Aug 2026 03:10:28 -0600 Subject: [PATCH] =?UTF-8?q?feat(phase-31):=20FIRST=204=20MAIN-EXE=20FUNCTI?= =?UTF-8?q?ONS=20BANKED=20=E2=80=94=20main=20is=20not=20blocked,=20it=20ne?= =?UTF-8?q?eds=20clean-rebuild=20gating?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - func_80013228, func_8001CB00, func_800142C8 (src/800.c) + func_8001099C (src/boot.c, the -O0 boot module) all byte-gated together: make clean && make extract BINARY=main && make build BINARY=main -> 143dbb89f34491258bbc27810d0a12ec8b43a8dd BYTE-IDENTICAL. - these are the drafts the incremental gate rejected 0/4 last night. The drafts were CORRECT; the gate path was wrong. R22's own rationale names this exact trap: psyq_integrate rewrites the .ld in place, so an incremental build re-runs it on an already-rewritten script and produces a FALSE diff. main cannot be gated incrementally -- it needs make clean first. - main was 0.5% matched and treated as the project's hardest remaining mass. It is minable. --- src/800.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++--- src/boot.c | 10 +++++++++- 2 files changed, 62 insertions(+), 4 deletions(-) diff --git a/src/800.c b/src/800.c index 41cbd810b..16ca7973b 100644 --- a/src/800.c +++ b/src/800.c @@ -54,7 +54,21 @@ INCLUDE_ASM("asm/nonmatchings/800", func_80013154); INCLUDE_ASM("asm/nonmatchings/800", func_80013200); -INCLUDE_ASM("asm/nonmatchings/800", func_80013228); + +extern void Square0(s32 *a0, s32 *a1); + +s32 func_80013228(s32 *a0, s32 *a1) { + s32 diff[3]; + s32 result[3]; + + diff[0] = a0[0] - a1[0]; + diff[1] = a0[1] - a1[1]; + diff[2] = a0[2] - a1[2]; + + Square0(diff, result); + + return result[0] + result[1] + result[2]; +} INCLUDE_ASM("asm/nonmatchings/800", func_80013294); @@ -122,7 +136,32 @@ INCLUDE_ASM("asm/nonmatchings/800", func_800141F0); INCLUDE_ASM("asm/nonmatchings/800", func_80014238); -INCLUDE_ASM("asm/nonmatchings/800", func_800142C8); + +extern void func_80029044(void); +extern void func_8002906C(void); +extern void func_80029094(void); +extern void func_80029218(void); +extern void func_8001903C(void); +extern void func_80018FC8(void); +extern void func_8001B324(void); +extern void func_80028FDC(s32); +extern void func_80029020(s32); +extern void func_80028DBC(s32); +extern void func_80028E00(s32); + +void func_800142C8(void) { + func_80029044(); + func_8002906C(); + func_80029094(); + func_80029218(); + func_8001903C(); + func_80018FC8(); + func_8001B324(); + func_80028FDC(0x7); + func_80029020(0x7); + func_80028DBC(0); + func_80028E00(0); +} INCLUDE_ASM("asm/nonmatchings/800", func_80014338); @@ -1562,7 +1601,18 @@ INCLUDE_ASM("asm/nonmatchings/800", func_8001CA1C); INCLUDE_ASM("asm/nonmatchings/800", func_8001CA88); -INCLUDE_ASM("asm/nonmatchings/800", func_8001CB00); + +extern void func_8001CF48(s32 a0); + +void func_8001CB00(s32 a0, void *a1, s32 a2, s32 a3) { + func_8001CF48(a0); + *(s16 *)(a0 + 0x2) = 1; + *(s16 *)(a0 + 0x28) = (s16)a2; + *(s16 *)(a0 + 0x2A) = (s16)a3; + *(s32 *)(a0 + 0x20) = (s32)a1; + *(s32 *)(a0 + 0x4) = 0x8000000; + *(s16 *)(a0 + 0x2C) = 0; +} INCLUDE_ASM("asm/nonmatchings/800", func_8001CB6C); diff --git a/src/boot.c b/src/boot.c index caf9c416f..e140cac3d 100644 --- a/src/boot.c +++ b/src/boot.c @@ -10,7 +10,15 @@ INCLUDE_ASM("asm/nonmatchings/boot", main); INCLUDE_ASM("asm/nonmatchings/boot", func_8001096C); -INCLUDE_ASM("asm/nonmatchings/boot", func_8001099C); + +extern s32 VSync(s32); +extern u8 D_800AF630[]; +extern s32 D_800AE810[]; + +void func_8001099C(void) { + register u8 *p = D_800AF630; + D_800AE810[*(u16 *)(p + 0xA3D2)] = VSync(1); +} INCLUDE_ASM("asm/nonmatchings/boot", func_80010A08);