Commit Graph

479 Commits

Author SHA1 Message Date
Matthew Stanley fee33960cd Compose analog routes with port and post-load admission; regenerate BIOS dispatcher 2026-10-24 09:51:59 -07:00
Matthew Stanley d04fa8f10d Apply TCP debug policy on every game session
Start a newly selected production listener on offline rematch, reuse an existing listener, and cleanly release its transport state when disabled. Balance Winsock ownership and failed starts. Native production runtime and four focused tests pass, including six isolated real listener/bulk-write launch cases. Tracking: beads-eio.3.385.
2026-10-24 09:36:58 -07:00
Matthew Stanley 4979d99ab3 Add opt-in production TCP debugging and bulk RAM writes 2026-10-24 09:36:24 -07:00
Matthew Stanley 2043d8274b Review integration: exclusive multiplayer profiles and local grids
# Conflicts:
#	docs/MOD_PACKAGES.md
#	generated/OpenBIOS.emitter.sha
#	runtime/src/debug_server.c
#	runtime/tests/test_mod_runtime.cpp
2026-10-24 09:35:23 -07:00
Matthew Stanley 9bbd395f58 Review integration: guarded function override lifecycle
# Conflicts:
#	docs/TCP_COMMANDS.md
2026-10-24 09:32:39 -07:00
Matthew Stanley 98e8bcda23 Review integration: postfx publication and bounded diagnostics
# Conflicts:
#	runtime/CMakeLists.txt
2026-10-24 09:28:59 -07:00
Matthew Stanley d2e1629aca Review integration: review/717-residency-20261024
# Conflicts:
#	runtime/src/debug_server.c
#	runtime/tests/test_duckstation_texture_pack.cpp
2026-10-24 09:28:21 -07:00
Matthew Stanley 7a0ba0e509 Review integration: review/703-encoder-lifecycle-20261024
# Conflicts:
#	docs/TCP_COMMANDS.md
2026-10-24 09:27:56 -07:00
Matthew Stanley e706b9d84f Publish coherent postfx projection and escape bounded diagnostic JSON 2026-10-24 09:26:47 -07:00
Henrique Guedes 4cbedf5579 Add function overrides with guarded registration and cycle credit on current runtime 2026-10-24 09:18:57 -07:00
yacineolivier-maker aed7b1be1e HD textures: filtered sampling, a cache sized for a whole pack, indexed keys
- Filtered replacement sampling: with any texture filter but nearest, the
  replacement is sampled through its mip chain (textureGrad), the footprint
  clamped to the primitive's own UV bounds so atlas neighbours cannot bleed
  in. Texture windows (repeat) and UVs outside the page keep hd_texel.
- Edge clamp: an out-of-bounds sample clamped to the primitive's UV bounds
  takes the edge's sub-texel position too (keeping the outside fraction read
  a 1 px sliver of the next glyph at sprite borders).
- GL cache: 4096 slots and a PSX_HD_GL_CACHE_MIB budget (default 2048 MiB)
  with a direct-mapped hint table; a 4x pack of one race scene is several
  hundred textures, and the old 256 slot / 128 MiB cache re-uploaded and
  re-mipped them every frame.
- Invalidation: duck_texture_pack_invalidate returns early when a native
  write touches no residency or cache entry (almost every draw under HD
  authority lands on the frame buffer), and retire_unused walks the
  residency lists once instead of once per source.
- Indexed replacements: a TTTTTTTT-index.png key resolves through the palette
  in use at draw time, for packs whose textures are shared by several CLUTs.
- Debug: TCP {"cmd":"hd_uploads","x":..,"y":..} lists the texture uploads
  covering a VRAM point (pack authoring).

Measured with a full HD HUD and course pack for R4: steady 60 fps in races
where the old cache dropped to the high 20s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rkyma8rbyPiccs9n2bkyG6
2026-10-24 09:04:34 -07:00
yacineolivier-maker 3ad83c910b Post effects: depth and history inputs, u_time / u_proj, live uniforms
For title-specific lighting presets ([video] post_shader):
- `input <sampler> depth`: view depth sz (GTE screen z) of the presented frame,
  R32F at window size, rebuilt from the surfaces' PGXP depth; 0 where nothing
  3D drew. Only built while a loaded chain reads it.
