Commit Graph
48818 Commits
Author SHA1 Message Date
libretroadmin b71fbaeb5c libretro: fix OOB, UAF, data races and control flow in core glue
System_AudioPushSamples converts straight into the output buffer: the
block loop never advanced the source pointer and copied numSamples*2
int16s out of a 2048-sample stack buffer, a stack OOB read for any push
over 1024 frames. Realloc failure drops samples instead of crashing and
log_cb is NULL-checked. retro_serialize refuses to write a state larger
than the frontend's buffer, retro_get_memory_data/size return nothing
until PSP memory is mapped, deferred unserialize no longer leaks the
previous buffer, and the cheat entry points stop leaking a CWCheatEngine
per call.

The emu thread acknowledges a pause with a CAS so it cannot clobber a
concurrent quit request. EmuThreadStop stops and joins from any live
state, so unloading while paused no longer leaves a thread running over
freed state. EmuThreadPause pumps queued frames until the thread parks,
via a new non-blocking GLRenderManager::HasQueuedThreadWork() check,
instead of draining one frame, which deadlocked when the thread was
blocked on a readback sync in the next frame. retro_run resumes a paused
thread and pauses it before check_variables() rewrites g_Config,
retro_reset stops it before PSP_Shutdown(), and the sleep_ms(4) after
resume is gone.
2026-10-13 13:50:05 +02:00
libretroadmin 8abc5920c6 libretro: include <array> for the cheat file buffer
MSVC doesn't get std::array through the other headers, so libretro.cpp failed to build there.
2026-10-13 13:49:41 +02:00
Henrik Rydgård 0af0d86470 Merge pull request #22542 from hrydgard/faster-build
Faster CMake builds: libc++ transitive includes, less glslang/SPIRV-Cross, include cleanup
2026-10-13 12:57:43 +02:00
Henrik RydgårdandClaude Opus 5.5 e602aa1548 Add includes that were only arriving transitively
VertexDecoderRiscV.cpp got <cfloat> through SmallDataConvert.h, and three
headers used malloc/free without <cstdlib>, which libc++ no longer brings in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 12:36:06 +02:00
Henrik Rydgård 3c25f21bae Merge pull request #22541 from hrydgard/libretro-fork-fixes
Various bugfixes from libretro's experimental fork
2026-10-13 12:26:27 +02:00
Henrik RydgårdandClaude Opus 5.5 2aff37162b CMake: Keep glslang's HLSL frontend on Windows
MinGW/Cygwin CMake builds should match the MSVC and UWP glslang projects,
which build with ENABLE_HLSL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 12:17:28 +02:00
Henrik RydgårdandClaude Opus 5.5 a361dfc490 Drop unused Config.h and SmallDataConvert.h includes
Config.h is edited about 100 times a year and each edit recompiled 198
files; now 172. SmallDataConvert.h pulls in arm_neon.h and was included by
headers that don't use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 12:13:42 +02:00
Henrik RydgårdandClaude Opus 5.5 ef8dcbf3c8 CMake: Build less, and parse less of libc++
- Define _LIBCPP_REMOVE_TRANSITIVE_INCLUDES for clang. Before C++23, libc++
  headers pull in many others for old code's sake (<vector> brings in
  <locale>). libstdc++ and MSVC ignore it.
- Turn off glslang's HLSL frontend everywhere, not just on Android. We only
  feed it GLSL.
- Don't build spirv-cross-cpp/msl/hlsl unless something links them (only
  hlsl, on Windows).

