Now SerialInterfaceManager::UpdateDevices reads the configured SI
devices directly from Config instead.
The main reason why I wanted to do this is so that Android can change SI
devices while emulation is running. (Android didn't have the code for
calling ChangeDevice.) But when implementing the change, I noticed that
NetPlay and Movie were using ChangeDevice as a way of overriding the SI
devices configured by the user. Replacing this ended up making the change
larger than I first anticipated.
For Wii Remotes, there was no equivalent to ChangeDevice, so NetPlay and
Movie were using Config::SetCurrent to override the Wii Remote source
configured by the user. If we can use the config system to override Wii
Remote sources, why not do the same for SI devices? This commit makes
NetPlay and Movie set SI devices and Wii Remote sources in the NetPlay
and Movie config layers, as that is the conceptually appropriate place
to do it.
As far as I can tell, the old Movie code for overriding SI devices and
Wii Remote sources didn't actually work. This new code does. I didn't
investigate exactly why it didn't work, but maybe it's because loading
a movie happens before emulation actually starts.
The following settings were excluded:
* Port 1-4 ROM: We're only supporting Game Boy Player for now
* Save in Same Directory as the ROM: Implementation nightmare due to SAF
Reasons:
- Only 0.000341% of all Android users were on API 21-23 in the last 365 days.
- These devices are old and likely do not run Dolphin well.
- Android 5.x and 6.0 have been without security updates for about 8 years.
- Staying on API 21–23 blocks AndroidX updates, including Lifecycle.
Default values for settings need to be the same in Kotlin and C++,
otherwise settings that haven't been changed by the user will be shown
as having one value in the Android GUI but treated as having a different
value in the core.
This lets users select Triforce Baseboard for SI and SP1. Limitations:
* The test, service and coin buttons can be bound to gamepads and other
physical inputs, but aren't available in the touch input overlay.
* The IP redirections are exposed to the user as a raw string rather than
a table like in DolphinQt.
Previously, when an input device was connected or disconnected, we would
recreate all devices. This commit makes it so we only touch the relevant
device instead. This matters because recreating a device causes us to
drop all held buttons for that device. Due to Android only delivering
inputs as events, we're unable to poll for currently held buttons when
recreating a device.
This recently became a problem for users of Ayn devices due to a
firmware update. Every now and then, something about the display
viewports changes, triggering an update to an input device that I assume
is a touch input device. This input device isn't something users
normally map in Dolphin's controller settings, but it changing was
causing Dolphin to drop all held buttons for the device's built-in
gamepad as well as any other connected gamepads.
* This fixes some UI elements (3-dot menu background, status bar when scrolling down in settings) not following Material You colors.
* It doesn't cause any issues on Android versions without dynamic colors (tested on Android 9, 11, 16)
Signed-off-by: Leonardo Ledda <leonardoledda@gmail.com>