673 Commits

Author SHA1 Message Date
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 fc6d99f5d2 Describe [launcher] quick_controls as the Quick Mods card only
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 17:33:26 -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 0ca9c3a645 Preserve legacy overlay keys for default camera component order
(cherry picked from commit 5478e5cfd1)
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 42ddce61b5 Preserve wide backdrop composites and guard GTE flag rejection
(cherry picked from commit 6b6402e7f0)
2026-10-24 15:15:46 -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 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 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
Matthew Stanley 541a9b067f Save SYS03 outgoing context for a closed current thread
CloseTh(current); ChangeTh(other) still stores the outgoing registers, as the BIOS exception handler does. Fixes both the HLE scheduler and the LLE fiber bridge. Reported by michaelm-afk.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 12:31:29 -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
Henrique Guedes 4cbedf5579 Add function overrides with guarded registration and cycle credit on current runtime 2026-10-24 09:18:57 -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
Shokunin 74c7cbf94a [video] supersample_disable_at_lines: drop SSAA on 4K/8K displays (opt-in) 2026-10-22 15:26:47 -07:00
Shokunin a8ff6be769 Fix the supersample settings writer's newline
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 10:44:27 -07:00
Shokunin 37c1e5254c Apply Internal resolution and Supersampling live
Changing the internal resolution in the in-game menu did nothing until a
relaunch: ovl_video_from() never copied it, and the restart bits forced
a relaunch for it anyway. Supersampling (the [video] supersample
multiplier) had no player setting at all.

- PsxHostVideoSettings gains supersample_milli; internal resolution and
  supersample are live changes (PSX_VIDEO_LIVE_RESOLUTION). Only the
  legacy integer supersampling factor still needs a relaunch.
- psx_video_apply_live resolves the new scale and calls
  gl_renderer_set_internal_scale_live(): it moves the step ceiling
  (clamped like the boot scale) and queues the step through the dynamic
  resolution machinery, recorded in stream order with the render thread.
  The dynamic-resolution controller is retargeted to the new ceiling.
- settings.toml [video] supersample is the player's pick (1.0..4.0).
- The in-game menu round-trips internal_resolution and, with a launcher
  that has RECOMP_LAUNCHER_HAS_SUPERSAMPLE, supersample_milli.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 10:43:34 -07:00
