Commit Graph

2865 Commits

Author SHA1 Message Date
Shokunin 7d56562066 PGXP colour: Smooth motion test covers it; setter syncs with the render thread
gl_renderer_set_pgxp_color_perspective syncs with a live render thread
(GL_RT_SYNC) and counts as a PGXP renderer feature for the per-triangle
depth command. gl_frame_gen_test's PGXP pass runs depth, colour and both:
the scene's SZ now differs per vertex (colour) with rows ordered far to
the right (depth), and the in-between frame at phase 1 must equal the real
frame with each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 02:39:11 -07:00
Shokunin 799d3ece7c Regenerate the OpenBIOS emitter stamp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 02:39:11 -07:00
Shokunin a3293573d1 PGXP perspective-correct Gouraud colour (opt-in)
[video] pgxp_color_correction (default off; PSX_PGXP_COLOR overrides). Gouraud
colour on PGXP 3D triangles interpolates with 1/SZ; textured triangles with
perspective UVs share their w. The flag rides in the per-vertex PGXP code the
depth buffer already carries (sz + 65536).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 02:39:03 -07:00
Shokunin dc2cd301d3 PGXP depth: no cost when off; render-thread-safe setters; Smooth motion honours depth
- gpu.c sends gr_set_depth_triangle only while a PGXP renderer feature is
  on (gl_renderer_pgxp_render_wanted): no RTH_DEPTH per triangle otherwise.
- The SZ rides in the textured vertex's unused colour alpha, so TEXV stays
  26 floats for every title.
- gl_renderer_set_pgxp_depth / _threshold / pgxp_render_stats sync with a
  live render thread (GL_RT_SYNC) like their neighbours.
- A depth-mode change is its own batch-break reason (7); batch_diag returns
  all eight reasons.
- Smooth-motion in-between frames replay RTH_DEPTH and test depth from
  their own clear; gl_frame_gen_test gains a PGXP pass (overlapping 3D
  triangles out of painter order) where the in-between frame must match
  the real one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 02:38:58 -07:00
Shokunin d89a27fd9b Regenerate the OpenBIOS emitter stamp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 02:38:58 -07:00
Shokunin 2a139843c1 PGXP depth: near-camera triangles stay painter-ordered; clear per frame
Triangles with a vertex nearer than SZ 1024 (PSX_PGXP_DEPTH_NEAR) stay out of
the depth buffer, the tolerance gains an absolute 48 SZ, and every displayed
frame starts with a cleared depth buffer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 02:38:41 -07:00
Shokunin 4c4f90e12a PGXP depth: relative tolerance keeps decals in painter order
A 3D batch is two passes: colour tests against depth pulled toward the
camera by 2% of the distance (PSX_PGXP_DEPTH_TOL) and writes none; a
colourless pass then writes the true depth. Lane markings drawn after the
road a hair off its plane stay whole.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 02:38:41 -07:00
Shokunin 2a36efcacb PGXP depth buffer for opaque 3D polygons (opt-in)
[video] pgxp_depth_buffer (default off; PSX_PGXP_DEPTH overrides) and
pgxp_depth_threshold. gpu.c hands the GL backend each triangle's GTE SZ when
all three vertices are dataflow-precise (gr_set_depth_triangle); the backend
draws those opaque triangles with a LEQUAL depth test and write. 2D,
unproven, semi-transparent polygons, lines and rectangles never test or
write. Depth mode is a batch key and rides in every high-resolution-window,
native-wide and render-thread replay command. Clears are colourless
depth-only draws through the flat batch: after a drawing-area change or a
fill, and when the average SZ rises by the threshold (4096, as DuckStation).
Generated (Smooth motion) frames draw without depth.

Docs: ENHANCEMENTS.md G1.14.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 02:38:41 -07:00
Matt Stanley cbfd24fda5 Merge pull request #577 from RetroPortingToolKit/integrate/pr561-guest-cycle-scale-20261008
Land approved guest cycle scaling from #561
2026-10-07 22:16:42 -07:00
Shokunin cba31b1923 guest_cycle_scale: range-check TOML integers before narrowing
Reject negative and >32-bit addr/value/size/mask in guest_cycle_scale_gate
and out-of-range guest_cycle_scale instead of wrapping or clamping; add
regression cases. Regenerate the OpenBIOS emitter stamp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 21:49:37 -07:00
Shokunin 91cd6db705 guest_cycle_scale: one CPU charge for every tier, declarative gate, rollback
Review of #561. Guest time now has two entry points (psx_cycles.h): the
CPU charge psx_cpu_charge() (instruction base, load fudge/region/completion,
i-cache refills, BIOS HLE costs), which applies [timing] guest_cycle_scale,
and the unscaled device advance psx_advance_cycles() (DMA, idle skips,
mul/div and GTE deadline waits). The emitters' block-mode charges emit
psx_cpu_charge; overlay DLLs accumulate it raw and publish through the
cpu_charge callback (was advance_cycles, same slot) into the same host
function, so nothing is scaled at the DLL boundary. The batched
psx_cyc_charge path, the dirty-RAM interpreter, psx_cyc_readmem, i-cache
refills and bios_hle.c all charge through it. At scale 1 it is exactly
psx_advance_cycles.

