aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/hid/hid_server.cpp
diff options
context:
space:
mode:
authorcirakg <cirakg@cirakg.xyz>2026-11-03 21:58:24 +0100
committercirakg <cirakg@cirakg.xyz>2026-11-03 21:58:24 +0100
commitcdfb1ae93444c0aa02dfe592af36d70ab36549fd (patch)
tree2fa8d7062d907d5ab8d85d64c66be87ea4cdf0d1 /src/core/hle/service/hid/hid_server.cpp
parent51341ec09b25de1d9b01d0c00ee828dd5b861d5c (diff)
parent4383b9787afbf6c63291bf803c8330afb4f21a16 (diff)
Merge upstream Djihads80/Eglantine nx2 into nx2HEADnx2
# Conflicts: # .github/workflows/release-binaries.yml
Diffstat (limited to 'src/core/hle/service/hid/hid_server.cpp')
-rw-r--r--src/core/hle/service/hid/hid_server.cpp21
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();
}