Clean Debug build on an M-series Mac: about 11% faster.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 12:13:40 +02:00
Henrik RydgårdandClaude Opus 5.5 1d92e28ce0 Update SPIRV-Cross to vulkan-sdk-1.4.363.0
The old version used std::terminate without including <exception>, which
breaks once libc++'s transitive includes are off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 12:13:40 +02:00
Henrik Rydgård df4ea65ee6 Merge pull request #22540 from hrydgard/ci-tests-in-build
CI: Run tests in the build jobs, fix ccache eviction, fewer macOS jobs
2026-10-13 11:16:43 +02:00
Henrik RydgårdandClaude Opus 5.5 fd79fb0007 Revert "CI: Cancel a PR's running builds when it gets a new push"
Cancelled runs show as failures on their commits, and PRs rarely get
pushed to often enough for it to pay off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 10:51:24 +02:00
Henrik RydgårdandClaude Opus 5.5 39f4d64abc CI: Suppress the MINGW64/MINGW32 deprecation warnings
Only make and bash come from MSYS2 in the libretro Windows builds, the compiler
is MSVC.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 10:48:50 +02:00
Henrik RydgårdandClaude Opus 5.5 4bdfb8604c CI: Only check out the FFmpeg libraries each build uses
FFmpeg has prebuilt libraries for every platform, 1.5 GB, and every job checked
all of it out, taking 2-3 minutes. checkout-submodules.sh fetches the other
submodules as before, and FFmpeg as a partial clone with a sparse checkout of
the given folders, plus the source headers since some builds have the ffmpeg
folder on the include path. A Linux x86-64 build gets 67 MB. Alpine, which
builds FFmpeg itself, gets the sources and none of the libraries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 10:47:22 +02:00
Henrik Rydgård d726e736d5 Merge pull request #22539 from hrydgard/validate-ge-dump-commands
GE dump playback: Validate commands, clamp writes, bound allocations
2026-10-13 10:37:55 +02:00
Henrik RydgårdandClaude Opus 5.5 11d16ece2d CI: Build the iOS and tvOS libretro cores in one job
Only five macOS jobs run at once, and with six, one waited about ten minutes
for a runner. The two builds take under five minutes each, a separate job
mostly added another checkout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 10:35:21 +02:00
Henrik RydgårdandClaude Opus 5.5 5866231f66 CI: Cache the FFmpeg that the Alpine job builds
Keyed on the FFmpeg submodule, its build script and the Alpine release. Saves
the 3.3 minutes it took to compile it every run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 10:32:40 +02:00
Henrik RydgårdandClaude Opus 5.5 39321af847 CI: Cancel a PR's running builds when it gets a new push
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 10:10:12 +02:00
Henrik RydgårdandClaude Opus 5.5 3ad5657ff4 CI: Only save ccache on master, cap the AppImage one
The Actions cache was full (10 GB), mostly with caches saved by PR runs that only
that PR could restore, and the AppImage ccache had no size limit. Master's got
evicted, so even master builds found no cache and hit 0.3% of the time. PRs
still restore master's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 10:10:11 +02:00
Henrik RydgårdandClaude Opus 5.5 6cc7d848a1 CI: Run the tests in the build jobs that build them
The test job needed the whole build matrix, so it only started once the slowest
build was done, though it only used three of its artifacts. Running the tests
right after those three builds also saves the artifact download and a second
round of package installs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 10:07:16 +02:00
Henrik RydgårdandClaude Opus 5.5 ec76a4d56e GE dump playback: Refuse sections over 1 GB
A zstd frame doesn't always declare its size, and a small one can expand to
gigabytes, so this is the limit that keeps a crafted dump from exhausting
memory. The largest section in the 1042-dump test set is 82 MB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 10:05:35 +02:00
Henrik Rydgård f8c1e39315 Merge pull request #22535 from hrydgard/tvos-support
Apple tvOS support prototype (and CI)
2026-10-13 10:03:15 +02:00
Henrik RydgårdandClaude Opus 5.5 9c2cf98b84 GE dump playback: Clamp the remaining writes, bound the loader's allocations
Follows up the command range validation:
- Don't require anything of the data commands' sizes or alignment. Version 2
  dumps have empty VERTICES and CLUT commands, and old recorders didn't align
  anything. Registers() drops a trailing partial word instead.
- Split register blocks bigger than the list buffer, which they overran.
- Clamp MEMCPYDATA and MEMSET to valid memory. Only their start was checked.
- Check the compressed sizes against the file, and the decompressed sizes
  against what the frame declares, before allocating. Some version 5 dumps
  leave the size out of the zstd frame; those are checked after decompressing.
- Don't let a large FRAMEBUF size wrap around in MarkNeededTargets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 10:01:29 +02:00
Henrik Rydgård db8a749536 Merge pull request #22538 from hrydgard/ui-focus-beam
UI: Switch to a much nicer "beam algorithm" for kb/controller UI navigation
2026-10-13 09:41:24 +02:00
Henrik RydgårdandClaude Opus 5.5 625db43746 tvOS: Back on the main screen goes to the home screen, like on Android
tvOS only does that with a Back press it gets to see, so the view controller
lets controller events through to UIKit while the top screen is top level
(the new TOP_LEVEL_CHANGED notification), and passes presses that aren't
keyboard keys on to super. Elsewhere Back stays ours.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 09:29:26 +02:00
Acts1631 80b813f507 Validate GE replay commands before execution
Crafted ppdmp command ranges can extend past the decompressed push
buffer. Frame buffer playback can then copy adjacent host heap data
into emulated VRAM, exposing process memory through rendered output.

