diff options
| author | 2020-11-26 15:19:08 -0500 | |
|---|---|---|
| committer | 2020-11-26 20:03:11 -0500 | |
| commit | 1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f (patch) | |
| tree | 3593cd42e0ba676c3919561983f7e9766fcb641c /src/core/hle/service/ncm | |
| parent | Merge pull request #4975 from comex/invalid-syncpoint-id (diff) | |
| download | yuzu-1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f.tar.gz yuzu-1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f.tar.xz yuzu-1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f.zip | |
service: Eliminate usages of the global system instance
Completely removes all usages of the global system instance within the
services code by passing in the using system instance to the services.
Diffstat (limited to 'src/core/hle/service/ncm')
| -rw-r--r-- | src/core/hle/service/ncm/ncm.cpp | 20 | ||||
| -rw-r--r-- | src/core/hle/service/ncm/ncm.h | 6 |
2 files changed, 16 insertions, 10 deletions
diff --git a/src/core/hle/service/ncm/ncm.cpp b/src/core/hle/service/ncm/ncm.cpp index e38dea1f4..b8d627ca8 100644 --- a/src/core/hle/service/ncm/ncm.cpp +++ b/src/core/hle/service/ncm/ncm.cpp | |||
| @@ -14,8 +14,8 @@ namespace Service::NCM { | |||
| 14 | 14 | ||
| 15 | class ILocationResolver final : public ServiceFramework<ILocationResolver> { | 15 | class ILocationResolver final : public ServiceFramework<ILocationResolver> { |
| 16 | public: | 16 | public: |
| 17 | explicit ILocationResolver(FileSys::StorageId id) | 17 | explicit ILocationResolver(Core::System& system_, FileSys::StorageId id) |
| 18 | : ServiceFramework{"ILocationResolver"}, storage(id) { | 18 | : ServiceFramework{system_, "ILocationResolver"}, storage{id} { |
| 19 | // clang-format off | 19 | // clang-format off |
| 20 | static const FunctionInfo functions[] = { | 20 | static const FunctionInfo functions[] = { |
| 21 | {0, nullptr, "ResolveProgramPath"}, | 21 | {0, nullptr, "ResolveProgramPath"}, |
| @@ -50,7 +50,8 @@ private: | |||
| 50 | 50 | ||
| 51 | class IRegisteredLocationResolver final : public ServiceFramework<IRegisteredLocationResolver> { | 51 | class IRegisteredLocationResolver final : public ServiceFramework<IRegisteredLocationResolver> { |
| 52 | public: | 52 | public: |
| 53 | explicit IRegisteredLocationResolver() : ServiceFramework{"IRegisteredLocationResolver"} { | 53 | explicit IRegisteredLocationResolver(Core::System& system_) |
| 54 | : ServiceFramework{system_, "IRegisteredLocationResolver"} { | ||
| 54 | // clang-format off | 55 | // clang-format off |
| 55 | static const FunctionInfo functions[] = { | 56 | static const FunctionInfo functions[] = { |
| 56 | {0, nullptr, "ResolveProgramPath"}, | 57 | {0, nullptr, "ResolveProgramPath"}, |
| @@ -72,7 +73,8 @@ public: | |||
| 72 | 73 | ||
| 73 | class IAddOnContentLocationResolver final : public ServiceFramework<IAddOnContentLocationResolver> { | 74 | class IAddOnContentLocationResolver final : public ServiceFramework<IAddOnContentLocationResolver> { |
| 74 | public: | 75 | public: |
| 75 | explicit IAddOnContentLocationResolver() : ServiceFramework{"IAddOnContentLocationResolver"} { | 76 | explicit IAddOnContentLocationResolver(Core::System& system_) |
| 77 | : ServiceFramework{system_, "IAddOnContentLocationResolver"} { | ||
| 76 | // clang-format off | 78 | // clang-format off |
| 77 | static const FunctionInfo functions[] = { | 79 | static const FunctionInfo functions[] = { |
| 78 | {0, nullptr, "ResolveAddOnContentPath"}, | 80 | {0, nullptr, "ResolveAddOnContentPath"}, |
| @@ -89,7 +91,7 @@ public: | |||
| 89 | 91 | ||
| 90 | class LR final : public ServiceFramework<LR> { | 92 | class LR final : public ServiceFramework<LR> { |
| 91 | public: | 93 | public: |
| 92 | explicit LR() : ServiceFramework{"lr"} { | 94 | explicit LR(Core::System& system_) : ServiceFramework{system_, "lr"} { |
| 93 | // clang-format off | 95 | // clang-format off |
| 94 | static const FunctionInfo functions[] = { | 96 | static const FunctionInfo functions[] = { |
| 95 | {0, nullptr, "OpenLocationResolver"}, | 97 | {0, nullptr, "OpenLocationResolver"}, |
| @@ -105,7 +107,7 @@ public: | |||
| 105 | 107 | ||
| 106 | class NCM final : public ServiceFramework<NCM> { | 108 | class NCM final : public ServiceFramework<NCM> { |
| 107 | public: | 109 | public: |
| 108 | explicit NCM() : ServiceFramework{"ncm"} { | 110 | explicit NCM(Core::System& system_) : ServiceFramework{system_, "ncm"} { |
| 109 | // clang-format off | 111 | // clang-format off |
| 110 | static const FunctionInfo functions[] = { | 112 | static const FunctionInfo functions[] = { |
| 111 | {0, nullptr, "CreateContentStorage"}, | 113 | {0, nullptr, "CreateContentStorage"}, |
| @@ -130,9 +132,9 @@ public: | |||
| 130 | } | 132 | } |
| 131 | }; | 133 | }; |
| 132 | 134 | ||
| 133 | void InstallInterfaces(SM::ServiceManager& sm) { | 135 | void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { |
| 134 | std::make_shared<LR>()->InstallAsService(sm); | 136 | std::make_shared<LR>(system)->InstallAsService(sm); |
| 135 | std::make_shared<NCM>()->InstallAsService(sm); | 137 | std::make_shared<NCM>(system)->InstallAsService(sm); |
| 136 | } | 138 | } |
| 137 | 139 | ||
| 138 | } // namespace Service::NCM | 140 | } // namespace Service::NCM |
diff --git a/src/core/hle/service/ncm/ncm.h b/src/core/hle/service/ncm/ncm.h index 7bc8518a6..ee01eddc0 100644 --- a/src/core/hle/service/ncm/ncm.h +++ b/src/core/hle/service/ncm/ncm.h | |||
| @@ -4,12 +4,16 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | namespace Core { | ||
| 8 | class System; | ||
| 9 | } | ||
| 10 | |||
| 7 | namespace Service::SM { | 11 | namespace Service::SM { |
| 8 | class ServiceManager; | 12 | class ServiceManager; |
| 9 | } | 13 | } |
| 10 | 14 | ||
| 11 | namespace Service::NCM { | 15 | namespace Service::NCM { |
| 12 | 16 | ||
| 13 | void InstallInterfaces(SM::ServiceManager& sm); | 17 | void InstallInterfaces(SM::ServiceManager& sm, Core::System& system); |
| 14 | 18 | ||
| 15 | } // namespace Service::NCM | 19 | } // namespace Service::NCM |