Commit Graph
50645 Commits
Author SHA1 Message Date
Henrik Rydgård efdf633d8a Merge pull request #23030 from hrydgard/empty-frame-handling
sceVideocodec: Fail decoding an empty access unit, as the PSP does
2026-11-10 18:49:53 +01:00
Henrik RydgårdandClaude Opus 5.5 6e70f2b193 sceVideocodec: Fail decoding an empty access unit, as the PSP does
sceMpegAvcDecode called again on an access unit it has already decoded passes
the ME an empty one, and on a PSP that fails with 0x80628002
(pspautotests video/mpeg/decoderepeat). We returned success with no picture.

A movie player that retries the same access unit until a picture comes back
then never got out of its loop, and as the decode took no time, it starved the
lower-priority thread that feeds the ringbuffer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:23:55 +01:00
Henrik Rydgård 0155d9be34 Merge pull request #23029 from hrydgard/misc-fixes
Font style refactor, custom Vulkan driver fallback, firmware .nomedia
2026-11-10 16:43:52 +01:00
Henrik RydgårdandClaude Opus 5.5 f53b614be4 AGENTS.md: Don't include VulkanLoader.h from UI
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:15:36 +01:00
Henrik RydgårdandClaude Opus 5.5 879933abce Fix the Linux build: keep the Vulkan headers away from the UI ones
X11, which the Vulkan headers bring in, defines Screen. NativeApp gets the
custom driver functions from VulkanDriverVars.h instead of VulkanLoader.h,
and the GPU debug overlays take their font from the caller instead of
including View.h for the theme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:13:47 +01:00
Henrik RydgårdandClaude Opus 5.5 e361ba7ae1 Translate the custom Vulkan driver failure notice
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 15:09:16 +01:00
Henrik RydgårdandClaude Opus 5.5 b44e93b3c6 Android: Check for a crashing custom driver on Android 11+ too
There the backend is never given up on, but a custom driver that crashed
Vulkan last time is cleared, and Vulkan is tried again with the system's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 15:09:16 +01:00
Henrik RydgårdandClaude Opus 5.5 3c491b7423 Vulkan: Retry with the system driver when a custom driver fails
Before falling back to OpenGL. Covers the availability check, a library
that won't load, a failed InitAPI and a crash on the last run. The setting
is cleared and a notice names the driver.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 15:00:39 +01:00
Henrik RydgårdandClaude Opus 5.5 59c9084fed Firmware: Create the NAND's .nomedia on every install
Installing from an updater file left it out, so Android's media scanner
indexed the firmware. Also only creates it when missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 14:33:12 +01:00
Henrik RydgårdandClaude Opus 5.5 822bae58e6 UI: Pass the font style to each text draw, drop UIContext's current style
What a draw used depended on whatever was set last, often by another view,
so several draws only got the right font because something before them
happened to reset it. Those now pass the theme's font, which is what they
got in practice.

