summaryrefslogtreecommitdiff
path: root/src/core/hle/service/nfp
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/nfp
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/nfp')
-rw-r--r--src/core/hle/service/nfp/nfp.cpp9
-rw-r--r--src/core/hle/service/nfp/nfp.h4
-rw-r--r--src/core/hle/service/nfp/nfp_user.cpp4
-rw-r--r--src/core/hle/service/nfp/nfp_user.h2
4 files changed, 10 insertions, 9 deletions
diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp
index a0469ffbd..5557da72e 100644
--- a/src/core/hle/service/nfp/nfp.cpp
+++ b/src/core/hle/service/nfp/nfp.cpp
@@ -21,8 +21,9 @@ namespace ErrCodes {
21constexpr ResultCode ERR_NO_APPLICATION_AREA(ErrorModule::NFP, 152); 21constexpr ResultCode ERR_NO_APPLICATION_AREA(ErrorModule::NFP, 152);
22} // namespace ErrCodes 22} // namespace ErrCodes
23 23
24Module::Interface::Interface(std::shared_ptr<Module> module, Core::System& system, const char* name) 24Module::Interface::Interface(std::shared_ptr<Module> module_, Core::System& system_,
25 : ServiceFramework(name), module(std::move(module)), system(system) { 25 const char* name)
26 : ServiceFramework{system_, name}, module{std::move(module_)} {
26 auto& kernel = system.Kernel(); 27 auto& kernel = system.Kernel();
27 nfc_tag_load = Kernel::WritableEvent::CreateEventPair(kernel, "IUser:NFCTagDetected"); 28 nfc_tag_load = Kernel::WritableEvent::CreateEventPair(kernel, "IUser:NFCTagDetected");
28} 29}
@@ -31,8 +32,8 @@ Module::Interface::~Interface() = default;
31 32
32class IUser final : public ServiceFramework<IUser> { 33class IUser final : public ServiceFramework<IUser> {
33public: 34public:
34 IUser(Module::Interface& nfp_interface, Core::System& system) 35 explicit IUser(Module::Interface& nfp_interface_, Core::System& system_)
35 : ServiceFramework("NFP::IUser"), nfp_interface(nfp_interface) { 36 : ServiceFramework{system_, "NFP::IUser"}, nfp_interface{nfp_interface_} {
36 static const FunctionInfo functions[] = { 37 static const FunctionInfo functions[] = {
37 {0, &IUser::Initialize, "Initialize"}, 38 {0, &IUser::Initialize, "Initialize"},
38 {1, &IUser::Finalize, "Finalize"}, 39 {1, &IUser::Finalize, "Finalize"},
diff --git a/src/core/hle/service/nfp/nfp.h b/src/core/hle/service/nfp/nfp.h
index 200013795..295de535b 100644
--- a/src/core/hle/service/nfp/nfp.h
+++ b/src/core/hle/service/nfp/nfp.h
@@ -16,7 +16,8 @@ class Module final {
16public: 16public:
17 class Interface : public ServiceFramework<Interface> { 17 class Interface : public ServiceFramework<Interface> {
18 public: 18 public:
19 explicit Interface(std::shared_ptr<Module> module, Core::System& system, const char* name); 19 explicit Interface(std::shared_ptr<Module> module_, Core::System& system_,
20 const char* name);
20 ~Interface() override; 21 ~Interface() override;
21 22
22 struct ModelInfo { 23 struct ModelInfo {
@@ -43,7 +44,6 @@ public:
43 44
44 protected: 45 protected:
45 std::shared_ptr<Module> module; 46 std::shared_ptr<Module> module;
46 Core::System& system;
47 }; 47 };
48}; 48};
49 49
diff --git a/src/core/hle/service/nfp/nfp_user.cpp b/src/core/hle/service/nfp/nfp_user.cpp
index 298184f17..10b0ef944 100644
--- a/src/core/hle/service/nfp/nfp_user.cpp
+++ b/src/core/hle/service/nfp/nfp_user.cpp
@@ -6,8 +6,8 @@
6 6
7namespace Service::NFP { 7namespace Service::NFP {
8 8
9NFP_User::NFP_User(std::shared_ptr<Module> module, Core::System& system) 9NFP_User::NFP_User(std::shared_ptr<Module> module_, Core::System& system_)
10 : Module::Interface(std::move(module), system, "nfp:user") { 10 : Interface(std::move(module_), system_, "nfp:user") {
11 static const FunctionInfo functions[] = { 11 static const FunctionInfo functions[] = {
12 {0, &NFP_User::CreateUserInterface, "CreateUserInterface"}, 12 {0, &NFP_User::CreateUserInterface, "CreateUserInterface"},
13 }; 13 };
diff --git a/src/core/hle/service/nfp/nfp_user.h b/src/core/hle/service/nfp/nfp_user.h
index 1686ebf20..7f3c124f6 100644
--- a/src/core/hle/service/nfp/nfp_user.h
+++ b/src/core/hle/service/nfp/nfp_user.h
@@ -10,7 +10,7 @@ namespace Service::NFP {
10 10
11class NFP_User final : public Module::Interface { 11class NFP_User final : public Module::Interface {
12public: 12public:
13 explicit NFP_User(std::shared_ptr<Module> module, Core::System& system); 13 explicit NFP_User(std::shared_ptr<Module> module_, Core::System& system_);
14 ~NFP_User() override; 14 ~NFP_User() override;
15}; 15};
16 16