Matthew Stanley 3f3cfb7571 Integrate EU RC4 runtime and overlay tooling changes
Import the supplied developer handoff against 03e635e8. Include regional capability controls, texture validation, SHA acceleration with portable fallback, SPU CD/XA correction, and overlay export/staging fixes. Validated with rebuilt EU runtime, guarded AOT audit and focused regressions.
2026-10-21 16:54:05 -07:00
Shokunin 44a51191d9 [video] match_display_max_lines: opt-in cap on Match display height (#722) 2026-10-21 14:45:27 -07:00
Matthew Stanley 56a6cfe782 Add one shared title release command with a required channel
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-19 20:46:47 -07:00
Matthew Stanley 9e0548137a Default Playtest Diagnostics on except in public releases (PSX_PUBLIC_RELEASE)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-19 18:18:34 -07:00
Matt Stanley 13b7f81d29 Add guarded instruction variants fixed during offline mod activation
Keep selector zero stock and seal all choices until the next session restart. Refuse nonzero online activation, scope non-stock save states by frozen choices, and preserve original instruction guards when combined with effective-address adapters. Use overlay ABI34 on current master without the old menu dependency stack.
2026-10-19 16:37:32 -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 da9029a73a Merge current master and qualified review fixes into PR #408 2026-10-19 13:09:25 -07:00
Matt Stanley e4ec3926f0 Merge current master and qualified review fixes into PR #645 2026-10-19 13:08:28 -07:00
Matt Stanley 93c2c7c098 Merge current master and qualified review fixes into PR #403 2026-10-19 13:08:14 -07:00
Matt Stanley aa36c8bfe4 Merge current master and qualified review fixes into PR #402 2026-10-19 13:08:01 -07:00
Matt Stanley b4be0aa0f7 Merge current master and qualified review fixes into PR #392 2026-10-19 13:07:47 -07:00
Matt Stanley 282a72e3bd Merge pull request #691 from maliquem/fix/mdec-busy-drain
mdec: keep status bit 29 set until decode output is down to one OutFIFO load
2026-10-19 11:44:07 -07:00
Matt Stanley a5db252c3f Merge pull request #676 from zap0xfce2/feat/ws-screen-x-sltu-band
feat(widescreen): screen_x_sites band form for sltu with the width in a register
2026-10-19 11:43:40 -07:00
Matt Stanley c24a236c4d Merge pull request #678 from Alexbeav/fix/ps1b526-cycle-fixture-link-20261017
tests: refresh isolated clock and optional-netplay fixtures
2026-10-19 11:10:17 -07:00
maliquem 613112996f mdec: keep status bit 29 set until decode output is down to one OutFIFO load
Bit 29 is Beetle's InCommand. The hardware decodes progressively and stalls
while its 32-word OutFIFO is full, so a decode command stays in progress until
all but the last FIFO load of its output has been read. mdec.c decodes a whole
command at once and cleared the bit at execute time.

libpress DecDCTin spins on bit 29 before issuing the next frame. Reporting
ready early let Breath of Fire IV's FMV player issue the next DecDCTin and
DecDCTout while a column DMA was mid-transfer; DecDCTout's CHCR=0 restart
dropped the 205 words already moved, so every later column read started 820
bytes late (vertical stripes at macroblock edges, a one-macroblock vertical
wrap and shifted colour channels in the intro FMV).

Derive the bit from the unread output instead. No new state, so snapshots
are unchanged. Adds mdec_busy_drain_test (fails on the old behaviour).
2026-10-19 10:38:08 -03:00
Matthew Stanley 444264f2aa Restore retail-only setup packaging and audit diagnostic release ZIPs 2026-10-17 14:04:52 -07:00
Alexandros Mandravillis 163b4c8d84 tests: mock host ICE in the optional netplay boundary fixture 2026-10-17 18:03:21 +03:00
Zap0xfce2 339007ecf1 feat(widescreen): screen_x_sites band form for sltu with the width in a register
Renderers that test a 16-bit screen X with an unsigned compare against a width kept in a register (often a loaded clip bound) reject every negative X, so widening the bound only reveals the right band. A screen_x site on sltu now routes through psx_ws_cull_sltu_band: -4m <= (int16)SX < W while widened, identity at 4:3. Four margins keep large near polygons whose corners all lie past one margin; an unbounded left side overflowed a renderer's fixed primitive lists. Covered by ws_cull_screen_x_hi_codegen_test; documented in WIDESCREEN.md.
2026-10-16 11:27:59 +02:00
Shokunin b279afdc4a In-game presets: draw-thread-safe callbacks and a coherent menu seed
P1: quality_launcher_apply is now a pure preset -> rows mapping
(psxq::rows_from_runtime plus startup constants); it never writes the live
globals. The in-game menu publishes only thread-safe callbacks: that
mapper, and a re-detect that returns this session's detection (a fresh
probe needs the GL context and mutates the run's state, so it stays in the
pre-game launcher). Summary/reason strings and the detection are fixed on
the main thread at menu setup; settings_get reads only the main-thread
snapshot.

P2: psxq::MenuSelection keeps what the player selected versus what is live.
A pick's next-launch rows and netplay-deferred rows stay selected for the
next seed until the live value matches; other rows follow live. The host
classification moves to psxq::classify_launcher/row_differs (same rules).

Tests: quality_presets_test test_ingame_menu_host_path runs the review's
fixture through the host get/pick/apply/save path (Ultra -> High, then
Antialiasing = NONE; a governed edit is still Custom from High; a netplay-
deferred row stays selected). menu_quality_callbacks_test guards the
draw-thread callbacks against runtime writes and stateful calls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 19:09:49 -07:00
Shokunin 004749ca8a quality_presets_test: the in-game menu's pick and governed edit
A hidden run keeps the saved preset without detecting; a menu pick of High
is saved and owns its keys; Smooth motion off while High is in force is a
governed live edit that saves Custom from High with its value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 15:44:05 -07:00
Matthew Stanley 50958497c4 Integrate merged experimental wheel support before preset validation 2026-10-15 13:49:46 -07:00
Matthew Stanley a6ee3aa062 Integrate current master and canonical BIOS stamp for PR609 validation 2026-10-15 13:40:27 -07:00
Shokunin 8be777f1f1 quality presets: a supported key set, host-side Custom classification
- [quality.*] accepts only the supported keys (quality_key_supported):
  twelve player-editable ones (masked, copied, classified, applied) and
  nine preset-only ones (no settings.toml form; applied on select). Any
  other key, e.g. vsync or renderer, is a load error.
- Picking a preset now also applies bloom, texture LOD, anisotropy, FMV
  chroma smoothing and dithering (quality_apply_video_globals).
- The frontends flag Custom on any tracked row; the host counts only rows
  of keys the title governs (psxq::launcher_custom_edit), so Antialiasing
  no longer turns Ultra into Custom when no preset sets it.
Tests cover the rejection, every player key's masking/copy, and the
classification cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 10:57:27 -07:00
Matthew Stanley 6d3c5308a7 Integrate current master and canonical BIOS stamp for preset re-review 2026-10-15 08:34:17 -07:00
Shokunin ab49f294e9 quality presets: one preset/key-ownership transaction for every settings save
The boot launcher, soft-return launcher and the in-game menu's live
settings now save settings.toml through psxq::settle_save:
- a one-run PSX_QUALITY override never persists: governed keys and the
  quality_* keys come from disk, so the previous preset or Custom values
  survive even when the boot seed was built empty;
