diff options
author | bunnei <bunneidev@gmail.com> | 2021-07-24 03:23:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-24 03:23:56 +0200 |
commit | 2656020608e32f1f0120dead047b61302bcb4461 (patch) | |
tree | 0f4b89d1e51ceb1232eec020d0fe22c7d8b7f930 /src/core/hle/service/hid/hid.h | |
parent | Merge pull request #6686 from ReinUsesLisp/vk-optimal-copy (diff) | |
parent | hle: service: kernel_helpers: Remove unnecessary pragma once. (diff) | |
download | yuzu-2656020608e32f1f0120dead047b61302bcb4461.tar yuzu-2656020608e32f1f0120dead047b61302bcb4461.tar.gz yuzu-2656020608e32f1f0120dead047b61302bcb4461.tar.bz2 yuzu-2656020608e32f1f0120dead047b61302bcb4461.tar.lz yuzu-2656020608e32f1f0120dead047b61302bcb4461.tar.xz yuzu-2656020608e32f1f0120dead047b61302bcb4461.tar.zst yuzu-2656020608e32f1f0120dead047b61302bcb4461.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 |