diff options
author | bunnei <bunneidev@gmail.com> | 2020-10-07 23:54:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-07 23:54:05 +0200 |
commit | 92adb69fa7fa21d2f5e078e9473c0ea08e009a71 (patch) | |
tree | f4093ecf2ed67a34a1863a7ce383cb6b577ceda0 /src/core/hle/service/hid/hid.cpp | |
parent | Merge pull request #4710 from Morph1984/fix-integrated-updates (diff) | |
parent | hid: Stub HomeButtonInputProtection service commands (diff) | |
download | yuzu-92adb69fa7fa21d2f5e078e9473c0ea08e009a71.tar yuzu-92adb69fa7fa21d2f5e078e9473c0ea08e009a71.tar.gz yuzu-92adb69fa7fa21d2f5e078e9473c0ea08e009a71.tar.bz2 yuzu-92adb69fa7fa21d2f5e078e9473c0ea08e009a71.tar.lz yuzu-92adb69fa7fa21d2f5e078e9473c0ea08e009a71.tar.xz yuzu-92adb69fa7fa21d2f5e078e9473c0ea08e009a71.tar.zst yuzu-92adb69fa7fa21d2f5e078e9473c0ea08e009a71.zip |
Diffstat (limited to 'src/core/hle/service/hid/hid.cpp')
-rw-r--r-- | src/core/hle/service/hid/hid.cpp | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 001427fd8..71dbaba7f 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -224,8 +224,8 @@ Hid::Hid(Core::System& system) : ServiceFramework("hid"), system(system) { {128, &Hid::SetNpadHandheldActivationMode, "SetNpadHandheldActivationMode"}, {129, &Hid::GetNpadHandheldActivationMode, "GetNpadHandheldActivationMode"}, {130, &Hid::SwapNpadAssignment, "SwapNpadAssignment"}, - {131, nullptr, "IsUnintendedHomeButtonInputProtectionEnabled"}, - {132, nullptr, "EnableUnintendedHomeButtonInputProtection"}, + {131, &Hid::IsUnintendedHomeButtonInputProtectionEnabled, "IsUnintendedHomeButtonInputProtectionEnabled"}, + {132, &Hid::EnableUnintendedHomeButtonInputProtection, "EnableUnintendedHomeButtonInputProtection"}, {133, nullptr, "SetNpadJoyAssignmentModeSingleWithDestination"}, {134, nullptr, "SetNpadAnalogStickUseCenterClamp"}, {135, nullptr, "SetNpadCaptureButtonAssignment"}, @@ -809,6 +809,40 @@ void Hid::SwapNpadAssignment(Kernel::HLERequestContext& ctx) { } } +void Hid::IsUnintendedHomeButtonInputProtectionEnabled(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto npad_id{rp.Pop<u32>()}; + const auto applet_resource_user_id{rp.Pop<u64>()}; + + LOG_WARNING(Service_HID, "(STUBBED) called, npad_id={}, applet_resource_user_id={}", npad_id, + applet_resource_user_id); + + auto& controller = applet_resource->GetController<Controller_NPad>(HidController::NPad); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(RESULT_SUCCESS); + rb.Push<bool>(controller.IsUnintendedHomeButtonInputProtectionEnabled(npad_id)); +} + +void Hid::EnableUnintendedHomeButtonInputProtection(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto unintended_home_button_input_protection{rp.Pop<bool>()}; + const auto npad_id{rp.Pop<u32>()}; + const auto applet_resource_user_id{rp.Pop<u64>()}; + + LOG_WARNING(Service_HID, + "(STUBBED) called, unintended_home_button_input_protection={}, npad_id={}," + "applet_resource_user_id={}", + npad_id, unintended_home_button_input_protection, applet_resource_user_id); + + auto& controller = applet_resource->GetController<Controller_NPad>(HidController::NPad); + controller.SetUnintendedHomeButtonInputProtectionEnabled( + unintended_home_button_input_protection, npad_id); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); +} + void Hid::BeginPermitVibrationSession(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto applet_resource_user_id{rp.Pop<u64>()}; |