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:
Weiyi Wang
2018-10-05 10:59:43 -04:00
committed by GitHub
parent 008242c5f3
commit b163502744
77 changed files with 329 additions and 111 deletions

View File

@@ -18,6 +18,10 @@
#include "core/hle/service/service.h"
#include "core/settings.h"
namespace Core {
class System;
}
namespace Kernel {
class Event;
class SharedMemory;
@@ -198,7 +202,7 @@ DirectionState GetStickDirectionState(s16 circle_pad_x, s16 circle_pad_y);
class Module final {
public:
Module();
explicit Module(Core::System& system);
class Interface : public ServiceFramework<Interface> {
public:
@@ -299,6 +303,8 @@ private:
void UpdateAccelerometerCallback(u64 userdata, s64 cycles_late);
void UpdateGyroscopeCallback(u64 userdata, s64 cycles_late);
Core::System& system;
// Handle to shared memory region designated to HID_User service
Kernel::SharedPtr<Kernel::SharedMemory> shared_mem;
@@ -329,7 +335,7 @@ private:
std::unique_ptr<Input::TouchDevice> touch_device;
};
void InstallInterfaces(SM::ServiceManager& service_manager);
void InstallInterfaces(Core::System& system);
/// Reload input devices. Used when input configuration changed
void ReloadInputDevices();