- `input <sampler> history`: the pass's own target from the last real frame
  (trails, temporal filters); generated frames do not update it.
- `u_time` (seconds since the chain loaded) and `u_proj` (latest GTE
  projection: 240/H, screen centre in uv, aspect) in every pass.
- Live uniforms: psx_host_set_post_uniform(name, x, y, z, w) sets a preset
  `uniform` from game state (e.g. a light source projected to the screen);
  the preset value applies until the first call.
- Debug: TCP {"cmd":"post_shader"} reports the loaded preset, its parse status
  and the live values; {"cmd":"post_shader","path":"..."} reloads a preset
  (or loads another) without restarting, for shader work.
docs/POST_EFFECTS.md documents the inputs and the uniforms.

Used by a lighting preset for R4 (sun and tunnel light shafts, lamp halos,
speed streaks, paint reflections on the player's car from live car pose),
about 0.7 ms of GPU at 1080p on an RTX 3060.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rkyma8rbyPiccs9n2bkyG6
2026-10-24 09:04:33 -07:00
Matthew Stanley 7f0f77b9e1 WIP: video recorder, offscreen window, input_route axes
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 08:52:20 -07:00
Matthew Stanley 182ea3d8d3 Merge branch 'review/718-fmv-safety-20261024' into review/psx-prs-20261024
# Conflicts:
#	runtime/src/debug_server.c
2026-10-24 08:52:19 -07:00
Matthew Stanley 6640236dd8 Bound HD movie allocations and join decoder workers at teardown
Reject invalid index products and unsafe paths, cap encoded/decoded residency, recover allocation and partial worker-start failures, release GL movie textures with their context, and serialize diagnostics through the presenter. Real SDL decode/restart/failure test passes and SDL2 C seam compiles warning-free. Guest/present timestamp ownership remains a separate design gate. Tracking: beads-eio.3.388.
2026-10-24 08:51:46 -07:00
Matthew Stanley 400c747c11 Add atomic local four-view split presentation and extra test input ports 2026-10-24 08:46:37 -07:00
Matthew Stanley 2fe9f3126e debug: start queued controller input after a native state load 2026-10-24 08:42:32 -07:00
Matthew Stanley 5382f05b16 debug: allow frame-scheduled input routes on guest pad two 2026-10-24 08:42:31 -07:00
Matthew Stanley b7c7d71582 Honor mapped save-menu controls and expose paused overlays to TCP 2026-10-24 08:41:13 -07:00
yacineolivier-maker 2d03e09d60 FMV: HD replacement of 24-bit movie frames (gpu_fmv_hd, fmv_hd/ packs)
An optional pack replaces a title's MDEC movies with high-definition frames
while the game keeps its own audio, timing and skip control:
- fmv_hd/<movie>/index.bin: header, then a luminance signature per source
  frame; fmv_hd/<movie>/frames/NNNNNN.jpg: `sub` HD frames per source frame.
- Every presented 24-bit frame is matched by signature (mean absolute
  difference), first around the last recognised frame, then over the whole
  pack when tracking is lost; a near global match is also tried a few lines
  up or down (each movie has its own vertical placement on screen) and the
  offset kept. Worker threads decode the upcoming frames ahead into a small
  RGBA ring.
- Format FMVHD002 records the native display the movie is shown in and its
  position, so the HD frame lands exactly where the original was.
- The last HD frame is held briefly when the next one is not ready or not
  recognised (no flicker back to the 4:3 original mid-movie), and is
  uploaded to the GPU only when it changes.
- Debug: TCP {"cmd":"fmv_hd"} reports the pack, the matches and lost frames.
No pack: no effect. Pack frames are the user's own upscale of their own disc;
nothing is distributed with the runtime.

Used for R4's intro and ending movies (SeedVR2 upscales, 25 fps sources).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rkyma8rbyPiccs9n2bkyG6
2026-10-24 08:34:12 -07:00
Matthew Stanley 84ba185176 Publish cadence through shared video telemetry without reader races
Use a bounded atomic snapshot and presenter-owned reset across all backends. Readers sort their own snapshots; report host API completion cadence. Add deterministic and concurrent reader/reset coverage.
2026-10-24 08:32:29 -07:00
yacineolivier-maker b6b3578282 Debug: perf command, the cadence of real swaps (what the player sees)
The GL swap records the interval between real swaps (ring of 4096, single
writer). TCP {"cmd":"perf","window_ms":N,"reset":0|1} returns count, fps,
mean / p50 / p95 / p99 / max interval and hitches (intervals over 1.5x the
median) for the last N ms; independent of guest vblank counting, so frame
generation, pacing and driver stalls are all visible. PSX_FPS_TELEMETRY adds
the same summary to the window title.

Used to measure R4 runs on a test bench (60.0 fps, p99 18 ms after the
cadence fix of the video-standard switch).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rkyma8rbyPiccs9n2bkyG6
2026-10-24 08:26:31 -07:00
Matthew Stanley 910c47602c Merge branch 'master' of https://github.com/RetroPortingToolKit/psxrecomp into fix/held-746-20261022
# Conflicts:
#	runtime/src/main.cpp
2026-10-22 18:01:49 -07:00
Matthew Stanley a2359ca095 Merge remote-tracking branch 'origin/master' into fix/held-737-20261022
# Conflicts:
#	docs/TCP_COMMANDS.md
#	generated/OpenBIOS.emitter.sha
2026-10-22 17:21:40 -07:00
Yves ebca6c5aaf Report XR readiness without the debug server 2026-10-23 06:53:57 +08:00
Matthew Stanley 182073bca9 Integrate current master and complete GPU fixture APIs 2026-10-22 15:35:38 -07:00
Matt Stanley e4301fb8fa VR: diagnose ambiguous XR origin poses without recentering 2026-10-22 15:34:35 -07:00
Yves 510560e599 Preserve precise eye poses and clip near-camera geometry
Co-authored-by: Yves <calibratedbeats@gmail.com>
2026-10-23 05:45:20 +08:00
Yves 689f3b348e Report ambiguous XR origin diagnostics without recentering
Co-authored-by: Yves <calibratedbeats@gmail.com>
2026-10-23 05:37:28 +08:00
Shokunin b1ce3be00a Live resolution: truthful restart contract per backend
Keep the requested internal resolution / supersample (shown and saved)
apart from what the backend last applied. When the live change is
unavailable (no GL, windowed high-resolution mode, CPU-authoritative dual
rendering, no context) or refused, the session scale is left as applied and
PSX_VIDEO_RESTART_RESOLUTION stays set, in both psx_video_apply_live and
the menu's restart bits (psx_host_video_restart_bits_backend, unit-tested
for the capable and refused cases). video_set rejects invalid presets and
factors without applying or saving, and reports applied values, capability
and pending restart. TCP command index regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:20:55 -07:00
Matthew Stanley 6c9d618f1f Validate synthetic pose requests before applying them 2026-10-22 14:07:34 -07:00
Yves 18d52c8bfb Add debug synthetic head translation and pitch
Co-authored-by: Yves <calibratedbeats@gmail.com>
2026-10-23 03:26:53 +08:00
Yves 4419d234ab Reuse one guest checkpoint per stereo pair
Co-authored-by: Yves <calibratedbeats@gmail.com>
2026-10-23 03:24:41 +08:00
Yves 0cdf95957c Bound stereo shedding and recover at the display deadline
Co-authored-by: Yves <calibratedbeats@gmail.com>
2026-10-23 03:24:01 +08:00
Yves 8400b55dc0 Add opt-in stereo and XR frame attribution
Co-authored-by: Yves <calibratedbeats@gmail.com>
2026-10-23 03:22:42 +08:00
Shokunin 8003db07de Live resolution: keep the legacy factor as booted; video_set debug command
psx_video_current reported the live scale as the legacy supersampling
factor, so a second live change looked like a legacy edit and asked for
a relaunch. Report the boot value. Debug-tools builds gain video_set
(internal_resolution, supersample) to drive the live path in tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 10:55:28 -07:00
yacineolivier-maker 030a50415e Mods: named debug commands (psx_mod_register_command, TCP mod_cmd) (#711) 2026-10-21 14:45:08 -07:00
Matthew Stanley 665f7eb823 Guard session_restart debug command in no-debug-tools builds
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-19 18:27:56 -07:00
Matt Stanley 916da6f80d Integrate shared disc tray with the maintained menu provider (#652) 2026-10-19 18:13:38 -07:00
Matt Stanley c0ffd6d4c5 Support guarded mod address adapters and atomic extended memory cards
Extract the audited adapters and card transport onto master without the held selector/menu stack. Keep adapters and codecs tied to mod activation, use overlay ABI 33, retain rejected-load protection on codec registration, and refuse extended-card codecs in netplay before frame zero. Preserve default atomic save publication and guest-visible write failures.
2026-10-19 16:00:11 -07:00
Matt Stanley bc574c5700 Isolate runtime publication and wall-time diagnostics from held mod selector stack 2026-10-19 14:07:22 -07:00
Matt Stanley 422238d0fa Merge current master and qualified review fixes into PR #642 2026-10-19 14:00:58 -07:00
Zap0xfce2 1b778616b7 feat(widescreen): continue framebuffer-feedback sprites into native-wide bands (#692)
* feat(widescreen): continue framebuffer-feedback sprites into native-wide bands

Titles tag a 15-bit sprite that copies a framebuffer 1:1 (gpu_ws_tag_feedback_rect / psx_mod_tag_feedback_rect). Where it touches the draw area's edge, gpu.c emits band spans and the new optional backend op wide_feedback_rect (GL incl. render thread, software) samples the source buffer's wide surface. Band texels count as bit 15 set, as the centre does once the trail blends.

The software rasterizer now writes the texel's bit 15 into the framebuffer, and wide_full can dump the surface alpha ("alpha":1).

* fix(widescreen): quantise band feedback like packed VRAM

The centre samples 5-bit packed VRAM each frame; the band copy read the 8-bit wide surface and modulated with /128, so the bands drifted ~3 grey levels brighter and left a step at the 4:3 edge. Truncate like PACK_FS and modulate like TEX_FS.

* Reject fully clipped sprites before extending feedback margins

* Complete isolated resident and PGXP fixture collaborators

* Preserve existing line endings in the review fixes

---------

Co-authored-by: Matthew Stanley <1379tech@gmail.com>
2026-10-19 11:44:13 -07:00
Matthew Stanley cf9bf1f9fd Allow developer pad injections to exercise serial hotplug 2026-10-17 09:40:22 -07:00
Matt Stanley bf7582bb3e Merge pull request #666 from FractalEngineer/feat/vr-hud-surfaces
Add isolated render capture and head-facing surfaces for VR HUDs
2026-10-15 00:33:52 -07:00
Yves 890fed78f5 Add frame-local positioned RGBA surfaces to stereo rendering 2026-10-15 05:17:37 +08:00
Shokunin c3a2f2c068 Menu host follow-ups: restart bits for touched groups, local return, default provider
- Restart bits: a group waits only when the edit touches it (next differs
  from the live value) and the result differs from boot. Dynamic
  resolution moves the live internal resolution off boot, so an in-game
  texture filter change relaunched the game. test_menu_video_snapshot
  covers both cases.
- Return to the frontend from a local game opens the launcher as at
  boot; only a lobby match start (the runtime's pending-launch exit, or
  the provider's lobby view asking once its match started) keeps the
  launch and resumes the room.
- Default provider: with no title choice, the UI library's provider is
  used when it ships one (recomp_ui_psx_menu.h), so recomp-ui stays the
  default; PsxMenuHost.default_selection tells it to keep the title's
  default presentation.
- Debug: menu_host reports provider, open, pause, capture and snapshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 12:17:18 -07:00
Matt Stanley d3db61b199 Merge pull request #598 from RetroPortingToolKit/feat/host-pause
Host pause API (in-game overlay P1)
2026-10-14 11:55:36 -07:00
Matthew Stanley 8a5559cc7c Cancel debug socket waits portably without timing out valid fragmented commands 2026-10-14 11:29:13 -07:00
Matthew Stanley d66916f4b6 Bring portable debugger shutdown repair onto current master 2026-10-14 11:23:51 -07:00