summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2018-07-28 10:46:09 -0700
committerGravatar GitHub2018-07-28 10:46:09 -0700
commit458fdda7005f5c84dad652792254260b01a1f389 (patch)
treefd1932868a8a7d5c675d272879577a1581909aae
parentMerge pull request #846 from lioncash/mii (diff)
parentservice: Add ncm services (diff)
downloadyuzu-458fdda7005f5c84dad652792254260b01a1f389.tar.gz
yuzu-458fdda7005f5c84dad652792254260b01a1f389.tar.xz
yuzu-458fdda7005f5c84dad652792254260b01a1f389.zip
Merge pull request #847 from lioncash/ncm
service: Add ncm services
Diffstat (limited to '')
-rw-r--r--src/common/logging/backend.cpp1
-rw-r--r--src/common/logging/log.h1
-rw-r--r--src/core/CMakeLists.txt2
-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
6 files changed, 80 insertions, 0 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index ca30fa6ff..38cc85e23 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -178,6 +178,7 @@ void FileBackend::Write(const Entry& entry) {
178 SUB(Service, LM) \ 178 SUB(Service, LM) \
179 SUB(Service, Mii) \ 179 SUB(Service, Mii) \
180 SUB(Service, MM) \ 180 SUB(Service, MM) \
181 SUB(Service, NCM) \
181 SUB(Service, NFC) \ 182 SUB(Service, NFC) \
182 SUB(Service, NFP) \ 183 SUB(Service, NFP) \
183 SUB(Service, NIFM) \ 184 SUB(Service, NIFM) \
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index 2515cb40f..db4a80d0a 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -65,6 +65,7 @@ enum class Class : ClassType {
65 Service_LM, ///< The LM (Logger) service 65 Service_LM, ///< The LM (Logger) service
66 Service_Mii, ///< The Mii service 66 Service_Mii, ///< The Mii service
67 Service_MM, ///< The MM (Multimedia) service 67 Service_MM, ///< The MM (Multimedia) service
68 Service_NCM, ///< The NCM service
68 Service_NFC, ///< The NFC (Near-field communication) service 69 Service_NFC, ///< The NFC (Near-field communication) service
69 Service_NFP, ///< The NFP service 70 Service_NFP, ///< The NFP service
70 Service_NIFM, ///< The NIFM (Network interface) service 71 Service_NIFM, ///< The NIFM (Network interface) service
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 18faf08f8..f1e7e2593 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -182,6 +182,8 @@ add_library(core STATIC
182 hle/service/mii/mii.h 182 hle/service/mii/mii.h
183 hle/service/mm/mm_u.cpp 183 hle/service/mm/mm_u.cpp
184 hle/service/mm/mm_u.h 184 hle/service/mm/mm_u.h
185 hle/service/ncm/ncm.cpp
186 hle/service/ncm/ncm.h
185 hle/service/nfc/nfc.cpp 187 hle/service/nfc/nfc.cpp
186 hle/service/nfc/nfc.h 188 hle/service/nfc/nfc.h
187 hle/service/nfp/nfp.cpp 189 hle/service/nfp/nfp.cpp
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 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <memory>
6
7#include "core/hle/service/ncm/ncm.h"
8#include "core/hle/service/service.h"
9#include "core/hle/service/sm/sm.h"
10
11namespace Service::NCM {
12
13class LocationResolver final : public ServiceFramework<LocationResolver> {
14public:
15 explicit LocationResolver() : ServiceFramework{"lr"} {
16 // clang-format off
17 static const FunctionInfo functions[] = {
18 {0, nullptr, "OpenLocationResolver"},
19 {1, nullptr, "OpenRegisteredLocationResolver"},
20 {2, nullptr, "RefreshLocationResolver"},
21 {3, nullptr, "OpenAddOnContentLocationResolver"},
22 };
23 // clang-format on
24
25 RegisterHandlers(functions);
26 }
27};
28
29class NCM final : public ServiceFramework<NCM> {
30public:
31 explicit NCM() : ServiceFramework{"ncm"} {
32 // clang-format off
33 static const FunctionInfo functions[] = {
34 {0, nullptr, "CreateContentStorage"},
35 {1, nullptr, "CreateContentMetaDatabase"},
36 {2, nullptr, "VerifyContentStorage"},
37 {3, nullptr, "VerifyContentMetaDatabase"},
38 {4, nullptr, "OpenContentStorage"},
39 {5, nullptr, "OpenContentMetaDatabase"},
40 {6, nullptr, "CloseContentStorageForcibly"},
41 {7, nullptr, "CloseContentMetaDatabaseForcibly"},
42 {8, nullptr, "CleanupContentMetaDatabase"},
43 {9, nullptr, "OpenContentStorage2"},
44 {10, nullptr, "CloseContentStorage"},
45 {11, nullptr, "OpenContentMetaDatabase2"},
46 {12, nullptr, "CloseContentMetaDatabase"},
47 };
48 // clang-format on
49
50 RegisterHandlers(functions);
51 }
52};
53
54void InstallInterfaces(SM::ServiceManager& sm) {
55 std::make_shared<LocationResolver>()->InstallAsService(sm);
56 std::make_shared<NCM>()->InstallAsService(sm);
57}
58
59} // 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 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::NCM {
12
13void InstallInterfaces(SM::ServiceManager& sm);
14
15} // 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 @@
36#include "core/hle/service/lm/lm.h" 36#include "core/hle/service/lm/lm.h"
37#include "core/hle/service/mii/mii.h" 37#include "core/hle/service/mii/mii.h"
38#include "core/hle/service/mm/mm_u.h" 38#include "core/hle/service/mm/mm_u.h"
39#include "core/hle/service/ncm/ncm.h"
39#include "core/hle/service/nfc/nfc.h" 40#include "core/hle/service/nfc/nfc.h"
40#include "core/hle/service/nfp/nfp.h" 41#include "core/hle/service/nfp/nfp.h"
41#include "core/hle/service/nifm/nifm.h" 42#include "core/hle/service/nifm/nifm.h"
@@ -214,6 +215,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
214 LM::InstallInterfaces(*sm); 215 LM::InstallInterfaces(*sm);
215 Mii::InstallInterfaces(*sm); 216 Mii::InstallInterfaces(*sm);
216 MM::InstallInterfaces(*sm); 217 MM::InstallInterfaces(*sm);
218 NCM::InstallInterfaces(*sm);
217 NFC::InstallInterfaces(*sm); 219 NFC::InstallInterfaces(*sm);
218 NFP::InstallInterfaces(*sm); 220 NFP::InstallInterfaces(*sm);
219 NIFM::InstallInterfaces(*sm); 221 NIFM::InstallInterfaces(*sm);