Commit Graph

1102 Commits

Author SHA1 Message Date
Matthew Stanley f3d60331a7 autocompile: name the resolved interpreter at configure, warn on Cygwin builds
Root-caused on Tomba 1: overlay_autocompile_cmd's bare 'python' resolved
through PATH to the devkitPro MSYS2/Cygwin python (usr/bin precedes the
Windows install), which segfaults (exit 0x0B00, signal 11) under the
kill-on-close job spawn BEFORE writing a byte — so every compile failed
with '(no output captured)' and nothing pointed at the cause; the title
silently ran interpreted.

At configure time, resolve the command's first token exactly as
cmd.exe /C will (SearchPathA with .exe), print the binding once, and
warn loudly when msys-2.0.dll/cygwin1.dll sits beside the resolved
interpreter, recommending the Windows launcher form 'py -3 ...'.
Also fail loudly up front when the token doesn't resolve at all.

Doc'd in ASYNC_OVERLAY_COMPILE.md. Title game.toml fixes (python ->
py -3) ship separately in each game repo.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-05 10:55:00 -07:00
Matthew Stanley e629d622fa dma: implement channel 5 (PIO / expansion port) transfers
Salvaged from PR #13 (feat/launcher-stb-revamp, commit 2ba52e97) by
NyperYuhgard. Master fatal-halts on any DMA start for channel 5; this
moves words to/from RAM directly (device side unemulated: RAM-to-device
reads-and-discards, device-to-RAM zero-fills) and completes the
transfer with the normal IRQ path.

Note: zero-filling from an unemulated expansion device is weaker than
the fail-closed psx_fatal_halt default the other channels follow; kept
as submitted because the contributor exercised it on a real title.
Trimmed from the original hunk: unused DMA_PIO_CYCLES_PER_WORD macro
and mdec_finish_async_{in,out}_transfer wrappers nothing references.

Co-Authored-By: NyperYuhgard <noreply@github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-05 10:55:00 -07:00
NyperYuhgard 95669105de interp: deliver alignment exceptions, protect Cause read-only bits, add CFC0
Salvaged from PR #13 (feat/launcher-stb-revamp, commit 9fd2876c) by
NyperYuhgard. Adds to the dirty-RAM interpreter:

- LoadAddressError/StoreAddressError delivery for misaligned LH/LW/LHU/
  SH/SW and misaligned JR/JALR targets, via a new interp_exception()
  that performs the architectural COP0 sequence (BadVAddr, Cause ExcCode,
  SR mode-stack push, EPC, BEV-selected vector).
- COP0 Cause write protection on MTC0/CTC0.
- CFC0/CTC0 aliases (identical to MFC0/MTC0 on R3000A).

Two deviations from the original:
- The original masked Cause writes to bits [15:10] (backwards vs
  hardware); corrected to the writable software-interrupt bits [9:8]
  per psx-spx / PCSX-Redux, which also un-deadens the psxTestSWInts
  recheck below it.
- The original's post-RFE immediate psx_check_interrupts recheck is
  dropped: master already delivers post-RFE interrupts through
  psx_rfe_mark_escape() and re-checking inside the handler window is
  the documented dbg-build boot-wedge livelock.

Co-Authored-By: NyperYuhgard <noreply@github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-05 10:55:00 -07:00
Matthew Stanley 084d2d4639 mods: clear the staged catalog before restaging it
copy_directory merges, so a mod package deleted from source survived in the
build output indefinitely -- it kept showing on the Mods page and inflated
the release packagers' catalog assertions (Tomba 2 found 7 manifests where 5
exist). Remove the staged tree first; this runs before the game's own
POST_BUILD copy, so game and framework catalogs both land on a clean slate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-05 10:48:09 -07:00
Matthew Stanley 25d2798037 mods: ship loading-speed mods with the framework, for every game
Loading acceleration is a property of the emulated hardware, not of any
particular disc, so having each title carry its own copy of the same two
manifests and plugins was duplication waiting to drift.

- target game_id "*" now matches every game. An empty target list still
  matches nothing, so a malformed manifest fails loudly as before.
- mods/builtin/packages ships psx.enhancement.fast-loading and
  psx.enhancement.cd-speed: independent host-pacing and CD-timing mods,
  each a free integer multiplier (1..1024) plus a tickbox that uses
  disabled_by to grey out the field it overrides.
