Files
BFM-decomp/src/libgpu2.c
T
Drew T 757bd82a0f feat(phase-31): S79 #4 — scattered-.bss split at link-prepare (psyq_bss_split): SYS.o→libgpu2, VM_F.o→snd12, GS_001.o→libgs8 LINKED; libgpu_used retired
The §9.1 "scattered .bss commons" exclusion class (Phase 8 → P31) is closed 3/3. New
tools/psyq_bss_split.py (own ELF32 REL reader/writer) cuts an object's packed .bss into
per-base NOBITS pieces: bases derived from the game bytes per HI16/LO16 pair, references
walked in offset order into single-base runs, cuts snapped to symbol starts (the linker
scattered SYMBOLS), symbols moved, a LOCAL section symbol per piece inserted, relocs
retargeted with the addend rewritten in the immediates, self-diffed. It runs inside the one
prepare step shared by psyq_link.link_object / psyq_link_region.build_region /
psyq_integrate.integrate (prepare_object before classify), re-derived every build.

GS_001.o was certified "5 interleaved bases, NOT splittable" by the S77 probe, which grouped
by BASE; by RUN it is six symbol-aligned pieces. All seven cuts across the three objects are
confirmed by the other objects' by-name recoveries (_que 0x800C5510, _svm_sreg_buf
0x800B9B58, PSDBASEX/CLIP2/PSDBASEY/POSITION/GsDRAWENV). R39 negative control: 235 placed
objects across 9 curated dirs, 0 refusals, exactly 3 splits (a libcd .bss+size end pointer
refused the first build → reference problems are fatal only when a split is needed).

Wiring: yaml 800c→libgpu2, sgap_6→sgap_6+snd12, gsgap3→libgs8 (comments rewritten);
LIBGPU_ELF := .run/obj40/libgpu (curated libgpu_used retired); libgs 34 objs/8 blocks
(make_libgs.sh +GS_001); snd 63/12 (make_snd_used.py exclusions 4→3). src/800c.c and
src/gsgap3.c removed (Sony code hand-matched as REAL/verbatim), sgap_6.c keeps only
func_8003FA54; splat-emitted libgpu2.c/libgs8.c/snd12.c stubs for the no-SDK fallback.

Verified: main 143dbb89f34491258bbc27810d0a12ec8b43a8dd WITH the SDK objects and WITHOUT
them from a fresh extract; make tools-health OK; R22 fleet clean extract-all 212/212 +
check-all 213/213. Metrics: main REAL 886→839, LINKED 1,040→1,150, VERBATIM 85→29, stubs 29
(unchanged); game-code weighted 91.1% (40,895/44,870) — both terms lost the 3,667 SDK ins;
the remainder is still exactly the 3,975-ins open-stub sum. Verbatim manifest --update
200→33 rows (subtractive). Docs: cookbook §489 (+index), psyq-worklist rows + "S78 task #4",
SETUP S79 R21 table, decision-log S79 addendum, accelerators S79, CURRENT_PHASE S79 FINAL 🛑.
2026-09-04 17:19:29 -06:00

214 lines
5.7 KiB
C

#include "common.h"
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_80059234);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_11C);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_16C);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SetGraphReverse);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_210);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_800594CC);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SetGraphQueue);
INCLUDE_ASM("asm/nonmatchings/libgpu2", GetGraphType);
INCLUDE_ASM("asm/nonmatchings/libgpu2", GetGraphDebug);
INCLUDE_ASM("asm/nonmatchings/libgpu2", DrawSyncCallback);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_80059658);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_800596F4);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_80059760);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_604);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_640);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_80059888);
INCLUDE_ASM("asm/nonmatchings/libgpu2", ClearImage2);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_800599B8);
INCLUDE_ASM("asm/nonmatchings/libgpu2", StoreImage);
INCLUDE_ASM("asm/nonmatchings/libgpu2", MoveImage);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_8F4);
INCLUDE_ASM("asm/nonmatchings/libgpu2", ClearOTag);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_80059BFC);
INCLUDE_ASM("asm/nonmatchings/libgpu2", DrawPrim);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_80059CF4);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_80059D68);
INCLUDE_ASM("asm/nonmatchings/libgpu2", DrawOTagEnv);
INCLUDE_ASM("asm/nonmatchings/libgpu2", GetDrawEnv);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_80059FC0);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_E34);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_F00);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_F24);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_F58);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_FD8);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_1034);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_11C0);
INCLUDE_ASM("asm/nonmatchings/libgpu2", GetDispEnv);
INCLUDE_ASM("asm/nonmatchings/libgpu2", GetODE);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SetTexWindow);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SetDrawArea);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SetDrawOffset);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SetPriority);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005A600);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SetDrawEnv);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_1578);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005A870);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_1790);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_18AC);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005AB00);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_191C);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005AB58);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_1964);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_19A4);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_19D8);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005AC24);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_1A30);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_1A70);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_1AA4);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005ACF0);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_1AF0);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005AD34);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_1B78);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005ADB8);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_1BC4);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_1C28);
void SYS_OBJ_1C2C(void) {
}
INCLUDE_ASM("asm/nonmatchings/libgpu2", _status);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005AE80);
INCLUDE_ASM("asm/nonmatchings/libgpu2", _clr);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_1D84);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_1DC0);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_1F64);
INCLUDE_ASM("asm/nonmatchings/libgpu2", _dws);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_1FF4);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_202C);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_21A4);
INCLUDE_ASM("asm/nonmatchings/libgpu2", _drs);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_222C);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_2264);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_242C);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005B684);
INCLUDE_ASM("asm/nonmatchings/libgpu2", _getctl);
INCLUDE_ASM("asm/nonmatchings/libgpu2", _cwb);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005B710);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005B75C);
INCLUDE_ASM("asm/nonmatchings/libgpu2", _addque);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005B7B0);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005B7E4);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_25C8);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_26EC);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_27A8);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_283C);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005BA90);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005BD7C);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_2C6C);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005BED8);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_2CC4);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_2CDC);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_2DD8);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005C020);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005C054);
INCLUDE_ASM("asm/nonmatchings/libgpu2", SYS_OBJ_2F7C);
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005C1C0);
void SYS_OBJ_3060(void) {
}
INCLUDE_ASM("asm/nonmatchings/libgpu2", func_8005C29C);