summaryrefslogtreecommitdiff
path: root/src/core/hle/service/set
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/set
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/set')
-rw-r--r--src/core/hle/service/set/set.cpp2
-rw-r--r--src/core/hle/service/set/set.h6
-rw-r--r--src/core/hle/service/set/set_cal.cpp2
-rw-r--r--src/core/hle/service/set/set_cal.h6
-rw-r--r--src/core/hle/service/set/set_fd.cpp2
-rw-r--r--src/core/hle/service/set/set_fd.h6
-rw-r--r--src/core/hle/service/set/set_sys.cpp2
-rw-r--r--src/core/hle/service/set/set_sys.h6
-rw-r--r--src/core/hle/service/set/settings.cpp11
-rw-r--r--src/core/hle/service/set/settings.h10
10 files changed, 38 insertions, 15 deletions
diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp
index ffbf90b00..d953b4303 100644
--- a/src/core/hle/service/set/set.cpp
+++ b/src/core/hle/service/set/set.cpp
@@ -188,7 +188,7 @@ void SET::GetKeyCodeMap2(Kernel::HLERequestContext& ctx) {
188 GetKeyCodeMapImpl(ctx); 188 GetKeyCodeMapImpl(ctx);
189} 189}
190 190
191SET::SET() : ServiceFramework("set") { 191SET::SET(Core::System& system_) : ServiceFramework{system_, "set"} {
192 // clang-format off 192 // clang-format off
193 static const FunctionInfo functions[] = { 193 static const FunctionInfo functions[] = {
194 {0, &SET::GetLanguageCode, "GetLanguageCode"}, 194 {0, &SET::GetLanguageCode, "GetLanguageCode"},
diff --git a/src/core/hle/service/set/set.h b/src/core/hle/service/set/set.h
index 8ac9c169d..d5bd7828d 100644
--- a/src/core/hle/service/set/set.h
+++ b/src/core/hle/service/set/set.h
@@ -6,6 +6,10 @@
6 6
7#include "core/hle/service/service.h" 7#include "core/hle/service/service.h"
8 8
9namespace Core {
10class System;
11}
12
9namespace Service::Set { 13namespace Service::Set {
10 14
11/// This is "nn::settings::LanguageCode", which is a NUL-terminated string stored in a u64. 15/// This is "nn::settings::LanguageCode", which is a NUL-terminated string stored in a u64.
@@ -32,7 +36,7 @@ LanguageCode GetLanguageCodeFromIndex(std::size_t idx);
32 36
33class SET final : public ServiceFramework<SET> { 37class SET final : public ServiceFramework<SET> {
34public: 38public:
35 explicit SET(); 39 explicit SET(Core::System& system_);
36 ~SET() override; 40 ~SET() override;
37 41
38private: 42private:
diff --git a/src/core/hle/service/set/set_cal.cpp b/src/core/hle/service/set/set_cal.cpp
index 3fbfecc9e..b2aa7bc0c 100644
--- a/src/core/hle/service/set/set_cal.cpp
+++ b/src/core/hle/service/set/set_cal.cpp
@@ -6,7 +6,7 @@
6 6
7namespace Service::Set { 7namespace Service::Set {
8 8
9SET_CAL::SET_CAL() : ServiceFramework("set:cal") { 9SET_CAL::SET_CAL(Core::System& system_) : ServiceFramework{system_, "set:cal"} {
10 // clang-format off 10 // clang-format off
11 static const FunctionInfo functions[] = { 11 static const FunctionInfo functions[] = {
12 {0, nullptr, "GetBluetoothBdAddress"}, 12 {0, nullptr, "GetBluetoothBdAddress"},
diff --git a/src/core/hle/service/set/set_cal.h b/src/core/hle/service/set/set_cal.h
index a0677e815..a29fc3ddd 100644
--- a/src/core/hle/service/set/set_cal.h
+++ b/src/core/hle/service/set/set_cal.h
@@ -6,11 +6,15 @@
6 6
7#include "core/hle/service/service.h" 7#include "core/hle/service/service.h"
8 8
9namespace Core {
10class System;
11}
12
9namespace Service::Set { 13namespace Service::Set {
10 14
11class SET_CAL final : public ServiceFramework<SET_CAL> { 15class SET_CAL final : public ServiceFramework<SET_CAL> {
12public: 16public:
13 explicit SET_CAL(); 17 explicit SET_CAL(Core::System& system_);
14 ~SET_CAL() override; 18 ~SET_CAL() override;
15}; 19};
16 20
diff --git a/src/core/hle/service/set/set_fd.cpp b/src/core/hle/service/set/set_fd.cpp
index 565882a31..f04dc5047 100644
--- a/src/core/hle/service/set/set_fd.cpp
+++ b/src/core/hle/service/set/set_fd.cpp
@@ -6,7 +6,7 @@
6 6
7namespace Service::Set { 7namespace Service::Set {
8 8
9SET_FD::SET_FD() : ServiceFramework("set:fd") { 9SET_FD::SET_FD(Core::System& system_) : ServiceFramework{system_, "set:fd"} {
10 // clang-format off 10 // clang-format off
11 static const FunctionInfo functions[] = { 11 static const FunctionInfo functions[] = {
12 {2, nullptr, "SetSettingsItemValue"}, 12 {2, nullptr, "SetSettingsItemValue"},
diff --git a/src/core/hle/service/set/set_fd.h b/src/core/hle/service/set/set_fd.h
index 216e65f1f..c28cb301e 100644
--- a/src/core/hle/service/set/set_fd.h
+++ b/src/core/hle/service/set/set_fd.h
@@ -6,11 +6,15 @@
6 6
7#include "core/hle/service/service.h" 7#include "core/hle/service/service.h"
8 8
9namespace Core {
10class System;
11}
12
9namespace Service::Set { 13namespace Service::Set {
10 14
11class SET_FD final : public ServiceFramework<SET_FD> { 15class SET_FD final : public ServiceFramework<SET_FD> {
12public: 16public:
13 explicit SET_FD(); 17 explicit SET_FD(Core::System& system_);
14 ~SET_FD() override; 18 ~SET_FD() override;
15}; 19};
16 20
diff --git a/src/core/hle/service/set/set_sys.cpp b/src/core/hle/service/set/set_sys.cpp
index 080b5743e..19b8f113d 100644
--- a/src/core/hle/service/set/set_sys.cpp
+++ b/src/core/hle/service/set/set_sys.cpp
@@ -103,7 +103,7 @@ void SET_SYS::SetColorSetId(Kernel::HLERequestContext& ctx) {
103 rb.Push(RESULT_SUCCESS); 103 rb.Push(RESULT_SUCCESS);
104} 104}
105 105
106SET_SYS::SET_SYS() : ServiceFramework("set:sys") { 106SET_SYS::SET_SYS(Core::System& system_) : ServiceFramework{system_, "set:sys"} {
107 // clang-format off 107 // clang-format off
108 static const FunctionInfo functions[] = { 108 static const FunctionInfo functions[] = {
109 {0, nullptr, "SetLanguageCode"}, 109 {0, nullptr, "SetLanguageCode"},
diff --git a/src/core/hle/service/set/set_sys.h b/src/core/hle/service/set/set_sys.h
index 13ee2cf46..edb185a68 100644
--- a/src/core/hle/service/set/set_sys.h
+++ b/src/core/hle/service/set/set_sys.h
@@ -6,11 +6,15 @@
6 6
7#include "core/hle/service/service.h" 7#include "core/hle/service/service.h"
8 8
9namespace Core {
10class System;
11}
12
9namespace Service::Set { 13namespace Service::Set {
10 14
11class SET_SYS final : public ServiceFramework<SET_SYS> { 15class SET_SYS final : public ServiceFramework<SET_SYS> {
12public: 16public:
13 explicit SET_SYS(); 17 explicit SET_SYS(Core::System& system_);
14 ~SET_SYS() override; 18 ~SET_SYS() override;
15 19
16private: 20private:
diff --git a/src/core/hle/service/set/settings.cpp b/src/core/hle/service/set/settings.cpp
index cf5541ca8..212ebc427 100644
--- a/src/core/hle/service/set/settings.cpp
+++ b/src/core/hle/service/set/settings.cpp
@@ -7,14 +7,15 @@
7#include "core/hle/service/set/set_fd.h" 7#include "core/hle/service/set/set_fd.h"
8#include "core/hle/service/set/set_sys.h" 8#include "core/hle/service/set/set_sys.h"
9#include "core/hle/service/set/settings.h" 9#include "core/hle/service/set/settings.h"
10#include "core/hle/service/sm/sm.h"
10 11
11namespace Service::Set { 12namespace Service::Set {
12 13
13void InstallInterfaces(SM::ServiceManager& service_manager) { 14void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) {
14 std::make_shared<SET>()->InstallAsService(service_manager); 15 std::make_shared<SET>(system)->InstallAsService(service_manager);
15 std::make_shared<SET_CAL>()->InstallAsService(service_manager); 16 std::make_shared<SET_CAL>(system)->InstallAsService(service_manager);
16 std::make_shared<SET_FD>()->InstallAsService(service_manager); 17 std::make_shared<SET_FD>(system)->InstallAsService(service_manager);
17 std::make_shared<SET_SYS>()->InstallAsService(service_manager); 18 std::make_shared<SET_SYS>(system)->InstallAsService(service_manager);
18} 19}
19 20
20} // namespace Service::Set 21} // namespace Service::Set
diff --git a/src/core/hle/service/set/settings.h b/src/core/hle/service/set/settings.h
index 6606ce776..7a6950dd0 100644
--- a/src/core/hle/service/set/settings.h
+++ b/src/core/hle/service/set/settings.h
@@ -4,11 +4,17 @@
4 4
5#pragma once 5#pragma once
6 6
7#include "core/hle/service/service.h" 7namespace Core {
8class System;
9}
10
11namespace Service::SM {
12class ServiceManager;
13}
8 14
9namespace Service::Set { 15namespace Service::Set {
10 16
11/// Registers all Settings services with the specified service manager. 17/// Registers all Settings services with the specified service manager.
12void InstallInterfaces(SM::ServiceManager& service_manager); 18void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system);
13 19
14} // namespace Service::Set 20} // namespace Service::Set