Commit Graph
1487 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5 2cb0be1bc4 UPnP: fix the exit hang and the CPU spin, and only run the thread when enabled
The two long-standing bug reports had a shared root: the service loop could
end up in a state it never left.

- Exit hang: UPNP_CMD_EXIT was queued alongside port requests and only acted
  on when it reached the front. A request that couldn't complete was never
  popped, so exit sat behind it forever and join() blocked indefinitely.
  Exit is a flag now, checked before anything else.
- CPU spin: wait_for() with a predicate returns immediately when the predicate
  already holds, so a stuck queue head meant a tight loop. sceNetInet's bind()
  queues UPnP_Add regardless of the setting, so this hit whenever UPnP was off
  and a game used sockets. The loop always blocks now, and requests are dropped
  while UPnP is off.
- Failed discovery was retried every 5s forever, each time a full 2s SSDP round
  plus an error toast. Now backs off 5s -> 300s and reports once.

Other things found while in here:

- Every failed Initialize() leaked a UPNPUrls + IGDdatas, so ~every 5 seconds
  for anyone with UPnP on and no router. The manual miniwget/parserootdesc/
  GetUPNPUrls block was also redundant - UPNP_GetValidIGD does all of it and
  memsets over the result, leaking the URLs and costing an extra HTTP round
  trip per attempt.
- UPNP_GetValidIGD's status was never checked, so we could go DONE with no
  usable IGD and hand a NULL controlURL to UPNP_GetConnectionTypeInfo.
- miniupnpc's strncpy into the port-mapping-entry buffers doesn't guarantee a
  terminator; an 80-char description ran std::string off the end of desc[80].
- Add() marked another app's port "taken" only after our own add succeeded, so
  a failed add left their mapping deleted and never restored.
- Clear() walked the router's entire table at exit, one HTTP round trip per
  index. It now deletes only what we know we mapped, and the exit cleanup has
  a time budget so an unreachable router can't stall shutdown.
- The in-flight request stayed in the queue during the router call, so a
  same-port request arriving concurrently could erase it and be dropped
  unexecuted.
- The queue is bounded, and last-write-wins per port collapses the churn from
  games that rebind in a loop.
- The mapping description is built when the request is queued rather than read
  off g_paramSFO from the UPnP thread later.

The thread now only exists while the setting is on - turning it off makes it
remove its mappings and exit, turning it on starts one. That means __UPnPInit()
has to run after the config is actually loaded; g_Config.Init() only builds a
lookup table. QueueRequest() reconciles too, so a per-game config or a libretro
core option enabling UPnP works without a notify at every call site.

The settings checkbox is disabled in-game, since sceNet latches related
settings at boot and a game that already mapped its ports wouldn't cope with
them disappearing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DCPmm7FoQUoqrbMdhfqhQ2
2026-08-30 00:37:05 +02:00
Henrik Rydgård 5cffcd34ad Get rid of the confusing old USING_WIN_UI define. Make a more clear system property for headless. 2026-08-16 12:19:41 +02:00
Henrik Rydgård 8cd7e1b2c0 Delete all support for Qt
Our Qt backend has long been left behind and doesn't even support Vulkan
currently. There would be a lot of work to make it viable, and I don't
think anyone is really interested.

