Commit Graph
234 Commits
Author SHA1 Message Date
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
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 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 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 9741bcacd9 iOS: Apply size changes between frames, fixing a glitch when rotating
UIKit lays out at the new size from the main thread, often while a frame
is being drawn, and the swapchain was only resized after presenting. So
the first frame of a rotation was laid out for one size and drawn at the
other. The view controller now hands the new size to the render thread,
and NativeFrame resizes before drawing instead of after presenting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 17:40:01 +02:00
Henrik RydgårdandClaude Opus 5.5 81efd601f0 iOS: Merge the Metal view controller into the base one
With the GL view controller gone, PPSSPPViewControllerMetal was the only
subclass of PPSSPPBaseViewController. They're now one class,
PPSSPPViewController, in ios/ViewController.mm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:13:29 +02:00
Henrik RydgårdandClaude Opus 5.5 5704b972e7 iOS: Remove OpenGL support from the app
The app now always uses the Metal view controller with Vulkan (MoltenVK),
for both the App Store and sideload builds. The GL view controller is gone,
and Common/GPU/OpenGL (except GLFeatures, used by the shader generators) and
GPU/GLES are no longer compiled for it. PPSSPP_API_ANY_GL is now off for
all of iOS except the libretro core, which still uses GLES.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:13:28 +02:00
Henrik RydgårdandClaude Opus 5.5 cfcf8cc17c iOS: Remove the iCade support
It has done nothing since 2017. iCade input came through iCadeReaderView,
a hidden UIKeyInput view that decoded the controller's keystrokes, and
f0ba66fcd6 ("add support for smart keyboard") commented out the code
that created it. Nothing has made one since, so the view controller's
iCadeEventDelegate methods and the ICadeTracker behind them were never
called.

iCade controllers present themselves to iOS as Bluetooth keyboards, so
their keys still arrive as hardware keyboard presses, which can be
mapped like any other keys. Modern controllers go through
GameController.framework anyway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 19:10:37 +02:00
Henrik RydgårdandClaude Opus 5.5 c8c3ba8bb6 iOS: Give the soft keyboard a view of its own
The view controller was the keyboard's text input, and UIKit hands first
responder back to it whenever something it presented goes away: a share
sheet, a photo picker, the alert after an app icon change. Each time,
up came the keyboard, and hideKeyboard calls were sprinkled around to
put it away again, one on a four second timer.

Text input now goes to a small view that only becomes first responder
when a text field gets focus. The view controller is first responder
otherwise, for hardware keyboard presses, but takes no text, so it can't
bring up the keyboard. The workaround hideKeyboard calls are gone, and
so is the endEditing on rotation, which dropped the keyboard if you
turned the phone while typing. Showing and hiding are synchronous now,
since every caller is on the main thread.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 19:09:41 +02:00
Henrik RydgårdandClaude Opus 5.5 6fe0f420b1 iOS: Drop version checks for iOS 12 and older, use one deployment target
The minimum is iOS 13 (15 for the App Store build), so the iOS 10
display link fallbacks, the iOS 13 orientation check, the weak import
of GCController and the respondsToSelector checks for APIs from iOS 8
to 13 can go.

The keyboard presses checked for iOS 13.0 but used UIPress.key outside
the check, which needs 13.4, so it would crash on 13.0-13.3 if it ever
runs there. It only runs in App Store builds now. Folded the two copies
into one function with the right check.

The deployment target was 13.0 in the toolchain's compile flags but
12.0 in CMAKE_OSX_DEPLOYMENT_TARGET and 11.0 in the Xcode attribute for
non-App Store builds. All three now come from the toolchain file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 16:28:27 +02:00
Henrik RydgårdandClaude Opus 5.5 69d33ef8e9 iOS: Resize in place on rotation instead of restarting graphics
Both view controllers stopped the emu/render thread on every rotation
and started it again, tearing down all of graphics. Since d0e45b94d9
NativeFrame resizes the graphics context and posts GPU_DISPLAY_RESIZED
on iOS too, so a NativeResized() is all a size change needs, like
Android now does. GLKView resizes its drawable by itself, and the Vulkan
context recreates the swapchain, which MoltenVK sizes from the layer.

The resize happens in viewDidLayoutSubviews, which UIKit runs at the
final size as a rotation animation starts. Resizing when the rotation
completed instead left half the screen black while it animated. This
also covers window resizes, which matter more now that
UIRequiresFullScreen is deprecated (iPadOS 26).

NativeFrame sets the PSP_CoreParameter() size, so the main thread
doesn't have to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 16:28:27 +02:00
Henrik RydgårdandClaude Opus 5.5 b544f5cb4e iOS: Run the Vulkan render thread through RunGraphicsLoop
The iOS Vulkan render loop was a copy of Android's from before it moved
to RunGraphicsLoop, and still had the bugs Android has since fixed:

- When InitSurface failed, the thread deleted the graphics context
  through its own copy of the pointer, leaving the view controller to
  call ShutdownAPI on freed memory later.
- A thread that exited by itself was never joined, since the exit
  request went by renderLoopRunning, so every later start bailed with
  "Already running" and the screen stayed black.
- renderLoopRunning was only set once the thread got going, so an exit
  request arriving before that skipped the join.

