Commit Graph
13106 Commits
Author SHA1 Message Date
Stenzek 2dd5cc3c31 CMake: Use DT_RPATH instead of DT_RUNPATH on Linux
Preloaded libraries that interpose dlopen() (e.g. NoMachine) prevented our
dependencies from being found, since only the caller's RUNPATH is searched.
2026-11-03 15:25:45 +10:00
Stenzek a9aa7e03f2 DynLibs: Set error when a previous load attempt failed 2026-11-03 15:25:45 +10:00
Stenzek 160a8f0228 CoreAudioStream: Buffer more when emulation can't keep up 2026-11-03 14:08:22 +10:00
Stenzek 0a21018acc CoreAudioStream: Don't reset stretch tempo on underruns
Resetting to 1x drains the buffer when emulation can't keep up, so it
underruns again.
2026-11-03 14:08:00 +10:00
Stenzek 69f5f9d35a CoreAudioStream: Raise stretch target after repeated short underruns
Decays back after a minute without underruns, capped to twice the buffer size.
2026-11-03 14:04:46 +10:00
Stenzek 85efae5df4 CoreAudioStream: Run stretching on the audio thread
The core thread now only copies raw samples into the buffer. The callback runs
all input through SoundTouch, and controls the tempo on its output buffer.
Reallocation locks out the callback, since WASAPI and XAudio2 don't wait for it.