ImGui on SDL will soon fulfill the need for a more classic user interface
with a menu bar on Linux, and on Mac we already have a native UI.
2026-08-08 18:18:28 +02:00
Henrik Rydgård cd254c9ec3 Merge branch 'master' into minor-tweaks 2026-08-07 15:14:47 +02:00
Henrik Rydgård 7219cd2f5a Split off ScreenManager from Screen.cpp 2026-08-07 14:30:36 +02:00
Henrik Rydgård c1310ae4a5 Rework UPnP service thread sync
No longer waking up twice per second. Instead a slow 5s poll plus
wakeups if needed.
2026-08-07 11:24:22 +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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JZk5y4Fzw811WJoNWZb8Sc
2026-08-06 20:56:37 +02:00
Henrik Rydgård 993c3a9c67 Avoid accurately computing disk space on iOS and Android (where it can be slow). Add a setting. 2026-07-14 22:22:29 +02:00
Henrik Rydgård 61e1ef8f7a Remove the "Software skinning" option. Now always on. 2026-07-14 17:02:57 +02:00
Henrik Rydgård 5f7281bd8e Remove old vestiges of geometry shader support 2026-07-08 18:25:08 +02:00
Henrik Rydgård 623545bd24 Delete the "Hardware tessellation" feature.
Very hard to maintain and debug, not worth it.
2026-06-16 16:17:14 +02:00
Henrik Rydgård 6d98293be9 Hide orientation controls on large Android 17 devices, since they won't work. 2026-06-15 10:37:58 +02:00
Henrik Rydgård 36bdde68f9 Delete the "Lazy texture cache" option 2026-06-09 23:49:54 +02:00
Henrik Rydgård 2534eb4480 Disable anisotropic filtering for all flat draws.
May improve performance slightly, and should fix the last instances of #19555
2026-06-08 15:28:58 +02:00
jasaaved 95006cf1d3 Changed bFullScreenExclusive to bAllowFullScreenExclusive
There's no guarantee VK_FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT will enter Fullscreen exclusive (FSE). Under the right conditions, the driver and/or DWM can grant FSE. Adding "allow" to the FSE setting should make this a bit clearer.
2026-06-04 12:54:52 -07:00
jasaaved 0147ea0ae8 Grey out "Use all screens" when "Exclusive fullscreen" is on
Exclusive full screens is fundamentally a single monitor concept. It doesn't make sense to have "use all screens" and "Exclusive fullscreen".

The order of the options have been swapped so "Fullscreen" and "Exclusive Fullscreen" are right next to each other.
2026-06-03 17:15:13 -07:00
jasaaved 5e25118043 Fix the exclusive fullscreen config guard and switching the setting on/off
Previously the exclusive fullscreen option in the settings screen was
guarded by a compile-time #ifdef VK_EXT_full_screen_exclusive, which is
always true on Windows. It now uses a runtime fullScreenExclusiveSupported
cap derived from whether the extension is actually enabled by the driver.

Switching between borderless and exclusive fullscreen currently requires a
restart. This is because once DWM has claimed the window (any frames
presented), ALLOWED_EXT cannot re-engage exclusive mode on an existing
swapchain. A new process gets a fresh HWND that DWM has not claimed yet,
so ALLOWED_EXT works correctly at startup.

The proper fix is to use VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT
with vkAcquireFullScreenExclusiveModeEXT/vkReleaseFullScreenExclusiveModeEXT
to explicitly negotiate exclusive mode with DWM mid-session without needing
a restart. To be done in a follow-up.
2026-06-03 17:15:13 -07:00
jasaaved b5bd685556 Add VK_EXT_full_screen_exclusive guard
Exclusive fullscreen option is now hidden on platforms without VK_EXT_full_screen_exclusive.
2026-06-03 17:15:13 -07:00
jasaaved 0c23cdaf3d Windows Vulkan: default to borderless fullscreen, add exclusive option
Vulkan swapchain now explicitly sets VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT by default, enabling proper borderless fullscreen behavior with benefits including better Alt+Tab, VRR/G-Sync/FreeSync, and Auto HDR support.
2026-06-03 17:15:13 -07:00
Henrik Rydgård 33ae88af6d Delete option "Disable range culling". No games are known to require it anymore. 2026-05-31 23:31:06 +02:00
Henrik Rydgård 931c246208 Merge pull request #21755 from Eloren1/load-save-confirm
Add load state confirmation setting
2026-05-31 22:04:19 +02:00
Henrik Rydgård e8e357e360 Implement the "Mix audio with other apps" setting on Android. 2026-05-31 19:08:45 +02:00
Eloren1 23aef44ae1 UI: Add load state confirmation option 2026-05-31 19:32:41 +03:00
Henrik Rydgård dd125b2e4d Delete obsolete (and non-working) support for GPUs without non-pow-2 textures. 2026-05-24 14:15:34 +02:00
Henrik Rydgård 4a420c95c2 Remove some redundant device caps, show clip/cull/depth-clamp in system info 2026-05-21 11:59:26 +02:00
Henrik Rydgård cc0ece038c Clean up the string type in RequestCallback - somehow was both char* and std::string????
Might be related to #21695
2026-05-18 14:16:34 +02:00
Henrik Rydgård afb764e6ae Rendering: Unify the Y-flipping state across backends (now only applied in-shader, not through matrices). 2026-05-14 23:30:06 +02:00
Henrik Rydgård bc62602935 Add checkboxes to enable/disable the three input backends.
Can probably serve as a workaround for #21494
2026-05-01 21:28:25 +02:00
Katharine Chui 64cfac792c fix adhoc server option missing when updating or using local address
Prior to this change, adhoc server option does not render when
g_Config.sProAdhocServer has value, but the hostname is not found
with AdhocGetServerByHost. This can be caused by either updating
from an older version of PPSSPP, or using one of the local
address in the server list.
2026-04-16 12:46:11 +02:00
Henrik Rydgård 5ef608a12a Network settings: Show proper server name if available 2026-04-13 11:30:52 -06:00
Henrik Rydgård 49d3d3dc37 Settings and dev settings: Preserve the current tab. Minor UI tweaks. 2026-04-06 12:09:40 -06:00
Guido Cella 4413c7b10f Implement pause on lost focus on SDL
This option was Windows exclusive and this commit implements it on SDL
as well.

