Commit Graph

1117 Commits

Author SHA1 Message Date
Matt Stanley a38bf783e4 Merge pull request #771 from michaelm-afk/pr/seamless-scoped-disc-reader
Reuse the effective disc reader during resident pack preparation
2026-10-26 17:08:46 -07:00
Matt Stanley 27e4a1e6fa Merge pull request #770 from michaelm-afk/pr/widescreen-scene-recovery
Stabilize mixed-world widescreen classification and retained UI release
2026-10-26 17:08:42 -07:00
Matt Stanley fc3b3e3fec Merge pull request #769 from michaelm-afk/pr/audio-sync-runtime
Recover host audio after accelerated execution and presentation underruns
2026-10-26 17:08:39 -07:00
Matt Stanley f7070e12f1 Merge pull request #761 from tetrisgm/fix/fmv-guest-timeline-upstream
FMV: bind HD replacement to guest movie timeline
2026-10-26 17:08:28 -07:00
Matthew Stanley 03aab1a223 Reset audio catch-up recovery with a new stream 2026-10-26 16:13:11 -07:00
Shokunin dbcd09a0e1 Expose guest movie identity and test MDEC phase reset
Co-Authored-By: GPT-6.1-Sol <noreply@openai.com>
2026-10-26 16:05:22 -07:00
Shokunin 24a5f608a0 Bind HD movies and source frames to guest CD and MDEC identity
FMVHD003 carries movie and per-frame LBA ranges; legacy signature-only packs require explicit opt-in. Capture CD stream generation and MDEC ordinal with each present so seeks and repeated images cannot reuse an old interpolation phase.

Co-Authored-By: GPT-6.1-Sol <noreply@openai.com>
2026-10-26 16:05:22 -07:00
Shokunin 08f21a68ac Bind HD movie subframes to guest presentation timeline
Replace host-time phase and hold with captured guest cycles, reset on state timeline changes and non-movie scanout, and fall back to native frames on misses.

