From d9d6428189e926c6b264dccd69822d9850cc815a Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sat, 22 Oct 2022 02:42:40 -0500 Subject: [PATCH] WiimoteEmu: Replace shinkansen MixedTriggers with Triggers. --- .../Core/Core/HW/WiimoteEmu/Extension/Shinkansen.cpp | 11 +++-------- Source/Core/Core/HW/WiimoteEmu/Extension/Shinkansen.h | 4 ++-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Source/Core/Core/HW/WiimoteEmu/Extension/Shinkansen.cpp b/Source/Core/Core/HW/WiimoteEmu/Extension/Shinkansen.cpp index c62344a802..4ed49a2861 100644 --- a/Source/Core/Core/HW/WiimoteEmu/Extension/Shinkansen.cpp +++ b/Source/Core/Core/HW/WiimoteEmu/Extension/Shinkansen.cpp @@ -13,7 +13,7 @@ #include "Core/HW/WiimoteEmu/WiimoteEmu.h" #include "InputCommon/ControllerEmu/ControlGroup/Buttons.h" -#include "InputCommon/ControllerEmu/ControlGroup/MixedTriggers.h" +#include "InputCommon/ControllerEmu/ControlGroup/Triggers.h" namespace WiimoteEmu { @@ -42,11 +42,9 @@ Shinkansen::Shinkansen() : Extension3rdParty("Shinkansen", _trans("Shinkansen Co // For easier axis mapping the right lever is inverted in Dolphin, // so that the train coasts when no trigger is squeezed. - groups.emplace_back(m_levers = new ControllerEmu::MixedTriggers(_trans("Levers"))); + groups.emplace_back(m_levers = new ControllerEmu::Triggers(_trans("Levers"))); m_levers->AddInput(ControllerEmu::Translate, _trans("L")); m_levers->AddInput(ControllerEmu::Translate, _trans("R")); - m_levers->AddInput(ControllerEmu::Translate, _trans("L-Analog")); - m_levers->AddInput(ControllerEmu::Translate, _trans("R-Analog")); groups.emplace_back(m_led = new ControllerEmu::ControlGroup(_trans("Light"))); m_led->AddOutput(ControllerEmu::Translate, _trans("Doors Locked")); @@ -56,10 +54,7 @@ void Shinkansen::BuildDesiredExtensionState(DesiredExtensionState* target_state) { DesiredState& state = target_state->data.emplace(); - u16 digital = 0; - const u16 lever_bitmasks[2] = {}; - double analog[2] = {}; - m_levers->GetState(&digital, lever_bitmasks, analog); + const auto analog = m_levers->GetState().data; // The game requires these specific values, all other values are treated like 0/255 (which are // guesses). const u8 brake_values[] = {0, 53, 79, 105, 132, 159, 187, 217, 250}; diff --git a/Source/Core/Core/HW/WiimoteEmu/Extension/Shinkansen.h b/Source/Core/Core/HW/WiimoteEmu/Extension/Shinkansen.h index 7c3cbb019d..69f811803c 100644 --- a/Source/Core/Core/HW/WiimoteEmu/Extension/Shinkansen.h +++ b/Source/Core/Core/HW/WiimoteEmu/Extension/Shinkansen.h @@ -9,7 +9,7 @@ namespace ControllerEmu { class Buttons; class ControlGroup; -class MixedTriggers; +class Triggers; } // namespace ControllerEmu namespace WiimoteEmu @@ -40,7 +40,7 @@ public: private: ControllerEmu::Buttons* m_buttons; - ControllerEmu::MixedTriggers* m_levers; + ControllerEmu::Triggers* m_levers; ControllerEmu::ControlGroup* m_led; struct DataFormat