It is hidden on mobile devices because it makes no sense there.
2026-04-01 15:39:34 +02:00
Henrik Rydgård cfc5d74602 Some progress with server status UI 2026-03-30 11:34:19 -06:00
Henrik Rydgård f6e518aae7 More string cleanup 2026-03-26 09:49:35 -06:00
Henrik Rydgård 212547eece Remove "Change" from "Change nickname", remove redundant translation 2026-03-26 09:35:37 -06:00
Henrik Rydgård a4b76ed285 Try to nudge the user to pick a unique nickname for adhoc 2026-03-26 09:29:20 -06:00
Henrik Rydgård 77c28d7b5d Clean up quickchat setting code and translation strings 2026-03-18 08:58:50 +01:00
Henrik Rydgård 0d2f7055fd Fix a minor misbehavior with "non-added" adhoc server names 2026-03-14 23:47:21 +01:00
Henrik Rydgård 75453632f9 Handle inset adjustements on the C++ side, handle them better in the UI. 2026-03-14 18:13:37 +01:00
Henrik Rydgård e33fd29bd2 Add a "quick-edit" button for the current server host/ip, if it's custom
This was requested by Majin on Discord, whose server changes IP
regularly for some reason.
2026-03-14 13:45:45 +01:00
Henrik Rydgård 80f8911c88 Make it clearer that you can enter a hostname or an IP when adding a server 2026-03-14 09:41:55 +01:00
Henrik Rydgård fba616a259 Show setting hints as disabled if the setting is disabled
See #21423
2026-03-13 16:40:02 +01:00
Henrik Rydgård d1d42a490a Rename "Change MAC address" to "MAC address" 2026-03-12 12:26:14 +01:00
Henrik Rydgård 556c501c30 Remove "PRO" branding from adhoc servers 2026-03-12 12:24:38 +01:00
Henrik Rydgård 6a627c4cd2 Add link to the new multiplayer quickstart guide 2026-03-12 12:20:14 +01:00
Henrik Rydgård 6c46d97af0 Reorder some settings, split out the hint for Port Offset 2026-03-12 12:01:34 +01:00
Henrik Rydgård 4af47ff7b2 Minor cleanup 2026-03-12 11:10:35 +01:00
Henrik Rydgård e0f1b6b7d9 Move the "localhost = multiple instances" hint into the adhoc server selector 2026-03-10 09:05:10 +01:00
Henrik Rydgård f175408968 Reorder network settings a little, show the nickname setting there too (yes, dupe, but useful). 2026-03-10 09:05:10 +01:00
Henrik Rydgård 7728a2996a Avoid emitting the "Audio backend" itemheader twice on SDL 2026-03-09 19:00:44 +01:00