SoundTouch holds about tempo * sequence length of input, so the tempo is limited
to what the buffer can hold, and input beyond that is dropped. On a reset the
held input is processed at the new speed and trimmed, instead of becoming a
backlog. Stale input after a long output stall is dropped.
2026-11-03 13:40:28 +10:00
Stenzek 4d7e89f0a3 CoreAudioStream: Don't allocate stretch buffers for null output
The null backend forces stretching off, but did so after allocating.
2026-11-03 13:40:28 +10:00
Stenzek e8777c3cfd CoreAudioStream: Fade out/in around underruns
Replaces the nearest-neighbour stretch of the remaining frames, which still
ended in silence, and avoids the pop when playback resumes.
2026-11-03 13:40:28 +10:00
Stenzek cd96e12962 CoreAudioStream: Improve stretch tempo control
Compute the tempo relative to the nominal rate, so it no longer has to integrate
its way there and can go inactive at speeds other than 100%. Smooth it with an
exponential moving average instead of a 256-entry history, which also reduces
overshoot after a reset. Resample mode nudges the tempo by up to 0.5% to
compensate for clock drift, instead of running open loop.
2026-11-03 13:40:28 +10:00
Stenzek 3465bbc854 CoreAudioStream: Fix races between the writer and audio thread
The writer moved the read position on overrun, and the reset counter was
modified from the audio thread. Each side also loaded the other's ring position
relaxed, so the reader could see stale samples on weakly ordered CPUs.
2026-11-03 13:40:28 +10:00
Stenzek 467370ab90 CoreAudioStream: Reallocate buffer when stretch mode changes
The buffer size depends on the stretch mode; switching Off->TimeStretch at
runtime left a 1x buffer that constantly overran.
2026-11-03 13:40:28 +10:00
Stenzek 8fd72f370c CoreAudioStream: Wait for a full callback before ending underrun fill
The fill threshold was ~3ms, so recovery immediately squashed a partial buffer
into the callback and flagged another underrun. The target also has to cover two
callbacks, otherwise the stretcher keeps the buffer below what a callback needs.
2026-11-03 13:40:28 +10:00
Stenzek 4320a739d6 PIO: Improve Xplorer flash/latch accuracy
Mirror latch writes, add chip erase, return DATA polling status when a read
ends a page load, erase pages at load start so bytes may load in any order,
show ID/status for code reads without side effects, and pad images with FFh.
2026-11-03 00:46:41 +10:00
Stenzek ab458f06c9 PIO: Fix Xplorer latch bit usage and banked code reads
Flash A17 comes from latch bit 5 and SRAM/flash select from bit 4. Fix code
reads from 1F040000h overflowing the buffer and ignoring the bank base.
2026-11-03 00:46:41 +10:00
PeterDelta f606b4412a Update duckstation-qt_es.ts (#3820) 2026-11-03 00:00:49 +10:00
Stenzek 144f903fa9 MSBuild: Migrate to slnx 2026-11-02 22:37:22 +10:00
Stenzek 94e12317c6 CPU/PGXP: Don't take fraction from the field below when extracting bitfields
Syphon Filter 3 extracts y from packed vertices with sll 10; sra 21, which
gave the x's top bits as a fraction.
2026-11-02 20:53:00 +10:00
Stenzek 586deb5927 CPU/PGXP: Average depth in ADD when both sides have depth
Gives screen space midpoints (a + ((b - a) >> 1)) their own depth instead
of a's, fixes warped textures in Syphon Filter 3.
2026-11-02 20:53:00 +10:00
Stenzek 2e356ae8be CPU/PGXP: Only move native upper half bits into x for packed right shifts
Fixes exploding car shadows in Driver 2 with CPU mode, which averages packed vertices.
2026-11-02 20:53:00 +10:00
Stenzek 4f6b5313bd FullscreenUI: Fix game list directories populating from wrong list
Wasn't shown in game properties, but still technically incorrect.
2026-11-02 20:02:43 +10:00
Stenzek 9add9b7816 SettingsInterface: Add GetStringListSize()
Avoids string allocations when only the count is needed in cheats.
2026-11-02 20:01:36 +10:00
Stenzek 6689bb4ae2 Settings: Drop redundant string defaults when parsing enums 2026-11-02 19:58:32 +10:00
Stenzek 184a4bc63a Bus: Base forced full RAM mapping on installed RAM size
Save states can change the RAM size without updating the setting.
2026-11-02 19:50:49 +10:00
Stenzek 2aa3d9d579 CPU: Define memory handler lookups in private header
Fixes core-tests failing to link in non-Debug builds.
2026-11-02 19:50:49 +10:00
Stenzek 9ab39541b2 Settings: Make depth normalisation option based on depth buffer
Then enable PGXP-CPU and depth normalization for Eutechnyx engine games.

Improves jitter, but doesn't eliminate it completely.
2026-11-02 19:50:23 +10:00
Stenzek e86770e527 CPU/PGXP: Drop upper half fraction when SLL shifts out its bits
Fixes exploding vertices in 007 Racing, which packs vertices as bitfields.
2026-11-02 00:53:27 +10:00
Stenzek 7a8335eca3 DMA: Drop redundant mask in linked list terminator check
The next pointer is already masked to 24 bits.
2026-11-02 00:18:25 +10:00
Stenzek dde19bd088 CPU/PGXP: Fix recompiled mtc0 validating its source with a garbage value
The recompiler only passes the source register, so take that alone.
2026-11-02 00:18:25 +10:00
Stenzek e762de1a24 CPU/PGXP: Treat $zero as precise
Constants built from $zero are precise, and storing it no longer drops
the precision of the other half of a word.
2026-11-02 00:18:25 +10:00
Stenzek e41a0fb95e CPU/PGXP: Fix swr into the upper half invalidating the lower half
The upper half kept its valid flag with the new native value.
2026-11-02 00:18:25 +10:00
Stenzek ebdbe9619f CPU/PGXP: Fix interpreter immediate moves in memory mode
addiu/ori/xori with a zero immediate used the rd field, which is part of the
immediate, so the move went to $zero.
2026-11-02 00:18:25 +10:00
Stenzek d3d7a12daa CPU/PGXP: Move value flags to the header
So the tests don't need their own copy.
2026-11-02 00:18:25 +10:00
Stenzek ca0dfa540f CPU/PGXP: Don't call PGXP for instructions that write $zero
Loads into $zero and every write in the interpreter replaced its PGXP value.
2026-11-02 00:18:19 +10:00
Stenzek e4a8496050 Bus: Force full RAM mapping should not apply to default RAM size 2026-11-01 20:29:50 +10:00
PeterDelta c3c73e1fad Update duckstation-qt_es.ts (#3819) 2026-11-01 20:28:40 +10:00
Stenzek 363ba68f7f Bus: Add option to force mapping of all installed RAM
Retail BIOSes only map 8MB, so 16MB was unusable without a patched BIOS.
Also available as a patch setting override.
2026-11-01 20:07:04 +10:00
Stenzek 30285103d5 CPU: Report the virtual fetch address in EPC on bus errors
Instruction bus errors used the masked physical address as EPC and set
BadVaddr, which bus errors don't change.
2026-11-01 19:40:47 +10:00
Stenzek 042261b596 CPU/CodeCache: Size LUTs to installed RAM and PIO device
Allocate the code and block LUTs as one block on system initialize, covering
at least 8MB of RAM, and EXP1 only when a PIO device is enabled.

Reallocate when a state changes the RAM size or the PIO device changes.
2026-11-01 19:40:47 +10:00
Stenzek 6255613944 CPU: Raise bus error on cached fetch from unmapped memory
Interpreter icache fills previously read zeros instead.
2026-11-01 19:40:46 +10:00
Stenzek 37f378220b System: Support 4-16MB expanded memory
You will need to re-configure this setting if you were previously using
the 8MB option.
2026-11-01 19:40:45 +10:00
Stenzek 8410fb55db Qt: Remove a few duplicate strings 2026-11-01 16:27:12 +10:00
Stenzek 919f35c833 Qt: Save a few bytes for speedup values 2026-11-01 14:05:24 +10:00
Stenzek 4375f646bb Android: Update translation strings 2026-10-31 23:06:36 +10:00
Stenzek 7063868c74 VideoPresenter: Add subframe presentation
Can be used for CRT shaders, black frame insertion, etc.
2026-10-31 22:03:20 +10:00
Stenzek e80857d868 VideoPresenter: Only count a missed vblank once per on-time present 2026-10-31 22:03:20 +10:00
Stenzek 310ee0217a FullscreenUI: Add DrawIntRangeSetting() with formatter 2026-10-31 22:03:20 +10:00
Stenzek dc8678310e dep/imgui: Add ImGuiSliderFlags_NoFormat 2026-10-31 22:03:19 +10:00
Stenzek 1bc5405c41 System: Include EXE override in save state
Fixes it getting lost when restarting with a normal state, or getting
disconnected from the actual file when there is no media and we are just
running ps-exe.
2026-10-31 21:28:02 +10:00
Stenzek 3fca4f4380 D3D12Device: Log debug layer messages
Register an ID3D12InfoQueue1 message callback when the debug device is
enabled, so that validation messages end up in the log, similar to the
Vulkan debug messenger. Useful for users without a debugger attached, and
for the regression tester.

Also drop break-on-error/warning, breakpoints can be placed in the
callback instead.
2026-10-31 21:27:54 +10:00
Stenzek 70ed7d646b D3D12Device: Fix stream buffer allocation catching up to GPU position
When allocating behind the GPU, the full space up to the GPU position was
handed out. If a caller committed all of it (e.g. vertex batches that fill
the mapped space), the offset would equal the GPU position, which the
allocator interprets as the GPU having caught up, and subsequent
allocations would overwrite data still referenced by the current command
list. Reserve one byte, matching the Vulkan stream buffer.

Fixes corruption in Jumping Flash in the regression tester, where command
lists can span hundreds of frames due to presentation being skipped.
2026-10-31 20:48:27 +10:00