summaryrefslogtreecommitdiff
path: root/src/core/hle/service/ncm
diff options
context:
space:
mode:
authorGravatar Zach Hilman2019-04-10 14:38:27 -0400
committerGravatar Zach Hilman2019-05-26 18:24:48 -0400
commit33ac193bf6465e782c030d2bcd22ac3fd3f0b02d (patch)
treeef5c85d4d4ca45b61f6257fe29033d9fb9d6a9f3 /src/core/hle/service/ncm
parentMerge pull request #2516 from lioncash/label (diff)
downloadyuzu-33ac193bf6465e782c030d2bcd22ac3fd3f0b02d.tar.gz
yuzu-33ac193bf6465e782c030d2bcd22ac3fd3f0b02d.tar.xz
yuzu-33ac193bf6465e782c030d2bcd22ac3fd3f0b02d.zip
ncm: Implement LR OpenLocationResolver (0)
Returns an object of type ILocationResolver with the provided StorageId.
Diffstat (limited to 'src/core/hle/service/ncm')
-rw-r--r--src/core/hle/service/ncm/ncm.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/core/hle/service/ncm/ncm.cpp b/src/core/hle/service/ncm/ncm.cpp
index 5d31f638f..7f775900a 100644
--- a/src/core/hle/service/ncm/ncm.cpp
+++ b/src/core/hle/service/ncm/ncm.cpp
@@ -11,8 +11,45 @@
11namespace Service::NCM { 11namespace Service::NCM {
12 12
13class LocationResolver final : public ServiceFramework<LocationResolver> { 13class LocationResolver final : public ServiceFramework<LocationResolver> {
14class ILocationResolver final : public ServiceFramework<ILocationResolver> {
15public:
16 explicit ILocationResolver(FileSys::StorageId id)
17 : ServiceFramework{"ILocationResolver"}, storage(id) {
18 static const FunctionInfo functions[] = {
19 {0, nullptr, "ResolveProgramPath"},
20 {1, nullptr, "RedirectProgramPath"},
21 {2, nullptr, "ResolveApplicationControlPath"},
22 {3, nullptr, "ResolveApplicationHtmlDocumentPath"},
23 {4, nullptr, "ResolveDataPath"},
24 {5, nullptr, "RedirectApplicationControlPath"},
25 {6, nullptr, "RedirectApplicationHtmlDocumentPath"},
26 {7, nullptr, "ResolveApplicationLegalInformationPath"},
27 {8, nullptr, "RedirectApplicationLegalInformationPath"},
28 {9, nullptr, "Refresh"},
29 {10, nullptr, "RedirectProgramPath2"},
30 {11, nullptr, "Refresh2"},
31 {12, nullptr, "DeleteProgramPath"},
32 {13, nullptr, "DeleteApplicationControlPath"},
33 {14, nullptr, "DeleteApplicationHtmlDocumentPath"},
34 {15, nullptr, "DeleteApplicationLegalInformationPath"},
35 {16, nullptr, ""},
36 {17, nullptr, ""},
37 {18, nullptr, ""},
38 {19, nullptr, ""},
39 };
40
41 RegisterHandlers(functions);
42 }
43
44private:
45 FileSys::StorageId storage;
46};
47
14public: 48public:
15 explicit LocationResolver() : ServiceFramework{"lr"} { 49 explicit LocationResolver() : ServiceFramework{"lr"} {
50class LR final : public ServiceFramework<LR> {
51public:
52 explicit LR() : ServiceFramework{"lr"} {
16 // clang-format off 53 // clang-format off
17 static const FunctionInfo functions[] = { 54 static const FunctionInfo functions[] = {
18 {0, nullptr, "OpenLocationResolver"}, 55 {0, nullptr, "OpenLocationResolver"},
@@ -24,6 +61,19 @@ public:
24 61
25 RegisterHandlers(functions); 62 RegisterHandlers(functions);
26 } 63 }
64
65private:
66 void OpenLocationResolver(Kernel::HLERequestContext& ctx) {
67 IPC::RequestParser rp{ctx};
68 const auto id = rp.PopRaw<FileSys::StorageId>();
69
70 LOG_DEBUG(Service_NCM, "called, id={:02X}", static_cast<u8>(id));
71
72 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
73 rb.Push(RESULT_SUCCESS);
74 rb.PushIpcInterface(std::make_shared<ILocationResolver>(id));
75 }
76
27}; 77};
28 78
29class NCM final : public ServiceFramework<NCM> { 79class NCM final : public ServiceFramework<NCM> {