Commit Graph
12843 Commits
Author SHA1 Message Date
Stenzek 5215e06dfd Pad/SIO: Mask unused mode bits and write-only control bits on read
Matches psxdiag and the SIO register docs.
2026-10-19 18:14:16 +10:00
Stenzek a89dc5501b Bus: Fix memory control register write masks
Base address bits 24-31 are fixed at 1Fh, and only DEV0 delay/size has bit 31.
2026-10-19 18:12:55 +10:00
Stenzek 3333953def Timers: Mode register bits 13-15 always read as zero 2026-10-19 18:12:54 +10:00
Stenzek 6cd02e1756 Bus: Honour byte enables for 8/16-bit DMA block control writes
The other DMA registers latch the whole shifted word, BCR merges (psxdiag).
2026-10-19 18:12:54 +10:00
Stenzek cd490cfff5 DMA: Make DICR bit 6 read-only
Only bits 0-5 read back what was written on hardware (psxdiag).
2026-10-19 18:12:54 +10:00
Stenzek db3704a130 DMA: Mirror channel control at offset 0xC
psxdiag shows 1F8010xCh reads and writes CHCR on hardware.
2026-10-19 18:12:54 +10:00
Stenzek 5c88e81379 GPU/HW: Deactivate ROV before blitting VRAM replacements
The replacement pipeline writes through a render target, so its output was
lost when the VRAM texture was still bound as an image.
2026-10-19 17:13:59 +10:00
Stenzek 42e66acf6e D3D11Device: Unbind UAVs when switching back from ROV binding
OMSetRenderTargets() does not clear the UAVs bound by
OMSetRenderTargetsAndUnorderedAccessViews(), so the VRAM texture could
stay bound as a UAV while it was being written as a render target.
2026-10-19 17:13:59 +10:00
Stenzek d0e7e070ab D3D12Device: Require typed UAV loads for ROV support
The ROV shaders load from RGBA8 UAVs. Feature level 12_0 guarantees this,
but 11_x devices that report ROVs may not support it.
2026-10-19 16:49:21 +10:00
Stenzek b9cd91a1bf D3D12Device: Increase persistent descriptor heap sizes
These heaps are CPU-only, so they're cheap. Large texture pools and
replacement packs could run out of SRVs and RTVs.
2026-10-19 16:49:21 +10:00
Stenzek 17efd80c5b D3D12Device: Don't key pipeline cache on adapter LUID
LUIDs change on reboot, which discarded the cache every time. Use the
vendor/device ID instead; the runtime already rejects driver mismatches.
2026-10-19 16:49:20 +10:00
Stenzek 2abd25761b D3D12Device: Fix swap chain ResizeBuffers() error handling and flags
Failures were ignored and old buffers reused. Return the error and skip
presenting without buffers, like D3D11. Also keep the mode switch flag
for exclusive fullscreen.
2026-10-19 16:49:10 +10:00
Stenzek a19c8e61b0 D3D12Device: Fix texture Map() bounds check and upload space reservation
Reserve space for the mapped region rather than the whole texture, and
reject layer/level indices equal to the count. Matches Vulkan.
2026-10-19 16:49:00 +10:00
Stenzek e2b59361ef D3D12Device: Free RTV/DSV to the right heap on texture creation failure 2026-10-19 16:48:58 +10:00
Stenzek 703bcf414c D3D12Device: Fix download texture destination row offset applied twice
It was added to both the footprint offset and DstY, which also made the
footprint run past the end of the buffer.
2026-10-19 16:48:39 +10:00
Stenzek 425a816d8b D3D12Device: Fix topology tracking and RTV handling in mipmap generation
Track the triangle list topology when no pipeline is bound. Free the
temporary RTV right away since RTVs are read at record time, and don't
loop forever if the RTV heap is full.
2026-10-19 16:48:38 +10:00
Stenzek 4eeecc16af D3D12Device: Fix sampler group cache going stale and never resetting
Destroyed samplers' indices could be reused, returning the old sampler.
The reset threshold counted groups, which could never reach it before the
heap filled, causing endless submits in PreDrawCheck().
2026-10-19 16:48:38 +10:00
Stenzek 060537cb47 D3D12Device: Unbind texture buffers on destruction
Left a dangling pointer, or a stale binding if the new buffer was allocated
at the same address.
2026-10-19 16:48:25 +10:00
Stenzek 3d7b934cad D3D12Device: Batch image RT UAV barriers before dispatch
Saves virtual calls.
2026-10-19 16:45:15 +10:00
Stenzek bf8824eb61 D3D12Device: Prepare textures on every SetTextureSampler() call
Re-binding the same texture skipped the clear, transition and use fence
update, unlike Vulkan. Also mark textures still bound from an older command
list as used, so later uploads don't go to the init command list.
2026-10-19 16:45:15 +10:00
Stenzek 9c512d9490 D3D12Device: Fix image RT bindings lost after command list submit
The UAV table was only re-dirtied if the last pipeline used images, and
the first pipeline in the new command list doesn't dirty it. Use the
render pass flags instead, like Vulkan.
2026-10-19 16:45:15 +10:00
Stenzek 37ae55b358 D3D12Device: Allow UAV writes in render passes with image RTs
Required by the spec for ROV passes, so tiling drivers can opt out.
2026-10-19 16:45:14 +10:00
Stenzek a78fc70099 D3D12Device: Don't end a closed render pass in EndPresent()
Uploads or clears after the last draw can end the swap chain pass early.
2026-10-19 16:45:14 +10:00
Stenzek 0dc05598bd D3D12Device: Unbind all render targets when one is destroyed
Clearing just the destroyed slot left a null entry that the next render
pass dereferenced. Matches Vulkan.
2026-10-19 16:45:14 +10:00
Stenzek af211cb60e D3D12Device: Only restart render pass after submit if one was active
Restarting unconditionally crashed with no render targets or swap chain
bound, or with no pipeline set.
2026-10-19 16:45:14 +10:00
Stenzek dd642f1556 D3D12Device: Begin render pass before applying dirty state
The dirty flags were cleared first, so a draw after an internal submit
without SetPipeline() never bound the pipeline, viewport or scissor.
2026-10-19 16:45:14 +10:00
Stenzek fe18bfa3f6 D3D12Device: End render pass when submitting command list
Texture uploads submit when the upload buffer is full, which could happen
with a render pass still open.
2026-10-19 16:45:14 +10:00
Stenzek 8f16f93252 Qt: Colour memory editor search box instead of dialog 2026-10-19 16:34:54 +10:00
Stenzek d84c1684be Qt: Allow value editing in memory editor inspector 2026-10-19 16:34:54 +10:00
Stenzek c0e283cd08 SPU: Remove per-voice last_volume
It was only ever read within the same frame it was written, for pitch
modulation of the next voice and the voice 1/3 capture buffers.

