A thin floating strip on the right edge with Top, PgUp, Up, Down, PgDn
and End buttons, acting on the last debugger window the user touched
(its name is shown under the buttons). Regular ImGui windows are
scrolled directly. The CPU disassembly and the memory viewers get key
presses instead, and Top/End go to the start or end of RAM.
The strip can be collapsed to a single button, or turned off from the
Misc menu.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The menus are split into lambdas, so they can be shown either side by
side or as submenus of a single "Menu" dropdown. The compact layout is
used on narrow screens, or when chosen from the Misc menu (the default
on phones).
The bar also gets an adjustable left margin (to keep the first button
clear of rounded screen corners, on by default on phones), slightly
taller menu rows in the compact layout, and a Running/Stepping
indicator.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Metal: Load the shader cache again in DeviceRestore, like Vulkan. DeviceLost
saves it and throws everything away, so the next save (the next app switch,
or quitting) overwrote it with only what had been drawn since.
- Software renderer: Bring the post-shader back after a device loss.
DestroyDeviceObjects asks for it with restorePostShader_, but
CreateDeviceObjects cleared the flag again before BeginFrame could act on
it. The hardware backends recover through renderResized_.
- Forget pointers into the old device's objects in DeviceLost, rather than
relying on BeginFrame to come before the next flush: Vulkan's last pipeline
and bound views, Metal's UBO allocations, the GLES last linked shader and
bound texture.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
0b1e1a9bb3 put the PopsMMIO entries inside the MeMMIO ones, leaving
unclosed tags, so Visual Studio couldn't load the filters. Also adds
the missing Util\KL4E.h.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The system info screen's "Copy summary" kept the draw context it was
created with, and the GPU driver test screen kept its pipelines and
sampler, using and finally releasing them into a deleted context after
Android lost the surface. Look up the draw context when clicked, and
release the test objects on device loss (they're recreated on draw).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Android replaces both when it loses the surface (a recreate, which
changing the display resolution does, or switching away), but the
settings screen and its views live on. The external display setting's
enabled check, which runs on every draw, then called into the deleted
DrawContext ("Pure virtual function called!"). The UI scale and
"Reload UI atlas" handlers had the same problem with the UIContext.
Look them up through the screen manager when needed instead.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
We don't support the headphone remote buttons, so we just leave
the buffer all zeroes. Previously we didn't write, which could cause
games to register a ghost "track forward" or the other buttons.
Should fix the DJ Max 2 OST track-forwarding problem in #7468.
Saves are written on a worker thread, so a state saved just before opening the pause
menu may not be on disk yet when the slots are listed, and the slot stayed empty.
Post SAVESTATE_SLOT_SAVED when a slot save is written, and recreate the pause
screen's views on it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
As on a PSP: pressing HOME in a game shows "Do you want to quit the game?"
over it. The game keeps running but gets no input while it's up (sceCtrl
samples are blanked). Left/right picks Yes or No, the confirm button (our
Confirmation button setting, or what compat forces) chooses, the other face
button or HOME closes it, and Yes/No can be tapped. The volume keys change
the game volume a step at a time, shown on the volume bar.
Yes runs the game's registered exit callback first, like the PSP does,
showing "Please wait..." meanwhile. Then, if the XMB launched the game, the
XMB is booted again; otherwise it's back to the game browser, like Exit to
menu. If the callback hasn't ended the game in 10 s, it's quit anyway. Not
in the XMB itself, the PS1 emulator (its own HOME menu) or GE dumps.
It lives in UI/ImposeHome.cpp; EmuScreen only feeds it input and frames and
draws it over the PSP display.
With a firmware dump installed, it's drawn with the firmware's own art from
flash0:/kd/resource/impose.rsc, which is what impose.prx draws it from:
prerendered text for each system language (the question, Yes/No normal and
highlighted, Enter/Back, Please wait...), the button icons, the lines, the
volume bar, the battery and the clock glyphs. The format is documented in
ImposeHome.cpp. Without one, the same screen is drawn with our font and
simple shapes at the same positions.
Where impose.rsc doesn't say where things go, the layout follows
impose_02g.prx (6.61), decrypted and disassembled:
- The screen is filled with 0x9CE7 (#393939); the images are opaque.
- Lines at (80, 96) and (80, 175); impose.prx grows them from the middle
when it opens, which isn't done here.
- Volume bar: the speaker at (28, 223), 30 steps from x 62, 12 apart. It
shows our game volume in the PSP's 30 steps.
- Button guide: the cross icon always left, the circle right, "Enter" and
"Back" next to whichever confirms and cancels.
- Status bar: the battery at (450, 5) (60% and up full, 30% two bars, 12%
one, then empty), the clock ending next to it at y 5: "M/D H:MM", or
"D/M" for the DD/MM/YYYY format, no leading zero on the month, day or
hour, AM/PM for the 12-hour clock.
The clock is the emulated PSP's local time (__RtcGetCurrentLocalTime, new),
in the system's date and time formats. The battery is this device's, since
the emulated PSP's is always full; a device without one shows it full.
For that, Windows now reports -1 for SYSPROP_BATTERY_PERCENTAGE without a
battery (was 100), as SDL already did; SDL polls the battery even when the
status overlay doesn't show it, and the overlay leaves it out when there's
none.
Core side: __CtrlSetGameInputBlocked; __KernelCanExitToVSH and
__KernelRequestExitToVSH to quit to the XMB from outside a syscall; and
__KernelInvokeRegisteredExitCallback(toVSH), so a callback that returns
without exiting ends in the XMB rather than powering down.
New strings: "Do you want to quit the game?", "Please wait..." (Dialog).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NB244iFpvm14JH2FbwHXeQ
It gets the UI page, Language and "Help the PPSSPP team" from the System tab, and
its General group. Its title and the General headers are looked up in MainSettings.
Translations: Move "General" from System to MainSettings
Done with langtool move-key.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The simulator check didn't compile on macOS, where the define doesn't exist.
The simulator's device reports only the Apple1 and Apple2 families, so require
Apple3 instead, which every device iOS 15 runs on has. Also silence the BC
format availability warnings in DataFormatToMetal, since GetDataFormatSupport
already checks for iOS 16.4.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The iOS simulator reports an Apple GPU but doesn't have the packed 16-bit
formats, so creating one tripped Metal's validation and aborted the app.
thin3d now maps them and only reports them as supported on an Apple GPU outside
the simulator, and GPU_Metal asks GetDataFormatSupport like the Vulkan backend
does. Without them, textures decode to 8888.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
On the iPhone Duo's cover screen, the camera sits in a box in the top right
corner, which gives a side inset down the whole right edge in portrait. The
controls are far below it, so they lose width for nothing. iOS 27.1 reports
the box as an occlusion region, and from that we report how far down the side
insets are needed (SYSPROP_DISPLAY_SIDE_INSETS_BOTTOM). When that's within the
top third, the game screen and the touch layout editor skip the side insets.
The rest of the UI, including the FPS counter, still keeps them.
The regions can show up after the size and insets have settled, so the insets
are now recomputed on every layout, and a screen recreates its views when its
layout mode changes, since the touch controls are placed for the bounds they
were created in.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Fixes#22762
The iPhone Duo's inner screen reports no side insets in landscape, but its
rounded corners clip whatever is at the edges, like the main screen's tabs.
Add a fixed physical side inset in landscape on every screen taller than an
iPhone's. That covers iPads too, which don't strictly need it, but it saves
relying on the model identifier. The safe insets are now also recomputed on
layout, since a rotation doesn't always change the system's.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
In portrait, a camera cutout is at the top, so a one-sided side inset is a
real edge and mirroring it just wastes space. The iPhone Duo's cover screen
has its sensor bar on the right in portrait, which left an equally wide
empty strip on the left of the main screen.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Adds an arm64 simulator platform to the iOS toolchain. The simulator build
renders with Metal only: it doesn't link MoltenVK, and loads Vulkan at
runtime like the libretro core, so Vulkan reports itself unavailable and
the config falls back to Metal.
b-ios-simulator.sh builds the App Store variant and runs it on the booted
simulator, or on one of a given device type, for App Store screenshots of
devices we don't have.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The XMB ejects the disc when it boots without one, and __UmdInit resets
the rest of the UMD state but not UMDInserted. So after visiting the XMB,
any game booted next saw an empty drive and waited forever for its disc
(Brandish: The Dark Revenant stops after registering its UMD callback),
until PPSSPP was restarted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On macOS a newer FFmpeg's headers (Homebrew's) came first through another
library's include directory, and AVIDump.cpp failed to build against them.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The ffmpeg submodule held prebuilt libraries for every platform next to the
sources (about 1.5 GB checked out), and nothing uses those any more. Only the
needed sources are copied in, from the submodule's commit, along with every
header and template they include. The path is new, so checking out commits on
either side of this works.
It's also cut down to what PPSSPP uses: the H.264, AAC, MP3, ATRAC3 and ATRAC3+
decoders, the H.264 parser, the demuxers as before, and the FFV1 encoder, AVI
muxer and file protocol for AVI dumping. config.h takes its CONFIG_ values from
FFmpeg 3.0.2's own configure run with just those enabled. The raw H.264 demuxer
stays even though nothing opens raw H.264: probing PSMF data uses it to identify
the video stream's codec, which otherwise comes out as none.
On top of that:
- The files nothing links (configure would build them, but they're never pulled
out of the static library, going by the GCC link map) are left out: mostly
libavutil's crypto and hashing and the alternative DCT/IDCT/FFT versions.
- libswresample isn't built, now that nothing uses it.
- The H.264 decoder only does 8-bit video, which is all the PSP has. The SPS
parser rejects any other bit depth, and the DSP files no longer build their 9-
to 16-bit variants, which the linker kept because the init functions pick one
by bit depth at run time.
That's 160 files to compile instead of 277, and 391 of FFmpeg's vendored, about
5.8 MB. The README in ext/ffmpeg has what was done, the PPSSPP patches in the
copy, how to add a component, and the tradeoffs.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The lossy MPEG-4 encoder (with the MPEG-video encoding code it needs) is most
of what FFmpeg's encoders weigh, and lossy footage is better recorded from the
output with a screen recorder. Dumps are now always lossless FFV1, which also
makes for much larger files than the old default.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
FFmpegAudioDecoder only used swresample to turn the decoders' output into
interleaved stereo s16, at the same sample rate. A small conversion does that
now, with swresample's rounding: floats go through lrintf and are clamped, and
mono goes to both channels at -3 dB, the coefficient swresample's mixing matrix
uses. Its output is sample-identical to swresample's for the MP3, AAC and
ATRAC3+ decoders, mono and stereo.
With "Use FFMPEG for all compressed audio", ATRAC3 got closed on its first
frame: its decoder sets no channel layout, and swresample refused to set up
without one. The conversion goes by the channel count, so that no longer fails.
The system-FFmpeg build no longer looks for libswresample.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Every build compiles FFmpeg now, so the per-platform library paths are gone, and
the Alpine job no longer builds it with the old script.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The ndk-build builds (android/jni and libretro/jni) get a static library module
with the files in ext/ffmpeg-build/sources.mk, in place of the prebuilt
libraries. The libretro Makefile compiles them itself, with FFmpeg's include
directories first so its config.h wins over the others on the include path, and
puts the objects in obj-ffmpeg/ rather than next to the sources, where a
configure build may have left its own.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ext/ffmpeg-build/ffmpeg.vcxproj (and UWP/ffmpeg_UWP for UWP) builds the same
sources as CMake, copied from sources.mk by update_vcxproj.py. It's optimized in
Debug too, and without /Zc:inline, since MSVC otherwise keeps references to
disabled components that FFmpeg expects the compiler to drop.
The projects that linked the prebuilt libraries reference it instead, and take
the headers from the source tree.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ext/ffmpeg-build now has a committed config.h in place of the configure checks.
Assembly and arch-specific code are off, as in the --disable-asm builds of the
old prebuilt libraries, so only the platform has to be told apart, with a few
preprocessor checks. The sources are listed once in sources.mk, for every build
system to use, and build one static library. ATRAC3 and ATRAC3+ are enabled to
match the prebuilt libraries, and HAVE_AV_CONFIG_H is now defined, as FFmpeg's
own build does.
CMake builds this unless USE_SYSTEM_FFMPEG or FFMPEG_DIR is set, and no longer
looks for the prebuilt libraries in ffmpeg/. MinGW now builds it too, instead
of falling back to the system's.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The screenshot readback ran in ScreenManager's post-render callback, and
on Vulkan it ends the backbuffer render step. renderImDebugger() draws
after that, so taking a screenshot with the debugger open made its first
SetViewport() write through a null render step (an assert in debug
builds, a Play crash report in release). Do the readback at the end of
the frame in NativeFrame instead, which also puts the debugger in the
screenshot, and remove the now unused callback.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
SetFileLogPath() held logFileLock_ while creating the folder and opening
the file, and both log (CreateDir at INFO, OpenCFile for content URIs and
on errors). Logging to the file takes logFileLock_, so the thread
deadlocked on itself, and every thread that logged after it blocked too.
A Play ANR shows the loading thread stuck in CPU_Init's
SetFileLogPath, and the main thread waiting on the same lock to log a
key press.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
sigaltstack() is per thread. InstallExceptionHandler() runs in CPU_Init()
on the loading thread, which exits after boot, while the faults come from
the CPU thread and UninstallExceptionHandler() runs on the emu thread. So
our stack was never used, and the uninstall "restored" the loading
thread's previous alt stack onto the emu thread. On Android that's the
one bionic gives each thread and frees when the thread exits, so every
later fault on the emu thread ran its handler on freed memory. A Play
crash report shows scudo finding a corrupted chunk header when freeing our
stack in UninstallExceptionHandler().
The alt stack came with the Dolphin code, which needs it to handle its own
stack overflows. Ours only handles guest memory faults, so let the handler
run on the faulting thread's stack, or the alt stack that thread already
has. This also leaves a libretro frontend's alt stack alone.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A size that makes addr + size wrap around 32 bits had Split() build a slab
that ends before it starts. Lookups then skipped it, and a later
Merge() ran FillHeads() over it with a huge count, writing far outside
heads_. Sizes come from games through HLE calls, and the large ones are
recorded even without detailed mem info. Seen in a Play crash report, on
the FlushMemInfo thread.
FillHeads() also took the address one past the end of heads_ for a slab
in the last slice, which Debug builds assert on.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The NDK's zlib is too old for uncompress2(), which the PSAR unpacker now uses,
so link ext/zlib like the CMake build already does on Android. It's linked
whole, since the prebuilt FFmpeg libraries come after it on the link line and
libavformat uses it too.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
3.60's index.dat carries tag 0x0B2B10F0, which sceResmgr_9DC14891 had no key
for, so the shell couldn't read its item index and stopped on "A serious
error has occurred". The key follows the tag in 3.60's mesg_led_02g.prx, laid
out like the other versions' (3.52's mesg_led.prx has the 3.5x key the same
way). 3.60 now boots to the XMB.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>