diff --git a/src/core/hle/service/hid/hid_server.cpp b/src/core/hle/service/hid/hid_server.cpp index 75bf3e682f..74898888a2 100644 --- a/src/core/hle/service/hid/hid_server.cpp +++ b/src/core/hle/service/hid/hid_server.cpp @@ -1444,8 +1444,8 @@ void IHidServer::SetNpadAnalogStickUseCenterClamp(HLERequestContext& ctx) { const auto parameters{rp.PopRaw()}; - LOG_WARNING(Service_HID, "(STUBBED) called, use_center_clamp={}, applet_resource_user_id={}", - parameters.use_center_clamp, parameters.applet_resource_user_id); + LOG_INFO(Service_HID, "called, use_center_clamp={}, applet_resource_user_id={}", + parameters.use_center_clamp, parameters.applet_resource_user_id); GetResourceManager()->GetNpad()->SetNpadAnalogStickUseCenterClamp( parameters.applet_resource_user_id, parameters.use_center_clamp); diff --git a/src/core/hle/service/hid/hid_system_server.cpp b/src/core/hle/service/hid/hid_system_server.cpp index ac0d8bd5df..ead593ab3a 100644 --- a/src/core/hle/service/hid/hid_system_server.cpp +++ b/src/core/hle/service/hid/hid_system_server.cpp @@ -54,8 +54,8 @@ IHidSystemServer::IHidSystemServer(Core::System& system_, std::shared_ptr(unique_pads.size())); } -void IHidSystemServer::GetIrSensorState(HLERequestContext& ctx) { +void IHidSystemServer::SetNpadSystemExtStateEnabled(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; + struct Parameters { + bool is_enabled; + INSERT_PADDING_BYTES_NOINIT(7); + u64 applet_resource_user_id; + }; + static_assert(sizeof(Parameters) == 0x10, "Parameters has incorrect size."); - LOG_WARNING(Service_HID, "(STUBBED) called"); + const auto parameters{rp.PopRaw()}; + + LOG_INFO(Service_HID, "called, is_enabled={}, applet_resource_user_id={}", + parameters.is_enabled, parameters.applet_resource_user_id); + + const auto result = GetResourceManager()->GetNpad()->SetNpadSystemExtStateEnabled( + parameters.applet_resource_user_id, parameters.is_enabled); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); + rb.Push(result); } void IHidSystemServer::RegisterAppletResourceUserId(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; diff --git a/src/core/hle/service/hid/hid_system_server.h b/src/core/hle/service/hid/hid_system_server.h index 53091cf536..0c2634e3f1 100644 --- a/src/core/hle/service/hid/hid_system_server.h +++ b/src/core/hle/service/hid/hid_system_server.h @@ -38,7 +38,7 @@ private: void HasBattery(HLERequestContext& ctx); void HasLeftRightBattery(HLERequestContext& ctx); void GetUniquePadsFromNpad(HLERequestContext& ctx); - void GetIrSensorState(HLERequestContext& ctx); + void SetNpadSystemExtStateEnabled(HLERequestContext& ctx); void RegisterAppletResourceUserId(HLERequestContext& ctx); void UnregisterAppletResourceUserId(HLERequestContext& ctx); void EnableAppletToGetInput(HLERequestContext& ctx); diff --git a/src/hid_core/resources/npad/npad.cpp b/src/hid_core/resources/npad/npad.cpp index ea035d7595..6be6edb7ec 100644 --- a/src/hid_core/resources/npad/npad.cpp +++ b/src/hid_core/resources/npad/npad.cpp @@ -1356,4 +1356,16 @@ std::size_t NPad::GetNpadCaptureButtonAssignment(std::spanEnableAppletToGetInput(aruid); + } + + return result; +} + } // namespace Service::HID diff --git a/src/hid_core/resources/npad/npad.h b/src/hid_core/resources/npad/npad.h index e602ddaea0..73e2780c4a 100644 --- a/src/hid_core/resources/npad/npad.h +++ b/src/hid_core/resources/npad/npad.h @@ -155,6 +155,8 @@ public: std::size_t GetNpadCaptureButtonAssignment(std::span out_list, u64 aruid) const; + Result SetNpadSystemExtStateEnabled(u64 aruid, bool is_enabled); + private: struct VibrationData { bool device_mounted{};