DrawTextRectSqueeze also measured with the theme's font whatever style it
drew with, so small text could be squeezed more than it needed to be.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 14:31:41 +01:00
Henrik Rydgård e7660457ca Fix font bug in InfoItem 2026-11-10 14:23:50 +01:00
Henrik Rydgård 14eebd9b09 Add Gitaroo Man Lives! to compat.ini for CenterLines, fixing title screen bug 2026-11-10 14:18:48 +01:00
Henrik Rydgård 8b993e27fb Merge pull request #23028 from hrydgard/misc-fixes
Misc UI reordering and behavior fixes
2026-11-10 13:51:07 +01:00
Henrik RydgårdandClaude Opus 5.5 daeb18ecc8 Settings: Move PSP firmware to the System tab, as "PSP firmware (XMB)"
Gives it an XMB icon, and points the PS1 firmware errors at its new place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 13:29:38 +01:00
Henrik Rydgård 767532b2c7 Reorder settings some more. System tab is now second after General. 2026-11-10 13:07:02 +01:00
Henrik RydgårdandClaude Opus 5.5 31c0a927c4 Settings: Switching tabs opens the tab on its root page
Not when going to a search result. Reselecting the current tab while
searching does nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 13:06:29 +01:00
Henrik RydgårdandClaude Opus 5.5 e57c8ba756 Settings: Clicking the current tab goes back up to its root page
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 13:06:28 +01:00
Henrik Rydgård 7cb6276a00 Log fix, add some more sprite sampling compat entries 2026-11-10 13:06:28 +01:00
Henrik Rydgård f8632abf70 Merge pull request #23026 from hrydgard/lag-sync-adaptive
Rework "Force real clock sync": Pace without spinning, shrink the audio buffer, call it Low-latency CPU timing
2026-11-10 13:01:30 +01:00
Henrik Rydgård 7ee4ca4227 Merge pull request #23025 from hrydgard/branch-in-delay-slot-test
CPU: Branches and jumps in delay slots as on hardware
2026-11-10 12:45:24 +01:00
Henrik RydgårdandClaude Opus 5.5 1f1915bc43 Translate the Low-latency CPU timing label and hint
Each hint quotes the old label as that language showed it. Khmer and Lao
get the English text for now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 12:19:56 +01:00
Henrik RydgårdandClaude Opus 5.5 8542bb0e72 UI: Give lag sync's old name in its hint
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 12:19:56 +01:00
Henrik RydgårdandClaude Opus 5.5 70b8c86b2c UI: Call lag sync "Low-latency CPU timing", with a hint
"Force real clock sync (slower, less lag)" no longer described it: it costs
little CPU, and falls back to normal timing by itself when the host is busy.
The config key stays until it's on by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 12:19:56 +01:00
Henrik RydgårdandClaude Opus 5.5 d291b1efe4 Audio: Make room for emulation stalls while lag sync paces
A slow display list can hold up emulation for several milliseconds on a slow
device. Lag sync catches up afterwards, but the output keeps pulling in the
meantime, and the fixed 4.4 ms over the output's period wasn't enough. Each
sync now records how far behind the wall clock emulation is, and the most
over the last five seconds is added to the target.

The granular mixer's queue cap no longer makes room for a frame's burst of
audio while pacing; it adds the room for stalls to that for two output reads
instead, up to a frame. The classic resampler drops a lasting excess above
5 ms rather than 10, to settle sooner after the room shrinks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 12:19:56 +01:00
Henrik RydgårdandClaude Opus 5.5 d67d47c4a3 Headless: Let --audio-sink drive the granular mixer
--audio-granular picks the granular mixer (the Audio sync mode setting), and
the sink then reports the queue's level and cap, and its underruns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 12:19:56 +01:00
Henrik RydgårdandClaude Opus 5.5 2b74fad44f Audio: Shrink the buffer target while lag sync paces
While lag sync paces, audio arrives every millisecond or two instead of a
frame's worth at a time, so the resampler's target drops from 40 ms to the
output's period plus 4.4 ms (or 20 ms where the platform doesn't report a
period), and goes back on a fallback to bursting.

The rate adjustment took around ten seconds to drain a startup fill down to
a small target, so a lasting excess (the lowest level over a quarter second
more than 10 ms over the target) is now dropped in one go.

The audio debug overlay shows the target in ms, the lag sync mode and the
dropped excess.

Headless gets --audio-sink=FRAMES, which pulls audio like an output device
with that period and prints how full the buffer ran and how often it ran
dry. docs/lag-sync.md has how to use it, and the Windows measurements: with
a 10 ms period, the buffer averages about 16 ms paced against 35-38 ms
bursting, with a 3 ms period about 9-10 ms, without underruns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 12:19:56 +01:00
Henrik RydgårdandClaude Opus 5.5 73157fc431 Windows: Give each thread its own sleep timer
sleep_precise and sleep_approx shared one waitable timer. It has one due
time and releases one waiter, so when two threads slept at once, the second
one's due time replaced the first's and one of them waited forever (and the
other woke at the wrong time). Lag sync sleeping on the emulator thread while
another thread slept was enough.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 12:19:56 +01:00
Henrik RydgårdandClaude Opus 5.5 746ddfa818 docs: How lag sync paces, and how to benchmark it on a platform
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 12:19:56 +01:00
Henrik RydgårdandClaude Opus 5.5 c0826fab63 Lag sync: Sleep without spinning, and burst when the host is nearly flat out
Lag sync waited with sleep_precise, which on Windows spins the last
millisecond, so its 1 ms waits were nearly all spinning. It now sleeps
with a new sleep_approx (no spin), only once 2 ms or more ahead, and asks
for as much less as the OS has been waking it late. Being late doesn't
add up, since the goal is measured from a fixed base.

