| Age | Commit message (Collapse) | Author |
|
Make `s_is_adapter_wanted` and the elements of `s_config_rumble_enabled`
atomic.
The CPU thread reads `s_is_adapter_wanted` and `s_config_rumble_enabled`
in `Output`, while the host thread writes to them in `RefreshConfig`.
The simplest way to trigger this race is to close the `Settings` window
while playing a game with the adapter active.
|
|
GCAdapter: Automatically start and stop thread
|
|
This keeps the logic encapsulated inside GCAdapter.cpp so callers don't
have to think about it.
|
|
Accomplished using `run-clang-tidy` with `performance-move-const-arg,performance-unnecessary-value-param,modernize-pass-by-value`.
Changed arguments to const references, removed them where inappropriate (e.g. sink parameters). Same with std::move.
Manually reviewed each change to make sure that it makes sense, and do something more appropriate if possible.
|
|
|
|
|
|
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...)
|
|
|
|
every 50 reads.
|
|
This reverts commit 74ed5e55326b9d8e67dfbb8dd6f61d04bcae2445.
It solves a problem that no longer exists.
|
|
This lets us get rid of the Reset call in ProcessInputPayload, which was
causing us some threading headaches (see 74ed5e5532). Instead we handle
disconnection in the same way as the libusb implementation does.
|
|
We can register a BroadcastReceiver to have Android tell us when a GC
adapter gets connected instead of having a loop where we continuously
call SleepCurrentThread(1000) and poll the current status. When waiting
for a GC adapter to connect, this both reduces power usage and improves
responsiveness.
Note that I made openAdapter get the UsbDevice that's been stored by the
hotplug code instead of having openAdapter find the UsbDevice on its own
like before. This is only because I want to ensure that the UsbDevice
being tracked for disconnection is the same as the UsbDevice actually
being used, in case the user has multiple adapters connected.
|
|
This isn't how we name things in Java/Kotlin.
|
|
|
|
|
|
The read thread could call Reset, which in turn tried to join the read
thread, leading to a SIGABRT. This manifested as Dolphin consistently
crashing when disconnecting a GC adapter and having a chance of crashing
a few seconds after connecting a GC adapter.
|
|
|
|
|
|
|
|
|
|
This way you can't mix up regular config callback IDs and CPU thread
config callback IDs. (It would be rather bad if you did!)
|
|
CONTROLLER_OUTPUT_INIT_PAYLOAD_SIZE is only used by the libusb
implementation.
|
|
|
|
|
|
|
|
Fixes GC adapter breaking on sleep-wake on Linux and burning a full CPU
core. This is cleaner than alternative approaches.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This was done for Android in 6cc40b12357ae339abcb44517810af304bab77ea.
|
|
This is only so that indentation is consistent with the non-android code.
|
|
It was removed for non-android in 56239d1ae139998a7cde17ff02f0526ffb17f5ef, and android already uses a separate thread, so presumably this isn't needed anymore.
|
|
|
|
|
|
This hack was added in 8f0cbefbe57762de92284ef151e984f52ec8d7e6, and the part of it in SI_DeviceGCAdapter is present on Android already, so I don't see any reason why this part doesn't apply to Android.
|
|
|
|
I believe the setting already existed in the UI; it just wasn't implemented in GCAdapter_Android.cpp.
|
|
|
|
This is mostly a brainless merge, #ifdef-ing anything that doesn't match between the two while preserving common logic. I didn't rename any variables (although similar ones do exist), but I did change one log that was ERROR on android and NOTICE elsewhere to just always be NOTICE. Further merging will follow.
|
|
Remove atomic usage and fix mutex locking in GCAdapter code
|
|
|
|
|
|
|