summaryrefslogtreecommitdiffstats
path: root/src/core/hid/hid_core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hid/hid_core.cpp')
-rw-r--r--src/core/hid/hid_core.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/core/hid/hid_core.cpp b/src/core/hid/hid_core.cpp
index 741a69c3c..a1c3bbb57 100644
--- a/src/core/hid/hid_core.cpp
+++ b/src/core/hid/hid_core.cpp
@@ -108,6 +108,16 @@ const EmulatedController* HIDCore::GetEmulatedControllerByIndex(std::size_t inde
void HIDCore::SetSupportedStyleTag(NpadStyleTag style_tag) {
supported_style_tag.raw = style_tag.raw;
+ player_1->SetSupportedNpadStyleTag(supported_style_tag);
+ player_2->SetSupportedNpadStyleTag(supported_style_tag);
+ player_3->SetSupportedNpadStyleTag(supported_style_tag);
+ player_4->SetSupportedNpadStyleTag(supported_style_tag);
+ player_5->SetSupportedNpadStyleTag(supported_style_tag);
+ player_6->SetSupportedNpadStyleTag(supported_style_tag);
+ player_7->SetSupportedNpadStyleTag(supported_style_tag);
+ player_8->SetSupportedNpadStyleTag(supported_style_tag);
+ other->SetSupportedNpadStyleTag(supported_style_tag);
+ handheld->SetSupportedNpadStyleTag(supported_style_tag);
}
NpadStyleTag HIDCore::GetSupportedStyleTag() const {
@@ -135,6 +145,42 @@ NpadIdType HIDCore::GetFirstNpadId() const {
return NpadIdType::Player1;
}
+NpadIdType HIDCore::GetFirstDisconnectedNpadId() const {
+ for (std::size_t player_index = 0; player_index < available_controllers; ++player_index) {
+ const auto* const controller = GetEmulatedControllerByIndex(player_index);
+ if (!controller->IsConnected()) {
+ return controller->GetNpadIdType();
+ }
+ }
+ return NpadIdType::Player1;
+}
+
+void HIDCore::EnableAllControllerConfiguration() {
+ player_1->EnableConfiguration();
+ player_2->EnableConfiguration();
+ player_3->EnableConfiguration();
+ player_4->EnableConfiguration();
+ player_5->EnableConfiguration();
+ player_6->EnableConfiguration();
+ player_7->EnableConfiguration();
+ player_8->EnableConfiguration();
+ other->EnableConfiguration();
+ handheld->EnableConfiguration();
+}
+
+void HIDCore::DisableAllControllerConfiguration() {
+ player_1->DisableConfiguration();
+ player_2->DisableConfiguration();
+ player_3->DisableConfiguration();
+ player_4->DisableConfiguration();
+ player_5->DisableConfiguration();
+ player_6->DisableConfiguration();
+ player_7->DisableConfiguration();
+ player_8->DisableConfiguration();
+ other->DisableConfiguration();
+ handheld->DisableConfiguration();
+}
+
void HIDCore::ReloadInputDevices() {
player_1->ReloadFromSettings();
player_2->ReloadFromSettings();