- runtime/src/mod_builtin_speed.c registers both activation plugins.
- runtime.cmake stages mods/builtin into every game's output beside its own
  catalog, before the game's own copy, so a title can still override an id.

Titles adopting these should delete their per-game copies; keeping both
would show two of each mod.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-05 10:40:07 -07:00
Matthew Stanley f44f56bfdc mods: let games expose loading speed as a free integer, plus disabled_by
Players asked for CD speeds beyond the curated 2x/4x list and for the two
loading accelerators to stop being one control (GH TombaRecomp#5: a
speedrunner wants shorter loads but NOT the host speed-up, which runs past
the loading screen and breaks a skip).

Three changes, all general:

- psx_mod_set_disc_speed accepted only divisor 2 or 4. That was policy,
  not safety: cdrom.c divides the sector delay and floors the result at
  CDROM_MIN_DELAY, and apply_speed leaves XA streaming at authentic
  timing, so no positive divisor can produce a zero-delay storm or
  pitch-shift FMV audio. Accept 1..PSX_MOD_DISC_SPEED_MAX and let the
  mod's description carry the risk warning.

- psx_mod_set_load_acceleration accepted 2..16. Host pacing cannot desync
  the guest at all (every frame, CD deadline, interrupt and callback still
  happens), so the ceiling was arbitrary. Accept 1..PSX_MOD_LOAD_ACCEL_MAX,
  with 1 meaning authentic and 0 still meaning uncapped.

- New option key disabled_by: an option names a BOOLEAN sibling that
  overrides it, so "tick Instant and the speed box stops mattering" needs
  no second widget type. The parser rejects a dangling, self-referential
  or non-boolean reference rather than leaving a control silently always
  enabled, and the provider resolves the link against the live selection
  so the launcher and the plugins can never disagree about whether a
  control counts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-04 23:55:25 -07:00
Matt Stanley 59244b228c Merge pull request #101 from mstan/codex/steam-car-disc-images
runtime: accept Steam .car disc images
2026-08-04 19:33:26 -07:00
Matthew Stanley 5abdb7d0a1 runtime: accept Steam .car disc images 2026-08-04 19:32:16 -07:00
Matthew Stanley 1bc84f38c6 mods: support save-safe damage override and deadzone rounding 2026-08-04 18:50:31 -07:00
Matthew Stanley 1dcab6a2ff Merge remote-tracking branch 'origin/master' into codex/debug-input-route-20260803 2026-08-03 23:31:59 -07:00
Matthew Stanley 3e89dbc6c2 widescreen: support MMX4 background refill layout 2026-08-03 23:31:52 -07:00
Matthew Stanley 33c96c567d debug: capture presented widescreen surface in screenshot 2026-08-03 23:00:44 -07:00
Matt Stanley 854a658372 Merge pull request #100 from mstan/codex/tomba-v011-framework
feat(runtime): CHD support and mod-owned loading modes
2026-08-03 22:46:09 -07:00
Matthew Stanley 67757efac4 feat(runtime): add CHD discs and mod-owned loading modes 2026-08-03 22:32:17 -07:00
Matthew Stanley ceb4919bb2 debug: add exact VBlank input route queue 2026-08-03 22:24:44 -07:00
Matthew Stanley 5959ef2fdd feat(tools): shared macOS release packager for game repos
tools/package_release.ps1 packages this framework's BIOS-only runtime, and
each game repo carries its own Windows packager. There was no macOS
equivalent at either level, so the first macOS release (Crash Bandicoot) was
assembled by hand and TombaRecomp already carries a private copy of most of
this logic. Add the generic one here so titles configure rather than
duplicate it.

Takes an already-built runtime plus the per-game identity and produces a
signed, relocatable .app in a staged release folder, archived as
<package>-<version>-macos-<arch>.zip with a .sha256 sidecar — the naming the
game repos' Windows releases already use. It does not build; the game's
build script builds, then calls this.

Release gates, porting the intent of the Windows packager to macOS:
- self-containment via otool (only OS libraries or bundled Frameworks)
- no baked absolute BIOS path, and no build-machine home path. The Windows
  gate keys on a drive letter; the macOS tell is a path rooted under
  /Users, /Volumes and friends. Matching bare "/...SCPH*.BIN" instead would
  flag both the correct relative default "bios/SCPH1001.BIN" and the usage
  string "/path/to/SCPH1001.BIN" in every binary.
