Commit Graph

1104 Commits

Author SHA1 Message Date
Matthew Stanley e5d92035a9 Review integration: borderless composition workaround
# Conflicts:
#	runtime/include/window_fullscreen.h
#	runtime/tests/test_window_fullscreen.cpp
2026-10-24 09:38:19 -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 56b6839602 Reject partial function override activation before session callbacks 2026-10-24 09:31:11 -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
Matthew Stanley dd7f45bb7e Bound recorder pipe writes and child shutdown waits 2026-10-24 09:23:38 -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 9a17832619 Support exclusive roster mods and selectable netplay seat profiles 2026-10-24 08:45:18 -07:00
Matthew Stanley 6b6f0ed8f7 Resolve and show only conditionally selected mod resources 2026-10-24 08:45:07 -07:00
Matthew Stanley d352dc4342 Require original mounted disc geometry alongside content identity 2026-10-24 08:44:24 -07:00
Matthew Stanley bcbd1d4635 Enforce configured original disc content independently of mods 2026-10-24 08:44:23 -07:00
Matthew Stanley d7a2d5dd2a Support Portuguese diacritics in native indexed fonts 2026-10-24 08:44:11 -07:00
Matthew Stanley 6323433e58 Qualify native language sessions and derived file lifecycle 2026-10-24 08:44:11 -07:00
Matthew Stanley 6e0ac7cb10 Add native JSON text and verified Mode-2 language assets 2026-10-24 08:43:46 -07:00
Matthew Stanley fa9f31adf4 Keep the local paired canvas through shared and fallback frames 2026-10-24 08:43:35 -07:00
Matthew Stanley 21c6b9c482 Add protected offline local view pair presentation 2026-10-24 08:43:17 -07:00
Matthew Stanley ea7d4d2f58 Migrate stateless mod guards across snapshot configuration changes
Preserve mutable-provider schemas, memory layout and atomic validation. Only declared stateless legacy records can be discarded. Refs beads-eio.9.167.
2026-10-24 08:41:58 -07:00
Matthew Stanley 90c565148b Use ordinary borderless windows with Windows SDL2
Keep native fullscreen separate, preserve window geometry, and qualify both SDL backends. Refs beads-eio.3.354.
2026-10-24 08:41:58 -07:00
Matthew Stanley 24b54b480b Preserve complete mod plans through lobby START and transport codecs 2026-10-24 08:41:57 -07:00
Matthew Stanley c73110fb0b Capture trusted title host snapshots and reset session resource arenas 2026-10-24 08:41:56 -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 25588e01d1 Merge branch 'review/715-cadence-publication-20261024' into review/psx-prs-20261024 2026-10-24 08:33:10 -07:00
Matthew Stanley ff075a4ec5 Merge branch 'review/736-preload-repeat-20261024' into review/psx-prs-20261024
# Conflicts:
#	runtime/include/hd_texture_pack.h
#	runtime/src/duckstation_texture_pack.cpp
#	runtime/src/hd_texture_pack.cpp
#	runtime/tests/test_duckstation_texture_pack.cpp
#	runtime/tests/test_hd_texture_pack.cpp
2026-10-24 08:33:10 -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
Matthew Stanley 214e5cdbe6 Account existing pinned textures across preload retries
Bound reservations against total retained residency, skip decoding pinned images, and report complete repeated loads truthfully. Cover cap reductions and publication retry in both formats. Tracking: beads-eio.3.386.
2026-10-24 08:31:16 -07:00
Matthew Stanley a7f7a4bed3 Account retained preload bytes after publication failure 2026-10-24 08:22:57 -07:00
Shokunin 50cbe5f653 HD preload: bounded contract, safe threads, explicit partial result
Both preload functions now take an aggregate decoded-byte cap and a thread
cap (runtime: 512 MiB, 4 threads). Each image is probed and its RGBA
reserved against the cap before decoding; per-image limits follow the
pack's decode budget, which is no longer grown to usage (pinned images sit
outside it, and outside the Duck 512-entry cap). The pool (texture_pack_
preload.hpp) joins every started thread on unwinding, survives thread
creation failure, and catches worker exceptions. Images not preloaded are
left to the asynchronous budgeted path instead of being marked failed, and
HdTexturePreloadResult reports loaded / over-cap / failed / worker errors
with a complete-or-partial status. The Beetle async worker no longer lets
allocation failures escape its thread entry.

Tests cover both formats: complete preload, over-cap skip with on-demand
fallback, malformed images, injected worker and thread-creation failures,
and budget reservation bounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 08:22:57 -07:00
Shokunin b6597c2c80 HD textures: decode the whole pack into RAM before the game runs
Replacement images were decoded on demand by a single low-priority
worker, so a texture first seen mid-race appeared late and could be
evicted again. When replacements are on, configuring a pack now decodes
every unambiguous image (DuckStation and Beetle formats) across all
cores and pins it in RAM before the game draws; pinned images are never
evicted by the decode budget. Logs the count, size and time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 08:22:57 -07:00
Matthew Stanley 099081df51 Merge remote-tracking branch 'review-20261024/pr-736' into review/psx-prs-20261024 2026-10-24 08:08:50 -07:00
Aliet Exposito Garcia 70d80f688c feat: add configurable widescreen sxy culling support
Some PlayStation 1 titles implement trivial rejection by folding the sign bits of projected vertex screen coordinates across triangle or quad primitives with a chain of AND instructions. Without adjusting these checks during widescreen presentation, geometry in the newly revealed horizontal area is still rejected by the original 4:3 bounds. Rather than embedding title specific instruction patterns directly into the recompiler, this introduces a generalized `[[widescreen.cull.sxy]]` configuration schema within `game.toml`.

Game configurations can now declare multi vertex trivial rejection sequences by their exact AND instruction words, vertex registers and the branch that consumes the result. The loader derives the expected chain from those words and rejects any other shape. Each AND keeps its original value except for the horizontal sign bit, which survives only while that vertex lies beyond the revealed left edge, so vertical and right side rejection are preserved and 4:3 output is bit identical. Shifted coordinate lower edge comparisons reuse the existing `screen_x_sites` handling through a new `slti rt, x, 0` form instead of adding a separate site family.

Full parity is maintained between recompiled code and the dirty RAM interpreter by sharing the same runtime helper and validating every fold and consumer instruction word on both paths, leaving mismatching overlay variants untouched. This eliminates hardcoded game logic from the recompiler while giving titles clean geometry retention in expanded aspect ratios.
2026-10-24 02:29:52 -04: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
Matt Stanley afc82849be Apply Internal resolution and Supersampling live from the in-game menu 2026-10-22 17:59:52 -07:00
Matt Stanley 7c4bf09259 Windows GL: wall-clock pacing instead of driver vsync (windowed/borderless) 2026-10-22 17:59:45 -07:00
Matthew Stanley 3a2057c6f5 Merge remote-tracking branch 'origin/master' into fix/held-723-20261022 2026-10-22 17:25:07 -07:00
Matthew Stanley 570c4c8398 Merge remote-tracking branch 'origin/master' into fix/held-710-20261022 2026-10-22 17:25:02 -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
Matthew Stanley 0980667752 Confirm live resolution allocation before reporting success 2026-10-22 17:03:12 -07:00
Matthew Stanley 25f453a3bd Account retained preload bytes after publication failure 2026-10-22 17:03:10 -07:00