summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/aoc/aoc_u.h2
-rw-r--r--src/core/hle/service/hid/controllers/controller_base.cpp6
-rw-r--r--src/core/hle/service/hid/controllers/controller_base.h8
-rw-r--r--src/core/hle/service/hid/controllers/debug_pad.cpp5
-rw-r--r--src/core/hle/service/hid/controllers/debug_pad.h5
-rw-r--r--src/core/hle/service/hid/controllers/gesture.cpp5
-rw-r--r--src/core/hle/service/hid/controllers/gesture.h5
-rw-r--r--src/core/hle/service/hid/controllers/keyboard.cpp5
-rw-r--r--src/core/hle/service/hid/controllers/keyboard.h5
-rw-r--r--src/core/hle/service/hid/controllers/mouse.cpp4
-rw-r--r--src/core/hle/service/hid/controllers/mouse.h5
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp4
-rw-r--r--src/core/hle/service/hid/controllers/npad.h5
-rw-r--r--src/core/hle/service/hid/controllers/stubbed.cpp5
-rw-r--r--src/core/hle/service/hid/controllers/stubbed.h5
-rw-r--r--src/core/hle/service/hid/controllers/touchscreen.cpp5
-rw-r--r--src/core/hle/service/hid/controllers/touchscreen.h5
-rw-r--r--src/core/hle/service/hid/controllers/xpad.cpp4
-rw-r--r--src/core/hle/service/hid/controllers/xpad.h5
-rw-r--r--src/core/hle/service/hid/hid.cpp6
-rw-r--r--src/core/hle/service/hid/hid.h6
-rw-r--r--src/core/hle/service/nim/nim.cpp2
-rw-r--r--src/core/hle/service/ns/pl_u.h2
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.cpp23
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.h5
25 files changed, 75 insertions, 62 deletions
diff --git a/src/core/hle/service/aoc/aoc_u.h b/src/core/hle/service/aoc/aoc_u.h
index e20f90a76..848b2f416 100644
--- a/src/core/hle/service/aoc/aoc_u.h
+++ b/src/core/hle/service/aoc/aoc_u.h
@@ -14,7 +14,7 @@ namespace Service::AOC {
14 14
15class AOC_U final : public ServiceFramework<AOC_U> { 15class AOC_U final : public ServiceFramework<AOC_U> {
16public: 16public:
17 AOC_U(Core::System& system); 17 explicit AOC_U(Core::System& system);
18 ~AOC_U() override; 18 ~AOC_U() override;
19 19
20private: 20private:
diff --git a/src/core/hle/service/hid/controllers/controller_base.cpp b/src/core/hle/service/hid/controllers/controller_base.cpp
index cc935b031..2ea9b78d8 100644
--- a/src/core/hle/service/hid/controllers/controller_base.cpp
+++ b/src/core/hle/service/hid/controllers/controller_base.cpp
@@ -6,15 +6,15 @@
6 6
7namespace Service::HID { 7namespace Service::HID {
8 8
9ControllerBase::ControllerBase() = default; 9ControllerBase::ControllerBase(Core::System& system) : system(system){};
10ControllerBase::~ControllerBase() = default; 10ControllerBase::~ControllerBase() = default;
11 11
12void ControllerBase::ActivateController(Core::System& system) { 12void ControllerBase::ActivateController() {
13 if (is_activated) { 13 if (is_activated) {
14 OnRelease(); 14 OnRelease();
15 } 15 }
16 is_activated = true; 16 is_activated = true;
17 OnInit(system); 17 OnInit();
18} 18}
19 19
20void ControllerBase::DeactivateController() { 20void ControllerBase::DeactivateController() {
diff --git a/src/core/hle/service/hid/controllers/controller_base.h b/src/core/hle/service/hid/controllers/controller_base.h
index 7abe24f1d..47972f5fc 100644
--- a/src/core/hle/service/hid/controllers/controller_base.h
+++ b/src/core/hle/service/hid/controllers/controller_base.h
@@ -18,11 +18,11 @@ class System;
18namespace Service::HID { 18namespace Service::HID {
19class ControllerBase { 19class ControllerBase {
20public: 20public:
21 ControllerBase(); 21 ControllerBase(Core::System& system);
22 virtual ~ControllerBase(); 22 virtual ~ControllerBase();
23 23
24 // Called when the controller is initialized 24 // Called when the controller is initialized
25 virtual void OnInit(Core::System& system) = 0; 25 virtual void OnInit() = 0;
26 26
27 // When the controller is released 27 // When the controller is released
28 virtual void OnRelease() = 0; 28 virtual void OnRelease() = 0;
@@ -34,7 +34,7 @@ public:
34 // Called when input devices should be loaded 34 // Called when input devices should be loaded
35 virtual void OnLoadInputDevices() = 0; 35 virtual void OnLoadInputDevices() = 0;
36 36
37 void ActivateController(Core::System& system); 37 void ActivateController();
38 38
39 void DeactivateController(); 39 void DeactivateController();
40 40
@@ -50,5 +50,7 @@ protected:
50 s64_le entry_count; 50 s64_le entry_count;
51 }; 51 };
52 static_assert(sizeof(CommonHeader) == 0x20, "CommonHeader is an invalid size"); 52 static_assert(sizeof(CommonHeader) == 0x20, "CommonHeader is an invalid size");
53
54 Core::System& system;
53}; 55};
54} // namespace Service::HID 56} // namespace Service::HID
diff --git a/src/core/hle/service/hid/controllers/debug_pad.cpp b/src/core/hle/service/hid/controllers/debug_pad.cpp
index 2c5528b67..8e8263f5b 100644
--- a/src/core/hle/service/hid/controllers/debug_pad.cpp
+++ b/src/core/hle/service/hid/controllers/debug_pad.cpp
@@ -14,10 +14,11 @@ constexpr s32 HID_JOYSTICK_MAX = 0x7fff;
14constexpr s32 HID_JOYSTICK_MIN = -0x7fff; 14constexpr s32 HID_JOYSTICK_MIN = -0x7fff;
15enum class JoystickId : std::size_t { Joystick_Left, Joystick_Right }; 15enum class JoystickId : std::size_t { Joystick_Left, Joystick_Right };
16 16
17Controller_DebugPad::Controller_DebugPad() = default; 17Controller_DebugPad::Controller_DebugPad(Core::System& system)
18 : ControllerBase(system), system(system) {}
18Controller_DebugPad::~Controller_DebugPad() = default; 19Controller_DebugPad::~Controller_DebugPad() = default;
19 20
20void Controller_DebugPad::OnInit(Core::System& system) {} 21void Controller_DebugPad::OnInit() {}
21 22
22void Controller_DebugPad::OnRelease() {} 23void Controller_DebugPad::OnRelease() {}
23 24
diff --git a/src/core/hle/service/hid/controllers/debug_pad.h b/src/core/hle/service/hid/controllers/debug_pad.h
index 629d6d582..6c4de817e 100644
--- a/src/core/hle/service/hid/controllers/debug_pad.h
+++ b/src/core/hle/service/hid/controllers/debug_pad.h
@@ -16,11 +16,11 @@
16namespace Service::HID { 16namespace Service::HID {
17class Controller_DebugPad final : public ControllerBase { 17class Controller_DebugPad final : public ControllerBase {
18public: 18public:
19 Controller_DebugPad(); 19 explicit Controller_DebugPad(Core::System& system);
20 ~Controller_DebugPad() override; 20 ~Controller_DebugPad() override;
21 21
22 // Called when the controller is initialized 22 // Called when the controller is initialized
23 void OnInit(Core::System& system) override; 23 void OnInit() override;
24 24
25 // When the controller is released 25 // When the controller is released
26 void OnRelease() override; 26 void OnRelease() override;
@@ -89,5 +89,6 @@ private:
89 buttons; 89 buttons;
90 std::array<std::unique_ptr<Input::AnalogDevice>, Settings::NativeAnalog::NUM_STICKS_HID> 90 std::array<std::unique_ptr<Input::AnalogDevice>, Settings::NativeAnalog::NUM_STICKS_HID>
91 analogs; 91 analogs;
92 Core::System& system;
92}; 93};
93} // namespace Service::HID 94} // namespace Service::HID
diff --git a/src/core/hle/service/hid/controllers/gesture.cpp b/src/core/hle/service/hid/controllers/gesture.cpp
index c01fd6d4e..80da0a0d3 100644
--- a/src/core/hle/service/hid/controllers/gesture.cpp
+++ b/src/core/hle/service/hid/controllers/gesture.cpp
@@ -10,10 +10,11 @@
10namespace Service::HID { 10namespace Service::HID {
11constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3BA00; 11constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3BA00;
12 12
13Controller_Gesture::Controller_Gesture() = default; 13Controller_Gesture::Controller_Gesture(Core::System& system)
14 : ControllerBase(system), system(system) {}
14Controller_Gesture::~Controller_Gesture() = default; 15Controller_Gesture::~Controller_Gesture() = default;
15 16
16void Controller_Gesture::OnInit(Core::System& system) {} 17void Controller_Gesture::OnInit() {}
17 18
18void Controller_Gesture::OnRelease() {} 19void Controller_Gesture::OnRelease() {}
19 20
diff --git a/src/core/hle/service/hid/controllers/gesture.h b/src/core/hle/service/hid/controllers/gesture.h
index c3827fa00..b0f8794ba 100644
--- a/src/core/hle/service/hid/controllers/gesture.h
+++ b/src/core/hle/service/hid/controllers/gesture.h
@@ -12,11 +12,11 @@
12namespace Service::HID { 12namespace Service::HID {
13class Controller_Gesture final : public ControllerBase { 13class Controller_Gesture final : public ControllerBase {
14public: 14public:
15 Controller_Gesture(); 15 Controller_Gesture(Core::System& system);
16 ~Controller_Gesture() override; 16 ~Controller_Gesture() override;
17 17
18 // Called when the controller is initialized 18 // Called when the controller is initialized
19 void OnInit(Core::System& system) override; 19 void OnInit() override;
20 20
21 // When the controller is released 21 // When the controller is released
22 void OnRelease() override; 22 void OnRelease() override;
@@ -59,5 +59,6 @@ private:
59 std::array<GestureState, 17> gesture_states; 59 std::array<GestureState, 17> gesture_states;
60 }; 60 };
61 SharedMemory shared_memory{}; 61 SharedMemory shared_memory{};
62 Core::System& system;
62}; 63};
63} // namespace Service::HID 64} // namespace Service::HID
diff --git a/src/core/hle/service/hid/controllers/keyboard.cpp b/src/core/hle/service/hid/controllers/keyboard.cpp
index b3fbb7962..e587b2e15 100644
--- a/src/core/hle/service/hid/controllers/keyboard.cpp
+++ b/src/core/hle/service/hid/controllers/keyboard.cpp
@@ -12,10 +12,11 @@ namespace Service::HID {
12constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3800; 12constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3800;
13constexpr u8 KEYS_PER_BYTE = 8; 13constexpr u8 KEYS_PER_BYTE = 8;
14 14
15Controller_Keyboard::Controller_Keyboard() = default; 15Controller_Keyboard::Controller_Keyboard(Core::System& system)
16 : ControllerBase(system), system(system) {}
16Controller_Keyboard::~Controller_Keyboard() = default; 17Controller_Keyboard::~Controller_Keyboard() = default;
17 18
18void Controller_Keyboard::OnInit(Core::System& system) {} 19void Controller_Keyboard::OnInit() {}
19 20
20void Controller_Keyboard::OnRelease() {} 21void Controller_Keyboard::OnRelease() {}
21 22
diff --git a/src/core/hle/service/hid/controllers/keyboard.h b/src/core/hle/service/hid/controllers/keyboard.h
index a594706a9..37ff075b1 100644
--- a/src/core/hle/service/hid/controllers/keyboard.h
+++ b/src/core/hle/service/hid/controllers/keyboard.h
@@ -15,11 +15,11 @@
15namespace Service::HID { 15namespace Service::HID {
16class Controller_Keyboard final : public ControllerBase { 16class Controller_Keyboard final : public ControllerBase {
17public: 17public:
18 Controller_Keyboard(); 18 Controller_Keyboard(Core::System& system);
19 ~Controller_Keyboard() override; 19 ~Controller_Keyboard() override;
20 20
21 // Called when the controller is initialized 21 // Called when the controller is initialized
22 void OnInit(Core::System& system) override; 22 void OnInit() override;
23 23
24 // When the controller is released 24 // When the controller is released
25 void OnRelease() override; 25 void OnRelease() override;
@@ -53,5 +53,6 @@ private:
53 keyboard_keys; 53 keyboard_keys;
54 std::array<std::unique_ptr<Input::ButtonDevice>, Settings::NativeKeyboard::NumKeyboardMods> 54 std::array<std::unique_ptr<Input::ButtonDevice>, Settings::NativeKeyboard::NumKeyboardMods>
55 keyboard_mods; 55 keyboard_mods;
56 Core::System& system;
56}; 57};
57} // namespace Service::HID 58} // namespace Service::HID
diff --git a/src/core/hle/service/hid/controllers/mouse.cpp b/src/core/hle/service/hid/controllers/mouse.cpp
index fd3f91e65..88f2ca4c1 100644
--- a/src/core/hle/service/hid/controllers/mouse.cpp
+++ b/src/core/hle/service/hid/controllers/mouse.cpp
@@ -11,10 +11,10 @@
11namespace Service::HID { 11namespace Service::HID {
12constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3400; 12constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3400;
13 13
14Controller_Mouse::Controller_Mouse() = default; 14Controller_Mouse::Controller_Mouse(Core::System& system) : ControllerBase(system), system(system) {}
15Controller_Mouse::~Controller_Mouse() = default; 15Controller_Mouse::~Controller_Mouse() = default;
16 16
17void Controller_Mouse::OnInit(Core::System& system) {} 17void Controller_Mouse::OnInit() {}
18void Controller_Mouse::OnRelease() {} 18void Controller_Mouse::OnRelease() {}
19 19
20void Controller_Mouse::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* data, 20void Controller_Mouse::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8* data,
diff --git a/src/core/hle/service/hid/controllers/mouse.h b/src/core/hle/service/hid/controllers/mouse.h
index df3a17491..67e2647ad 100644
--- a/src/core/hle/service/hid/controllers/mouse.h
+++ b/src/core/hle/service/hid/controllers/mouse.h
@@ -14,11 +14,11 @@
14namespace Service::HID { 14namespace Service::HID {
15class Controller_Mouse final : public ControllerBase { 15class Controller_Mouse final : public ControllerBase {
16public: 16public:
17 Controller_Mouse(); 17 Controller_Mouse(Core::System& system);
18 ~Controller_Mouse() override; 18 ~Controller_Mouse() override;
19 19
20 // Called when the controller is initialized 20 // Called when the controller is initialized
21 void OnInit(Core::System& system) override; 21 void OnInit() override;
22 22
23 // When the controller is released 23 // When the controller is released
24 void OnRelease() override; 24 void OnRelease() override;
@@ -53,5 +53,6 @@ private:
53 std::unique_ptr<Input::MouseDevice> mouse_device; 53 std::unique_ptr<Input::MouseDevice> mouse_device;
54 std::array<std::unique_ptr<Input::ButtonDevice>, Settings::NativeMouseButton::NumMouseButtons> 54 std::array<std::unique_ptr<Input::ButtonDevice>, Settings::NativeMouseButton::NumMouseButtons>
55 mouse_button_devices; 55 mouse_button_devices;
56 Core::System& system;
56}; 57};
57} // namespace Service::HID 58} // namespace Service::HID
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 104924d03..f7a0aa4ff 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -93,7 +93,7 @@ u32 Controller_NPad::IndexToNPad(std::size_t index) {
93 }; 93 };
94} 94}
95 95
96Controller_NPad::Controller_NPad() = default; 96Controller_NPad::Controller_NPad(Core::System& system) : ControllerBase(system), system(system) {}
97Controller_NPad::~Controller_NPad() = default; 97Controller_NPad::~Controller_NPad() = default;
98 98
99void Controller_NPad::InitNewlyAddedControler(std::size_t controller_idx) { 99void Controller_NPad::InitNewlyAddedControler(std::size_t controller_idx) {
@@ -167,7 +167,7 @@ void Controller_NPad::InitNewlyAddedControler(std::size_t controller_idx) {
167 controller.battery_level[2] = BATTERY_FULL; 167 controller.battery_level[2] = BATTERY_FULL;
168} 168}
169 169
170void Controller_NPad::OnInit(Core::System& system) { 170void Controller_NPad::OnInit() {
171 auto& kernel = system.Kernel(); 171 auto& kernel = system.Kernel();
172 styleset_changed_event = Kernel::WritableEvent::CreateEventPair( 172 styleset_changed_event = Kernel::WritableEvent::CreateEventPair(
173 kernel, Kernel::ResetType::Automatic, "npad:NpadStyleSetChanged"); 173 kernel, Kernel::ResetType::Automatic, "npad:NpadStyleSetChanged");
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h
index 755739700..3552c248e 100644
--- a/src/core/hle/service/hid/controllers/npad.h
+++ b/src/core/hle/service/hid/controllers/npad.h
@@ -20,11 +20,11 @@ constexpr u32 NPAD_UNKNOWN = 16; // TODO(ogniK): What is this?
20 20
21class Controller_NPad final : public ControllerBase { 21class Controller_NPad final : public ControllerBase {
22public: 22public:
23 Controller_NPad(); 23 Controller_NPad(Core::System& system);
24 ~Controller_NPad() override; 24 ~Controller_NPad() override;
25 25
26 // Called when the controller is initialized 26 // Called when the controller is initialized
27 void OnInit(Core::System& system) override; 27 void OnInit() override;
28 28
29 // When the controller is released 29 // When the controller is released
30 void OnRelease() override; 30 void OnRelease() override;
@@ -327,5 +327,6 @@ private:
327 std::array<ControllerPad, 10> npad_pad_states{}; 327 std::array<ControllerPad, 10> npad_pad_states{};
328 bool IsControllerSupported(NPadControllerType controller); 328 bool IsControllerSupported(NPadControllerType controller);
329 bool is_in_lr_assignment_mode{false}; 329 bool is_in_lr_assignment_mode{false};
330 Core::System& system;
330}; 331};
331} // namespace Service::HID 332} // namespace Service::HID
diff --git a/src/core/hle/service/hid/controllers/stubbed.cpp b/src/core/hle/service/hid/controllers/stubbed.cpp
index 5de75c958..9b829341e 100644
--- a/src/core/hle/service/hid/controllers/stubbed.cpp
+++ b/src/core/hle/service/hid/controllers/stubbed.cpp
@@ -9,10 +9,11 @@
9 9
10namespace Service::HID { 10namespace Service::HID {
11 11
12Controller_Stubbed::Controller_Stubbed() = default; 12Controller_Stubbed::Controller_Stubbed(Core::System& system)
13 : ControllerBase(system), system(system) {}
13Controller_Stubbed::~Controller_Stubbed() = default; 14Controller_Stubbed::~Controller_Stubbed() = default;
14 15
15void Controller_Stubbed::OnInit(Core::System& system) {} 16void Controller_Stubbed::OnInit() {}
16 17
17void Controller_Stubbed::OnRelease() {} 18void Controller_Stubbed::OnRelease() {}
18 19
diff --git a/src/core/hle/service/hid/controllers/stubbed.h b/src/core/hle/service/hid/controllers/stubbed.h
index af636bae3..96dec4872 100644
--- a/src/core/hle/service/hid/controllers/stubbed.h
+++ b/src/core/hle/service/hid/controllers/stubbed.h
@@ -10,11 +10,11 @@
10namespace Service::HID { 10namespace Service::HID {
11class Controller_Stubbed final : public ControllerBase { 11class Controller_Stubbed final : public ControllerBase {
12public: 12public:
13 Controller_Stubbed(); 13 Controller_Stubbed(Core::System& system);
14 ~Controller_Stubbed() override; 14 ~Controller_Stubbed() override;
15 15
16 // Called when the controller is initialized 16 // Called when the controller is initialized
17 void OnInit(Core::System& system) override; 17 void OnInit() override;
18 18
19 // When the controller is released 19 // When the controller is released
20 void OnRelease() override; 20 void OnRelease() override;
@@ -30,5 +30,6 @@ public:
30private: 30private:
31 bool smart_update{}; 31 bool smart_update{};
32 std::size_t common_offset{}; 32 std::size_t common_offset{};
33 Core::System& system;
33}; 34};
34} // namespace Service::HID 35} // namespace Service::HID
diff --git a/src/core/hle/service/hid/controllers/touchscreen.cpp b/src/core/hle/service/hid/controllers/touchscreen.cpp
index ea8dffaab..25912fd69 100644
--- a/src/core/hle/service/hid/controllers/touchscreen.cpp
+++ b/src/core/hle/service/hid/controllers/touchscreen.cpp
@@ -13,10 +13,11 @@
13namespace Service::HID { 13namespace Service::HID {
14constexpr std::size_t SHARED_MEMORY_OFFSET = 0x400; 14constexpr std::size_t SHARED_MEMORY_OFFSET = 0x400;
15 15
16Controller_Touchscreen::Controller_Touchscreen() = default; 16Controller_Touchscreen::Controller_Touchscreen(Core::System& system)
17 : ControllerBase(system), system(system) {}
17Controller_Touchscreen::~Controller_Touchscreen() = default; 18Controller_Touchscreen::~Controller_Touchscreen() = default;
18 19
19void Controller_Touchscreen::OnInit(Core::System& system) {} 20void Controller_Touchscreen::OnInit() {}
20 21
21void Controller_Touchscreen::OnRelease() {} 22void Controller_Touchscreen::OnRelease() {}
22 23
diff --git a/src/core/hle/service/hid/controllers/touchscreen.h b/src/core/hle/service/hid/controllers/touchscreen.h
index fdb45fd85..2e8383b80 100644
--- a/src/core/hle/service/hid/controllers/touchscreen.h
+++ b/src/core/hle/service/hid/controllers/touchscreen.h
@@ -14,11 +14,11 @@
14namespace Service::HID { 14namespace Service::HID {
15class Controller_Touchscreen final : public ControllerBase { 15class Controller_Touchscreen final : public ControllerBase {
16public: 16public:
17 Controller_Touchscreen(); 17 Controller_Touchscreen(Core::System& system);
18 ~Controller_Touchscreen() override; 18 ~Controller_Touchscreen() override;
19 19
20 // Called when the controller is initialized 20 // Called when the controller is initialized
21 void OnInit(Core::System& system) override; 21 void OnInit() override;
22 22
23 // When the controller is released 23 // When the controller is released
24 void OnRelease() override; 24 void OnRelease() override;
@@ -69,5 +69,6 @@ private:
69 TouchScreenSharedMemory shared_memory{}; 69 TouchScreenSharedMemory shared_memory{};
70 std::unique_ptr<Input::TouchDevice> touch_device; 70 std::unique_ptr<Input::TouchDevice> touch_device;
71 s64_le last_touch{}; 71 s64_le last_touch{};
72 Core::System& system;
72}; 73};
73} // namespace Service::HID 74} // namespace Service::HID
diff --git a/src/core/hle/service/hid/controllers/xpad.cpp b/src/core/hle/service/hid/controllers/xpad.cpp
index 22ee0c7d7..1bce044b4 100644
--- a/src/core/hle/service/hid/controllers/xpad.cpp
+++ b/src/core/hle/service/hid/controllers/xpad.cpp
@@ -10,10 +10,10 @@
10namespace Service::HID { 10namespace Service::HID {
11constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3C00; 11constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3C00;
12 12
13Controller_XPad::Controller_XPad() = default; 13Controller_XPad::Controller_XPad(Core::System& system) : ControllerBase(system), system(system) {}
14Controller_XPad::~Controller_XPad() = default; 14Controller_XPad::~Controller_XPad() = default;
15 15
16void Controller_XPad::OnInit(Core::System& system) {} 16void Controller_XPad::OnInit() {}
17 17
18void Controller_XPad::OnRelease() {} 18void Controller_XPad::OnRelease() {}
19 19
diff --git a/src/core/hle/service/hid/controllers/xpad.h b/src/core/hle/service/hid/controllers/xpad.h
index 8522efd50..813cb7755 100644
--- a/src/core/hle/service/hid/controllers/xpad.h
+++ b/src/core/hle/service/hid/controllers/xpad.h
@@ -12,11 +12,11 @@
12namespace Service::HID { 12namespace Service::HID {
13class Controller_XPad final : public ControllerBase { 13class Controller_XPad final : public ControllerBase {
14public: 14public:
15 Controller_XPad(); 15 Controller_XPad(Core::System& system);
16 ~Controller_XPad() override; 16 ~Controller_XPad() override;
17 17
18 // Called when the controller is initialized 18 // Called when the controller is initialized
19 void OnInit(Core::System& system) override; 19 void OnInit() override;
20 20
21 // When the controller is released 21 // When the controller is released
22 void OnRelease() override; 22 void OnRelease() override;
@@ -56,5 +56,6 @@ private:
56 }; 56 };
57 static_assert(sizeof(SharedMemory) == 0x1000, "SharedMemory is an invalid size"); 57 static_assert(sizeof(SharedMemory) == 0x1000, "SharedMemory is an invalid size");
58 SharedMemory shared_memory{}; 58 SharedMemory shared_memory{};
59 Core::System& system;
59}; 60};
60} // namespace Service::HID 61} // namespace Service::HID
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index cd88696cd..33145b891 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -67,8 +67,8 @@ IAppletResource::IAppletResource(Core::System& system)
67 MakeController<Controller_Gesture>(HidController::Gesture); 67 MakeController<Controller_Gesture>(HidController::Gesture);
68 68
69 // Homebrew doesn't try to activate some controllers, so we activate them by default 69 // Homebrew doesn't try to activate some controllers, so we activate them by default
70 GetController<Controller_NPad>(HidController::NPad).ActivateController(system); 70 GetController<Controller_NPad>(HidController::NPad).ActivateController();
71 GetController<Controller_Touchscreen>(HidController::Touchscreen).ActivateController(system); 71 GetController<Controller_Touchscreen>(HidController::Touchscreen).ActivateController();
72 72
73 GetController<Controller_Stubbed>(HidController::Unknown1).SetCommonHeaderOffset(0x4c00); 73 GetController<Controller_Stubbed>(HidController::Unknown1).SetCommonHeaderOffset(0x4c00);
74 GetController<Controller_Stubbed>(HidController::Unknown2).SetCommonHeaderOffset(0x4e00); 74 GetController<Controller_Stubbed>(HidController::Unknown2).SetCommonHeaderOffset(0x4e00);
@@ -89,7 +89,7 @@ IAppletResource::IAppletResource(Core::System& system)
89} 89}
90 90
91void IAppletResource::ActivateController(HidController controller) { 91void IAppletResource::ActivateController(HidController controller) {
92 controllers[static_cast<size_t>(controller)]->ActivateController(system); 92 controllers[static_cast<size_t>(controller)]->ActivateController();
93} 93}
94 94
95void IAppletResource::DeactivateController(HidController controller) { 95void IAppletResource::DeactivateController(HidController controller) {
diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h
index bf8dbdc0e..35b663679 100644
--- a/src/core/hle/service/hid/hid.h
+++ b/src/core/hle/service/hid/hid.h
@@ -42,7 +42,7 @@ enum class HidController : std::size_t {
42 42
43class IAppletResource final : public ServiceFramework<IAppletResource> { 43class IAppletResource final : public ServiceFramework<IAppletResource> {
44public: 44public:
45 IAppletResource(Core::System& system); 45 explicit IAppletResource(Core::System& system);
46 ~IAppletResource() override; 46 ~IAppletResource() override;
47 47
48 void ActivateController(HidController controller); 48 void ActivateController(HidController controller);
@@ -61,7 +61,7 @@ public:
61private: 61private:
62 template <typename T> 62 template <typename T>
63 void MakeController(HidController controller) { 63 void MakeController(HidController controller) {
64 controllers[static_cast<std::size_t>(controller)] = std::make_unique<T>(); 64 controllers[static_cast<std::size_t>(controller)] = std::make_unique<T>(system);
65 } 65 }
66 66
67 void GetSharedMemoryHandle(Kernel::HLERequestContext& ctx); 67 void GetSharedMemoryHandle(Kernel::HLERequestContext& ctx);
@@ -78,7 +78,7 @@ private:
78 78
79class Hid final : public ServiceFramework<Hid> { 79class Hid final : public ServiceFramework<Hid> {
80public: 80public:
81 Hid(Core::System& system); 81 explicit Hid(Core::System& system);
82 ~Hid() override; 82 ~Hid() override;
83 83
84 std::shared_ptr<IAppletResource> GetAppletResource(); 84 std::shared_ptr<IAppletResource> GetAppletResource();
diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp
index 8c47b2d75..75d414952 100644
--- a/src/core/hle/service/nim/nim.cpp
+++ b/src/core/hle/service/nim/nim.cpp
@@ -126,7 +126,7 @@ public:
126class IEnsureNetworkClockAvailabilityService final 126class IEnsureNetworkClockAvailabilityService final
127 : public ServiceFramework<IEnsureNetworkClockAvailabilityService> { 127 : public ServiceFramework<IEnsureNetworkClockAvailabilityService> {
128public: 128public:
129 IEnsureNetworkClockAvailabilityService(Core::System& system) 129 explicit IEnsureNetworkClockAvailabilityService(Core::System& system)
130 : ServiceFramework("IEnsureNetworkClockAvailabilityService") { 130 : ServiceFramework("IEnsureNetworkClockAvailabilityService") {
131 static const FunctionInfo functions[] = { 131 static const FunctionInfo functions[] = {
132 {0, &IEnsureNetworkClockAvailabilityService::StartTask, "StartTask"}, 132 {0, &IEnsureNetworkClockAvailabilityService::StartTask, "StartTask"},
diff --git a/src/core/hle/service/ns/pl_u.h b/src/core/hle/service/ns/pl_u.h
index d2ef5bead..a843d569e 100644
--- a/src/core/hle/service/ns/pl_u.h
+++ b/src/core/hle/service/ns/pl_u.h
@@ -20,7 +20,7 @@ void EncryptSharedFont(const std::vector<u8>& input, Kernel::PhysicalMemory& out
20 20
21class PL_U final : public ServiceFramework<PL_U> { 21class PL_U final : public ServiceFramework<PL_U> {
22public: 22public:
23 PL_U(Core::System& system); 23 explicit PL_U(Core::System& system);
24 ~PL_U() override; 24 ~PL_U() override;
25 25
26private: 26private:
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp
index 9217ef040..2e4d707b9 100644
--- a/src/core/hle/service/nvflinger/nvflinger.cpp
+++ b/src/core/hle/service/nvflinger/nvflinger.cpp
@@ -29,8 +29,7 @@ namespace Service::NVFlinger {
29constexpr s64 frame_ticks = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 60); 29constexpr s64 frame_ticks = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 60);
30constexpr s64 frame_ticks_30fps = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 30); 30constexpr s64 frame_ticks_30fps = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 30);
31 31
32NVFlinger::NVFlinger(Core::Timing::CoreTiming& core_timing, Core::System& system) 32NVFlinger::NVFlinger(Core::System& system) : system(system) {
33 : core_timing{core_timing}, system(system) {
34 displays.emplace_back(0, "Default", system); 33 displays.emplace_back(0, "Default", system);
35 displays.emplace_back(1, "External", system); 34 displays.emplace_back(1, "External", system);
36 displays.emplace_back(2, "Edid", system); 35 displays.emplace_back(2, "Edid", system);
@@ -38,18 +37,20 @@ NVFlinger::NVFlinger(Core::Timing::CoreTiming& core_timing, Core::System& system
38 displays.emplace_back(4, "Null", system); 37 displays.emplace_back(4, "Null", system);
39 38
40 // Schedule the screen composition events 39 // Schedule the screen composition events
41 composition_event = core_timing.RegisterEvent("ScreenComposition", [this](u64 userdata, 40 composition_event = system.CoreTiming().RegisterEvent(
42 s64 cycles_late) { 41 "ScreenComposition", [this](u64 userdata, s64 cycles_late) {
43 Compose(); 42 Compose();
44 const auto ticks = Settings::values.force_30fps_mode ? frame_ticks_30fps : GetNextTicks(); 43 const auto ticks =
45 this->core_timing.ScheduleEvent(std::max<s64>(0LL, ticks - cycles_late), composition_event); 44 Settings::values.force_30fps_mode ? frame_ticks_30fps : GetNextTicks();
46 }); 45 this->system.CoreTiming().ScheduleEvent(std::max<s64>(0LL, ticks - cycles_late),
47 46 composition_event);
48 core_timing.ScheduleEvent(frame_ticks, composition_event); 47 });
48
49 system.CoreTiming().ScheduleEvent(frame_ticks, composition_event);
49} 50}
50 51
51NVFlinger::~NVFlinger() { 52NVFlinger::~NVFlinger() {
52 core_timing.UnscheduleEvent(composition_event, 0); 53 system.CoreTiming().UnscheduleEvent(composition_event, 0);
53} 54}
54 55
55void NVFlinger::SetNVDrvInstance(std::shared_ptr<Nvidia::Module> instance) { 56void NVFlinger::SetNVDrvInstance(std::shared_ptr<Nvidia::Module> instance) {
diff --git a/src/core/hle/service/nvflinger/nvflinger.h b/src/core/hle/service/nvflinger/nvflinger.h
index 85aae725c..5d7e3bfb8 100644
--- a/src/core/hle/service/nvflinger/nvflinger.h
+++ b/src/core/hle/service/nvflinger/nvflinger.h
@@ -38,7 +38,7 @@ class BufferQueue;
38 38
39class NVFlinger final { 39class NVFlinger final {
40public: 40public:
41 explicit NVFlinger(Core::Timing::CoreTiming& core_timing, Core::System& system); 41 explicit NVFlinger(Core::System& system);
42 ~NVFlinger(); 42 ~NVFlinger();
43 43
44 /// Sets the NVDrv module instance to use to send buffers to the GPU. 44 /// Sets the NVDrv module instance to use to send buffers to the GPU.
@@ -105,9 +105,6 @@ private:
105 /// Event that handles screen composition. 105 /// Event that handles screen composition.
106 Core::Timing::EventType* composition_event; 106 Core::Timing::EventType* composition_event;
107 107
108 /// Core timing instance for registering/unregistering the composition event.
109 Core::Timing::CoreTiming& core_timing;
110
111 Core::System& system; 108 Core::System& system;
112}; 109};
113 110