summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar german772021-09-20 20:46:17 -0500
committerGravatar Narr the Reg2021-11-24 20:30:24 -0600
commit510c7d29537f4d17ec5751b981729e1bf66fe44c (patch)
tree70f9f3fb3eff0add73810186c764da90c4d14677 /src
parentcore: Remove frontend/input (diff)
downloadyuzu-510c7d29537f4d17ec5751b981729e1bf66fe44c.tar.gz
yuzu-510c7d29537f4d17ec5751b981729e1bf66fe44c.tar.xz
yuzu-510c7d29537f4d17ec5751b981729e1bf66fe44c.zip
core/frontend: Update applets
Diffstat (limited to 'src')
-rw-r--r--src/core/frontend/applets/controller.cpp23
-rw-r--r--src/core/hle/service/am/applets/applet_controller.cpp2
2 files changed, 15 insertions, 10 deletions
diff --git a/src/core/frontend/applets/controller.cpp b/src/core/frontend/applets/controller.cpp
index 03bbedf8b..ca1edce15 100644
--- a/src/core/frontend/applets/controller.cpp
+++ b/src/core/frontend/applets/controller.cpp
@@ -49,26 +49,31 @@ void DefaultControllerApplet::ReconfigureControllers(std::function<void()> callb
49 // Connect controllers based on the following priority list from highest to lowest priority: 49 // Connect controllers based on the following priority list from highest to lowest priority:
50 // Pro Controller -> Dual Joycons -> Left Joycon/Right Joycon -> Handheld 50 // Pro Controller -> Dual Joycons -> Left Joycon/Right Joycon -> Handheld
51 if (parameters.allow_pro_controller) { 51 if (parameters.allow_pro_controller) {
52 npad.AddNewControllerAt( 52 npad.AddNewControllerAt(Core::HID::EmulatedController::MapSettingsTypeToNPad(
53 npad.MapSettingsTypeToNPad(Settings::ControllerType::ProController), index); 53 Settings::ControllerType::ProController),
54 index);
54 } else if (parameters.allow_dual_joycons) { 55 } else if (parameters.allow_dual_joycons) {
55 npad.AddNewControllerAt( 56 npad.AddNewControllerAt(Core::HID::EmulatedController::MapSettingsTypeToNPad(
56 npad.MapSettingsTypeToNPad(Settings::ControllerType::DualJoyconDetached), index); 57 Settings::ControllerType::DualJoyconDetached),
58 index);
57 } else if (parameters.allow_left_joycon && parameters.allow_right_joycon) { 59 } else if (parameters.allow_left_joycon && parameters.allow_right_joycon) {
58 // Assign left joycons to even player indices and right joycons to odd player indices. 60 // Assign left joycons to even player indices and right joycons to odd player indices.
59 // We do this since Captain Toad Treasure Tracker expects a left joycon for Player 1 and 61 // We do this since Captain Toad Treasure Tracker expects a left joycon for Player 1 and
60 // a right Joycon for Player 2 in 2 Player Assist mode. 62 // a right Joycon for Player 2 in 2 Player Assist mode.
61 if (index % 2 == 0) { 63 if (index % 2 == 0) {
62 npad.AddNewControllerAt( 64 npad.AddNewControllerAt(Core::HID::EmulatedController::MapSettingsTypeToNPad(
63 npad.MapSettingsTypeToNPad(Settings::ControllerType::LeftJoycon), index); 65 Settings::ControllerType::LeftJoycon),
66 index);
64 } else { 67 } else {
65 npad.AddNewControllerAt( 68 npad.AddNewControllerAt(Core::HID::EmulatedController::MapSettingsTypeToNPad(
66 npad.MapSettingsTypeToNPad(Settings::ControllerType::RightJoycon), index); 69 Settings::ControllerType::RightJoycon),
70 index);
67 } 71 }
68 } else if (index == 0 && parameters.enable_single_mode && parameters.allow_handheld && 72 } else if (index == 0 && parameters.enable_single_mode && parameters.allow_handheld &&
69 !Settings::values.use_docked_mode.GetValue()) { 73 !Settings::values.use_docked_mode.GetValue()) {
70 // We should *never* reach here under any normal circumstances. 74 // We should *never* reach here under any normal circumstances.
71 npad.AddNewControllerAt(npad.MapSettingsTypeToNPad(Settings::ControllerType::Handheld), 75 npad.AddNewControllerAt(Core::HID::EmulatedController::MapSettingsTypeToNPad(
76 Settings::ControllerType::Handheld),
72 index); 77 index);
73 } else { 78 } else {
74 UNREACHABLE_MSG("Unable to add a new controller based on the given parameters!"); 79 UNREACHABLE_MSG("Unable to add a new controller based on the given parameters!");
diff --git a/src/core/hle/service/am/applets/applet_controller.cpp b/src/core/hle/service/am/applets/applet_controller.cpp
index 2721679c1..c1b6cd126 100644
--- a/src/core/hle/service/am/applets/applet_controller.cpp
+++ b/src/core/hle/service/am/applets/applet_controller.cpp
@@ -25,7 +25,7 @@ namespace Service::AM::Applets {
25static Core::Frontend::ControllerParameters ConvertToFrontendParameters( 25static Core::Frontend::ControllerParameters ConvertToFrontendParameters(
26 ControllerSupportArgPrivate private_arg, ControllerSupportArgHeader header, bool enable_text, 26 ControllerSupportArgPrivate private_arg, ControllerSupportArgHeader header, bool enable_text,
27 std::vector<IdentificationColor> identification_colors, std::vector<ExplainText> text) { 27 std::vector<IdentificationColor> identification_colors, std::vector<ExplainText> text) {
28 HID::Controller_NPad::NpadStyleSet npad_style_set; 28 Core::HID::NpadStyleTag npad_style_set;
29 npad_style_set.raw = private_arg.style_set; 29 npad_style_set.raw = private_arg.style_set;
30 30
31 return { 31 return {