Просмотр исходного кода

core/ns: Implement GetReadOnlyApplicationControlDataInterface

Used in checkpoint homebrew
Narr the Reg 4 лет назад
Родитель
Сommit
54f007efc6
2 измененных файлов с 26 добавлено и 1 удалено
  1. 19 1
      src/core/hle/service/ns/ns.cpp
  2. 7 0
      src/core/hle/service/ns/ns.h

+ 19 - 1
src/core/hle/service/ns/ns.cpp

@@ -571,11 +571,29 @@ IFactoryResetInterface::IFactoryResetInterface(Core::System& system_)
 
 
 IFactoryResetInterface::~IFactoryResetInterface() = default;
 IFactoryResetInterface::~IFactoryResetInterface() = default;
 
 
+IReadOnlyApplicationControlDataInterface::IReadOnlyApplicationControlDataInterface(
+    Core::System& system_)
+    : ServiceFramework{system_, "IReadOnlyApplicationControlDataInterface"} {
+    // clang-format off
+    static const FunctionInfo functions[] = {
+        {0, nullptr, "GetApplicationControlData"},
+        {1, nullptr, "GetApplicationDesiredLanguage"},
+        {2, nullptr, "ConvertApplicationLanguageToLanguageCode"},
+        {3, nullptr, "ConvertLanguageCodeToApplicationLanguage"},
+        {4, nullptr, "SelectApplicationDesiredLanguage"},
+    };
+    // clang-format on
+
+    RegisterHandlers(functions);
+}
+
+IReadOnlyApplicationControlDataInterface::~IReadOnlyApplicationControlDataInterface() = default;
+
 NS::NS(const char* name, Core::System& system_) : ServiceFramework{system_, name} {
 NS::NS(const char* name, Core::System& system_) : ServiceFramework{system_, name} {
     // clang-format off
     // clang-format off
     static const FunctionInfo functions[] = {
     static const FunctionInfo functions[] = {
         {7988, nullptr, "GetDynamicRightsInterface"},
         {7988, nullptr, "GetDynamicRightsInterface"},
-        {7989, nullptr, "GetReadOnlyApplicationControlDataInterface"},
+        {7989, &NS::PushInterface<IReadOnlyApplicationControlDataInterface>, "GetReadOnlyApplicationControlDataInterface"},
         {7991, nullptr, "GetReadOnlyApplicationRecordInterface"},
         {7991, nullptr, "GetReadOnlyApplicationRecordInterface"},
         {7992, &NS::PushInterface<IECommerceInterface>, "GetECommerceInterface"},
         {7992, &NS::PushInterface<IECommerceInterface>, "GetECommerceInterface"},
         {7993, &NS::PushInterface<IApplicationVersionInterface>, "GetApplicationVersionInterface"},
         {7993, &NS::PushInterface<IApplicationVersionInterface>, "GetApplicationVersionInterface"},

+ 7 - 0
src/core/hle/service/ns/ns.h

@@ -74,6 +74,13 @@ public:
     ~IFactoryResetInterface() override;
     ~IFactoryResetInterface() override;
 };
 };
 
 
+class IReadOnlyApplicationControlDataInterface final
+    : public ServiceFramework<IReadOnlyApplicationControlDataInterface> {
+public:
+    explicit IReadOnlyApplicationControlDataInterface(Core::System& system_);
+    ~IReadOnlyApplicationControlDataInterface() override;
+};
+
 class NS final : public ServiceFramework<NS> {
 class NS final : public ServiceFramework<NS> {
 public:
 public:
     explicit NS(const char* name, Core::System& system_);
     explicit NS(const char* name, Core::System& system_);