Gate in psxrecomp: [timing] guest_cycle_scale_gate, RAM predicates judged
at every VBlank edge (deterministic, works online, no mod needed), plus
psx_mod_set_guest_cycle_scale_gate() in mod_plugins.h for custom logic or
to tie the scale to a mod (guest_cycle_scale_gated = true; every mod
session reset shuts it). The carried fraction and both gate states are a
boot_state section (BS_SEC_GCS, written only when the scale is not 1), so
savestates and the netplay rollback snapshot re-simulate the same cycles.
psx_guest_cycle_scale_gate_test pins tier identity, the gates and rollback
re-simulation against the real psx_cycles.c.

OpenBIOS regenerated (emitter stamp); retail SCPH1001 is not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 21:41:39 -07:00
Shokunin 1e6e43639a Title timing constant: [timing] guest_cycle_scale (and _gated)
No CPU is emulated: recompiled code charges the guest clock a fixed cost
per instruction. guest_cycle_scale = N charges 1/N of it (instruction,
load, mul/div, GTE latencies, overlay DLL batches) while VBlank, timers,
CD, SPU and DMA keep hardware time, so the game never runs out of frame
time. A title constant in game.toml (1 = faithful, 1..64), never a player
setting; guest_cycle_scale_gated applies it only while the title's mod
opens the gate (psx_guest_cycle_scale_gate_open). PSX_GUEST_CYCLE_SCALE
overrides for testing. A scale other than 1 is folded into the netplay
content fingerprint as a safety net.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 21:41:34 -07:00
Matt Stanley 1cf45e45cd Merge pull request #574 from RetroPortingToolKit/fix/parappa-audio-buffer-target
Honor game audio buffer_ms in the SDL audio bridge
2026-10-07 21:17:41 -07:00
Matt Stanley 3b2c0bb1b4 Merge pull request #575 from RetroPortingToolKit/chore/untrack-scph1001-generated
Stop tracking SCPH1001 generated sources
2026-10-07 20:57:10 -07:00
Matthew Stanley b6e34d24e3 Stop tracking SCPH1001 generated sources
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 20:56:48 -07:00
Matthew Stanley 0e9845a07b Honor configured audio buffer target in SDL bridge 2026-10-07 20:35:02 -07:00
Matt Stanley 9e19229a9a Merge pull request #573 from RetroPortingToolKit/land/hfr-framework-20261007
Land feat/high-frame-rate framework work on master
2026-10-07 20:06:29 -07:00
Matthew Stanley e9fbe0d1b3 ws_backdrop_scene_test: stub the GPU packet key gpu.c now calls
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 18:21:00 -07:00
Matthew Stanley e080f9fab7 TCP_COMMANDS: regenerate the command index (host_profile)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 18:20:59 -07:00
Matthew Stanley bd10ee3ba4 Regenerate BIOS emitter stamps (SCPH1001, OpenBIOS)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 18:20:59 -07:00
Matthew Stanley 7bcb11916a GPU packet keys keep the enhancement aperture apart from the main RAM it aliases
The UI prepass re-read aperture node payloads through the RAM-folded key, so
THPS2's relocated prim arena discarded the HUD squash every frame.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit fd6267e952)
2026-10-07 18:20:59 -07:00
Matthew Stanley 12036fab6e ws_ui_groups: count why a UI prepass was discarded
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit edd67d848e)
2026-10-07 18:20:59 -07:00
Matthew Stanley c55ddc4f29 Widescreen HUD size: proportional option shrinks the auto-UI HUD beyond 16:9
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 41a9889566)
2026-10-07 18:20:59 -07:00
Matthew Stanley e5198880ef RENDER_PASSES: mod arenas in the pass sandbox
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 4121c6c6dd)
2026-10-07 18:20:59 -07:00
Matthew Stanley 3431e2e2a8 Render passes capture the part of the buffer the presenter shows (netplay local viewport)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit d4b2ec0828)
2026-10-07 18:20:59 -07:00
Matthew Stanley 9379df8f12 Render passes in netplay dual raster; verify mode checks the whole CPU VRAM
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 2a46b01374)
2026-10-07 18:20:58 -07:00
Matthew Stanley 14237c6beb Port-2 injection: release the pad when the injection ends
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 701f54eb0b)
2026-10-07 18:20:58 -07:00
Matthew Stanley e28f7f18ee Host sampler: accessors in every build; tools/host_profile.py names hot functions
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit a51504fd3b)
2026-10-07 18:20:58 -07:00
Matthew Stanley 9af4abb94f Widescreen prepass: validate DMA nodes through an address index, not a scan per node
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 1ba6c41595)
2026-10-07 18:20:58 -07:00
Matthew Stanley 9032b1005e Always-on host CPU sampler ring (TCP host_profile)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 0901bb8b1e)
2026-10-07 18:20:58 -07:00
Matthew Stanley eb783e15ed Motion kit: blend mirrored orthonormal bases; snap a handedness change
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 487224cd9c)
2026-10-07 18:20:57 -07:00
Matthew Stanley 3cd6d2d1e0 TCP_COMMANDS: document the input port parameter
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 075553beed)
2026-10-07 18:20:57 -07:00
Matthew Stanley dd64bc6611 TCP input injection for port 2 (set_input/press/clear_input port=2)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 66cc81fe63)
2026-10-07 18:20:57 -07:00
Matt Stanley e372fe2f22 Merge pull request #572 from RetroPortingToolKit/fix/village-ws-margins-20261007
Native-wide: present finite 2D backdrop scenes at 4:3
2026-10-07 17:51:12 -07:00
Matthew Stanley 4b4fddb769 Present finite 2D backdrop scenes at 4:3 in native-wide
A full-screen rect backdrop that stops short of the reveal vetoes polygon overhang (Tomba village, beads-eio.4.28).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 17:46:17 -07:00
Matt Stanley edecdd1d3a Merge pull request #570 from RetroPortingToolKit/review/pr502-hd-exclusive-safety-20261007
Integrate validated rendering pipeline with native-VRAM and HD safety
2026-10-07 15:42:55 -07:00
Matthew Stanley bbd71522d5 Record PR569 ancestry; its tested fix is already included 2026-10-07 15:38:53 -07:00
Matthew Stanley 4dabdabb12 Record refreshed rendering-stack ancestry preserving tested safety fixes 2026-10-07 15:38:52 -07:00
Matthew Stanley be2bfbf6b4 test: retain refreshed HD provenance fixture stubs 2026-10-07 15:38:52 -07:00
Matthew Stanley c20c05ccc0 fix: keep HD texture authority on the synchronous renderer 2026-10-07 15:03:51 -07:00
Shokunin 86b15cfbbb Frame generation: in-between frames never rasterize native VRAM
Under HD texture-pack authority (and dual-raster netplay) every draw was
also rasterized into CPU VRAM unless a render pass was active. Replayed
draws of a generated frame were not exempt, so each in-between frame wrote
interpolated geometry into the guest's native VRAM. They are presentation
only, like a pass. Fixture: compose under HD authority, VRAM unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 14:51:50 -07:00
Matthew Stanley b620b13837 Integrate current framework master without dropping texture fixes 2026-10-07 14:39:05 -07:00
Matthew Stanley 7547d9257a Integrate refreshed rendering stack preserving validated retail BIOS stamp 2026-10-07 14:39:05 -07:00
Shokunin 7692b8134d Frame generation: in-between frames never rasterize native VRAM
Under HD texture-pack authority (and dual-raster netplay) every draw was
also rasterized into CPU VRAM unless a render pass was active. Replayed
draws of a generated frame were not exempt, so each in-between frame wrote
interpolated geometry into the guest's native VRAM. They are presentation
only, like a pass. Fixture: compose under HD authority, VRAM unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 14:32:36 -07:00
Shokunin d29390a85d Regenerate the OpenBIOS emitter stamp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 14:32:36 -07:00
Shokunin ae4f45f2c3 Call frame generation "Smooth motion" in user-visible text
Log lines and doc headings say "Smooth motion (frame generation)", the
player-facing name. Config key [video] frame_generation and PSX_FRAME_GEN
are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 14:32:36 -07:00
Shokunin 4f25e6de83 Pipeline toggles as player settings and launcher rows
render_thread, present_thread and frame_generation are read from the
player's settings.toml [video] (over the game.toml default; PSX_* env
still overrides one run and is never saved), written back by
save_user_settings, and round-tripped through the recomp-ui Display rows
when the launcher defines RECOMP_LAUNCHER_HAS_RENDER_PIPELINE. The
pipeline starts once at boot: a first-boot launcher choice applies
immediately, an in-game change is saved and applies at next launch.
Regenerated the OpenBIOS emitter stamp for the config_loader change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 14:32:36 -07:00
Shokunin 38fbe239f1 Test: GP0 history guard fixture stubs the frame-generation hooks
gpu.c's precise-triangle path references Smooth motion's vertex sources;
the software-only fixture never reaches them (abort if it does).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 14:32:36 -07:00
Shokunin f4160b55d9 Test: GPU exec fixtures stub the frame-generation vertex-source hooks
gpu.c asks the GL backend and gte.cpp for Smooth motion's vertex sources;
master's native_wide_projection_test (cd9981cd) links gpu.c with these stubs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 14:32:36 -07:00
Shokunin 22fe3669cf Frame generation: shared corners are one vertex; no motion rounding
The remaining tunnel cracks came from vertex sources, not from missing
depth: 46 % of R4 lookups were marked ambiguous because the same 3D point
is projected several times per frame (corners shared by separate meshes,
other functions), so those vertices fell back to a triangle-mean guess.
- The same point projected again is one vertex (the smaller identity, so
  the choice does not follow draw order).
- Up to two different points on one pixel are kept; gpu.c picks the one
  projected by the same function as the triangle's other vertices, else
  the one nearest their depth.
- Per-vertex motion is no longer rounded to 1/8 px: at high internal
  scales the rounding opened hairlines along long T-junction seams.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 14:32:36 -07:00