diff options
| author | 2019-06-05 18:05:50 -0400 | |
|---|---|---|
| committer | 2019-06-05 18:05:50 -0400 | |
| commit | e4fea833d4b9c6089bf56c85d64db9a9ec226936 (patch) | |
| tree | 9b4b76c91fd351bb9a0f17784cb3c684e42218a0 /src | |
| parent | Merge pull request #2521 from lioncash/naming (diff) | |
| parent | ncm: Implement LR OpenAddOnContentLocationResolver (2) (diff) | |
| download | yuzu-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.cpp | 80 |
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 | ||
| 11 | namespace Service::NCM { | 13 | namespace Service::NCM { |
| 12 | 14 | ||
| 13 | class LocationResolver final : public ServiceFramework<LocationResolver> { | 15 | class ILocationResolver final : public ServiceFramework<ILocationResolver> { |
| 14 | public: | 16 | public: |
| 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 | |||
| 47 | private: | ||
| 48 | FileSys::StorageId storage; | ||
| 49 | }; | ||
| 50 | |||
| 51 | class IRegisteredLocationResolver final : public ServiceFramework<IRegisteredLocationResolver> { | ||
| 52 | public: | ||
| 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 | |||
| 72 | class IAddOnContentLocationResolver final : public ServiceFramework<IAddOnContentLocationResolver> { | ||
| 73 | public: | ||
| 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 | |||
| 87 | class LR final : public ServiceFramework<LR> { | ||
| 88 | public: | ||
| 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 | ||
| 54 | void InstallInterfaces(SM::ServiceManager& sm) { | 128 | void 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 | ||