diff options
| author | Jonas <104419015+jojo-chaechae@users.noreply.github.com> | 2026-11-03 08:21:31 +0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-03 08:21:31 +0600 |
| commit | 68a945d0a84fca00545df0fe7b8fe714436242a5 (patch) | |
| tree | 23f226f44a198b4f2077135928dc9694213c135a /src/core/hle/service/hid/hid_server.cpp | |
| parent | e5e82c1bb0cca2ba0262cfbea0c1282b73f53fea (diff) | |
| parent | 465aa33077f44d3f8664c076f8580e78446c0dee (diff) | |
Merge pull request #155 from Djihads80/neo.ai/vibration-fix
Diagnoses to fix vibration support
Diffstat (limited to 'src/core/hle/service/hid/hid_server.cpp')
| -rw-r--r-- | src/core/hle/service/hid/hid_server.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/hid_server.cpp b/src/core/hle/service/hid/hid_server.cpp index 20118345a9..f2a7b7d04a 100644 --- a/src/core/hle/service/hid/hid_server.cpp +++ b/src/core/hle/service/hid/hid_server.cpp @@ -4,6 +4,7 @@ // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later +#include <algorithm> #include <array> #include "common/common_types.h" @@ -1112,8 +1113,24 @@ Result IHidServer::IsVibrationDeviceMounted( R_SUCCEED(); } -Result IHidServer::SendNx2VibrationValues() { - LOG_DEBUG(Service_HID, "(STUBBED) called"); +Result IHidServer::SendNx2VibrationValues( + u64 unknown, AppletResourceUserId aruid, + InArray<Core::HID::VibrationDeviceHandle, BufferAttr_HipcPointer> vibration_handles, + InArray<Core::HID::VibrationValue, BufferAttr_HipcPointer> vibration_values) { + LOG_DEBUG(Service_HID, "called, unknown={}, applet_resource_user_id={}", unknown, aruid.pid); + + // Unlike 206 this never fails: rumble is best effort and the command is only known from + // captures, so an unexpected handle or layout shouldn't return an error a game may treat as + // fatal. + const auto count = (std::min)(vibration_handles.size(), vibration_values.size()); + for (std::size_t i = 0; i < count; i++) { + const auto result = GetResourceManager()->SendVibrationValue( + aruid.pid, vibration_handles[i], vibration_values[i]); + if (result.IsError()) { + LOG_DEBUG(Service_HID, "failed to send vibration {}, result={:#x}", i, result.raw); + } + } + R_SUCCEED(); } |
