Commit Graph

148 Commits

Author SHA1 Message Date
Matthew Stanley 38bdeeaade pgxp: emit hook macros + dual build targets + flavor-namespaced caches (phase 2)
Emitter side of the value-propagation engine (ENHANCEMENTS.md G1.10):

- recompiler/src/pgxp_hook_emitter.{h,cpp} (new, in the codegen-hash
  surface): ONE hook grammar shared by BOTH emitters, wrapping loads/
  stores/COP2 transfers and precision-carrying ALU ops (moves, add/sub,
  or-merge, shifts, LUI, HI/LO, muldiv) with PGXP_*() macros. Clobberable
  sources are captured into locals before the statement. Precision-
  destroying ops (AND/XOR/SLT/...) are deliberately unhooked - validate-
  on-read drops their stale shadows for free.
- code_generator.cpp: central append in translate_instruction; LWC2/SWC2
  emissions capture the RAW loaded/stored word (a masked GTE register
  write must validate against the word as loaded).
- strict_translator.cpp: translate() wraps translate_impl()'s c_code with
  the shared grammar; deferred load-delay variants hook the psx_ldd temp.
- BIOS regenerated, fingerprints verified CHANGED (SCPH1001 + OpenBIOS;
  42.6k/12.2k macro sites). Base runtime + 33/33 tests green against it.
- Gating: macros expand only under -DPSX_PGXP=1. runtime.cmake grows a
  PGXP option on psxrecomp_add_runtime_target (defines PSX_PGXP=1 +
  PSX_OVERLAY_FLAVOR=2, _pgxp exe suffix) and PSX_PGXP_VARIANT to build
  the sibling target from the same generated tree (framework runtime +
  game wrapper). No ABI version bump needed: the appended PGXPHooks
  table is NULL-tolerant and the flavor half of the ABI tag rejects any
  host/DLL flavor mix.
- Shard caches: flavor folded into the cache tag (cg<V>_<hash>_gc<hash>
  _f<flavor>) in overlay_loader.c + compile_overlays.py so base and pgxp
  caches never share a directory; compile_overlays.py passes
  -DPSX_PGXP=1 when flavor bit 2 is set; overlay preamble forwards
  psx_pgxp_* through the table. PSX_OVERLAY_CODEGEN_VER 9 -> 10.
- Env overrides PSX_GEOMETRY_CORRECTION / PSX_PERSPECTIVE_TEXTURING /
  PSX_PGXP_CPU_MODE (validation path: free-running headless boots arm
  from the first vertex); census grew produced/swc2_stores and the pgxp
  verb reports suppress/active gate state.

