mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 10:19:47 -04:00
ee09ab9bbb
Adds full 16:9/21:9 native-wide support for fully-3D titles (Ape Escape, SCUS-94423) as a generic, opt-in, 4:3-byte-identical framework capability, plus a native-wide GL compositor perf fix and a cutscene present-mode flicker fix. Widescreen (generic, per-game opt-in via [widescreen*]): - Shared screen-extent cull detector (runtime/include/ws_cull_detect.h) used by all three backends (recompiler, dirty-RAM interp, sljit). Per-game signature immediates ([widescreen.cull] screen_w_imms/screen_h_imms) — Ape's funnel tests 0x181/0xF1 on its 368px display, not Tomba's 0x140/0xE0. - Three funnel idioms widened: unsigned per-vertex sltiu (psx_ws_cull_sltiu), signed min/max slti right edge + bare-bltz left edge (psx_ws_cull_slti/bltz, new helpers + SLJIT_HLP appends), and billboard center+/-halfwidth. Explicit [widescreen.cull] slti_sites for X-only funnels the auto-detector can't qualify. - gte_game_mode: GTE-activity gameplay detector for 3D titles with no sprite-tag helper (gte.cpp notes every RTPS/RTPT). STICKY (>=3 verts, 45-frame hysteresis) so sparse cutscene frames never flip to a 4:3 pillarbox = fixes intro flicker. - nw_hud_corners: push outer-third screen-space HUD sprites to the true wide corners in native-wide (else inset by the reveal). - nw_backdrop: stretch a full-frame axis-aligned 2D backdrop quad to fill the wide frame (for titles with a flat sky plane). - Pattern-scanned interp/sljit widen hooks now gated per-game (auto_screen_x / auto_backdrop): fixes an ungated auto_backdrop false-positive that rewrote a live GPR = the ~24s native-wide crash on Ape. Native-wide GL perf (fixes 16:9 frame drops): - The wide surface centre equals the canonical 4:3 framebuffer, so wide_blit_center copies canonical->wide-centre at present (both present paths) and the per-prim mirror SKIPS prims fully inside the 4:3 frame (mirror_x/geo/batch_center_only). Only reveal-margin prims re-rasterize. Peak frame time 38.8ms -> 17.5ms, no vsync misses. Toggle gl_wide_fast; 4:3 untouched (all gated on g_wide_cur). Runtime-only except the recompiler cull emit (regen needed for cull widening). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>