Commit Graph

910 Commits

Author SHA1 Message Date
Claudio Varandas 64ca4c3dba recompiler: [widescreen.cull] bltz_sites (explicit left-edge funnel widen)
Left-edge counterpart to slti_sites: emit psx_ws_cull_bltz at configured
bltz PCs. detect_cull_bltz_sites only classifies left-edge bltz for
auto_screen_x-qualified functions, so an X-only funnel wired via explicit
slti_sites had no left-edge widen. bltz_sites closes that gap. Identity at
4:3; regen-class.
2026-07-22 22:36:41 +01:00
Matthew Stanley ed5b1838b8 Merge pull request #68 from keeganatorr/Subdirectory-Linux-Fix 2026-07-22 12:29:09 -07:00
Matthew Stanley 280330e63f Test cross-platform boot path handling 2026-07-22 12:25:06 -07:00
Matt Stanley 7cc35bda7d Merge pull request #69 from mstan/fix/tomba-vulkan-renderer-fixes
Vulkan: fix draw-area batching and enable builds by default
2026-07-22 12:11:24 -07:00
Matthew Stanley 27de42d073 vulkan: fix draw-area batching and enable builds by default 2026-07-22 12:07:32 -07:00
Keeganator e8c8b2b964 Fix psx executable linux subdirectory 2026-07-22 19:26:22 +10:00
Matthew Stanley e558c971ab runtime: restore native Tomba FMV overlays 2026-07-22 00:35:26 -07:00
Matthew Stanley 1ea7e28b10 runtime: fix debug cycle throttle symbols 2026-07-21 22:37:43 -07:00
Matthew Stanley d482ab67a2 runtime: resume compiled code after patched FMV entries 2026-07-21 22:32:07 -07:00
Matthew Stanley 6c914a763f runtime: quiet high-frequency diagnostics during FMV 2026-07-21 22:24:55 -07:00
Matthew Stanley f1bdefad20 runtime: batch faithful FMV load-cycle charges 2026-07-21 22:23:15 -07:00
Matt Stanley 985849dd9b Merge pull request #66 from mstan/fix/merged-submodule-pins
Finalize merged netplay dependency pins
2026-07-21 21:57:33 -07:00
Matthew Stanley 65845939bf build: finalize merged dependency pins 2026-07-21 21:57:18 -07:00
Matt Stanley 0194a70cc6 Merge pull request #65 from mstan/feat/recomp-ui-netplay-integration
Draft: integrate recomp-ui netplay flow
2026-07-21 21:55:38 -07:00
Matthew Stanley 87491cb035 launcher: integrate recomp-ui netplay flow 2026-07-21 21:39:28 -07:00
Matthew Stanley 0527806ce3 Repair netplay PR rebase for MotK bring-up 2026-07-21 21:38:05 -07:00
Alex Vanderveen b6850026a4 Restore missing cycle/icache link symbols for MotK.
Re-add watchdog/PC-sample fire wrappers and overlay icache_fetch_fn;
stop shadowing the inlined psx_advance_cycles with a missing extern.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-21 21:38:05 -07:00
Alex Vanderveen 30df7acaf2 Restore missing cycle/icache link symbols for MotK.
Re-add watchdog/PC-sample fire wrappers and overlay icache_fetch_fn;
pull inlined psx_advance_cycles via psx_cycles.h.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-21 21:38:05 -07:00
Alex Vanderveen fe7913cbca Fix psx_cycles / audio linkage for MotK CI.
Export service_to_now, rename advance to *_slow for the header inline,
and give g_audio_host_rate C linkage.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-21 21:38:05 -07:00
Alex Vanderveen 916b8ca7d3 Fix incomplete load/icache refactor for MotK CI.
Rename out-of-line load helpers to *_slow to match psx_cyc.h inlines,
declare psx_icache_fetch/reset, and wire overlay callbacks to slow paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-21 21:38:05 -07:00
Alex Vanderveen 6475162d80 Bump recomp-net for savestate/SRAM transfer APIs 2026-07-21 21:38:05 -07:00
Alex Vanderveen 0aa50e514f Update bios_emitter_fingerprint.sh 2026-07-21 21:38:05 -07:00
Alex Vanderveen 4eb1794abb Update regen_bios.sh 2026-07-21 21:38:05 -07:00
Alex Vanderveen 7cf9958135 FMV optimizations 2026-07-21 21:38:04 -07:00
Alex Vanderveen 0b890cdc13 lobby game version control 2026-07-21 21:38:04 -07:00
Alex Vanderveen 31015ceab1 feat: launcher polish and recomp-net lobby netplay
Wire MotK-style lobby (recomp-net submodule, WS client, match_caps),
netplay delay-sync, and launcher UX so host sim settings stay aligned
across peers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-21 21:37:57 -07:00
Matt Stanley dcd74b5272 Merge pull request #63 from ClaudioVarandas/fix/cop0-software-interrupts
runtime: implement COP0 software interrupts (CAUSE.IP0/IP1 vs SR.IM0/IM1)
2026-07-21 17:53:28 -07:00
Matt Stanley ea29d56516 Merge pull request #64 from mstan/codex/pr54-linux-current
Add Linux macOS dev setup helper
2026-07-21 17:02:47 -07:00
Matthew Stanley e03c743e87 tools: add Linux macOS dev setup helper
Add a conservative source-checkout setup helper based on the Linux quick-start intent from PR #54.