Validated: PSXRecomp_pgxp.exe boots the recompiled BIOS with hooks armed
(engine active, per-vertex lookups flowing; the BIOS shell has no RTPS
content so produced=0 there is correct - coverage measurement moves to a
3D title in phase 3).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-15 19:03:36 -07:00
Matthew Stanley 2ba74f3b4b pgxp: land clean-room value-propagation engine (phases 0+1, issue #92)
The G1.2/G1.3 mechanism: per-word RAM/scratchpad + per-GPR + per-GTE-reg
shadows carrying sub-pixel projections BY PROVENANCE, validated against
the actual guest word on every read (never guessed from rounded position
- the measured 93.1%-ambiguous G1.4 dead end). Clean-room from psx-spx +
public design docs; vendored duckstation (CC BY-NC-ND) and beetle-psx
(GPL) trees remain black-box oracles only - no code ported.

- runtime/src/pgxp.cpp + pgxp.h: engine, per-vertex GetPreciseVertex
  (dataflow -> ambiguity-gated position cache -> native) with truncation
  agreement + tolerance safeguards; stats; test accessors.
- pgxp_hooks.h: 5-entry hook funnel; PGXP_*() macros no-op unless
  -DPSX_PGXP=1 (codegen-time gate over ONE generated tree); appended
  PGXPHooks* table member in OverlayCallbacks (ABI bump ships with the
  Phase-2 emitter change).
- Both interpreters wired: loads/stores/COP2 + precision-carrying
  arithmetic (moves, add/sub, or-merge, 16-bit shifts, LUI, HI/LO).
- gte.cpp: RTPS feeds the GTE reg shadows; retired s_precise_sxy FIFO,
  hashed s_precision_store, and plain-store invalidation (redundant
  under validate-on-read; store hot path gets 3 calls back).
- gpu.c: prepare_precise_triangle rewritten per-vertex; perspective UVs
  share the same provenance and compose per triangle.
- [video] pgxp_cpu_mode / pgxp_tolerance keys; TCP pgxp verb live-
  toggles geometry/texture/cpu_mode/tolerance; geom_correction census
  grew the pgxp dataflow counters (G1.9 gate metric).
- tests: new pgxp_test (registered); gte_register_access_test updated
  to precise invalidation contract. 33/33 enabled tests green.

Also fixed while landing (both broke a fresh master tree):
- runtime.cmake: once-only psx_game_version.txt stamp (multi-target
  file(GENERATE) collision broke every fresh single-config configure).
- test_overlay_capture_retry: SDL3 rot (SDL_SetMainReady gone, inverted
  SDL_Init check) -> psx_sdl_init.

Tracked as beads-eio.3.48; postmortem + this landing: ENHANCEMENTS.md
G1-G1.10.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-15 18:34:47 -07:00
Matthew Stanley cab7d00f9a Fix PSX launcher hotkeys and audio persistence 2026-08-14 15:22:29 -07:00
Alex Vanderveen a9a61b4d47 Merge origin/master into feat/rbengine.
Keep recomp-net at occupied_mask (d65918f); master's pin was an ancestor.
Brings in rewind/save-state controls from master.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-14 02:57:25 -04:00
Alex Vanderveen 904ef39073 zlib1.dll 2026-08-14 02:41:50 -04:00
Alex Vanderveen 94cd223249 FMV Heal patch and build optimizations for launcher 2026-08-13 12:55:41 -04:00
Alex Vanderveen 9253f229a1 fmv heal patch + appicon 2026-08-13 10:37:18 -04:00
Alex Vanderveen ae9e6a4e2b hotfix build error on ci 2026-08-12 22:00:46 -04:00
Alex Vanderveen d5b5a029fe hotfix ci template 2026-08-12 21:53:26 -04:00
Alex Vanderveen c4f412be17 project studio, harden prefetch sdl3 2026-08-12 16:49:03 -04:00
Matthew Stanley cee9b97239 Add PSX rewind and save-state controls 2026-08-12 11:12:24 -07:00
Alex Vanderveen 554476457f rewind support 2026-08-12 03:51:50 -04:00
Alex Vanderveen a73a5c1093 rewind feature 2026-08-12 02:42:30 -04:00
Alex Vanderveen 3acb8f6d59 Integrate retcomm-rbengine as shared rollback host policy.
Wire lib/retcomm-rbengine beside recomp-net and replace MotK in-tree sched,
hash_confirm, input hist, snap ring, and rb_post with thin PSX shims so the
ecosystem can share invent/pacing policy outside each title facade.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 23:52:31 -04:00
Alex Vanderveen 2207cd9a09 auto versioning CI releases 2026-08-11 22:05:20 -04:00
Alex Vanderveen 581d4e927c Merge origin/master into feat/legendofmanaetc
Resolve main.cpp by keeping ae_fill/rematch netplay bring-up and taking
master's mod-safe turbo_loads/skip_fmv apply (no pre-activation clobber).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 19:28:20 -04:00
Alex Vanderveen 61279a9d01 bios select and rematch pathing fix 2026-08-10 20:44:18 -04:00
Matt Stanley 52d6a5440d Merge pull request #127 from mstan/hotfix/windows-installations
Fix Windows setup installs: require_generated cmdline + BIOS picker.
2026-08-09 21:22:51 -07:00
Matthew Stanley 4f8f584ac6 fix(msvc): close issue 122 portability gaps 2026-08-09 21:06:23 -07:00
Alex Vanderveen 6c0d343077 Fix Windows setup installs: require_generated cmdline + BIOS picker.
Pass generated shard paths via a SOURCES_FILE so cmake -P is not killed by
CreateProcess's ~8191-char limit, and keep has_bios on for OpenBIOS-only
setup SDKs so the first-run wizard still offers SCPH1001.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-09 22:57:18 -04:00
Matthew Stanley e5cb95b787 fix(build): link nd_intro_ot.c — PR #110 added the TU but never the source entry
083959df added runtime/src/nd_intro_ot.c + nd_intro_ot.h, and 02b08dae /
later commits call psx_nd_note_wood_batch_ot(), psx_nd_wood_batch_ot(),
psx_nd_note_sibling_ot_hint() and psx_nd_sibling_ot_hint() from gte.cpp and
debug_server.c. runtime.cmake keeps an explicit source list (no globbing), so
the TU was never compiled and every link failed with undefined references.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-09 15:04:00 -07:00
Alex Vanderveen 9689ad40dd shrink 0's and use explicit portable toolchain python 2026-08-08 22:50:17 -04:00
Alex Vanderveen 755e2440cb OSD and volume hotkey fix 2026-08-08 22:01:51 -04:00
Alex Vanderveen 069adf871e bump windows build errors 2026-08-08 21:10:11 -04:00
Alex Vanderveen 014f5581bf bump 2026-08-08 20:32:16 -04:00
Alex Vanderveen e8f96d75b5 SDL3 toolchain patch 2026-08-08 20:01:44 -04:00
Alex Vanderveen c31eb12dc1 setup wizard and launcher support 2026-08-08 14:10:49 -04:00
Alex Vanderveen e3495c3eab Merge branch 'integrate/game-codegen-hooks-into-rollback' of https://github.com/mstan/psxrecomp into integrate/game-codegen-hooks-into-rollback 2026-08-08 01:48:52 -04:00
Alex Vanderveen db1726a5a3 cmake gate out netplay files with no netplay flag 2026-08-08 01:48:05 -04:00
Alex Vanderveen 40baa06360 Merge origin/master into integrate/game-codegen-hooks-into-rollback
Bring upstream hotfixes (DualShock rumble, load-delay, BIOS pin, mods)
into the integrate branch. Resolve SIO conflicts by keeping multitap /
PSX_MAX_PLAYERS paths and appending rumble state after snapshot meta.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 20:43:06 -04:00
Alex Vanderveen 46540c77d2 Windows scheduling paths 2026-08-07 16:42:43 -04:00
Alex Vanderveen 346e627f3e toolchain + CI + wizard hardening 2026-08-07 14:33:43 -04:00
Alex Vanderveen 67aaae8a75 buiild with ICE 2026-08-07 03:56:04 -04:00
Alex Vanderveen 480fcad652 new build wizard 2026-08-07 01:43:04 -04:00
Alex Vanderveen 94cb3807a9 Merge origin/master into integrate/game-codegen-hooks-into-rollback
Keep rollback/netplay multiplayer routing, dual-raster GL present, and TOC
fingerprints while taking master's CHD support, mod load acceleration,
adaptive widescreen, and geometry/perspective APIs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 22:50:38 -04:00
Alexandros Mandravillis 6201fd2324 cmake: BIOS pin replaces only its own stem, keeps registry and other backends 2026-08-06 13:19:47 +03:00
Alex Vanderveen 652be7ba02 rollback FMV patches and overlay 2026-08-06 00:52:14 -04: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 67757efac4 feat(runtime): add CHD discs and mod-owned loading modes 2026-08-03 22:32:17 -07:00
Alex Vanderveen 910b998485 mingw build for toolchain to compile netplay 2026-08-03 15:39:52 -04:00
Alex Vanderveen c19618adc6 BIOS handling 2026-08-03 14:44:17 -04:00
Alex Vanderveen ba276624b9 patch bad merge 2026-08-03 05:26:37 -04:00
Alex Vanderveen 804d3094c0 Merge feat/game-codegen-hooks into feat/rollback-netplay.
Keep rollback netplay/runtime authority (dual-raster, snaps, lobby) while
taking local codegen host/CLI/toolchain packaging from game-codegen-hooks.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-03 05:13:45 -04:00
Alex Vanderveen 7234d347ea Merge upstream/master into feat/game-codegen-hooks.
Keep local codegen/FMV cutover/zlib host work while taking upstream
tests, FPS telemetry, and mod-provider wiring.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-03 03:29:32 -04:00
Alex Vanderveen 0392b3ff48 rollback scheduler v1 2026-08-02 12:57:00 -04:00
Alex Vanderveen 4ddd2d01b9 rollback patches 2026-08-01 14:13:58 -04:00
Alex Vanderveen db24f79db5 toolchain patch windows 2026-08-01 14:09:49 -04: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
Alex Vanderveen 2f99cca345 migrate more tools into psxrecomp for building 2026-08-01 00:32:10 -04:00