summaryrefslogtreecommitdiff
path: root/src/core/hle/service/fgm
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/fgm
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/fgm')
-rw-r--r--src/core/hle/service/fgm/fgm.cpp18
-rw-r--r--src/core/hle/service/fgm/fgm.h6
2 files changed, 14 insertions, 10 deletions
diff --git a/src/core/hle/service/fgm/fgm.cpp b/src/core/hle/service/fgm/fgm.cpp
index e461274c1..9dc1bc52e 100644
--- a/src/core/hle/service/fgm/fgm.cpp
+++ b/src/core/hle/service/fgm/fgm.cpp
@@ -14,7 +14,7 @@ namespace Service::FGM {
14 14
15class IRequest final : public ServiceFramework<IRequest> { 15class IRequest final : public ServiceFramework<IRequest> {
16public: 16public:
17 explicit IRequest() : ServiceFramework{"IRequest"} { 17 explicit IRequest(Core::System& system_) : ServiceFramework{system_, "IRequest"} {
18 // clang-format off 18 // clang-format off
19 static const FunctionInfo functions[] = { 19 static const FunctionInfo functions[] = {
20 {0, nullptr, "Initialize"}, 20 {0, nullptr, "Initialize"},
@@ -30,7 +30,7 @@ public:
30 30
31class FGM final : public ServiceFramework<FGM> { 31class FGM final : public ServiceFramework<FGM> {
32public: 32public:
33 explicit FGM(const char* name) : ServiceFramework{name} { 33 explicit FGM(Core::System& system_, const char* name) : ServiceFramework{system_, name} {
34 // clang-format off 34 // clang-format off
35 static const FunctionInfo functions[] = { 35 static const FunctionInfo functions[] = {
36 {0, &FGM::Initialize, "Initialize"}, 36 {0, &FGM::Initialize, "Initialize"},
@@ -46,13 +46,13 @@ private:
46 46
47 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 47 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
48 rb.Push(RESULT_SUCCESS); 48 rb.Push(RESULT_SUCCESS);
49 rb.PushIpcInterface<IRequest>(); 49 rb.PushIpcInterface<IRequest>(system);
50 } 50 }
51}; 51};
52 52
53class FGM_DBG final : public ServiceFramework<FGM_DBG> { 53class FGM_DBG final : public ServiceFramework<FGM_DBG> {
54public: 54public:
55 explicit FGM_DBG() : ServiceFramework{"fgm:dbg"} { 55 explicit FGM_DBG(Core::System& system_) : ServiceFramework{system_, "fgm:dbg"} {
56 // clang-format off 56 // clang-format off
57 static const FunctionInfo functions[] = { 57 static const FunctionInfo functions[] = {
58 {0, nullptr, "Initialize"}, 58 {0, nullptr, "Initialize"},
@@ -65,11 +65,11 @@ public:
65 } 65 }
66}; 66};
67 67
68void InstallInterfaces(SM::ServiceManager& sm) { 68void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) {
69 std::make_shared<FGM>("fgm")->InstallAsService(sm); 69 std::make_shared<FGM>(system, "fgm")->InstallAsService(sm);
70 std::make_shared<FGM>("fgm:0")->InstallAsService(sm); 70 std::make_shared<FGM>(system, "fgm:0")->InstallAsService(sm);
71 std::make_shared<FGM>("fgm:9")->InstallAsService(sm); 71 std::make_shared<FGM>(system, "fgm:9")->InstallAsService(sm);
72 std::make_shared<FGM_DBG>()->InstallAsService(sm); 72 std::make_shared<FGM_DBG>(system)->InstallAsService(sm);
73} 73}
74 74
75} // namespace Service::FGM 75} // namespace Service::FGM
diff --git a/src/core/hle/service/fgm/fgm.h b/src/core/hle/service/fgm/fgm.h
index e59691264..75978f2ed 100644
--- a/src/core/hle/service/fgm/fgm.h
+++ b/src/core/hle/service/fgm/fgm.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::FGM { 15namespace Service::FGM {
12 16
13void InstallInterfaces(SM::ServiceManager& sm); 17void InstallInterfaces(SM::ServiceManager& sm, Core::System& system);
14 18
15} // namespace Service::FGM 19} // namespace Service::FGM