mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 10:19:47 -04:00
1e28a9455a
The far backdrop (ocean/cloud/distant mountain) is GTE-projected 3D drawn by the main-EXE driver FUN_8004db3c (sole caller of the GTE emitter FUN_80027600). The global widescreen GTE X-squash compresses it toward centre, so its geometry falls short of the revealed 16:9 edges -> blue void that pops as the camera moves. Fix: bracket the backdrop driver with gte_ws_set_suppress(1)/(0) so its draws skip the X-squash and fill the stretched frame (skybox treatment), while the near 3D world keeps the wider FOV. FUN_8004db3c draws a MIX (far backdrop + nearer props/scenery), so the suppress is DEPTH-GATED in gte_rtps_internal: only vertices with projected SZ >= s_ws_far_threshold (default 900, tunable live via the ws_far_threshold TCP cmd) un-squash; nearer props stay squashed and aligned. Validated: threshold 900 fills the void, keeps the foreground door + background scenery (path/tree) aligned. Residual: the mountain grass-top straddles the depth band (per-vertex limitation) -> flickers when the camera dips; this is the checkpoint before exploring native-wide rendering to remove the squash (and this whole artifact class) entirely. Mechanism: - recompiler: [widescreen.backdrop] unsquash_funcs emits gte_ws_set_suppress(1) at entry + (0) before each jr-$ra return (code_generator + config_loader + main_psx). Main-EXE -> regen-class. - runtime: gte.cpp depth-gated squash + s_ws_far_threshold; cpu_state.h decl; debug_server.c ws_aspect (live squash on/off) + ws_far_threshold (set split + read SZ stats) diagnostics. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>