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.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/hid/hid_core.cpp b/src/core/hid/hid_core.cpp
index 0c3eb5a62..a1c3bbb57 100644
--- a/src/core/hid/hid_core.cpp
+++ b/src/core/hid/hid_core.cpp
@@ -145,6 +145,16 @@ 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();