Commit Graph
46785 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5 b6b8780cb9 iOS: Remove some dead code
- AudioEngine.mm/.h: not in the source list at all, only in the ARC
  set_source_files_properties list, and written for manual retain/release
  ([super dealloc]), so it couldn't have compiled under ARC anyway. The actual
  audio path is iOSCoreAudio.mm.
- DisplayManager.mm: empty file, referenced nowhere.
- iOSCoreAudioSetDisplayConnected: never called, so g_displayConnected was
  always false and the external-display branch in UpdateSession unreachable.
  Also dropped an unused local there.
- AppDelegate: the "screen" property was never assigned, so both view
  controllers were setting their frame from [nil bounds], i.e. CGRectZero. The
  window sizes the root view anyway. Also removed the stale launchPPSSPP:argv:
  declaration (it lives on SceneDelegate now), a forward declaration of a
  PPSSPPViewController protocol that doesn't exist, and an unreachable return.
- getView: declared on the base class and implemented identically in both
  subclasses, called by nobody.
- bindDefaultFBO: moved the empty implementation to the base class so it isn't
  missing there, and dropped the Metal no-op override.
- The unused delta/lastTimestamp computation in displayLinkFired.

Also fixed the viewWillAppear/viewWillDisappear log messages in the GL view
controller, which claimed to resume and pause the display link but don't.

The getView and bindDefaultFBO changes clear three -Wincomplete-implementation
warnings, and the AppDelegate.h one clears a fourth.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZk5y4Fzw811WJoNWZb8Sc
2026-08-07 06:56:07 +02:00
Henrik RydgårdandClaude Opus 5 d3012ea1db iOS: Don't pass a non-literal format string to NSLog
Benign as written since neither string contains a format specifier, but it's
exactly the pattern -Wformat-security exists to catch.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZk5y4Fzw811WJoNWZb8Sc
2026-08-06 20:56:37 +02:00
Henrik RydgårdandClaude Opus 5 56affb3cb9 iOS: Don't resolve request ID 0 from the payment queue
updatedTransactions posted success/failure unconditionally, but StoreKit also
delivers transactions we didn't initiate - unfinished ones at startup, for
instance - when no request is pending. Request IDs start at 10, so that just
produced "Unexpected request ID 0" errors. Guard it like the restore-finished
handler already does.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZk5y4Fzw811WJoNWZb8Sc
2026-08-06 20:56:37 +02:00
Henrik RydgårdandClaude Opus 5 6548a4f5cf iOS: Move accelerometer queue setup inside the init null check
Harmless today since messaging nil is a no-op, but it doesn't belong outside the
"if (self)" block.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZk5y4Fzw811WJoNWZb8Sc
2026-08-06 20:56:37 +02:00
Henrik RydgårdandClaude Opus 5 11a402df6f iOS: Call [super init] in LocationHelper's initializer
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZk5y4Fzw811WJoNWZb8Sc
2026-08-06 20:56:37 +02:00
Henrik RydgårdandClaude Opus 5 99624b7fd4 iOS: Fix string encoding used when launching URLs
NSStringEncodingConversionAllowLossy is a conversion option, not an encoding.
Its value is 1, which as an NSStringEncoding means NSASCIIStringEncoding, so any
URL with non-ASCII characters produced a nil string and a nil NSURL. Use UTF-8,
and bail out with a log instead of calling openURL with nil.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZk5y4Fzw811WJoNWZb8Sc
2026-08-06 20:56:37 +02:00
Henrik RydgårdandClaude Opus 5 8de3d9b8a0 iOS: Don't fall off the end of checkPermission
The switch covered every AVAuthorizationStatus known today, so an unhandled one
would return garbage from a non-void function. Treat unknown statuses as denied.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZk5y4Fzw811WJoNWZb8Sc
2026-08-06 20:56:37 +02:00
Henrik RydgårdandClaude Opus 5 bc2a5c7f3b iOS: Fix per-frame leak in the camera capture path
imageFromSampleBuffer released the input context but not the output one, leaking
a full-size bitmap context for every captured camera frame.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZk5y4Fzw811WJoNWZb8Sc
2026-08-06 20:56:37 +02:00
Henrik RydgårdandClaude Opus 5 89f7094513 iOS: Fix use-after-free when Vulkan init fails
viewDidLoad deleted the graphics context on InitAPI failure but left the member
pointing at the freed object, and then kept going - runVulkanRenderLoop and
shutdown would both use it. Null it out instead; both already check.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZk5y4Fzw811WJoNWZb8Sc
2026-08-06 20:56:37 +02:00
Henrik RydgårdandClaude Opus 5 6aad668a38 iOS: Fix always-true condition in the gsEvent key decoder
"else if (GSEVENT_TYPE_KEYDOWN)" tests a constant, so every gsEvent that wasn't
a key up - modifier events (type 12) in particular - was delivered to NativeKey
as a key down.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZk5y4Fzw811WJoNWZb8Sc
2026-08-06 20:56:37 +02:00
Henrik RydgårdandClaude Opus 5 8bfc151395 iOS: Hide the status bar when immersive mode is enabled
prefersStatusBarHidden was dead code - it computed an orientation and a
(commented out) user preference, then unconditionally returned false. So the
status bar was only ever hidden on iPhone in landscape, and only because iOS
does that on its own in compact height.

