diff options
author | german77 <juangerman-13@hotmail.com> | 2023-03-27 05:26:28 +0200 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2023-03-30 15:49:44 +0200 |
commit | 11edba4974ab702deb54371bf1bf7644f1dd8e38 (patch) | |
tree | 46d733ac751af1426de717991feb1e262bea117b /src/core/hle | |
parent | Merge pull request #9505 from liamwhite/request-exit (diff) | |
download | yuzu-11edba4974ab702deb54371bf1bf7644f1dd8e38.tar yuzu-11edba4974ab702deb54371bf1bf7644f1dd8e38.tar.gz yuzu-11edba4974ab702deb54371bf1bf7644f1dd8e38.tar.bz2 yuzu-11edba4974ab702deb54371bf1bf7644f1dd8e38.tar.lz yuzu-11edba4974ab702deb54371bf1bf7644f1dd8e38.tar.xz yuzu-11edba4974ab702deb54371bf1bf7644f1dd8e38.tar.zst yuzu-11edba4974ab702deb54371bf1bf7644f1dd8e38.zip |
Diffstat (limited to 'src/core/hle')
-rw-r--r-- | src/core/hle/service/am/applets/applet_controller.cpp | 12 | ||||
-rw-r--r-- | src/core/hle/service/am/applets/applet_controller.h | 9 |
2 files changed, 14 insertions, 7 deletions
diff --git a/src/core/hle/service/am/applets/applet_controller.cpp b/src/core/hle/service/am/applets/applet_controller.cpp index 2d1d115d7..9840d2547 100644 --- a/src/core/hle/service/am/applets/applet_controller.cpp +++ b/src/core/hle/service/am/applets/applet_controller.cpp @@ -224,7 +224,8 @@ void Controller::Execute() { parameters.allow_dual_joycons, parameters.allow_left_joycon, parameters.allow_right_joycon); - frontend.ReconfigureControllers([this] { ConfigurationComplete(); }, parameters); + frontend.ReconfigureControllers( + [this](bool is_success) { ConfigurationComplete(is_success); }, parameters); break; } case ControllerSupportMode::ShowControllerStrapGuide: @@ -232,16 +233,16 @@ void Controller::Execute() { case ControllerSupportMode::ShowControllerKeyRemappingForSystem: UNIMPLEMENTED_MSG("ControllerSupportMode={} is not implemented", controller_private_arg.mode); - ConfigurationComplete(); + ConfigurationComplete(true); break; default: { - ConfigurationComplete(); + ConfigurationComplete(true); break; } } } -void Controller::ConfigurationComplete() { +void Controller::ConfigurationComplete(bool is_success) { ControllerSupportResultInfo result_info{}; // If enable_single_mode is enabled, player_count is 1 regardless of any other parameters. @@ -250,7 +251,8 @@ void Controller::ConfigurationComplete() { result_info.selected_id = static_cast<u32>(system.HIDCore().GetFirstNpadId()); - result_info.result = 0; + result_info.result = + is_success ? ControllerSupportResult::Success : ControllerSupportResult::Cancel; LOG_DEBUG(Service_HID, "Result Info: player_count={}, selected_id={}, result={}", result_info.player_count, result_info.selected_id, result_info.result); diff --git a/src/core/hle/service/am/applets/applet_controller.h b/src/core/hle/service/am/applets/applet_controller.h index 1fbabee11..f6c64f633 100644 --- a/src/core/hle/service/am/applets/applet_controller.h +++ b/src/core/hle/service/am/applets/applet_controller.h @@ -48,6 +48,11 @@ enum class ControllerSupportCaller : u8 { MaxControllerSupportCaller, }; +enum class ControllerSupportResult : u32 { + Success = 0, + Cancel = 2, +}; + struct ControllerSupportArgPrivate { u32 arg_private_size{}; u32 arg_size{}; @@ -112,7 +117,7 @@ struct ControllerSupportResultInfo { s8 player_count{}; INSERT_PADDING_BYTES(3); u32 selected_id{}; - u32 result{}; + ControllerSupportResult result{}; }; static_assert(sizeof(ControllerSupportResultInfo) == 0xC, "ControllerSupportResultInfo has incorrect size."); @@ -131,7 +136,7 @@ public: void Execute() override; Result RequestExit() override; - void ConfigurationComplete(); + void ConfigurationComplete(bool is_success); private: const Core::Frontend::ControllerApplet& frontend; |