diff --git a/docs/dev/findings-index.csv b/docs/dev/findings-index.csv index 8e8df50b..993f16e9 100644 --- a/docs/dev/findings-index.csv +++ b/docs/dev/findings-index.csv @@ -218,4 +218,5 @@ D336,FIXED,"Frigate (and any level) ""all polygons break except the gun"" after D337,FIXED,Aim modes folded (user decision):,FIXED (2026-09-26 bookkeeping: D338,FIXED,"Input.AimRange (F10 ""Aim range""):",FIXED (2026-09-26 bookkeeping: D339,OPEN,"#92 (low-end ~30 fps, Celeron N3060 / HD 400) —","OPEN (2026-09-26, user:" -D341,FIXED,"Intro gun-barrel blood drip draws as static blocks/lines instead of dripping (user, v0.4.0, 2026-09-26; death blood fine).",FIXED (M-201): two fast3d defects — +D341,FIXED,"Intro gun-barrel blood drip draws as static blocks/lines instead of dripping (user, v0.4.0, 2026-09-26; death blood fine).","FIXED (M-201, user-verified 2026-09-27):" +D342,FIXED,"File select: folder bodies and Bond photos vanish after selecting a file and backing out (user, v0.4.0, 2026-09-26).","FIXED (M-201, user-verified):" diff --git a/docs/dev/findings.md b/docs/dev/findings.md index e68195b1..5e51552b 100644 --- a/docs/dev/findings.md +++ b/docs/dev/findings.md @@ -626,7 +626,8 @@ covers D24–D69; the log continues in §H (D32 procedure, D70–D121). | D337 | **Aim modes folded (user decision): N64 (default) = the N64 aim model with the mouse fed through the game's integrator at PD's damp (D332 made default); CENTRED (PC) opt-in; Q/L and Toggle-aim now route mouse aim like RMB; pad/keyboard aim no longer swallowed by the mouse integration.** — full `## D337` entry at file tail | FIXED (2026-09-26 bookkeeping: shipped; user reports it feels good in v0.4.0 play). Earlier: IMPLEMENTED (port/src/input.c + optionsoverlay.c); headless-measured with new scripted-mouse harness; golden 3/3; Win + Linux builds. Open: N64-range calibration decision. | | D338 | **`Input.AimRange` (F10 "Aim range"): PC (default, GEPD/mouse-injector full-screen crosshair) or N64 (original stick limits: 65% of half-width, camera turn from ~49%).** — full `## D338` entry at file tail | FIXED (2026-09-26 bookkeeping: shipped; user reports it feels good in v0.4.0 play). Earlier: IMPLEMENTED + measured (PC 98%/72%, N64 65%/49%); golden 3/3; Win + Linux builds. | | D339 | **#92 (low-end ~30 fps, Celeron N3060 / HD 400) — measured CPU budget: game thread ~0.2–0.35 ms/frame, render-thread display-list pass 0.4–1.8 ms/frame on this box; CPU very likely not the bottleneck. New `GE_PERFSTAT=1` probe (render phases, tris/batches, game-thread busy, GPU timer query).** — full `## D339` entry at file tail | OPEN (2026-09-26, user: review toward the end of v0.4.0; needs a test machine with similar HD 400-class hardware). Earlier: INVESTIGATING — probe landed; target-hardware numbers needed before any fix. | -| D341 | **Intro gun-barrel blood drip draws as static blocks/lines instead of dripping (user, v0.4.0, 2026-09-26; death blood fine).** — full `## D341` entry at file tail | FIXED (M-201): two fast3d defects — the 1-cycle blood texrect sampled a stale tile-1 declaration via the D236 LOD rule, and the in-place-regenerated dyn-pool texture hit a stale address-keyed cache entry. | +| D341 | **Intro gun-barrel blood drip draws as static blocks/lines instead of dripping (user, v0.4.0, 2026-09-26; death blood fine).** — full `## D341` entry at file tail | FIXED (M-201, user-verified 2026-09-27): two fast3d defects — the 1-cycle blood texrect sampled a stale tile-1 declaration via the D236 LOD rule, and the in-place-regenerated dyn-pool texture hit a stale address-keyed cache entry. | +| D342 | **File select: folder bodies and Bond photos vanish after selecting a file and backing out (user, v0.4.0, 2026-09-26).** — full `## D342` entry at file tail | FIXED (M-201, user-verified): scratch placed at the N64 offset +0xA000 of `ptr_logo_and_walletbond_DL` landed inside the larger PC wallet model; moved past its 0x17000 reservation. | Phase 2 replaced the Phase-1 demo loop with the real `mainproc()` on real OS threads, compiled GE's real `src/sched.c`, and brought in PD's fast3d software @@ -12279,7 +12280,7 @@ Adversarial pre-ship review of the whole v0.3.0 window (147 commits since v0.2.2 - **Fix:** size op-22 vertex regions as `16*4*nv` in both tools. `d43_emit.py ntsc-final` re-run: ALL CHECKS PASSED (round-trip field validation, region tiling, buffer bounds); 512 sidecars regenerated. After: `src[6..7]=(289,±20)` real arm vertices; the M16 renders a clean 6-arm star (`scratch/d303_after.png`). Affects every star-flash weapon. Golden gate 3/3. - **Note:** `data/pcmodels-*` is generated (gitignored). Existing installs must re-run `python3 tools_pc/d43_emit.py `; bundles run the shipped emitter. -**Status: FIXED (M-201, headless-verified 2026-09-26; user visual check owed).** +**Status: FIXED (M-201, user-verified 2026-09-27).** ## D304 — Mouse sensitivity menu overhaul (user request, 2026-09-18): aim speed/turn speed sliders weren't "1:1" and had too little range. @@ -13510,5 +13511,19 @@ Implemented as `Input.PdMouseAim` (**default off**, because it changes aim feel) **Verified:** headless boot capture — the blood now runs down from the top over the gun barrel as on N64 (`scratch/blood_after.png`). Golden gate 3/3. User visual check owed. -**Status: FIXED (M-201, headless-verified 2026-09-26).** +**Status: FIXED (M-201, user-verified 2026-09-27).** + +## D342 — File select: folder bodies and Bond photos vanish after selecting a file and backing out (M-201, 2026-09-26) + +**Report:** select a file, back out to file select: the folders draw only their outlines; bodies and Bond photos are gone. Reproduced headless (`SkipIntro=1`, `GE_INPUTSCRIPT="400:A;700:B"`). + +**Cause (layout-only, A1-adjacent):** the file-select folders are `PROP_WALLETBOND` model instances loaded at the start of `ptr_logo_and_walletbond_DL`. On PC that model expands to 0x1664C bytes and was given a 0x17000 reservation (D45) instead of N64's 0xA000, but two users of the space AFTER it kept the N64 offset `4096*10` (+0xA000): `init_menu05_fileselect`'s scratch DL (budget 0x6e000) and `load_briefing_text_for_stage` (briefing data). On PC both write into the middle of the wallet model. `load_walletbond` only reloads the model when the instances were freed (coming from the legal screen), so after main menu → back, the overwritten model was drawn: outlines intact, body/photo geometry corrupt. + +**Ruled out first:** GL texture-cache staleness on pool reuse (a queued texLoad-address invalidation made no difference; reverted). + +**Fix (`src/game/front.c`, `#ifdef PORT`):** both sites use `ptr_logo_and_walletbond_DL + 0x17000`. The budget is unchanged: 0x85000 (PC buffer) - 0x17000 == 0x78000 - 0xA000 == 0x6e000. + +**Verified:** user playtest (select/back out repeatedly, folders and photos intact); golden gate 3/3. + +**Status: FIXED (M-201, user-verified 2026-09-27).** diff --git a/docs/porting-notes.md b/docs/porting-notes.md index 1e84b09b..9fcde9d2 100644 --- a/docs/porting-notes.md +++ b/docs/porting-notes.md @@ -277,6 +277,10 @@ IDO accepts a struct that redeclares an inherited member name (`inherits ObjectR The offline model converter sizes each record's trailing arrays from its count field. Check what the *runtime consumer* does with that count before trusting its name: GE's op-22 `DisplayListPrimaryRecord.numVertices` is really the number of star-flash ARMS, and `dorottex()` reads `count*4` vertices (PD names it `stargunfire.unk00` and reads `unk00*4`). Sizing by the field name dropped 3/4 of every muzzle star; the missing vertices came from neighbouring sidecar bytes and drew as spikes. For every record type, derive the copied extent from the reading loop, and cross-check PD's typed struct. +### A-buf. Growing one region of a shared buffer must move every hard-coded offset after it (D342) + +When a PC-larger asset gets a bigger reservation inside a shared scratch buffer (D45: the wallet model 0xA000 -> 0x17000 in `ptr_logo_and_walletbond_DL`), grep for every other user of that buffer that computes a fixed offset (`base + 4096*10`). Those still point into the old boundary and silently overwrite the enlarged asset; the corruption only shows when the asset is not reloaded. + ## B. 16-byte PC `Gfx` / `Vtx` vs 8-byte N64 Any buffer reservation, `memcpy` size, slot stride, or pool budget diff --git a/src/game/front.c b/src/game/front.c index e76fcd92..310eceee 100644 --- a/src/game/front.c +++ b/src/game/front.c @@ -2206,7 +2206,17 @@ void frontCleanUpWalletBond(void) void init_menu05_fileselect(void) { s32 size = 0x6e000; +#ifdef PORT + /* File-select folders (M-201): the PC wallet model is 0x1664C bytes and + * loads at the start of this buffer with a 0x17000 reservation (D45, see + * load_walletbond), not N64's 0xA000. Scratch placed after it at the N64 + * offset 4096*10 landed INSIDE the wallet model, corrupting the folder + * body/photo geometry once written. Same N64 budget: 0x85000 - 0x17000 + * == 0x78000 - 0xA000 == 0x6e000. Layout-only. */ + Gfx* DL = (Gfx *)(ptr_logo_and_walletbond_DL + 0x17000); +#else Gfx* DL = (s32)(ptr_logo_and_walletbond_DL) + (s32)(4096*10); +#endif int i; prev_keypresses = FALSE; @@ -6612,7 +6622,15 @@ void load_briefing_text_for_stage(void) s32 argg; // what is this +#ifdef PORT + /* File-select folders (M-201): past the PC wallet model's 0x17000 + * reservation (see init_menu05_fileselect). The briefing data loaded here + * overwrote the wallet model tail -> folder bodies/photos vanished after + * backing out of a file. Layout-only. */ + temp_s0 = (Gfx *)(ptr_logo_and_walletbond_DL + 0x17000); +#else temp_s0 = (s32)(ptr_logo_and_walletbond_DL) + (s32)(4096*10); +#endif // alright argg = 0x200;