Pacing every millisecond only pays with time to spare. Each second, the
share of wall time spent waiting (in lag sync or in the frame throttle)
is measured. Under 10%, it falls back to bursting with the frame
throttle, as without lag sync, and goes back after two seconds over 25%.

GTA VCS on an M1, at --speed values around the host's limit, now runs
as fast as without lag sync or slightly faster. At 1x it costs about 1%
of a core in cycles over bursting, the same as before.

Headless --frame-stats prints lag sync's sleeps, lateness and fallbacks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 12:19:55 +01:00
Henrik Rydgård b915046842 Merge pull request #23024 from hrydgard/granular-target-like-classic
Audio: Make smooth audio use similar buffersizes to classic audio. Show stats.
2026-11-10 12:19:38 +01:00
Henrik RydgårdandClaude Opus 5.5 e933af2080 IR: Leave branches with a branch or jump in the delay slot to the interpreter
The IR frontend dropped a branch or jump in a delay slot (and reported it),
or approximated it with a link to +12 and an exit into the delay slot. Such
a pair now ends the block with the new BranchPair pseudo-op, which the
interpreter runs until it's out of the delay slot, so every core does what
tests/cpu/delayslot/branch recorded. It's an ordinary Interpret, so the
native backends need nothing new, and other branches compile as before.

This removes the delay-slot special cases from the branch compilers and
ResolveNotTakenTarget(), with the eight reports about them. The CPU fuzzer
now runs its d class (branches in delay slots) on every core, and they
agree, cycles included. cpu/delayslot/branch moves to tests_good.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 11:47:35 +01:00
Henrik RydgårdandClaude Opus 5.5 86958037ae Interpreter: Branches and jumps in delay slots as on hardware
As tests/cpu/delayslot/branch shows: in a jump's delay slot, a jump or a
taken branch replaces the jump's target, and a link there saves that target.
In a conditional branch's delay slot, a jump is ignored but still links. A
jump skipped by a not-taken likely branch still jumps, with the next
instruction as its delay slot, but doesn't link (Brooktown High relies on
the jump).

The CPU fuzzer gets a d class, which puts branches and jumps in delay slots.
Only the interpreter runs those cases until the IR frontend handles them;
PPSSPP_CPUFUZZ_ALLCORES runs them on every core.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 11:23:16 +01:00
Henrik RydgårdandClaude Opus 5.5 1cac55b0e2 Add the cpu/delayslot/branch test to tests_next
Branches and jumps in the delay slot of another branch, recorded on a PSP.
Neither the interpreter nor the IR frontend matches it yet: a jump in a
jump's delay slot should take its own target, links in a jump's delay slot
go to the outer jump's target, a conditional branch in a jump's slot should
override it in IR, and a jump annulled by a not-taken likely branch still
jumps but doesn't link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 10:54:28 +01:00
Henrik Rydgård 5fc7f4b957 Default audio playback mode to smooth. 2026-11-10 10:37:59 +01:00
Henrik RydgårdandClaude Opus 5.5 e040fa5223 Audio: Show granular mixer stats in the audio debug overlay
Queue fill and cap (in granules and ms), under/overruns, output rate, read
size and frame time, replacing the "no stats yet" placeholder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 10:29:23 +01:00
Henrik RydgårdandClaude Opus 5.5 5f349fd603 Audio: Size the granular queue from the classic resampler's target
The queue cap was four output callbacks plus a frame of audio. Bluetooth and
other outputs without a fast path call back with large chunks, so that came
to about 100 ms there. Now it's the classic target (which also honors Extra
audio buffering), raised for slow games' per-frame bursts and to keep half
the queue above one callback's read, plus a granule for the overlap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 10:29:23 +01:00
Henrik RydgårdandClaude Opus 5.5 997cc92072 ImDebugger: Count a queued granule as half a granule of latency
The granules overlap by half, so each one in the queue adds 128 samples, not 256.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 10:29:23 +01:00
Henrik Rydgård d20d388611 Merge pull request #23020 from hrydgard/god-eater-dlc
Loader: Don't boot a game update that isn't newer than the disc
2026-11-10 01:00:21 +01:00
Henrik RydgårdandClaude Opus 5.5 44ba2a1c93 Loader: Don't boot a game update that isn't newer than the disc
Since we started booting PSP/GAME/<DISC_ID>/PBOOT.PBP, a modified disc that
has the latest update built in (with its APP_VER raised to match) gets its
executable replaced by the stock update's. With fan translations, that runs
the untranslated executable, which can reject the translated data files.

