Core: pass down Core::System reference to all services (#4272)
* Core: pass down Core::System reference to all services This has to be done at once due to unified interface used by HLE/LLE switcher * apt: eliminate Core::System::GetInstance * gpu_gsp: eliminate Core::System::GetInstance in service * hid: eliminate Core::System::GetInstance * nwm: eliminate Core::System::GetInstance * err_f: eliminate Core::System::GetInstance
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "common/common_paths.h"
|
||||
#include "common/file_util.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "core/file_sys/archive_extsavedata.h"
|
||||
#include "core/file_sys/errors.h"
|
||||
#include "core/file_sys/file_backend.h"
|
||||
@@ -226,7 +227,8 @@ void Module::SetPlayCoins(u16 play_coins) {
|
||||
Module::Interface::Interface(std::shared_ptr<Module> ptm, const char* name, u32 max_session)
|
||||
: ServiceFramework(name, max_session), ptm(std::move(ptm)) {}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
void InstallInterfaces(Core::System& system) {
|
||||
auto& service_manager = system.ServiceManager();
|
||||
auto ptm = std::make_shared<Module>();
|
||||
std::make_shared<PTM_Gets>(ptm)->InstallAsService(service_manager);
|
||||
std::make_shared<PTM_Play>(ptm)->InstallAsService(service_manager);
|
||||
|
@@ -9,6 +9,10 @@
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::PTM {
|
||||
|
||||
/// Charge levels used by PTM functions
|
||||
@@ -140,6 +144,6 @@ private:
|
||||
bool pedometer_is_counting = false;
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
||||
} // namespace Service::PTM
|
||||
|
Reference in New Issue
Block a user