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>
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>
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>
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>
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>
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>
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>
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>
- 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
* 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