Co-Authored-By: GPT-6.1-Sol <noreply@openai.com>
2026-10-26 16:05:21 -07:00
Matthew Stanley 6b3730d634 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-26 16:04:58 -07:00
yacineolivier-maker 4a8108782d 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-26 16:04:25 -07:00
Matthew Stanley b5072fa153 Resolve keyboard settings beside extensionless executables 2026-10-26 15:52:39 -07:00
Codex 86942b3ece Refill starved audio before suppressing catch-up excess 2026-10-26 22:15:03 +01:00
Codex 96c1bc12c3 Reuse the effective disc reader within resident pack preparation 2026-10-26 20:18:16 +01:00
Codex 9bb83ac877 Keep mixed 3D scenes wide and retire retained UI evidence after display flip 2026-10-26 17:19:24 +01:00
Codex f033f0ee69 Recover host audio after accelerated execution and presentation underruns 2026-10-26 17:09:50 +01:00
Matthew Stanley f42d2c004b Merge Tron Bonne resident-sector adapter and validation 2026-10-25 12:55:31 -07:00
Matthew Stanley 2e5a8f27ab Integrate resident CD completion checkpoint 2026-10-25 12:51:46 -07:00
Matthew Stanley c9dabd0d95 Integrate validated SH1 widescreen and save-request fixes 2026-10-25 12:50:36 -07:00
Matthew Stanley 619bb418cf Add guarded single-sector resident CD FIFO delivery 2026-10-25 11:33:40 -07:00
Matthew Stanley 60e8f8c71e Preserve CD header and cursor when completing resident data reads 2026-10-25 08:47:03 -07:00
Matthew Stanley a461512a03 Poll pending save requests at native IRQ fast edges 2026-10-25 01:32:07 -07:00
Matthew Stanley a3f36c8c02 Scale widescreen cull margin to the display width; keep ratio sites on the 320 basis
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 00:16:38 -07:00
Matthew Stanley f29503ffcd Poll staged user snapshots before interrupt maintenance fast returns 2026-10-25 00:06:40 -07:00
Matthew Stanley 161ef53b20 Add deterministic post-SPU PCM callbacks for trusted mods 2026-10-25 00:06:40 -07:00
Matt Stanley 3db41f83f8 Merge pull request #766 from RetroPortingToolKit/feat/settings-to-builtin-mods-20261024
Move PSX enhancement settings to built-in mods; remove Graphics presets
2026-10-24 20:45:27 -07:00
Matthew Stanley 4734f69306 Internal resolution becomes a built-in host-only mod; drop the sample-rate setting; host-only mod options editable in netplay
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 20:29:37 -07:00
Matthew Stanley 7a786f8e84 Move PSX enhancement settings to built-in host-only mods; remove Graphics presets
CRT Filter, Image Filtering, Enhanced Audio and Rewind become default-off mods (netplay = host_only,
outside the plan fingerprint); Internal resolution gains Auto in place of dynamic resolution.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 19:23:40 -07:00
Matthew Stanley 7ef29ad112 Fold the debug host layer's left stick onto the D-pad for digital pads
set_input layer=host is a default-mapped gamepad; a real one folds ls_* onto the D-pad in digital mode, the layer dropped the stick.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 18:42:06 -07:00
Matthew Stanley 56b4a3d08a Scale widescreen cull margin to the display width; keep ratio sites on the 320 basis
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 17:42:23 -07:00
Matt Stanley 9b41a1b712 Merge pull request #762 from RetroPortingToolKit/integrate/tomba2-resident-to-master-20261024
Land Tomba 2 widescreen cull work on master
2026-10-24 16:51:29 -07:00
Matthew Stanley 969eaa01ec Recover verified thin terrain faces from zero integer NCLIP
(cherry picked from commit bffd30fe81)
2026-10-24 15:24:21 -07:00
Matthew Stanley 4fca2d27d8 Allow explicit world axes for widescreen visibility cones
(cherry picked from commit 2c6e0a3a20)
2026-10-24 15:24:20 -07:00
Matthew Stanley 6f37a0edee Widen guarded packed screen-X predicates in native and interpreted code
(cherry picked from commit b0f7b2be8e)
2026-10-24 15:15:42 -07:00
Matthew Stanley a4524da999 Make GTE-projection tracking opt-in; fix ws_aspect doc; stub new symbols in mod tests
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 14:47:44 -07:00
Matthew Stanley bcda320f9c Anchor GTE-projected HUD pieces by translation; expose recent-GTE-projection query
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 14:12:26 -07:00
Matthew Stanley ec6b77b3d6 Include windows.h directly in regional_launch.h
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 13:26:15 -07:00
Matthew Stanley 33e01140e4 Merge branch 'fix/spu-shadow-cd-activity-gate-20261024' into feat/launcher-quick-controls-artwork-20261024 2026-10-24 13:10:23 -07:00
Matthew Stanley d170737361 Merge remote-tracking branch 'origin/master' into integrate/tombi-eu-to-master-20261024
# Conflicts:
#	runtime/src/mod_runtime.cpp
2026-10-24 13:10:16 -07:00
Matthew Stanley c3ff07814c 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 12:36:09 -07:00
Matthew Stanley 338bf846cb Account retained preload bytes after publication failure 2026-10-24 12:36:08 -07:00
Shokunin 954e28b051 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 12:36:08 -07:00
Shokunin 0a9fb8600a 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 12:35:57 -07:00
Matthew Stanley a149511e41 Add launcher quick controls, regional locked disc and artwork root
Mods declare quick = true for the Quick Mods card; [launcher] quick_controls opts a title in. Regional identity now hashes portably. Based on michaelm-afk's handoff.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 12:31:56 -07:00
yacineolivier-maker f7fed074f1 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 12:30:30 -07:00
Matt Stanley ddf1dfdbd4 Merge pull request #716: post effects depth, history and live uniforms
Coherent projection publication and bounded diagnostics; repaired final-pass history advancement and reload clock. Real GL182 checks and combined title regression/visual gate passed. Owner explicitly authorized this merge.
2026-10-24 12:29:29 -07:00
Matt Stanley 38f11cd804 Merge pull request #715: race-free host API present cadence
Atomic/versioned telemetry and presenter-owned reset; explicitly measures host API completion. Focused and combined runtime/title checks passed; owner explicitly authorized this merge.
2026-10-24 12:29:22 -07:00
Aliet Exposito Garcia 1c4731bb14 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 12:28:38 -07:00
Matthew Stanley e3ddd8c426 Merge Tombi EU integration branch into master
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 12:08:24 -07:00
Matthew Stanley d486a78acf Scope package overrides and defer snapshots across their native stacks 2026-10-24 11:16:39 -07:00
Matthew Stanley 56b6839602 Reject partial function override activation before session callbacks 2026-10-24 09:31:11 -07:00