The script builds the CLI/recompiler tools, refreshes BIOS C when a BIOS is present, and builds the BIOS-only runtime only when BIOS/generated sources are available. It deliberately leaves game project creation to the existing CLI generator.

Co-authored-by: Keeganator <keegan.pan@gmail.com>
2026-07-21 17:02:05 -07:00
Claudio Varandas 55120e102e runtime: implement COP0 software interrupts (CAUSE.IP0/IP1 vs SR.IM0/IM1)
Jackie Chan Stuntmaster (SLUS-00684) hard-blackscreens after the intro
logos: the game's exception dispatcher is re-entrant by design. Its
stage-1 handler saves SR/EPC to a single save slot, then executes
mtc0 CAUSE,0x100 + mtc0 SR,0x101 and relies on the resulting COP0
SOFTWARE interrupt (CAUSE.IP0 & SR.IM0 & IEc) to vector into its
stage-2, which acks the CD INT at the controller, delivers events, and
restores the saved SR. The runtime only ever considered the INTC line
(i_stat & i_mask) gated by SR.IM2, so the sw-int was never taken:
stage-2 never ran, CD INT3 stayed unacked (process_pending freezes the
completion countdown while irq_flag != 0), and the machine deadlocked
with the display disabled and SR parked at 0x101 (IM2 stripped -> all
hardware interrupts dead).

Three changes, all architectural (no per-game logic):

1. interrupts.c psx_check_interrupts(): a pending software interrupt
   (CAUSE & SR & 0x0300, plus IEc) is now a deliverable source. The
   fast path, the pending check, and the SR gate each consider it; the
   INTC path still requires IM2, the sw path only its own IM bit.
   Exception entry sets CAUSE.IP2 only when the hardware line is what
   is being delivered, so a pure sw-int presents the guest-written
   IP0/IP1 bits unmodified (the dispatcher discriminates its stages by
   exactly these bits).

2. interrupts.c: save/restore exception_jmpbuf across delivery. The
   sw-int nests inside the hardware-interrupt handler window; the
   nested setjmp used to overwrite the single global jmpbuf, so the
   OUTER handler's later RFE longjmp'd into the exited inner frame
   (host stack corruption, SIGSEGV).

3. dirty_ram_interp.c: deliver immediately after an interpreted MTC0
   to CAUSE or SR that makes a sw-int deliverable, with EPC = the
   committed next pc. Hardware vectors within the next instruction;
   waiting for the next block boundary opened a window in which a
   second hardware IRQ re-entered the (legitimately non-reentrant)
   guest dispatcher and destroyed its saved SR. precise_irq_deliverable
   gains the same sw-pending condition.

Verified on SLUS-00684: boots through BIOS/logos/FMV into rendered
3D gameplay at 60 fps, SR observed at the canonical 0x40000401, CD
irq_flag acked, MDEC decoding. BIOS-only boot unaffected.

Known scope limit: compiled (static) MTC0 sites do not yet trigger the
immediate check; the raising writes observed in the wild live in the
BIOS-installed, dirty-RAM-interpreted trampoline, which this covers.
2026-07-22 00:54:04 +01:00
Matt Stanley 0e95c3c61d Merge pull request #62 from mstan/codex/vulkan-credit-followup
Credit PR16 Vulkan source developer
2026-07-21 16:43:24 -07:00
Matthew Stanley c4517c3b7c docs: credit PR16 Vulkan source developer
Record that PR #61 reconstructed the reusable Vulkan work from Martin Penkava's PR #16 branch.

Co-authored-by: Martin Penkava <mpenkava1337@gmail.com>
2026-07-21 16:42:54 -07:00
Matt Stanley d2c2ca7f6c Merge pull request #61 from mstan/codex/vulkan-perf-rmlui-removal
Improve experimental Vulkan path and remove deprecated launcher
2026-07-21 16:31:57 -07:00
Matthew Stanley 9228f32c00 runtime: keep Vulkan opt-in and remove old launcher
Remove the in-tree launcher implementation and its submodules now that game projects use recomp-ui for launcher support.

Keep Vulkan hidden from the launcher unless a game explicitly sets [video] offer_vulkan = true, and clamp stale Vulkan settings back to OpenGL when it is not offered.

Co-authored-by: Martin Penkava <mpenkava1337@gmail.com>
2026-07-21 16:31:36 -07:00
Matthew Stanley da64f44e82 launcher: expose the Vulkan renderer
Cycle the renderer selector through Software, OpenGL, and Vulkan while retaining OpenGL-only option gating.

Co-authored-by: Martin Penkava <mpenkava1337@gmail.com>
2026-07-21 15:55:16 -07:00
Matthew Stanley f1fd8ec848 vulkan: expose present blocking telemetry
Record queue-wait, acquire, and present durations plus presentation timestamps in the existing vk_perf ring.

