summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2020-09-27 17:40:15 +0200
committerMorph <39850852+Morph1984@users.noreply.github.com>2020-11-16 05:33:19 +0100
commitc0c4ed0d3bff9670bfaab6a8de304e37ec9e0896 (patch)
tree8de86050d87c1d699379c52357c7433718ffc35b /src/core
parentapplets/controller: Auto accept a valid single player configuration (diff)
downloadyuzu-c0c4ed0d3bff9670bfaab6a8de304e37ec9e0896.tar
yuzu-c0c4ed0d3bff9670bfaab6a8de304e37ec9e0896.tar.gz
yuzu-c0c4ed0d3bff9670bfaab6a8de304e37ec9e0896.tar.bz2
yuzu-c0c4ed0d3bff9670bfaab6a8de304e37ec9e0896.tar.lz
yuzu-c0c4ed0d3bff9670bfaab6a8de304e37ec9e0896.tar.xz
yuzu-c0c4ed0d3bff9670bfaab6a8de304e37ec9e0896.tar.zst
yuzu-c0c4ed0d3bff9670bfaab6a8de304e37ec9e0896.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index e311bc18c..c4b26196a 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -224,6 +224,19 @@ void Controller_NPad::OnInit() {
player.connected};
});
+ // Connect the Player 1 or Handheld controller if none are connected.
+ if (std::none_of(connected_controllers.begin(), connected_controllers.end(),
+ [](const ControllerHolder& controller) { return controller.is_connected; })) {
+ const auto controller = MapSettingsTypeToNPad(Settings::values.players[0].controller_type);
+ if (controller == NPadControllerType::Handheld) {
+ Settings::values.players[HANDHELD_INDEX].connected = true;
+ connected_controllers[HANDHELD_INDEX] = {controller, true};
+ } else {
+ Settings::values.players[0].connected = true;
+ connected_controllers[0] = {controller, true};
+ }
+ }
+
// Account for handheld
if (connected_controllers[HANDHELD_INDEX].is_connected) {
connected_controllers[HANDHELD_INDEX].type = NPadControllerType::Handheld;