Only boot the update when its APP_VER is higher than the disc's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 00:38:48 +01:00
Henrik Rydgård 3a85ec9fae Merge pull request #23019 from hrydgard/gta-pause-flash
GPU: Don't estimate a first-frame safe size for screen-sized buffers
2026-11-10 00:33:25 +01:00
Henrik Rydgård 2f4bd6b9d0 Merge pull request #23017 from hrydgard/android17-adrenotools
Android: Stop linkernsbypass from running at load; no custom drivers on 17+
2026-11-09 22:48:07 +01:00
Henrik Rydgård d6c4cc55a1 Merge pull request #23016 from hrydgard/more-ui-fixes
Debugger input fixes, and a corrected port offset hint
2026-11-09 22:34:22 +01:00
Henrik RydgårdandClaude Opus 5.5 c2340b1cb3 Declare VulkanCustomDriverAllowedByOS() in the Vulkan-free header
DriverManagerScreen.cpp included VulkanLoader.h, which pulls in X11 on
Linux, whose Screen typedef clashes with our Screen class.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 22:30:59 +01:00
Henrik RydgårdandClaude Opus 5.5 8de4bcd797 Android: Stop linkernsbypass from running at load; no custom drivers on 17+
Google reports PPSSPP crashing at startup on Android 17 internal builds,
in linkernsbypass (part of libadrenotools), whose constructor walks
libdl's dlopen to find the linker's internal __loader_dlopen. It ran on
every launch, custom driver or not.

Switch libadrenotools to the hrydgard fork, where linkernsbypass resolves
those symbols on first use, so only users who picked a custom driver get
there. Also disable custom drivers on Android 17 and its previews until
they've been tested there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 22:08:41 +01:00
Henrik RydgårdandClaude Opus 5.5 3c6876ac0e GPU: Don't estimate a first-frame safe size for screen-sized buffers
- Fixes #21802

The estimate from #21678 made the first-frame readback read back a part of
any buffer drawn in through mode. In the Japanese GTA games, that writes a
64x320 strip of the 32-bit loading screen into VRAM, where the two 16-bit
display buffers later go. Nothing else writes that memory, and when pausing,
the game shows one of them for a few frames before drawing it, which we then
display from memory, pink strip and all. Before, it was all black.

The estimate was for small render targets (Evangelion Jo's menu text), so
limit it to buffers smaller than the screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 21:22:21 +01:00
Henrik RydgårdandClaude Opus 5.5 a73b093fff Windows debugger: Don't edit a register on a double click on the category tabs
Releasing the button over the tabs also selected the top visible register,
so a double click there opened the change value dialog for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 20:29:01 +01:00
Henrik RydgårdandClaude Opus 5.5 10af4afc72 Windows debugger: Make the left edge of the register category tabs clickable
The 16 pixel left margin of the register rows was excluded from every click,
including on the tab row, which has no margin, so most of "GPR" didn't
respond.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 20:24:47 +01:00
Henrik RydgårdandClaude Opus 5.5 d946f65270 ImDebugger: Fix the memory window stealing keys, and keys stuck after closing
The memory window's single-letter shortcuts (F, B, H, U...) were taken even
when it wasn't focused, opening the search form and focusing its text field
while the game had the keyboard. Only take them when the window is focused,
like the disassembly window does.

Key events don't reach imgui while the debugger is hidden, so a key held while
closing it stayed down. Clear imgui's key state while it's hidden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 19:08:34 +01:00
Henrik RydgårdandClaude Opus 5.5 8f6b43ce8e Fix the port offset hint: unmodified PSPs can't connect anyway
Offset 0 only helps with a real PSP running the old Pro Online plugin. Also
say that all players must use the same offset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 18:56:58 +01:00
Henrik Rydgård bf11170ed4 Merge pull request #23015 from hrydgard/audio-clamp-audit
Audio: Fix wrapping overflows, filter the SAS reverb's rate conversions
2026-11-09 18:11:49 +01:00