summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/GCAdapter.cpp
AgeCommit message (Collapse)Author
2022-04-22GCAdapter: move libusb context teardown lastShawn Hoffman
2022-04-22GCAdapter: some macro cleanupShawn Hoffman
2022-04-22GCAdapter: set read/write thread namesShawn Hoffman
2022-03-27Remove unnecessary atomic usage in GCAdapter.cppnyanpasu64
You can safely read or write non-atomic integers on multiple threads, as long as every thread reading or writing it holds the same mutex while doing so (here, s_mutex). Removing the atomic accesses makes the code faster, but the actual performance difference is probably negligible.
2022-03-10GCAdapter: Defer initialization until MainWindow::InitControllersPokechu22
If libusb fails to initialize, an assertion fails, but if that happens before the main window is created, then Dolphin just dies. Now, the panic alert is properly shown and the user can ignore it.
2022-01-08Config: Port SI device settings to new config system.Admiral H. Curtiss
2022-01-05Config: Port GC Adapter settings to new config system.Admiral H. Curtiss
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
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.
2021-06-07Lint: End of namespaceSepalani
2021-05-05InputCommon: replace SerialInterface log with ControllerInterfaceFiloppi
where appropriate. SerialInterface was a leftover from the past, and makes no sense to be used on actual/real controllers.
2020-10-23InputCommon: Migrate logging over to fmtLioncash
Continues the migration of the logging calls over to the fmt capable ones.
2020-07-18Use range loop (if possible)Filip Gawin
2020-07-09InputCommon/GCAdapter: Unbreak Mayflash GCAdapters by allowing ↵Jordan Woyak
libusb_control_transfer call to fail.
2020-07-07InputCommon/GCAdapter: Fix offbrand "GCAdapters" with a ↵Jordan Woyak
libusb_control_transfer call.
2020-05-10GCAdapter: add libusb error logging on reads/writesPierre Bourdon
2019-06-26Use separate libusb contexts to avoid thread safety issuesLéo Lam
Unfortunately, it appears that using libusb's synchronous transfer API from several threads causes nasty race conditions in event handling and can lead to deadlocks, despite the fact that libusb's synchronous API is documented to be perfectly fine to use from several threads (only the manual polling functionality is supposed to require special precautions). Since usbdk was the only real reason for using a single libusb context and since usbdk (currently) has so many issues with Dolphin, I think dropping support for it in order to fix other backends is acceptable.
2019-06-07Core/ConfigManager: Use forward declarations where applicableLioncash
Avoids dragging in IniFile, EXI device and SI device headers in this header which is quite widely used throughout the codebase. This also uncovered a few cases where indirect inclusions were being relied upon, which this also fixes.
2019-05-29GCAdapter: Handle dynamic status updates for non-hotplug libusbVincent Duvert
Detect when the setup function found no adapter, or found one but could not connect to it, and report the new status in that case.
2019-05-29GCPadWiiUConfigDialog: Update the adapter state dynamicallyVincent Duvert
Update the GC adapter config GUI if the adapter is plugged or unplugged.
2019-05-29GCAdapter: Report libusb open errors to the userVincent Duvert
If opening the adapter fails, report the libusb error message in the GUI instead of “No Adapter Detected”. The error condition is removed when the adapter is unplugged.
2019-05-29GCAdapter: Close libusb handle if an open error occursVincent Duvert
The handle was previously kept open, which was causing future adapter plug/unplug events to be ignored.
2019-05-27Move libusb utilities to LibusbUtilsLéo Lam
* Simplifies libusb context usage and allows us to set options for all contexts easily. Notably, this lets us enable usbdk support in libusb, which is now opt-in in the latest version. * Moves the libusb config descriptor wrapper class to LibusbUtils too since that could easily be reused. * Moves device listing to LibusbUtils too and add a lock around it as some libusb backends are not thread safe. * Consequences: only a single context and a single event handling thread is used now, which is more efficient.
2019-03-29HW/SI: GCAdapter calibration fix.Jordan Woyak
2019-01-16Flatten GCAdapter functionEmmanuel Gil Peyrot
Make CheckDeviceAccess() more flat by inverting checks, reducing indentation and removing dead code.
2018-04-12Reformat all the things!spycrab
2017-09-13Add Core::State::StartingMichael M
2017-08-02Send rumble data to the adapter on a separate threadHannes Mann
2017-06-07do not assign in conditional statementsShawn Hoffman
2017-04-03Core: Hide determinism globalLioncash
This is only ever queried and not set outside of the Core.cpp, so this should just be hidden internally and just have a function exposed that allows querying it.
2017-03-26Revert "Use a single libusb context"Léo Lam
This reverts commit c8a6dc6c23a5efe99b4bf937003ba3f2f7f8f200. libusb on Windows isn't really safe to use from different threads with a single context.
2017-03-16SI: Namespace device classesLioncash
Places all of the SI code under the SerialInterface namespace instead of only the main source file. This keeps all SI code under a common name, as well as out of the global namespace
2017-03-16SI: Move MAX_SI_CHANNELS into the SerialInterface namespaceLioncash
Given this constant is related to the serial interface, it shouldn't be outside of the namespace.
2017-02-07Move libusb context initialization to on first useLéo Lam
This prevents libusb warnings from showing up even when the user is not using Bluetooth or USB passthrough, or the Wii U GC adapter.
2017-02-07Merge pull request #4408 from leoetlino/usbMatthew Parlane
IOS: USB support (OH0, USB_VEN, USB_HID)
2017-02-05Core: Convert State enum into an enum classLioncash
2017-02-05Use a single libusb contextLéo Lam
libusb on Windows is limited to only a single context. Trying to open more than one can cause device enumerations to fail randomly. libusb is thread-safe and we don't use the manual polling support (with `poll()`) so this should be safe.
2017-01-20Core: Move SI source files to their own directoryLioncash
2017-01-17InputCommon: Fix FreeBSD 11 libusb incompatibilitiesJeffrey Pfau
2016-10-01Reorganise a ton of logs levelaldelaro5
Most of this commits changes performance decreasing logs from info to debug and also cleans up innacurate levels.
2016-08-01GCAdapter: Return input state by valueLioncash
2016-07-05Use g_want_determinism in code added by 8f0cbefJosJuice
There's no reason this only should apply to netplay.
2016-06-24Reformat all the things. Have fun with merge conflicts.Pierre Bourdon
2016-05-19Merge pull request #3805 from mathieui/gcadapter-unplug-crashMarkus Wick
GCAdapter: improve thread safety
2016-05-19GCAdapter: protect some more functionsmathieui
Reset() and Setup() are not used outside of this namespace
2016-05-18GCAdapter: improve thread safetymathieui
make sure Reset() can’t be run concurrently with AddGCAdapter() or ResetRumble() (which is called on other threads) which can cause crashes (issue #9462)
2016-05-12Disable part of the adapter features for netplaymathieui
In order to avoid desyncs
2016-01-24Fix a bug in GCAdaptermathieui
where the payload size would end up being crazy values on the other thread. Mirroring the similar commit made for the android side: https://github.com/Sonicadvance1/dolphin/commit/2833685fbfd782b78bbf1813f30cbb0a4ecd801d
2016-01-20Allow multiple GC adapters on one PC to be used with multiple Dolphin instances.Ryan Houdek
Previously we would iterate through every GC adapter plugged in to the PC and steal ownership of it. This causes issues all over the place in the implementation if this happens. Break on the first adapter we can get access to.
2016-01-06Add a stubbed GCAdapter namespace.Ryan Houdek
This cleans up a bunch of #ifdef checks in places.
2016-01-06Fixup typo in GCAdapterRyan Houdek