Co-authored-by: Martin Penkava <mpenkava1337@gmail.com>
2026-07-21 15:55:11 -07:00
Matthew Stanley f5498f796c vulkan: prefer MAILBOX for tear-free presentation
Let the frontend remain the sole frame pacer by requesting MAILBOX for tear-free delivery, with FIFO retained as the required fallback.

Co-authored-by: Martin Penkava <mpenkava1337@gmail.com>
2026-07-21 15:55:06 -07:00
Matthew Stanley af9de64951 vulkan: reuse persistently mapped staging buffers
Cache best-fit host-visible staging allocations across queue-idle reclamation points and safely detach long-lived CPU-present buffers during teardown.

Co-authored-by: Martin Penkava <mpenkava1337@gmail.com>
2026-07-21 15:54:42 -07:00
Matthew Stanley b5e9f763fe vulkan: batch work into one command buffer
Keep a shared work command buffer open across logical GPU operations and submit it at the existing synchronization boundary.

Co-authored-by: Martin Penkava <mpenkava1337@gmail.com>
2026-07-21 15:54:29 -07:00
Matthew Stanley 92cbb1a327 vulkan: order back-to-back color passes
Add same-layout color attachment barriers before geometry and wide-surface render passes so prior writes are visible to LOAD and blend operations.

Co-authored-by: Martin Penkava <mpenkava1337@gmail.com>

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 15:54:17 -07:00
Matthew Stanley 7f9f59a2bb vulkan: wait for acquire before transfer writes
Include the transfer stage in the swapchain acquire wait mask because the present command buffer clears and blits the acquired image with transfer operations.

Co-authored-by: Martin Penkava <mpenkava1337@gmail.com>

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 15:54:12 -07:00
Matthew Stanley c25931e3b7 vulkan: align packed upload offsets
Pad each packed R16 upload region to an even texel count so subsequent VkBufferImageCopy offsets retain the required four-byte alignment.

Co-authored-by: Martin Penkava <mpenkava1337@gmail.com>

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 15:54:07 -07:00
Matt Stanley 5c9bd7f042 Merge pull request #55 from sgilissen/feature-mod-loader
Add ModFrameHook
2026-07-21 15:50:46 -07:00
Steve Gilissen 1ae1cfdaf6 runtime: add mod frame hooks
Add a small generic frame-hook surface for statically linked mod code. Mods can
register C callbacks with mod_register_frame_hook(); the runtime invokes them
after normal input sampling and before presentation/widescreen frame work.

Expose the SDL window symbol with C linkage so linked mod code can integrate
with SDL APIs such as window grab control.
2026-07-21 15:45:45 -07:00
Matt Stanley 7bb1014d47 Merge pull request #57 from OpokXeno/feat/widescreen-cull-xclip-load
widescreen: add per-primitive X-reject bound-load cull sites
2026-07-21 15:30:59 -07:00
Opok 4412bc7a7d widescreen: add per-primitive X-reject bound-load cull sites
Add opt-in [widescreen.cull] xclip_load_sites: a configured `lw rt,off(rs)`
loading a per-primitive X-reject bound (sltu-compared against ANDI-masked
u16 screen X) routes through psx_ws_xclip_bound() - INT32_MAX while the
margins are revealed (reject disabled; the wide-surface scissor clips the
overflow, wrapped off-left u16 coords pass), vanilla value at 4:3. Matched
native codegen emit and interpreter hook; overlay ABI v18 forwarder (NULL
preserves the vanilla loaded value); codegen ver 8. Parser, codegen and
overlay-mismatch regression coverage.

Split from #49: replaces the xclip_globals RAM poke with a recompile-time
instruction transform so native shards and the interpreter behave identically.
2026-07-21 15:02:20 -07:00
Matt Stanley 9b52decf58 Merge pull request #56 from OpokXeno/feat/widescreen-cull-plane-nx
widescreen: add side frustum-plane normal-X cull sites
2026-07-21 14:54:26 -07:00
Matthew Stanley 2ba20f5af7 runtime: make FPS stderr logging opt-in 2026-07-21 14:53:47 -07:00
Opok a5fdf1ad9a widescreen: add side frustum-plane normal-X cull sites
Add opt-in [widescreen.cull] plane_nx_sites: a configured `lw rt,off(rs)`
loading the X component of a side frustum-plane normal (sign-tested per
corner, dot = nx*px + nz*pz) routes through psx_ws_plane_nx() — scaled by
the inverse aspect factor (4*den)/(3*num) while the margins are revealed,
widening the plane cone by exactly atan((3*num)/(4*den)*tan(theta));
identity at 4:3. Matched native codegen emit and interpreter hook; overlay
ABI v17 forwarder (NULL preserves the vanilla normal); codegen ver 7.
Parser, codegen and overlay-mismatch regression coverage.

Split from #49: replaces the plane sign-test RAM pokes with a
recompile-time instruction transform so native shards and the interpreter
behave identically.
2026-07-21 14:38:55 -07:00
Matt Stanley 1441d7baf9 Merge pull request #58 from TechnicallyComputers/feat/fmv-perf
runtime: shareable FMV host-path optimizations
2026-07-21 14:30:23 -07:00