Also join the render thread (GL or Vulkan) in shutdown, which on app
termination runs without a willResignActive first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 15:01:33 +02:00
Henrik Rydgård 7700861d49 More iOS cleanup
Remove outdated code.
2026-08-07 08:49:29 +02:00
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JZk5y4Fzw811WJoNWZb8Sc
2026-08-07 06:56:07 +02:00
Henrik Rydgård 16206d18ab Simplify the EmuThread API again 2026-08-05 09:48:51 +02:00
Henrik Rydgård 5eb4772644 Minor EmuThread refactor 2026-08-05 00:15:56 +02:00
Henrik Rydgård be922eca62 Make OpenGL render thread shutdown more robust. 2026-08-04 16:44:55 +02:00
Henrik Rydgård 1649d2fcae Also merge away the iOS GL graphics context 2026-07-26 20:16:24 +02:00
Henrik Rydgård 3eb056ad86 Move Common/GraphicsContext.h to Common/GPU/GraphicsContext.h 2026-07-26 13:58:17 +02:00
Henrik Rydgård 568ffe5a05 Use the common EmuThread implementation on iOS as well 2026-07-26 12:04:51 +02:00
Henrik Rydgård 29edec7684 Move calling ThreadStart and ThreadEnd into the EmuThread wrapper 2026-07-26 11:54:50 +02:00
Henrik Rydgård 7f218acc53 Change the GraphicsContext interface to be more consistent 2026-07-26 10:22:00 +02:00
Henrik Rydgård 85f8715660 Break the circular dependency caused by putting EmuThread in core using an interface 2026-07-24 15:31:42 +02:00
Henrik Rydgård af7977267e Add NeedsRenderThread property to GraphicsContext 2026-07-24 15:31:41 +02:00
Henrik Rydgård 9f30700188 Fix multitouch in OpenGL mode on iOS. Oops.
Fixes #21349
2026-03-05 13:18:19 +01:00
Henrik Rydgård 42970d1118 Modernize iOS screen resize code a little. 2026-02-13 18:16:26 +01:00
Henrik Rydgård 8e06e4c5c2 iOS: Delete untested multi-screen-management code that uses deprecated APIs 2026-02-13 18:16:26 +01:00
Henrik Rydgård 138be54f6a More misc work 2025-10-28 11:54:07 +01:00
Henrik Rydgård df9c575a22 iOS: Show the status bar (overlay style) in portrait mode. 2025-10-28 11:54:07 +01:00
Henrik Rydgård c7370c2e72 Move even more stuff into PPSSPPBaseViewController 2025-10-27 21:38:27 +01:00
Henrik Rydgård d5834d0f84 Move a lot more stuff into PPSSPPBaseViewController 2025-10-27 21:11:39 +01:00
Henrik Rydgård f825db5551 Move camera and location support to PPSSPPBaseViewController 2025-10-27 20:44:34 +01:00
Henrik Rydgård 5e41be136b Move photo picking support to PPSSPPBaseViewController 2025-10-27 20:29:00 +01:00
Henrik Rydgård ae920edf91 iOS: Add a common PPSSPPBaseViewController 2025-10-27 20:19:22 +01:00
Henrik Rydgård 95549ae2c9 iOS ViewController: Get rid of the GLKViewController base class 2025-10-27 19:24:25 +01:00
Henrik Rydgård e2b21d26bf Rotation on iOS fixes: Make sure the setting is saved, etc. 2025-10-22 15:54:00 +02:00
Henrik Rydgård c5dcb0009c Support screen rotation in OpenGL as well. 2025-10-22 15:19:12 +02:00
Henrik Rydgård 1c49ad7b29 Support screen rotation on iOS (unrestricted) 2025-10-22 15:13:21 +02:00
Henrik Rydgård 9218fe9b59 Rework the shutdown logic in the OpenGL backend. Eliminated race conditions. 2025-08-31 10:57:06 +02:00
Henrik Rydgård 164dd53a89 More IAP improvements 2025-05-25 11:22:05 +02:00
Henrik Rydgård 758dcf6afc More icon stuff 2025-05-25 11:22:05 +02:00
Henrik Rydgård c3ed94b721 More icon work 2025-05-25 11:22:05 +02:00
Henrik Rydgård 6035ef0652 Implement image file picker on iOS, various buildfixes 2025-05-19 20:41:16 +02:00
Henrik Rydgård e01ca5b057 Logging API change (refactor) (#19324)
* Rename LogType to Log

* Explicitly use the Log:: enum when logging. Allows for autocomplete when editing.

* Mac/ARM64 buildfix

* Do the same with the hle result log macros

* Rename the log names to mixed case while at it.

* iOS buildfix

* Qt buildfix attempt, ARM32 buildfix
2024-07-14 14:42:59 +02:00
Henrik Rydgård 305418813a Add option to control the iOS app switching mode 2024-07-05 20:08:12 +02:00
Henrik Rydgård 21df698a20 iOS: Enable "double-swipe" to switch apps
To prevent accidental app switching.

Unfortunately, the way to do this is to disable auto-hiding of the swipe indicator.
Another strange Apple quirk.
2024-06-20 11:28:35 +02:00
Henrik Rydgård 898e117b6b Do the same for the Metal/Vulkan viewcontroller. 2024-06-19 23:09:58 +02:00
Henrik Rydgård 4c4fcabc5e iOS: Disable the swipe-back gesture in-game, to maximize touch responsiveness 2024-06-19 22:43:42 +02:00
Henrik Rydgård 78a3cb5689 Fix for non-app-store builds 2024-06-05 23:30:22 +02:00
Henrik Rydgård 584d07ea8e iOS: Implement basic physical keyboard support 2024-06-05 23:27:03 +02:00