summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/hid.cpp
diff options
context:
space:
mode:
authorMorph1984 <39850852+Morph1984@users.noreply.github.com>2019-09-04 08:42:22 +0200
committerGitHub <noreply@github.com>2019-09-04 08:42:22 +0200
commita83eb90a78c4ee3aac3636e22bebc8ab460b46f2 (patch)
tree129c3ea8412dd07f93ad925b5f97033e9714fb49 /src/core/hle/service/hid/hid.cpp
parentMerge pull request #2765 from FernandoS27/dma-fix (diff)
downloadyuzu-a83eb90a78c4ee3aac3636e22bebc8ab460b46f2.tar
yuzu-a83eb90a78c4ee3aac3636e22bebc8ab460b46f2.tar.gz
yuzu-a83eb90a78c4ee3aac3636e22bebc8ab460b46f2.tar.bz2
yuzu-a83eb90a78c4ee3aac3636e22bebc8ab460b46f2.tar.lz
yuzu-a83eb90a78c4ee3aac3636e22bebc8ab460b46f2.tar.xz
yuzu-a83eb90a78c4ee3aac3636e22bebc8ab460b46f2.tar.zst
yuzu-a83eb90a78c4ee3aac3636e22bebc8ab460b46f2.zip
Diffstat (limited to 'src/core/hle/service/hid/hid.cpp')
-rw-r--r--src/core/hle/service/hid/hid.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 0bd24b8eb..6446edae3 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -216,8 +216,8 @@ Hid::Hid() : ServiceFramework("hid") {
{201, &Hid::SendVibrationValue, "SendVibrationValue"},
{202, &Hid::GetActualVibrationValue, "GetActualVibrationValue"},
{203, &Hid::CreateActiveVibrationDeviceList, "CreateActiveVibrationDeviceList"},
- {204, nullptr, "PermitVibration"},
- {205, nullptr, "IsVibrationPermitted"},
+ {204, &Hid::PermitVibration, "PermitVibration"},
+ {205, &Hid::IsVibrationPermitted, "IsVibrationPermitted"},
{206, &Hid::SendVibrationValues, "SendVibrationValues"},
{207, nullptr, "SendVibrationGcErmCommand"},
{208, nullptr, "GetActualVibrationGcErmCommand"},
@@ -679,6 +679,27 @@ void Hid::CreateActiveVibrationDeviceList(Kernel::HLERequestContext& ctx) {
rb.PushIpcInterface<IActiveVibrationDeviceList>();
}
+void Hid::PermitVibration(Kernel::HLERequestContext& ctx) {
+ IPC::RequestParser rp{ctx};
+ const auto can_vibrate{rp.Pop<bool>()};
+ applet_resource->GetController<Controller_NPad>(HidController::NPad)
+ .SetVibrationEnabled(can_vibrate);
+
+ LOG_DEBUG(Service_HID, "called, can_vibrate={}", can_vibrate);
+
+ IPC::ResponseBuilder rb{ctx, 2};
+ rb.Push(RESULT_SUCCESS);
+}
+
+void Hid::IsVibrationPermitted(Kernel::HLERequestContext& ctx) {
+ LOG_DEBUG(Service_HID, "called");
+
+ IPC::ResponseBuilder rb{ctx, 3};
+ rb.Push(RESULT_SUCCESS);
+ rb.Push(applet_resource->GetController<Controller_NPad>(HidController::NPad)
+ .IsVibrationEnabled());
+}
+
void Hid::ActivateConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto applet_resource_user_id{rp.Pop<u64>()};