summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-07-28 19:46:09 +0200
committerGitHub <noreply@github.com>2018-07-28 19:46:09 +0200
commit458fdda7005f5c84dad652792254260b01a1f389 (patch)
treefd1932868a8a7d5c675d272879577a1581909aae /src/core/hle/service
parentMerge pull request #846 from lioncash/mii (diff)
parentservice: Add ncm services (diff)
downloadyuzu-458fdda7005f5c84dad652792254260b01a1f389.tar
yuzu-458fdda7005f5c84dad652792254260b01a1f389.tar.gz
yuzu-458fdda7005f5c84dad652792254260b01a1f389.tar.bz2
yuzu-458fdda7005f5c84dad652792254260b01a1f389.tar.lz
yuzu-458fdda7005f5c84dad652792254260b01a1f389.tar.xz
yuzu-458fdda7005f5c84dad652792254260b01a1f389.tar.zst
yuzu-458fdda7005f5c84dad652792254260b01a1f389.zip
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/ncm/ncm.cpp59
-rw-r--r--src/core/hle/service/ncm/ncm.h15
-rw-r--r--src/core/hle/service/service.cpp2
3 files changed, 76 insertions, 0 deletions
diff --git a/src/core/hle/service/ncm/ncm.cpp b/src/core/hle/service/ncm/ncm.cpp
new file mode 100644
index 000000000..0297edca0
--- /dev/null
+++ b/src/core/hle/service/ncm/ncm.cpp
@@ -0,0 +1,59 @@
+// Copyright 2018 yuzu emulator team
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include <memory>
+
+#include "core/hle/service/ncm/ncm.h"
+#include "core/hle/service/service.h"
+#include "core/hle/service/sm/sm.h"
+
+namespace Service::NCM {
+
+class LocationResolver final : public ServiceFramework<LocationResolver> {
+public:
+ explicit LocationResolver() : ServiceFramework{"lr"} {
+ // clang-format off
+ static const FunctionInfo functions[] = {
+ {0, nullptr, "OpenLocationResolver"},
+ {1, nullptr, "OpenRegisteredLocationResolver"},
+ {2, nullptr, "RefreshLocationResolver"},
+ {3, nullptr, "OpenAddOnContentLocationResolver"},
+ };
+ // clang-format on
+
+ RegisterHandlers(functions);
+ }
+};
+
+class NCM final : public ServiceFramework<NCM> {
+public:
+ explicit NCM() : ServiceFramework{"ncm"} {
+ // clang-format off
+ static const FunctionInfo functions[] = {
+ {0, nullptr, "CreateContentStorage"},
+ {1, nullptr, "CreateContentMetaDatabase"},
+ {2, nullptr, "VerifyContentStorage"},
+ {3, nullptr, "VerifyContentMetaDatabase"},
+ {4, nullptr, "OpenContentStorage"},
+ {5, nullptr, "OpenContentMetaDatabase"},
+ {6, nullptr, "CloseContentStorageForcibly"},
+ {7, nullptr, "CloseContentMetaDatabaseForcibly"},
+ {8, nullptr, "CleanupContentMetaDatabase"},
+ {9, nullptr, "OpenContentStorage2"},
+ {10, nullptr, "CloseContentStorage"},
+ {11, nullptr, "OpenContentMetaDatabase2"},
+ {12, nullptr, "CloseContentMetaDatabase"},
+ };
+ // clang-format on
+
+ RegisterHandlers(functions);
+ }
+};
+
+void InstallInterfaces(SM::ServiceManager& sm) {
+ std::make_shared<LocationResolver>()->InstallAsService(sm);
+ std::make_shared<NCM>()->InstallAsService(sm);
+}
+
+} // namespace Service::NCM
diff --git a/src/core/hle/service/ncm/ncm.h b/src/core/hle/service/ncm/ncm.h
new file mode 100644
index 000000000..7bc8518a6
--- /dev/null
+++ b/src/core/hle/service/ncm/ncm.h
@@ -0,0 +1,15 @@
+// Copyright 2018 yuzu emulator team
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+namespace Service::SM {
+class ServiceManager;
+}
+
+namespace Service::NCM {
+
+void InstallInterfaces(SM::ServiceManager& sm);
+
+} // namespace Service::NCM
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 98c912eb3..5180a0c93 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -36,6 +36,7 @@
#include "core/hle/service/lm/lm.h"
#include "core/hle/service/mii/mii.h"
#include "core/hle/service/mm/mm_u.h"
+#include "core/hle/service/ncm/ncm.h"
#include "core/hle/service/nfc/nfc.h"
#include "core/hle/service/nfp/nfp.h"
#include "core/hle/service/nifm/nifm.h"
@@ -214,6 +215,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
LM::InstallInterfaces(*sm);
Mii::InstallInterfaces(*sm);
MM::InstallInterfaces(*sm);
+ NCM::InstallInterfaces(*sm);
NFC::InstallInterfaces(*sm);
NFP::InstallInterfaces(*sm);
NIFM::InstallInterfaces(*sm);