mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 10:19:47 -04:00
dd867215af
Two opt-in [video] keys for titles whose build carries the PGXP hooks, both live-tunable through the TCP pgxp verb. Defaults keep today's behaviour. pgxp_position_fallback (default true). false skips the position-cache tier in pgxp_get_precise_vertex and stops gte.cpp filling it. At hook-build coverage the cache only hands unrelated 3D fractions to CPU-built 2D polygons (a HUD needle, menus). Beetle and DuckStation leave their vertex cache off by default. pgxp_preserve_projection (default false). true makes RTPS/RTPT shadow the exact projection, from the unshifted MACs and a true divide (pgxp_project_precise), instead of the GTE's integer-IR one. That removes the residual wobble of near geometry. Guest SXY, MAC0 and FLAG are untouched. Only sf=1 vertices with no IR, SZ3 or divide saturation qualify, and the rest keep the IR path. The exact position can sit a little below the guest integer or more than a pixel above it, so truncation agreement becomes the window -4 < precise - native < 5 px, a sanity bound over the IR path's own error (on R4 every on-screen vertex falls within -1.9 .. +2.6 px). A packet half at or beyond the GTE saturation limit must still agree exactly. The tolerance clamp now measures the offset both ways. [widescreen] precise_nclip reads the same shadows, so in a title that sets both, its branch sign follows the exact projection too. Observability: geom_correction reports both switches, ppp_produced, and geometry-corrected triangles split into all-precise, mixed and native. The mixed share is the mesh-cracking exposure of G1.1. Tests: pgxp_test (fallback off, window edges, saturation, two-sided tolerance, the exact projection and its qualifiers, triangle census); gte_register_access_test (RTPS/RTPT guest state equals the oracle with the mode on, and the shadow is the exact projection); video settings test (defaults, parsing, type check). gpu_gp0_history_guard_test's gpu.c stubs gain pgxp_note_triangle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>