diff options
Diffstat (limited to 'src/input_common/drivers/gc_adapter.cpp')
-rw-r--r-- | src/input_common/drivers/gc_adapter.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/input_common/drivers/gc_adapter.cpp b/src/input_common/drivers/gc_adapter.cpp index 155caae42..f4dd24e7d 100644 --- a/src/input_common/drivers/gc_adapter.cpp +++ b/src/input_common/drivers/gc_adapter.cpp @@ -1,6 +1,5 @@ -// Copyright 2014 Dolphin Emulator Project -// Licensed under GPLv2+ -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: 2014 Dolphin Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include <fmt/format.h> #include <libusb.h> @@ -91,7 +90,7 @@ GCAdapter::~GCAdapter() { void GCAdapter::AdapterInputThread(std::stop_token stop_token) { LOG_DEBUG(Input, "Input thread started"); - Common::SetCurrentThreadName("yuzu:input:GCAdapter"); + Common::SetCurrentThreadName("GCAdapter"); s32 payload_size{}; AdapterPayload adapter_payload{}; @@ -215,7 +214,7 @@ void GCAdapter::UpdateStateAxes(std::size_t port, const AdapterPayload& adapter_ } void GCAdapter::AdapterScanThread(std::stop_token stop_token) { - Common::SetCurrentThreadName("yuzu:input:ScanGCAdapter"); + Common::SetCurrentThreadName("ScanGCAdapter"); usb_adapter_handle = nullptr; pads = {}; while (!stop_token.stop_requested() && !Setup()) { @@ -524,4 +523,20 @@ Common::Input::ButtonNames GCAdapter::GetUIName(const Common::ParamPackage& para return Common::Input::ButtonNames::Invalid; } +bool GCAdapter::IsStickInverted(const Common::ParamPackage& params) { + if (!params.Has("port")) { + return false; + } + + const auto x_axis = static_cast<PadAxes>(params.Get("axis_x", 0)); + const auto y_axis = static_cast<PadAxes>(params.Get("axis_y", 0)); + if (x_axis != PadAxes::StickY && x_axis != PadAxes::SubstickY) { + return false; + } + if (y_axis != PadAxes::StickX && y_axis != PadAxes::SubstickX) { + return false; + } + return true; +} + } // namespace InputCommon |