Преглед изворни кода

Merge pull request #8274 from german77/firmware

service: hid: Stub IsFirmwareUpdateNeededForNotification
Morph пре 4 година
родитељ
комит
b50e1596cc
2 измењених фајлова са 21 додато и 1 уклоњено
  1. 20 1
      src/core/hle/service/hid/hid.cpp
  2. 1 0
      src/core/hle/service/hid/hid.h

+ 20 - 1
src/core/hle/service/hid/hid.cpp

@@ -357,7 +357,7 @@ Hid::Hid(Core::System& system_)
         {1000, &Hid::SetNpadCommunicationMode, "SetNpadCommunicationMode"},
         {1000, &Hid::SetNpadCommunicationMode, "SetNpadCommunicationMode"},
         {1001, &Hid::GetNpadCommunicationMode, "GetNpadCommunicationMode"},
         {1001, &Hid::GetNpadCommunicationMode, "GetNpadCommunicationMode"},
         {1002, &Hid::SetTouchScreenConfiguration, "SetTouchScreenConfiguration"},
         {1002, &Hid::SetTouchScreenConfiguration, "SetTouchScreenConfiguration"},
-        {1003, nullptr, "IsFirmwareUpdateNeededForNotification"},
+        {1003, &Hid::IsFirmwareUpdateNeededForNotification, "IsFirmwareUpdateNeededForNotification"},
         {2000, nullptr, "ActivateDigitizer"},
         {2000, nullptr, "ActivateDigitizer"},
     };
     };
     // clang-format on
     // clang-format on
@@ -1798,6 +1798,25 @@ void Hid::SetTouchScreenConfiguration(Kernel::HLERequestContext& ctx) {
     rb.Push(ResultSuccess);
     rb.Push(ResultSuccess);
 }
 }
 
 
+void Hid::IsFirmwareUpdateNeededForNotification(Kernel::HLERequestContext& ctx) {
+    IPC::RequestParser rp{ctx};
+    struct Parameters {
+        s32 unknown;
+        INSERT_PADDING_WORDS_NOINIT(1);
+        u64 applet_resource_user_id;
+    };
+    static_assert(sizeof(Parameters) == 0x10, "Parameters has incorrect size.");
+
+    const auto parameters{rp.PopRaw<Parameters>()};
+
+    LOG_WARNING(Service_HID, "(STUBBED) called, unknown={}, applet_resource_user_id={}",
+                parameters.unknown, parameters.applet_resource_user_id);
+
+    IPC::ResponseBuilder rb{ctx, 3};
+    rb.Push(ResultSuccess);
+    rb.Push(false);
+}
+
 class HidDbg final : public ServiceFramework<HidDbg> {
 class HidDbg final : public ServiceFramework<HidDbg> {
 public:
 public:
     explicit HidDbg(Core::System& system_) : ServiceFramework{system_, "hid:dbg"} {
     explicit HidDbg(Core::System& system_) : ServiceFramework{system_, "hid:dbg"} {

+ 1 - 0
src/core/hle/service/hid/hid.h

@@ -166,6 +166,7 @@ private:
     void SetNpadCommunicationMode(Kernel::HLERequestContext& ctx);
     void SetNpadCommunicationMode(Kernel::HLERequestContext& ctx);
     void GetNpadCommunicationMode(Kernel::HLERequestContext& ctx);
     void GetNpadCommunicationMode(Kernel::HLERequestContext& ctx);
     void SetTouchScreenConfiguration(Kernel::HLERequestContext& ctx);
     void SetTouchScreenConfiguration(Kernel::HLERequestContext& ctx);
+    void IsFirmwareUpdateNeededForNotification(Kernel::HLERequestContext& ctx);
 
 
     std::shared_ptr<IAppletResource> applet_resource;
     std::shared_ptr<IAppletResource> applet_resource;