summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/hid.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-11-29 00:22:46 +0100
committerGitHub <noreply@github.com>2020-11-29 00:22:46 +0100
commit312a8bd4b47d3d359b9e65031a82e657e9e3df3a (patch)
treeef98f8b9826ccc7317cf8351be9860bce920115b /src/core/hle/service/hid/hid.cpp
parentMerge pull request #5031 from ogniK5377/temp_mix_buffer-remove (diff)
parentStub set and get NpadCommunicationMode (diff)
downloadyuzu-312a8bd4b47d3d359b9e65031a82e657e9e3df3a.tar
yuzu-312a8bd4b47d3d359b9e65031a82e657e9e3df3a.tar.gz
yuzu-312a8bd4b47d3d359b9e65031a82e657e9e3df3a.tar.bz2
yuzu-312a8bd4b47d3d359b9e65031a82e657e9e3df3a.tar.lz
yuzu-312a8bd4b47d3d359b9e65031a82e657e9e3df3a.tar.xz
yuzu-312a8bd4b47d3d359b9e65031a82e657e9e3df3a.tar.zst
yuzu-312a8bd4b47d3d359b9e65031a82e657e9e3df3a.zip
Diffstat (limited to 'src/core/hle/service/hid/hid.cpp')
-rw-r--r--src/core/hle/service/hid/hid.cpp32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 80804b483..a1d307a41 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -308,8 +308,8 @@ Hid::Hid(Core::System& system_) : ServiceFramework{system_, "hid"} {
{527, nullptr, "EnablePalmaBoostMode"},
{528, nullptr, "GetPalmaBluetoothAddress"},
{529, nullptr, "SetDisallowedPalmaConnection"},
- {1000, nullptr, "SetNpadCommunicationMode"},
- {1001, nullptr, "GetNpadCommunicationMode"},
+ {1000, &Hid::SetNpadCommunicationMode, "SetNpadCommunicationMode"},
+ {1001, &Hid::GetNpadCommunicationMode, "GetNpadCommunicationMode"},
{1002, nullptr, "SetTouchScreenConfiguration"},
{1003, nullptr, "IsFirmwareUpdateNeededForNotification"},
{2000, nullptr, "ActivateDigitizer"},
@@ -1298,6 +1298,34 @@ void Hid::SetPalmaBoostMode(Kernel::HLERequestContext& ctx) {
rb.Push(RESULT_SUCCESS);
}
+void Hid::SetNpadCommunicationMode(Kernel::HLERequestContext& ctx) {
+ IPC::RequestParser rp{ctx};
+ const auto applet_resource_user_id{rp.Pop<u64>()};
+ const auto communication_mode{rp.PopEnum<Controller_NPad::NpadCommunicationMode>()};
+
+ applet_resource->GetController<Controller_NPad>(HidController::NPad)
+ .SetNpadCommunicationMode(communication_mode);
+
+ LOG_WARNING(Service_HID, "(STUBBED) called, applet_resource_user_id={}, communication_mode={}",
+ applet_resource_user_id, communication_mode);
+
+ IPC::ResponseBuilder rb{ctx, 2};
+ rb.Push(RESULT_SUCCESS);
+}
+
+void Hid::GetNpadCommunicationMode(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);
+
+ IPC::ResponseBuilder rb{ctx, 4};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushEnum(applet_resource->GetController<Controller_NPad>(HidController::NPad)
+ .GetNpadCommunicationMode());
+}
+
class HidDbg final : public ServiceFramework<HidDbg> {
public:
explicit HidDbg(Core::System& system_) : ServiceFramework{system_, "hid:dbg"} {