- the 512 KiB OpenBIOS image and its MIT notice are present
- every --require-mod package is present, so a title cannot ship a launcher
  whose Mods page silently vanished
- no disc / retail BIOS / memory-card / generated / local-state files
- saves/ ships empty
- the .app carries a valid signature

The mod catalog is taken from the repo's reviewed source, never the build
tree: a developer build dir accumulates mods/state.toml with enhancements
switched on, which would silently flip a title's default presentation for
every player. Packaging from a build tree without --mods-src is refused.

Bundle layout: staged data lives in Contents/Resources with symlinks from
Contents/MacOS. The runtime resolves bios/, assets/ and mods/ beside the
real executable, but codesign treats anything non-executable under
Contents/MacOS as nested code and rejects the whole bundle —
mods/packages/<pkg>/<version>/ parses as a versioned bundle. codesign seals
a symlink without descending, so this signs cleanly and path resolution is
unchanged. Signing is deliberately not --deep for the same reason.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-03 18:19:34 -07:00
Matthew Stanley bc6b277c94 feat(mods): add GPU DMA enhancement memory 2026-08-03 15:55:47 -07:00
Matthew Stanley b2af4e89c9 feat(mods): add trusted game enhancement hooks 2026-08-03 15:17:39 -07:00
Matthew Stanley 0cfa9fe0a8 runtime: add PaRappa timing debug controls 2026-08-01 16:11:11 -07:00
Matt Stanley 295262e25e Merge pull request #91 from mstan/codex/generic-startup-wtrace-20260801
Generalize the Crash Bash boot write watch and fix SDL3 MinGW entry-point ownership.
2026-08-01 10:45:53 -07:00
Matthew Stanley 5176e40037 build: isolate the SDL3 entry point implementation
SDL_main.h is a single-header implementation in SDL3. Include it only from the translation unit that owns main so MinGW emits one WinMain instead of one per SDL-using source.
2026-08-01 10:43:59 -07:00
Matthew Stanley c264a704ec debug: generalize Crash Bash boot write watch
Extract the useful diagnostic from PR #13 into an opt-in, title-agnostic boot
write-range trace with TCP-queryable context.

Co-authored-by: NyperYuhgard <93950153+NyperYuhgard@users.noreply.github.com>
2026-08-01 02:15:34 -07:00
Matt Stanley 9aa748bb6b Merge pull request #89 from fabioap-cpu/master
Add condition to prevent CDDA playback restart
2026-07-31 18:28:09 -07:00
Matt Stanley d9eb0f02d3 Merge pull request #85 from luisg0c/test/register-orphaned-cxx-tests
test(recompiler): register l2_structural_test and reachable_discovery_test
2026-07-31 15:45:48 -07:00
luisg0c 65b499f79a test(recompiler): register l2_structural_test and reachable_discovery_test
Both targets are defined unconditionally and every build produces them, but
neither had an add_test() entry, so neither could run and neither could fail.

This is the same gap the codegen tests below them had before they were wired
in, and docs/TESTING.md states the rule directly: "an unregistered test cannot
fail, and a test that cannot fail is not a test."

Both were run manually before being registered and both pass. They are
self-contained -- no BIOS profile, no generated C, no psxrecomp-game -- so
unlike the neighbouring tests they need no WORKING_DIRECTORY.

    l2_structural_test        -> L2 structural: 239/239 ok
    reachable_discovery_test  -> ALL PASS

ctest -N goes 33 -> 35, so the three places that state the count are updated
to match. Note they said 29, which was already stale before this change.
2026-07-31 15:42:55 -07:00
Matt Stanley cb0c00f397 Merge pull request #86 from luisg0c/fix/persist-dir-host-independent-path-check
fix(config): validate overlay_capture_persist_dir independent of host path grammar
2026-07-31 15:40:21 -07:00
Matt Stanley ba37110ee3 Merge pull request #90 from mstan/codex/fix-pr87-regressions-20260731
fix: revert destructive PR #87 runtime merge
2026-07-31 15:39:06 -07:00
Matthew Stanley 987c6eeced Revert "Merge pull request #87 from mstan/feat/ui-5p"
This reverts commit e01347cbca, reversing
changes made to 60cb60eee6.
2026-07-31 15:37:57 -07:00
Fábio AP 1348c118f9 Add condition to prevent CDDA playback restart
This fix is ​​due to games like Tekken 1, which contains multiple discs (multiple .bin files). The problem was that the current code caused the music to repeat several times without counting each second and never allowed the music to continue, both in menus and during gameplay, and also when we paused the game, this repetition continued and did not stop...

