From 87d2f03c39bc441055d593a7913f63a017795359 Mon Sep 17 00:00:00 2001 From: MaranBr Date: Sat, 26 Sep 2026 02:21:45 +0200 Subject: [PATCH] [hid_core] Code cleanup (#4461) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- This is just a code cleanup. This is no longer necessary due to commit #4457. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4461 Reviewed-by: lizzie --- src/hid_core/frontend/emulated_controller.cpp | 22 ++++--------------- src/hid_core/frontend/emulated_controller.h | 2 -- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/src/hid_core/frontend/emulated_controller.cpp b/src/hid_core/frontend/emulated_controller.cpp index 1092970ee8..7b4af13232 100644 --- a/src/hid_core/frontend/emulated_controller.cpp +++ b/src/hid_core/frontend/emulated_controller.cpp @@ -761,9 +761,6 @@ void EmulatedController::StartMotionCalibration() { } void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback, std::size_t index, Common::UUID uuid) { - const auto player_index = Service::HID::NpadIdTypeToIndex(npad_id_type); - const auto& player = Settings::values.players.GetValue()[player_index]; - if (index >= controller.button_values.size()) { return; } @@ -916,21 +913,10 @@ void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback break; } - if (!is_connected) { - if (npad_type == NpadStyleIndex::Handheld) { - if (npad_id_type == NpadIdType::Handheld) { - Connect(); - controller_connected[player_index] = true; - } - } else if (npad_type != NpadStyleIndex::Handheld) { - if (npad_id_type == NpadIdType::Player1) { - Connect(); - controller_connected[player_index] = true; - } else if (player.connected && !controller_connected[player_index]) { - Connect(); - controller_connected[player_index] = true; - } - } + const auto player_index = Service::HID::NpadIdTypeToIndex(npad_id_type); + const auto& player = Settings::values.players.GetValue()[player_index]; + if (player.connected) { + Connect(); } TriggerOnChange(ControllerTriggerType::Button, true); diff --git a/src/hid_core/frontend/emulated_controller.h b/src/hid_core/frontend/emulated_controller.h index 7a2291b8a4..80ea633c63 100644 --- a/src/hid_core/frontend/emulated_controller.h +++ b/src/hid_core/frontend/emulated_controller.h @@ -22,7 +22,6 @@ #include "common/settings.h" #include "common/vector_math.h" #include "hid_core/frontend/motion_input.h" -#include "hid_core/hid_core.h" #include "hid_core/hid_types.h" #include "hid_core/irsensor/irs_types.h" @@ -585,7 +584,6 @@ private: std::array last_vibration_value{DEFAULT_VIBRATION_VALUE, DEFAULT_VIBRATION_VALUE}; std::array last_vibration_timepoint{}; - std::array controller_connected{}; // Atomically synched values std::atomic npad_type{HID::NpadStyleIndex::None};