Validate each command's type, range, and minimum payload size before
constructing the replay executor.
2026-10-13 09:21:14 +02:00
Henrik Rydgård 76d86d8b9d Merge pull request #22537 from acts-1631/validate-stripped-zip-paths
Validate ZIP paths after stripping their common prefix
2026-10-13 09:18:59 +02:00
Acts1631 8220a0f855 Validate ZIP paths after stripping their common prefix
ExtractZipContents checked each archive path for parent components
before removing stripChars. A name could become ../ only after
stripping and escape the install directory, allowing a crafted archive
to overwrite files in sibling PSP directories.

Validate both archive and output paths, and apply stripping consistently
when checking for overwrites.
2026-10-12 22:17:53 -04:00
Henrik RydgårdandClaude Opus 5.5 31918b8636 UI: Arrow key focus moves by beam and edge distance
Replaces the center-to-center scoring, which skipped a wide view between narrow
ones, since its center is far away even when its edge is right there. Now it
works like Android's FocusFinder: only views in the direction of the move are
candidates, ones in the origin's beam beat ones off to the side (going up or
down, unless those are in a nearer row), and otherwise the nearest wins, with
distance along the move weighted 13 times distance across it. Unlike Android,
the distance across is to the candidate's nearest edge rather than its center.

First/last and page moves keep their scoring.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 02:31:07 +02:00
Henrik RydgårdandClaude Opus 5.5 84ba31eb9f Adhoc: stop connecting to the adhoc server when the friend finder is stopped
initNetwork() runs on the friend finder thread and its connect loop only
gave up on power-down or after the timeout. sceNetAdhocctlTerm joins that
thread from the emulation thread, so terminating while the server was
unreachable could freeze emulation for up to adhocDefaultTimeout.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 02:24:27 +02:00
Henrik RydgårdandClaude Opus 5.5 71c425d052 Savestate screenshot: stop retrying after SCREENSHOT_FAILURE_RETRIES
Each retry went through ScheduleSaveScreenshot(), which reset the
failure count, so the limit was never reached and a state saved while no
screenshot could be taken kept retrying every frame.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 02:24:19 +02:00
Henrik RydgårdandClaude Opus 5.5 70b9a810b7 Rewind: wait for the compress thread before restoring
Save() hands the newest state to a compress thread and returns. A rewind
right after could take lock_ first and decode that slot's old buffer
against the new base, loading a garbage state.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 02:24:11 +02:00
Henrik RydgårdandClaude Opus 5.5 847625359d HTTP connect: re-arm the select() set on each wait, and skip failed sockets
select() clears the sockets that aren't ready, so after one 0.5 s slice
with no connection the loop waited on an empty set and every connect
slower than that ran out the whole timeout. A socket that turns writable
because its connect failed was also taken as connected.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 02:24:05 +02:00
LibretroAdmin 664f6ff5ad D3D11: work on a context that refuses ID3D11DeviceContext1
D3D11DrawContext takes its base context from the deviceContext
argument, and the blend state is bound through the base context, which
accepts an ID3D11BlendState1 as is. ID3D11DeviceContext1 is optional:
RetroArch's threaded video hands v1 cores a deferred-context proxy that
answers ID3D11DeviceContext only, and the core now starts on it.
2026-10-13 02:23:48 +02:00
Henrik RydgårdandClaude Opus 5.5 5b05b34b4e tvOS: Fewer ifdefs, capability checks instead
The Siri Remote setup builds on iOS too, the device type comes from the
interface idiom, and requests for things the platform says it lacks are
refused by checking the property. What's left ifdeffed is API tvOS doesn't
have at all. Reports say tvOS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 02:21:14 +02:00
Henrik RydgårdandClaude Opus 5.5 5ce0eb58fd tvOS: Layered app icon and Top Shelf images
Generated from the iOS icon art by ios/generate_tvos_icons.py: the logo floats
over the background for the parallax effect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 02:11:55 +02:00
Henrik RydgårdandClaude Opus 5.5 7315c0392c Games tab: Hide the browse button where there's no folder browser (tvOS)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 02:03:37 +02:00
Henrik RydgårdandClaude Opus 5.5 9512d619da tvOS: Read the Siri Remote's ring buttons, memstick in Caches/PPSSPP
The 2nd generation remote's ring has real direction buttons and a center
button, which take GCSupportsMultipleMicroGamepads. Its buttonA is pressed
along with all of them, which gave stray enters. Swiping is off for now, it
fought with the ring. The memory stick moves into a folder of its own, out
of the way of what the system keeps in Caches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 01:59:30 +02:00
Henrik RydgårdandClaude Opus 5.5 56c522260e tvOS: Usable remote, smaller UI, keep file browsing in the container
Tested on an Apple TV 4K. The micro gamepad's dpad buttons flicker with every
wobble on the touch surface, so read the finger position instead: swipes step
once per fixed distance, and clicks are arrows at the edges and enter in the
middle. The UI scale now matches a 1080p Android TV (320 dpi). b-tvos.sh
can sign, install and launch on a device.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 01:52:48 +02:00
Henrik RydgårdandClaude Opus 5.5 b58dd17c2e iOS: Show paths in the app's container as ~/...
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 01:52:48 +02:00
Henrik RydgårdandClaude Opus 5.5 bfdf532965 CI: Build the tvOS app and the iOS and tvOS libretro cores
Adds b-tvos.sh and b.sh --tvos.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 01:15:41 +02:00
Henrik RydgårdandClaude Opus 5.5 3a8a1799ee Add a tvOS build of the app
Shares the iOS frontend, with camera, location, motion, photo/document
pickers, share sheet, clipboard, microphone, battery and rotation compiled
out. The view controller is a GCEventViewController, so controllers only
reach us through GCController, and the Siri Remote is read as a micro
gamepad and sent as arrow/enter/escape/back keys. tvOS has no persistent
storage besides NSUserDefaults, so the memory stick lives in Caches for now.

