diff options
author | bunnei <bunneidev@gmail.com> | 2021-06-28 23:41:24 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-07-21 03:54:55 +0200 |
commit | 015058fadf8dbc72c186e833512e7189c625474b (patch) | |
tree | bc8839ef4b46c86283fda20cf95e4b0c6ab18e54 /src/core/hle/service/hid/hid.h | |
parent | hle: kernel: Provide methods for tracking dangling kernel objects. (diff) | |
download | yuzu-015058fadf8dbc72c186e833512e7189c625474b.tar yuzu-015058fadf8dbc72c186e833512e7189c625474b.tar.gz yuzu-015058fadf8dbc72c186e833512e7189c625474b.tar.bz2 yuzu-015058fadf8dbc72c186e833512e7189c625474b.tar.lz yuzu-015058fadf8dbc72c186e833512e7189c625474b.tar.xz yuzu-015058fadf8dbc72c186e833512e7189c625474b.tar.zst yuzu-015058fadf8dbc72c186e833512e7189c625474b.zip |
Diffstat (limited to 'src/core/hle/service/hid/hid.h')
-rw-r--r-- | src/core/hle/service/hid/hid.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h index 83fc2ea1d..9c5c7f252 100644 --- a/src/core/hle/service/hid/hid.h +++ b/src/core/hle/service/hid/hid.h @@ -7,6 +7,7 @@ #include <chrono> #include "core/hle/service/hid/controllers/controller_base.h" +#include "core/hle/service/kernel_helpers.h" #include "core/hle/service/service.h" namespace Core::Timing { @@ -39,7 +40,8 @@ enum class HidController : std::size_t { class IAppletResource final : public ServiceFramework<IAppletResource> { public: - explicit IAppletResource(Core::System& system_); + explicit IAppletResource(Core::System& system_, + KernelHelpers::ServiceContext& service_context_); ~IAppletResource() override; void ActivateController(HidController controller); @@ -60,11 +62,18 @@ private: void MakeController(HidController controller) { controllers[static_cast<std::size_t>(controller)] = std::make_unique<T>(system); } + template <typename T> + void MakeControllerWithServiceContext(HidController controller) { + controllers[static_cast<std::size_t>(controller)] = + std::make_unique<T>(system, service_context); + } void GetSharedMemoryHandle(Kernel::HLERequestContext& ctx); void UpdateControllers(std::uintptr_t user_data, std::chrono::nanoseconds ns_late); void UpdateMotion(std::uintptr_t user_data, std::chrono::nanoseconds ns_late); + KernelHelpers::ServiceContext& service_context; + std::shared_ptr<Core::Timing::EventType> pad_update_event; std::shared_ptr<Core::Timing::EventType> motion_update_event; @@ -176,6 +185,8 @@ private: static_assert(sizeof(VibrationDeviceInfo) == 0x8, "VibrationDeviceInfo has incorrect size."); std::shared_ptr<IAppletResource> applet_resource; + + KernelHelpers::ServiceContext service_context; }; /// Reload input devices. Used when input configuration changed |