diff options
| author | 2020-07-14 13:04:02 -0400 | |
|---|---|---|
| committer | 2020-07-14 13:04:02 -0400 | |
| commit | 93fe982a0c3a5bfb7fa5df97ebced0a7692ccaf3 (patch) | |
| tree | c4ab9e3acff296733b00effd85371bf04db6491f /src/input_common/gcadapter/gc_adapter.h | |
| parent | Break out of scan loop if can't find adapter on first run (diff) | |
| parent | Merge pull request #4294 from MerryMage/cpu-opt-settings (diff) | |
| download | yuzu-93fe982a0c3a5bfb7fa5df97ebced0a7692ccaf3.tar.gz yuzu-93fe982a0c3a5bfb7fa5df97ebced0a7692ccaf3.tar.xz yuzu-93fe982a0c3a5bfb7fa5df97ebced0a7692ccaf3.zip | |
Rebase to master
Diffstat (limited to 'src/input_common/gcadapter/gc_adapter.h')
| -rw-r--r-- | src/input_common/gcadapter/gc_adapter.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/input_common/gcadapter/gc_adapter.h b/src/input_common/gcadapter/gc_adapter.h index a67485586..3586c8bda 100644 --- a/src/input_common/gcadapter/gc_adapter.h +++ b/src/input_common/gcadapter/gc_adapter.h | |||
| @@ -8,10 +8,13 @@ | |||
| 8 | #include <mutex> | 8 | #include <mutex> |
| 9 | #include <thread> | 9 | #include <thread> |
| 10 | #include <unordered_map> | 10 | #include <unordered_map> |
| 11 | #include <libusb.h> | ||
| 12 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 13 | #include "common/threadsafe_queue.h" | 12 | #include "common/threadsafe_queue.h" |
| 14 | 13 | ||
| 14 | struct libusb_context; | ||
| 15 | struct libusb_device; | ||
| 16 | struct libusb_device_handle; | ||
| 17 | |||
| 15 | namespace GCAdapter { | 18 | namespace GCAdapter { |
| 16 | 19 | ||
| 17 | enum class PadButton { | 20 | enum class PadButton { |
| @@ -91,6 +94,9 @@ public: | |||
| 91 | void BeginConfiguration(); | 94 | void BeginConfiguration(); |
| 92 | void EndConfiguration(); | 95 | void EndConfiguration(); |
| 93 | 96 | ||
| 97 | /// Returns true if there is a device connected to port | ||
| 98 | bool DeviceConnected(std::size_t port); | ||
| 99 | |||
| 94 | std::array<Common::SPSCQueue<GCPadStatus>, 4>& GetPadQueue(); | 100 | std::array<Common::SPSCQueue<GCPadStatus>, 4>& GetPadQueue(); |
| 95 | const std::array<Common::SPSCQueue<GCPadStatus>, 4>& GetPadQueue() const; | 101 | const std::array<Common::SPSCQueue<GCPadStatus>, 4>& GetPadQueue() const; |
| 96 | 102 | ||
| @@ -100,7 +106,7 @@ public: | |||
| 100 | int GetOriginValue(int port, int axis) const; | 106 | int GetOriginValue(int port, int axis) const; |
| 101 | 107 | ||
| 102 | private: | 108 | private: |
| 103 | GCPadStatus GetPadStatus(int port, const std::array<u8, 37>& adapter_payload); | 109 | GCPadStatus GetPadStatus(std::size_t port, const std::array<u8, 37>& adapter_payload); |
| 104 | 110 | ||
| 105 | void PadToState(const GCPadStatus& pad, GCState& state); | 111 | void PadToState(const GCPadStatus& pad, GCState& state); |
| 106 | 112 | ||
| @@ -112,11 +118,8 @@ private: | |||
| 112 | /// Stop scanning for the adapter | 118 | /// Stop scanning for the adapter |
| 113 | void StopScanThread(); | 119 | void StopScanThread(); |
| 114 | 120 | ||
| 115 | /// Returns true if there is a device connected to port | ||
| 116 | bool DeviceConnected(int port); | ||
| 117 | |||
| 118 | /// Resets status of device connected to port | 121 | /// Resets status of device connected to port |
| 119 | void ResetDeviceType(int port); | 122 | void ResetDeviceType(std::size_t port); |
| 120 | 123 | ||
| 121 | /// Returns true if we successfully gain access to GC Adapter | 124 | /// Returns true if we successfully gain access to GC Adapter |
| 122 | bool CheckDeviceAccess(libusb_device* device); | 125 | bool CheckDeviceAccess(libusb_device* device); |