diff options
| author | Morph <39850852+Morph1984@users.noreply.github.com> | 2020-11-10 12:09:44 -0500 |
|---|---|---|
| committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2020-11-15 23:33:21 -0500 |
| commit | ad502093835868d5d3ae43caa9faa28c8cb621f2 (patch) | |
| tree | 7ca07f49137e7962396ceffa55b973d567c438f0 /src/core/hle/service/hid/hid.cpp | |
| parent | d8ad2f3484af7a10251a7b1ced19433b55de8ce7 (diff) | |
hid: Reimplement Begin/EndPermitVibrationSession
Upon further investigation, these commands allow temporary vibrations even when the "Controller Vibration" system setting is disabled. As a result, vibrations are allowed when either the system setting or this flag is set to true. Therefore, we can only block vibrations when both flags are set to false.
Diffstat (limited to 'src/core/hle/service/hid/hid.cpp')
| -rw-r--r-- | src/core/hle/service/hid/hid.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 2e9682bed..902516b29 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -1119,15 +1119,20 @@ void Hid::BeginPermitVibrationSession(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto applet_resource_user_id{rp.Pop<u64>()}; - LOG_WARNING(Service_HID, "(STUBBED) called, applet_resource_user_id={}", - applet_resource_user_id); + applet_resource->GetController<Controller_NPad>(HidController::NPad) + .SetPermitVibrationSession(true); + + LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); } void Hid::EndPermitVibrationSession(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_HID, "(STUBBED) called"); + applet_resource->GetController<Controller_NPad>(HidController::NPad) + .SetPermitVibrationSession(false); + + LOG_DEBUG(Service_HID, "called"); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); |