- a governed live edit (psxq::live_edit) or launcher Custom becomes
  Custom from the current base, with the edited values, and survives
  restart instead of being masked away;
- a launcher pick records the preset; unrelated edits keep it.
Tests reproduce both review cases through a settings.toml round trip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 01:05:25 -07:00
Matthew Stanley d110d0a423 Integrate current master for reviewed PR597 and retain canonical BIOS stamp 2026-10-15 00:36:07 -07:00
Shokunin 09ee810fbd quality presets: an unrecognised GPU gets Medium, not Ultra; honest docs
Nothing is measured about an unknown GPU, so the fallback no longer assumes
Ultra's extra work (supersampling above the display, title Ultra extras);
Low would drop Smooth motion and the PGXP extras on what is usually capable
new hardware. Medium keeps the display's resolution with dynamic
resolution under it. Covers unnamed renderers, Linux with only an AMD PCI
id, and unnamed nouveau chips. docs/QUALITY_PRESETS.md states plainly that
autodetect is a static heuristic over name, threads and memory with no
benchmark, and that the dynamic systems keep the frame rate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 14:31:26 -07:00
Shokunin 43afb3bb16 timing: opt-in batching of the scaled CPU charge
With [timing] guest_cycle_scale active, every one-cycle psx_cyc_charge went
straight to psx_cpu_charge and psx_advance_cycles, bypassing the batch the
scale-1 path uses. [timing] guest_cycle_scale_batch (PSX_GCS_BATCH=0/1)
scales the charge in place, with the same fractional carry and order as
psx_cpu_charge, then batches it like the scale-1 path. It flushes at the same
observation points. Default off.

R4 exactness, frame_fingerprint off vs on, 9000 frames each: headless boot
through intro, title and attract; a 1P Grand Prix race; and a 2P VS race.
cyc, mmio, mc and qc are identical on every frame. sp, wr, pc and ws are
identical at the end. The only differences are single-frame VBlank straddles
of wc/sc (never two frames in a row). 0 dispatch misses.

Speed, release builds, races at 60 Hz:
- M4 (macOS sample): psx_cpu_charge 4.3 % -> 0 % of emulation-thread samples;
  busy 46.0 -> 44.4 % (2 pairs).
- 9800X3D: no measurable change (30.0 vs 30.5 %; one core 44.6 vs 44.2 %).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 14:31:26 -07:00
Shokunin f99a318999 quality presets: review fixes (headless, persistence, Linux, renderer table)
1. Detection never runs under --headless / --hidden-window (CI, scripted
   runs): a saved preset applies, else the title's [video]; nothing is
   written. A detection is saved only when the GL probe succeeded; a result
   from the OS name alone is used for that run and the next launch probes
   again (a failed probe could otherwise pin "unknown GPU" -> Ultra).
2. Linux without a GL probe: the classifier now reads the sysfs PCI id
   (Steam Deck parts, Intel integrated vs Arc, NVIDIA).
3. AMD/Intel rules rewritten against real renderer strings: "Radeon RX
   Vega 11 Graphics" and other Vega/"Radeon Graphics"/R5-R7/680M-890M APUs
   are integrated (Low); RX/Pro/W cards and Strix Halo are Ultra; the Intel
   Arc iGPU is Low, Arc A/B cards Ultra. quality_presets_test holds a
   44-row table of Windows, Mesa (incl. Steam Deck LCD/OLED, zink) and macOS
   GL_RENDERER strings, plus probe-failure and headless cases.
5. generated/OpenBIOS.emitter.sha re-stamped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 14:31:26 -07:00
Shokunin 59189e2f67 quality presets: autodetect picks Low or Ultra only
Owner correction: low-end machines (software GL, Steam Deck, mobile GPUs,
integrated GPUs up to the 890M/Iris Xe class, Apple M1/M2 base, GeForce
MX/GT, fewer than 5 threads, under 6 GB) start on Low; every other machine
starts on Ultra with the dynamic systems as its safety net. Medium and High
are manual choices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 14:31:26 -07:00
Shokunin 35e55efb08 quality presets: Ultra by default; step down only classes that cannot hold 60 Hz at the dynamic floor
Owner decision: Ultra on first launch, with dynamic resolution, Smooth
motion from surplus and the adaptive aspect as the live safety net. Apple
silicon, discrete GPUs, unknown GPUs and 8 GB machines now detect as Ultra;
software GL, Steam Deck, mobile, Intel HD/UHD and small AMD iGPUs stay Low,
mid iGPUs Medium; fewer than 4 threads or under 6 GB still caps.

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