summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/am/applets/applet_controller.cpp12
-rw-r--r--src/core/hle/service/am/applets/applet_controller.h9
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;