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.
Yellow squiggly lines begone!
Done automatically on .cpp files through `run-clang-tidy`, with manual corrections to the mistakes.
If an import is directly used, but is technically unnecessary since it's recursively imported by something else, it is *not* removed.
The tool doesn't touch .h files, so I did some of them by hand while fixing errors due to old recursive imports.
Not everything is removed, but the cleanup should be substantial enough.
Because this done on Linux, code that isn't used on it is mostly untouched.
(Hopefully no open PR is depending on these imports...)
GCAdapter::UseAdapter() reads s_is_adapter_wanted, which gets
initialized by config_guard.~ConfigChangeCallbackGuard(). So we must
wait until after destroying the config guard to know whether we have any
controllers set to GC Adapter.
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.