Commit Graph
12812 Commits
Author SHA1 Message Date
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
Stenzek c893d47ba7 SPU: Predict the next sample that can trigger a RAM IRQ
Up to ~15% performance improvement in SPU-bound games.
2026-10-17 19:20:31 +10:00
Stenzek a15efdc570 SPU: Don't run every sample while the IRQ flag is set 2026-10-17 18:37:53 +10:00
Stenzek 670f0bb0c8 SPU: Sync pending samples on ENDX reads and manual RAM writes 2026-10-17 18:37:53 +10:00
Stenzek 05650d942f SPU: Flush pending samples on off-voice register access with IRQs enabled 2026-10-17 18:37:53 +10:00
Stenzek d708117400 ImGuiManager: Don't try to upload an empty vertex/index buffer
Can happen when only the background/a callback needs to render.
2026-10-17 16:47:46 +10:00
Stenzek c896368731 SPU: Fix IRQ-enabled event scheduling with overclock active 2026-10-17 16:47:42 +10:00
Stenzek d2c5c067f9 Qt: Work around Qt 6.12.0 spinbox text alignment bug
Remove this once updated to 6.12.1.
2026-10-17 16:47:42 +10:00
Stenzek 25477b188c ImGuiOverlays: Add frame number to OSD 2026-10-17 16:47:42 +10:00
Stenzek e9b9975035 Settings: Shuffle some bitfields
Make space.
2026-10-17 16:47:41 +10:00
Stenzek 1216a5171b ImGuiOverlays: Allow displaying resolution while paused
It's relevant to the paused frame.
2026-10-17 16:47:41 +10:00
Stenzek e89a23c54a FullscreenUI: Fix trails shader starting late 2026-10-17 14:24:01 +10:00
Stenzek 8cbf86cb6d SettingsInterface: Fix CopySection() breaking string lists 2026-10-17 14:24:00 +10:00
Stenzek 4b3dafaafa Tests: Fix timers test failures and assertion on shutdown 2026-10-17 14:24:00 +10:00
Stenzek bdf55357eb Tests: Fix util-tests building 2026-10-17 14:24:00 +10:00
Ariel Nogueira Kovaljski 1f1f2d4617 Add @ANK-dev to UI Contributions (#3811) 2026-10-17 14:19:10 +10:00
Stenzek 35b3260383 FullscreenUI: Ensure background load time is initialised
Might help with precision issues on Intel GPUs?
2026-10-16 22:24:24 +10:00
Stenzek 7adc495e34 FullscreenUI: Display achievements points in landing window 2026-10-16 22:24:22 +10:00
Stenzek 4d3028038a FullscreenUI: Improve footer styling 2026-10-16 22:24:22 +10:00
Stenzek 6c7d834eac FullscreenUI: Make background shader accent dynamic 2026-10-16 21:49:45 +10:00
Stenzek bad45f0a59 CPU/Recompiler: Use ubfx for low-bit andi masks on ARM32
Masks such as 0xFFFF can't be encoded as an immediate and were loaded into a
register first. ubfx extracts the low bits in a single instruction.
2026-10-16 20:58:27 +10:00
Stenzek 383fa02357 CPU/Recompiler: Use rotated/inverted immediates for ARM32 constants
Constants which are a rotated 8-bit immediate, or the inverse of one
(e.g. 0xFFFFFFFF, 0x80000000, 0x1F800000), can be loaded with a single
mov/mvn instead of movw + movt.
2026-10-16 20:46:16 +10:00
Stenzek 9f171d3c6f CPU/Recompiler: Load downcount and pending ticks as a pair on ARM64
They are adjacent in the CPU state, so the event test at the end of every
block can load both with a single ldp.
2026-10-16 20:46:16 +10:00
Stenzek e320597892 CPU/Recompiler: Shorten lwl/lwr/swl/swr shift setup on ARM
ARM64 uses ubfiz for (addr & 3) * 8, and eor for 24 - shift, since shift
only ever has bits 3 and 4 set. ARM32 uses rsb for 24 - shift.
2026-10-16 20:46:16 +10:00
Stenzek b975fc3535 CPU/Recompiler: Swap operands for slt with constant rs on ARM
s < t is the same as t > s, which lets the constant be encoded as a
compare immediate instead of being loaded into a register first,
e.g. for sltu rd, zero, rt.
2026-10-16 20:46:16 +10:00
Stenzek f7a237e493 CPU/Recompiler: Avoid constant load for const - reg on ARM
0 - rt (negu) uses the zero register on ARM64. ARM32 uses rsb, which takes the
left hand side as an immediate, and sets the same flags as the equivalent subs.
2026-10-16 20:46:16 +10:00
Stenzek a2b812c2fe CPU/Recompiler: Use sub for negative add immediates on ARM
The raw assembler can't encode a negative immediate, so addiu with a negative
immediate and loads/stores with a negative offset moved the constant into a
register first (two instructions on ARM64, three on ARM32).

Subtract the negated immediate instead. The overflow flag for subs is the
same as adds with the negated operand.
2026-10-16 20:46:16 +10:00
Stenzek 6de56e0ef0 CPU/Recompiler: Use tbz/tbnz for bltz/bgez on ARM64
These only depend on the sign bit, so a single test-bit-and-branch
replaces the cmp + b.cond pair.
2026-10-16 20:46:15 +10:00
Stenzek 20c0b43b46 CPU/Recompiler: Allow 12-bit compare immediates on ARM64
cmp is an alias of subs, so it takes the same immediates as add/sub.

The 5-bit limit is for ccmp, and meant any compare against a constant
above 31 loaded it into a register first.
2026-10-16 20:46:15 +10:00
Stenzek 10ecadbfdc CPU/Recompiler: Use native divide semantics on ARM
sdiv/udiv never trap: x / 0 produces 0, and 0x80000000 / -1 produces 0x80000000.

Followed by msub/mls, that already gives the MIPS result for the unrepresentable
case, and the MIPS hi for divide by zero, so only lo needs fixing up when the
divisor is zero.

Drops two compares and branches from every div.
2026-10-16 20:46:15 +10:00
Stenzek b9b8366406 GPU: Implement v2 textured rectangle flips 2026-10-16 20:44:49 +10:00
Stenzek a9c01a628d GPU: Implement v2 register queries and status bits 2026-10-16 19:12:25 +10:00