Configure with -DIOS_PLATFORM=TVOS. The MoltenVK submodule gets the tvOS
slice from the same stock v1.4.2 release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 01:06:55 +02:00
Henrik RydgårdandClaude Opus 5.5 20d1a58806 CMake: Only build FreeType along with AtlasTool, its only user
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 01:06:09 +02:00
Henrik RydgårdandClaude Opus 5.5 7c9765d02c Add PPSSPP_PLATFORM(TVOS), skip sigaltstack on tvOS
tvOS doesn't have sigaltstack, which broke the libretro tvOS build. The
exception handler now runs on the faulting thread's stack there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 00:42:33 +02:00
Henrik Rydgård dd6bd1a53d Merge pull request #22529 from hrydgard/android-hidden-bar-insets
Android: Don't leave room for system bars we have hidden
2026-10-12 21:59:03 +02:00
Henrik Rydgård 503b36bf5a Merge pull request #22531 from hrydgard/libchdr-no-warnings
Windows: Turn off annoying compiler warnings in dependencies
2026-10-12 21:58:52 +02:00
Henrik Rydgård fe018ee1e9 Merge pull request #22533 from hrydgard/search-backspace-utf8
Type-to-search: UTF-8 character support, ignore § and other Latin-1 symbols
2026-10-12 21:58:40 +02:00
Henrik Rydgård 4a00ee7667 Merge pull request #22532 from hrydgard/mac-drag-drop
SDL: Boot a file dropped onto the window
2026-10-12 21:58:27 +02:00
Henrik RydgårdandClaude Opus 5.5 671b6ce397 Type-to-search: Backspace removes a whole UTF-8 character, ignore § and other Latin-1 symbols
Backspace popped a single byte, leaving half of a multi-byte character behind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 21:30:32 +02:00
Henrik Rydgård 4c48f85664 Merge pull request #22527 from hrydgard/vulkan-prerotate-270
Android: Pre-rotate reverse landscape on Vulkan again, fix insets for hidden bars
2026-10-12 19:45:55 +02:00
Henrik Rydgård b947316f4b Merge pull request #22528 from hrydgard/darwin-memory-reserve
Darwin: Reserve space for the memory views instead of probing for it
2026-10-12 19:45:43 +02:00