summaryrefslogtreecommitdiff
path: root/src/core/hle/service/mii
diff options
context:
space:
mode:
authorGravatar Lioncash2020-11-26 15:19:08 -0500
committerGravatar Lioncash2020-11-26 20:03:11 -0500
commit1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f (patch)
tree3593cd42e0ba676c3919561983f7e9766fcb641c /src/core/hle/service/mii
parentMerge pull request #4975 from comex/invalid-syncpoint-id (diff)
downloadyuzu-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/mii')
-rw-r--r--src/core/hle/service/mii/mii.cpp18
-rw-r--r--src/core/hle/service/mii/mii.h6
2 files changed, 15 insertions, 9 deletions
diff --git a/src/core/hle/service/mii/mii.cpp b/src/core/hle/service/mii/mii.cpp
index d7080b715..26be9e45b 100644
--- a/src/core/hle/service/mii/mii.cpp
+++ b/src/core/hle/service/mii/mii.cpp
@@ -18,7 +18,8 @@ constexpr ResultCode ERROR_INVALID_ARGUMENT{ErrorModule::Mii, 1};
18 18
19class IDatabaseService final : public ServiceFramework<IDatabaseService> { 19class IDatabaseService final : public ServiceFramework<IDatabaseService> {
20public: 20public:
21 explicit IDatabaseService() : ServiceFramework{"IDatabaseService"} { 21 explicit IDatabaseService(Core::System& system_)
22 : ServiceFramework{system_, "IDatabaseService"} {
22 // clang-format off 23 // clang-format off
23 static const FunctionInfo functions[] = { 24 static const FunctionInfo functions[] = {
24 {0, &IDatabaseService::IsUpdated, "IsUpdated"}, 25 {0, &IDatabaseService::IsUpdated, "IsUpdated"},
@@ -252,7 +253,8 @@ private:
252 253
253class MiiDBModule final : public ServiceFramework<MiiDBModule> { 254class MiiDBModule final : public ServiceFramework<MiiDBModule> {
254public: 255public:
255 explicit MiiDBModule(const char* name) : ServiceFramework{name} { 256 explicit MiiDBModule(Core::System& system_, const char* name)
257 : ServiceFramework{system_, name} {
256 // clang-format off 258 // clang-format off
257 static const FunctionInfo functions[] = { 259 static const FunctionInfo functions[] = {
258 {0, &MiiDBModule::GetDatabaseService, "GetDatabaseService"}, 260 {0, &MiiDBModule::GetDatabaseService, "GetDatabaseService"},
@@ -266,7 +268,7 @@ private:
266 void GetDatabaseService(Kernel::HLERequestContext& ctx) { 268 void GetDatabaseService(Kernel::HLERequestContext& ctx) {
267 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 269 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
268 rb.Push(RESULT_SUCCESS); 270 rb.Push(RESULT_SUCCESS);
269 rb.PushIpcInterface<IDatabaseService>(); 271 rb.PushIpcInterface<IDatabaseService>(system);
270 272
271 LOG_DEBUG(Service_Mii, "called"); 273 LOG_DEBUG(Service_Mii, "called");
272 } 274 }
@@ -274,7 +276,7 @@ private:
274 276
275class MiiImg final : public ServiceFramework<MiiImg> { 277class MiiImg final : public ServiceFramework<MiiImg> {
276public: 278public:
277 explicit MiiImg() : ServiceFramework{"miiimg"} { 279 explicit MiiImg(Core::System& system_) : ServiceFramework{system_, "miiimg"} {
278 // clang-format off 280 // clang-format off
279 static const FunctionInfo functions[] = { 281 static const FunctionInfo functions[] = {
280 {0, nullptr, "Initialize"}, 282 {0, nullptr, "Initialize"},
@@ -298,11 +300,11 @@ public:
298 } 300 }
299}; 301};
300 302
301void InstallInterfaces(SM::ServiceManager& sm) { 303void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) {
302 std::make_shared<MiiDBModule>("mii:e")->InstallAsService(sm); 304 std::make_shared<MiiDBModule>(system, "mii:e")->InstallAsService(sm);
303 std::make_shared<MiiDBModule>("mii:u")->InstallAsService(sm); 305 std::make_shared<MiiDBModule>(system, "mii:u")->InstallAsService(sm);
304 306
305 std::make_shared<MiiImg>()->InstallAsService(sm); 307 std::make_shared<MiiImg>(system)->InstallAsService(sm);
306} 308}
307 309
308} // namespace Service::Mii 310} // namespace Service::Mii
diff --git a/src/core/hle/service/mii/mii.h b/src/core/hle/service/mii/mii.h
index 7ce9be50e..9d3238e72 100644
--- a/src/core/hle/service/mii/mii.h
+++ b/src/core/hle/service/mii/mii.h
@@ -4,12 +4,16 @@
4 4
5#pragma once 5#pragma once
6 6
7namespace Core {
8class System;
9}
10
7namespace Service::SM { 11namespace Service::SM {
8class ServiceManager; 12class ServiceManager;
9} 13}
10 14
11namespace Service::Mii { 15namespace Service::Mii {
12 16
13void InstallInterfaces(SM::ServiceManager& sm); 17void InstallInterfaces(SM::ServiceManager& sm, Core::System& system);
14 18
15} // namespace Service::Mii 19} // namespace Service::Mii