(I would appreciate it if you could review and analyze the code. My intention is to keep it updated and improve it over time.)

This is my current possible fix:

`cdda_playing` -> "Is the music already playing?" If the game sends a "Play" command, but the music is paused, we allow the command to pass normally so that the music starts.

`requested_track == 0` -> "Does the game want to play the same track?" When Tekken 1 enters "spam" mode, it sends the pure "Play" command (0x03), without specifying a new track (which in the engine code translates to `requested_track = 0`). If you request track 4, we will allow the command to pass. Since it asks for "0", we know it's just redundancy for a song that's already playing.

`iso_handle` -> "Is there a CD inserted?" This ensures the engine doesn't try to check for phantom tracks and won't crash if there's no .cue file loaded. `iso_track_count(iso_handle) > 1` -> "Does the CD have audio tracks?" The PlayStation game format dictates that Track 1 always contains the game data. If the CD has more than one track, it means it has audio tracks (CDDA).
2026-07-31 16:07:43 +01:00
Matthew Stanley c03fcf4746 docs: add mod authoring guide 2026-07-30 14:54:34 -07:00
Matthew Stanley fc23d497de Merge branch 'codex/remove-engine-recomp-ui' 2026-07-30 13:36:18 -07:00
Matthew Stanley 18ba9dcf1e build: remove recomp-ui from engine tree 2026-07-30 13:35:14 -07:00
Alex Vanderveen c5b64dc75d bump recomp-net back to main 2026-07-29 22:11:48 -04:00
Alex Vanderveen 1b3bd66eca rollback checklist doc 2026-07-29 22:11:05 -04:00
Alex Vanderveen 11de0f2b95 bump recomp-net, REMOVE recomp-ui. 2026-07-29 22:10:30 -04:00
Matthew Stanley eaa4062b78 fix: pin launcher boot timing implementation 2026-07-29 00:42:55 -07:00
Alex Vanderveen bb7240261d sdf 2026-07-29 03:27:25 -04:00
Alex Vanderveen 3da61df355 Revert "ok"
This reverts commit b836f2198c.
2026-07-29 03:18:10 -04:00
Alex Vanderveen b836f2198c ok 2026-07-29 03:15:42 -04:00
Alex Vanderveen e01347cbca Merge pull request #87 from mstan/feat/ui-5p
Feat/UI 5p
2026-07-29 02:48:42 -04:00
Alex Vanderveen 92efb5c4fd no mods in MP, minor patches 2026-07-29 02:40:50 -04:00
Matthew Stanley 60cb60eee6 fix: repair CLI BIOS and launcher builds 2026-07-28 22:46:55 -07:00
Alex Vanderveen 070fc805c4 Merge origin/master into feat/ui-5p.
Keep 5p/ICE netplay host + lobby client; take master's cycle batching,
SDL3 defaults, and dropped vendored lib/recomp-ui.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-28 20:17:14 -04:00
Matthew Stanley 3c67a52f95 opengl: add motion-adaptive interpolation blend 2026-07-28 14:27:40 -07:00
Matthew Stanley 224147bb07 runtime: select PSX recomp-ui assets 2026-07-28 13:48:08 -07:00
Alex Vanderveen 437eee734d Update recomp-net 2026-07-28 16:04:13 -04:00
Alex Vanderveen e13e197ce6 Update recomp-net 2026-07-28 16:04:08 -04:00
Alex Vanderveen 3b72058a5c Update recomp-net 2026-07-28 15:58:56 -04:00
Alex Vanderveen 6cfe713011 workflow and cross platform update 2026-07-28 15:52:23 -04:00
Alex Vanderveen 54a691617e PGO workflow CI hardening 2026-07-28 15:42:53 -04:00