10939 Commits

Author SHA1 Message Date
Stenzek
bb4e9ac5e6 Qt: Add copy/view in dump to debugger register and stack lists 2026-11-07 01:17:36 +10:00
Stenzek
b85648e54c Qt: Tab debugger call stack, breakpoints and threads by default 2026-11-07 01:17:36 +10:00
Stenzek
5443d027b1 Qt: Round the bottom corners of south-facing tabs in themes 2026-11-07 01:17:36 +10:00
Stenzek
f46d11ec27 Qt: Allow debugger windows to be closed
Adds a Window menu to show/hide each dock, and reset the layout.
2026-11-07 01:17:36 +10:00
Stenzek
90da456736 Qt: Add debugger call stack context menu 2026-11-07 01:17:36 +10:00
Stenzek
2015c40d2f Qt: Add symbol support to debugger
Loads ELF/GNU ld map symbols next to the game or from a chosen file, showing
labels and branch targets.
2026-11-07 01:17:36 +10:00
Stenzek
33245ebe56 Qt: Refresh debugger memory view region on system start
Opening the debugger before starting a game left the RAM view one byte long.
2026-11-07 01:05:01 +10:00
Stenzek
18543d4a5c Qt: Align debugger code view addresses to instructions 2026-11-07 01:05:00 +10:00
Stenzek
715ebadf76 CPU: Bound call stack function scan by the live call target
Fixes leaf functions failing to unwind when the preceding code is an
out-of-line block of the previous function containing a call.
2026-11-07 01:05:00 +10:00
Stenzek
5cbdc008df System: Report EXE override alongside running game
Sideloading or clearing the override now raises OnSystemGameChanged.
2026-11-07 00:22:17 +10:00
Stenzek
a056fe398f Bus: Ensure RAM pointer is always initialized
Fixes empty view in debugger.
2026-11-07 00:22:17 +10:00
Stenzek
6a10b09dcd Tests: Fix util-tests failing in debug builds 2026-11-06 23:13:05 +10:00
Stenzek
7518df7d21 MetalDevice: Fix renderer correctness issues and enable compute
Correctness:
- ClearDepth() left the texture in the Cleared state after drawing the
  clear, so depth was wiped again whenever the render pass restarted.
- ClearDepth() drew with the current pipeline's primitive type, and
  dereferenced the current pipeline before checking it for null.
- Only one encoder is ever left active on the command buffer. Resolves,
  dispatches, inline blits and submission now end render/compute/inline
  upload encoders, instead of only render passes.
- Unbind pipelines on destruction, m_current_pipeline was left dangling.
- Protect the depth state cache, pipelines are created on worker threads.
- Render targets are always updated inline, and inline copies, resolves,
  clears and image binds now mark the texture as used, so that uploads
  are not reordered ahead of them via the upload command buffer.
- Apply the pipeline's blend constant, it was never set.
- ResolveTextureRegion() commits a pending clear on the source and marks
  the destination as dirty.
- Depth resolves are drawn instead of using a compute kernel, since depth
  textures cannot be written from compute. The colour resolve kernel now
  bounds checks, as the dispatch grid is rounded up.
- Don't clamp the viewport to the framebuffer, it rescaled the geometry.
- Handle a nil drawable in RenderBlankFrame().
- Report D24S8 as unsupported when the device does not have it.
- Large texture uploads over-read the source for compressed formats and
  partial last rows.
- Use the vertex attribute's index instead of its position in the layout.
- Fix off-by-one in the layer/level check in MetalTexture::Map().
- Log command buffer errors.

Compute:
- Enable the compute_shaders feature, and bind the uniform buffer and
  texture buffer in compute passes.
- Report gpu_timing as supported.

Leaks:
- Texture buffers were over-retained by the stream buffer, and are now
  kept alive until the command buffers using them have completed.
- Resolve pipelines were released after the deferred release queue was
  drained on shutdown. Open encoders and the drawable are cleaned up too.
- Use autorelease pools when creating clear pipelines/compute encoders.
2026-11-06 21:52:37 +10:00
Stenzek
b39186489e Updater/CocoaTools: Fix assorted correctness issues
- Reject zip filenames that overflow the name buffer.
- Never return nil from StringViewToNSString().
- Format NSError codes as signed.
- Release the launch semaphore, and the updater's views.
- Avoid a zero contents scale for unparented Metal layers.
- Fix the fchmod() error message printing the wrong value.
2026-11-06 21:49:23 +10:00
Stenzek
9dd51b2543 Misc: Remove some redundant setting load parameters 2026-11-06 20:33:32 +10:00
Stenzek
c347a186f6 Qt: Update machine translations 2026-11-05 21:58:53 +10:00
Stenzek
30a1676e68 Qt: Add Bind All dialog 2026-11-05 16:53:39 +10:00
Stenzek
c66588e564 FullscreenUI: Add Bind All Buttons 2026-11-05 16:53:35 +10:00
Stenzek
b740968c88 InputManager: Only capture pointer input when mouse mapping is enabled
So it can be used to cancel sequential binding.
2026-11-05 16:53:23 +10:00
Stenzek
fe5b63c847 SoundEffectManager: Don't hold the state lock while stopping the stream
Pulse/ALSA/SDL wait for the callback when stopping, and it takes the lock.
2026-11-05 00:47:39 +10:00
Stenzek
375164496f CoreAudioStream: Recreate the stream instead of updating parameters
Just extra complexity that we didn't need, and the silly mutex.
2026-11-05 00:47:39 +10:00
Stenzek
4eb1a46f0b CoreAudioStream: Fix data race on output volume
Read by the audio thread while the core thread sets it.
2026-11-05 00:47:39 +10:00
Stenzek
2a2b7d086b CoreAudioStream: Write directly to the ring buffer
Removes the staging buffer copy. When the buffer is full, the SPU writes
to its dummy buffer instead.
2026-11-05 00:47:39 +10:00
Stenzek
d599f5ef2e Tests: Add CoreAudioStream playback simulation
Runs a bursty producer and periodic callback in simulated time, checking
underruns, clicks, and latency.
2026-11-04 23:59:39 +10:00
Stenzek
ce8a79b272 Qt: Update MacOS plist 2026-11-04 12:50:21 +10:00
Stenzek
defb7eed54 Qt: Work around checkbox showing in CollapsibleWidget 2026-11-03 23:21:46 +10:00
Stenzek
c1f7c6b7d6 Qt: Simplify MacOS native theme path 2026-11-03 23:21:14 +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
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