Return it from SampleVoice() instead.
2026-10-19 16:34:53 +10:00
Stenzek b8e5e9a576 SPU: Clear ENDX on the first sample of the key on delay
Hardware clears ENDX along with the first header fetch, four samples before
the first attack tick, rather than when KON is serviced.
2026-10-19 15:52:08 +10:00
Stenzek 4a8158b445 SPU: Time the repeat address latch from key on
Writing the repeat address stops loop start flags from overwriting it until
the next key on. Hardware fetches the first block's header on each of the
first three samples of the key on delay, so writes before the last fetch are
overwritten and do not latch; later writes latch regardless of pitch or how
long the first block plays.

This replaces the first-block heuristic and removes is_first_block.
2026-10-19 15:52:06 +10:00
Stenzek 805aaf0894 SPU: Model key-on timing and startup delay
Key on/off is only processed on every second sample, and a keyed-on voice
stays silent for four samples before the first attack tick, so ENVX first
changes six or seven samples after the KON write.

Key on clears has_samples, so the remaining delay is only checked before
reading a new block, and voices that are idle or mid-block cost the same as
before. Key off during the delay does not cut it short. IRQ prediction
accounts for the delay before the first block read.
2026-10-19 15:48:46 +10:00
Stenzek de332d5423 SPU: Eliminate padding in Voice structure 2026-10-19 15:48:34 +10:00
Stenzek 075c8afcab SPU: Decay below the sustain threshold
Require decay to cross the sustain threshold before entering sustain, including
when the threshold is the maximum envelope level. Keep release ending at zero.
2026-10-19 15:48:34 +10:00
Stenzek 1ecd1aa2b1 SPU: Prime the interpolation window on key on
Start the pitch counter at sample index three so the first interpolation window
contains four decoded samples. Add hardware capture regressions for pitches
0x2000 and 0x1500, where ring rotation cannot hide the initial source phase.
2026-10-19 15:48:21 +10:00
Stenzek 1892b879cc SPU: Fix interpolation product precision
Retain one fractional bit in each Gaussian product before accumulation to match
hardware captures. Add capture regressions at unity and fractional pitch, and
update the scalar/SIMD comparison.
2026-10-19 14:31:07 +10:00
Stenzek 5f486f8510 SPU: Write per-voice dumps from the caller
SampleVoice() returns silence for voices that are off, so the dump can be
written once in Execute() from the returned samples instead of at each
return point.
2026-10-19 14:31:07 +10:00
Stenzek ab15051cf1 Android: Update translation strings 2026-10-19 01:58:50 +10:00
Stenzek 8a5b99b8b3 FullscreenUI: Simplify LoadTextureImage() path handling 2026-10-18 22:17:11 +10:00
Stenzek be81684b4d PostProcessing: Load built-in shaders by absolute path 2026-10-18 22:17:11 +10:00
Stenzek 0d73ecc483 Host: Remove resource file functions
Use EmuFolders::Resources and FileSystem directly instead.
2026-10-18 22:17:11 +10:00
Stenzek 9ed01fa11d dep/imgui: Add minimal bidirectional text support
Just enough for Hebrew.
2026-10-18 14:43:05 +10:00
Stenzek 4627e28f75 dep/imgui: Update to 4be0b47ec 2026-10-18 14:29:47 +10:00
Stenzek 27669c0271 GameList: Reduce padding in entry struct 2026-10-18 01:49:07 +10:00
Stenzek 6613bf3425 FullscreenUI: Fix heading font size not adjusting 2026-10-17 20:40:43 +10:00
Stenzek ccecbf4510 VideoThread: Start idle frames half a refresh before vblank
Input is sampled after waiting instead of after the last present.
2026-10-17 20:33:57 +10:00
Stenzek 0a07f4d24b System: Lock throttler phase to vblank with blocking vsync
Frames are presented shortly before vblank, instead of a random phase.
2026-10-17 20:33:51 +10:00
Stenzek baa9c86af3 VideoPresenter: Drop frames that missed vblank with blocking vsync
Otherwise presentation stays a frame behind indefinitely.
2026-10-17 20:33:51 +10:00
Stenzek e7d2bb44b2 D3D11/D3D12: Block until vblank on FIFO present
Uses the frame latency waitable object, or waits for vblank in exclusive
fullscreen, matching Vulkan FIFO behaviour.
2026-10-17 20:33:51 +10:00