Now it honors bImmersiveMode from the DisplayLayoutConfig matching the current
orientation, so it also applies in portrait and on iPad. Adds the corresponding
checkbox to the iOS system settings, and updates the status bar on rotation and
when the setting is toggled.

Also fixes a missing break in the ROTATE_UPDATED case in System_Notify, and a
static/non-static mismatch on sceKernelLoadModuleBufferUsbWlan that broke the
build (the header intentionally exposes it for sceVshBridge).

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JZk5y4Fzw811WJoNWZb8Sc
2026-08-06 20:56:37 +02:00
Henrik Rydgård 35f558d677 Merge pull request #22032 from Kethen/wayland_vulkan_fix
bring back VulkanContext::SetCbGetDrawSize for linux wayland
2026-08-06 09:21:03 +02:00
Katharine Chui c39205496c bring back VulkanContext::SetCbGetDrawSize for linux wayland
It was removed during https://github.com/hrydgard/ppsspp/pull/21982

On Linux Wayland however this can be observed without:
34:25:550 Vulkan/VulkanContext.cpp:1401 I[G3D]: surfCapabilities_.current: -1x-1
34:25:550 Vulkan/VulkanContext.cpp:1406 I[G3D]: surfCapabilities_.current after clamp: -1x-1 min: 1x1 max: 32768x32768 computed: 1x1 cbdraw
2026-08-06 00:29:21 +02:00
Henrik Rydgård 2c620494b2 Merge pull request #22029 from hrydgard/cmdline-cleanup
Finish moving command line parsing into CmdLine.cpp
2026-08-05 16:40:42 +02:00
Henrik RydgårdandClaude Sonnet 5 5bd1ff8066 Move remaining manual command line parsing into CmdLine.cpp
Headless.cpp, NativeApp.cpp, and SDLMain.cpp each still hand-parsed a few
argv flags directly (mount/log/state/ignore/loglevel in headless and the
app, xres/yres/dpi/scale in SDL), duplicating and in some cases conflicting
with the shared CommandLineOptions parser. Consolidate all of it into
CmdLine.cpp/.h so there's a single source of truth, and drop the now-dead
remain_argc/remain_argv filtering in SDLMain.cpp since NativeInit no longer
reads argv itself.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PfFvWzpHxErWgRhKqqSewN
2026-08-05 16:02:49 +02:00
Henrik Rydgård e260188c49 Merge pull request #22026 from hrydgard/headless-refactor
Rework graphics init in the PPSSPPHeadless build
2026-08-05 11:02:29 +02:00
Henrik Rydgård 16206d18ab Simplify the EmuThread API again 2026-08-05 09:48:51 +02:00
Henrik Rydgård e0c942e862 Windows ARM64 buildfix (no GL available) 2026-08-05 09:24:12 +02:00
Henrik Rydgård 58c70f312a SDL: Initialize g_display before starting the EmuThread
Avoid racing between EmuThread and main thread.
2026-08-05 09:21:43 +02:00
Henrik Rydgård 905650921e Android hang fix when switching backends, buildfix 2026-08-05 00:59:33 +02:00
Henrik Rydgård 0324c7a912 Windows buildfix 2026-08-05 00:15:56 +02:00
Henrik Rydgård 4add25e6c7 Buildfixes, bump gradle 2026-08-05 00:15:56 +02:00
Henrik Rydgård ecae62e737 Fix headless with OpenGL for SDL 2026-08-05 00:15:56 +02:00
Henrik Rydgård 551e4cd0ab Headless: Make all GPU backends work correctly on Windows 2026-08-05 00:15:56 +02:00
Henrik Rydgård 25cf52176f Misc headless work 2026-08-05 00:15:56 +02:00
Henrik Rydgård 5eb4772644 Minor EmuThread refactor 2026-08-05 00:15:56 +02:00
Henrik Rydgård edd968062a Correct the Atrac3 security check that broke music in GTA
See 4cd611b71f
2026-08-05 00:15:38 +02:00
Henrik Rydgård a6896ae3b0 Merge pull request #22025 from hrydgard/graphics-context-refactor
Graphics context shutdown refactor
2026-08-04 19:26:51 +02:00
Henrik Rydgård 15f2bbc27f Buildfixes 2026-08-04 18:57:53 +02:00
Henrik Rydgård c42a3f070a Implement the new shutdown path for libretro too 2026-08-04 17:45:03 +02:00
Henrik Rydgård be922eca62 Make OpenGL render thread shutdown more robust. 2026-08-04 16:44:55 +02:00
Henrik Rydgård 092ec2f391 Merge pull request #22023 from hrydgard/wasapi-fixes
WASAPI (Windows audio): Fix a 5.1 bug, fix a bunch more smaller bugs
2026-08-04 10:38:28 +02:00
Henrik Rydgård 971b5eca13 WASAPI: Use device's suggested format when available
When IsFormatSupported returns S_FALSE with a closestMatch format,
evaluate it and use it if it's acceptable (stereo float). This can
improve compatibility with devices that don't support our exact
requested format but have a similar one.

