summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2019-06-05 18:05:50 -0400
committerGravatar GitHub2019-06-05 18:05:50 -0400
commite4fea833d4b9c6089bf56c85d64db9a9ec226936 (patch)
tree9b4b76c91fd351bb9a0f17784cb3c684e42218a0 /src
parentMerge pull request #2521 from lioncash/naming (diff)
parentncm: Implement LR OpenAddOnContentLocationResolver (2) (diff)
downloadyuzu-e4fea833d4b9c6089bf56c85d64db9a9ec226936.tar.gz
yuzu-e4fea833d4b9c6089bf56c85d64db9a9ec226936.tar.xz
yuzu-e4fea833d4b9c6089bf56c85d64db9a9ec226936.zip
Merge pull request #2419 from DarkLordZach/srv-lr-iface
lr: Add command handler skeletons for Open*LocationResolver
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/ncm/ncm.cpp80
1 files changed, 77 insertions, 3 deletions
diff --git a/src/core/hle/service/ncm/ncm.cpp b/src/core/hle/service/ncm/ncm.cpp
index 5d31f638f..b405a4b66 100644
--- a/src/core/hle/service/ncm/ncm.cpp
+++ b/src/core/hle/service/ncm/ncm.cpp
@@ -4,15 +4,89 @@
4 4
5#include <memory> 5#include <memory>
6 6
7#include "core/file_sys/romfs_factory.h"
8#include "core/hle/ipc_helpers.h"
7#include "core/hle/service/ncm/ncm.h" 9#include "core/hle/service/ncm/ncm.h"
8#include "core/hle/service/service.h" 10#include "core/hle/service/service.h"
9#include "core/hle/service/sm/sm.h" 11#include "core/hle/service/sm/sm.h"
10 12
11namespace Service::NCM { 13namespace Service::NCM {
12 14
13class LocationResolver final : public ServiceFramework<LocationResolver> { 15class ILocationResolver final : public ServiceFramework<ILocationResolver> {
14public: 16public:
15 explicit LocationResolver() : ServiceFramework{"lr"} { 17 explicit ILocationResolver(FileSys::StorageId id)
18 : ServiceFramework{"ILocationResolver"}, storage(id) {
19 // clang-format off
20 static const FunctionInfo functions[] = {
21 {0, nullptr, "ResolveProgramPath"},
22 {1, nullptr, "RedirectProgramPath"},
23 {2, nullptr, "ResolveApplicationControlPath"},
24 {3, nullptr, "ResolveApplicationHtmlDocumentPath"},
25 {4, nullptr, "ResolveDataPath"},
26 {5, nullptr, "RedirectApplicationControlPath"},
27 {6, nullptr, "RedirectApplicationHtmlDocumentPath"},
28 {7, nullptr, "ResolveApplicationLegalInformationPath"},
29 {8, nullptr, "RedirectApplicationLegalInformationPath"},
30 {9, nullptr, "Refresh"},
31 {10, nullptr, "RedirectProgramPath2"},
32 {11, nullptr, "Refresh2"},
33 {12, nullptr, "DeleteProgramPath"},
34 {13, nullptr, "DeleteApplicationControlPath"},
35 {14, nullptr, "DeleteApplicationHtmlDocumentPath"},
36 {15, nullptr, "DeleteApplicationLegalInformationPath"},
37 {16, nullptr, ""},
38 {17, nullptr, ""},
39 {18, nullptr, ""},
40 {19, nullptr, ""},
41 };
42 // clang-format on
43
44 RegisterHandlers(functions);
45 }
46
47private:
48 FileSys::StorageId storage;
49};
50
51class IRegisteredLocationResolver final : public ServiceFramework<IRegisteredLocationResolver> {
52public:
53 explicit IRegisteredLocationResolver() : ServiceFramework{"IRegisteredLocationResolver"} {
54 // clang-format off
55 static const FunctionInfo functions[] = {
56 {0, nullptr, "ResolveProgramPath"},
57 {1, nullptr, "RegisterProgramPath"},
58 {2, nullptr, "UnregisterProgramPath"},
59 {3, nullptr, "RedirectProgramPath"},
60 {4, nullptr, "ResolveHtmlDocumentPath"},
61 {5, nullptr, "RegisterHtmlDocumentPath"},
62 {6, nullptr, "UnregisterHtmlDocumentPath"},
63 {7, nullptr, "RedirectHtmlDocumentPath"},
64 {8, nullptr, ""},
65 };
66 // clang-format on
67
68 RegisterHandlers(functions);
69 }
70};
71
72class IAddOnContentLocationResolver final : public ServiceFramework<IAddOnContentLocationResolver> {
73public:
74 explicit IAddOnContentLocationResolver() : ServiceFramework{"IAddOnContentLocationResolver"} {
75 // clang-format off
76 static const FunctionInfo functions[] = {
77 {0, nullptr, "ResolveAddOnContentPath"},
78 {1, nullptr, "RegisterAddOnContentStorage"},
79 {2, nullptr, "UnregisterAllAddOnContentPath"},
80 };
81 // clang-format on
82
83 RegisterHandlers(functions);
84 }
85};
86
87class LR final : public ServiceFramework<LR> {
88public:
89 explicit LR() : ServiceFramework{"lr"} {
16 // clang-format off 90 // clang-format off
17 static const FunctionInfo functions[] = { 91 static const FunctionInfo functions[] = {
18 {0, nullptr, "OpenLocationResolver"}, 92 {0, nullptr, "OpenLocationResolver"},
@@ -52,7 +126,7 @@ public:
52}; 126};
53 127
54void InstallInterfaces(SM::ServiceManager& sm) { 128void InstallInterfaces(SM::ServiceManager& sm) {
55 std::make_shared<LocationResolver>()->InstallAsService(sm); 129 std::make_shared<LR>()->InstallAsService(sm);
56 std::make_shared<NCM>()->InstallAsService(sm); 130 std::make_shared<NCM>()->InstallAsService(sm);
57} 131}
58 132