Previously we just discarded closestMatch and forced manual conversion,
which was wasteful when the device provided a perfectly usable
alternative format.
2026-08-04 00:37:55 +02:00
Henrik Rydgård 32f3fbd65a WASAPI: Fix channel mapping for 5.1 audi
CRITICAL BUG FIX: The previous code assumed incorrect channel ordering
for multichannel audio, breaking 5.1 (6-channel) configurations.

Problem:
- Code assumed channel order: FL, FR, RL, RR, C, LFE
o systems- Actual 5.1 standard order: FL, FR, C, LFE, RL, RR
- This caused center/LFE to receive rear audio and vice versa
- Users had to force stereo mode to get working audio

Solution:
- Parse dwChannelMask from WAVEFORMATEXTENSIBLE to determine actual
  channel positions
- Map stereo input to correct output channels based on the mask
- Properly handles 5.1, 7.1, and other multichannel configurations
- Safely handles non-standard channel layouts

The channel mapping now works correctly for all standard speaker
configurations by querying the device's actual channel layout instead
of assuming a fixed order.
2026-08-04 00:37:55 +02:00
Henrik Rydgård 11d4107230 WASAPI: Replace magic numbers with named constants
Define constants for channel upmixing attenuation factors to improve
code readability and maintainability:
- SURROUND_ATTENUATION (0.7f) for rear/side channels
- CENTER_MIX_ATTENUATION (0.7f) for center channel
- LFE_MIX_ATTENUATION (0.5f) for LFE channel
2026-08-04 00:37:55 +02:00
Henrik Rydgård fd1e48ecc5 WASAPI: Add error check for RegisterEndpointNotificationCallback
Log a warning if registering for device change notifications fails.
This is non-fatal but means automatic device switching won't work.
2026-08-04 00:37:55 +02:00
Henrik Rydgård 95e09324a7 WASAPI: Fix ClampFloatToS16 to use full s16 range
Changed minimum clamp from -32767 to -32768 to match the full
range of signed 16-bit integers.
2026-08-04 00:37:55 +02:00
Henrik Rydgård d97f42c225 WASAPI: Cache channel count to avoid unsafe pointer access from audio thread
Store format_->nChannels in atomic curChannels_ member to avoid
unsynchronized access to format_ pointer from the audio thread.
The format_ pointer can be freed/reallocated during Stop() while
the audio thread might still be reading it.
2026-08-04 00:37:55 +02:00
Henrik Rydgård 3eeae2d89a Merge pull request #22021 from hrydgard/more-sdl-window
More SDL window/init fixes
2026-08-04 00:37:30 +02:00
Henrik Rydgård 5cb0965ea4 Merge pull request #22022 from hrydgard/android-taskswitch-fix
Don't exit games when leaving the emuthread
2026-08-04 00:37:20 +02:00
Henrik Rydgård 648560b2d3 Don't exit games when leaving the emuthread 2026-08-04 00:24:39 +02:00
Henrik Rydgård ced24079cb Error handling cleanup, with some Claude help 2026-08-03 23:53:48 +02:00
Henrik Rydgård 6272eca2e7 Fix some error handling bugs. 2026-08-03 23:37:17 +02:00
Henrik Rydgård 72a80363d9 Update the SDL DPI handling 2026-08-03 23:26:46 +02:00
Henrik Rydgård b6d7c18f39 Try to eliminate a race condition 2026-08-03 23:09:07 +02:00
Henrik Rydgård d8d7225710 Correct the OpenGL retry loop 2026-08-03 22:51:31 +02:00
Henrik Rydgård 2e7e6ab5a7 Merge pull request #22015 from hrydgard/texture-replacement-unittest
Add TextureReplacer unit test; make replacer testable standalone
2026-08-03 22:43:11 +02:00
Henrik Rydgård 68ec34ad54 Build and warning fixes 2026-08-03 19:11:07 +02:00
Henrik Rydgård 55eee26c52 Assorted warning fixes 2026-08-03 18:55:35 +02:00
Henrik Rydgård 4d98ff8404 Clean up Android.mk for the unittest 2026-08-03 18:55:33 +02:00