summaryrefslogtreecommitdiffstats
path: root/src/hid_core/resources/controller_base.cpp
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2024-01-06 22:38:59 +0100
committerGitHub <noreply@github.com>2024-01-06 22:38:59 +0100
commit12fd2ae86d78c69d5bce6ab5b5ba26a4b265ac92 (patch)
tree3b95cbb74be05f0ce7a007353f1f9f95e1ed3901 /src/hid_core/resources/controller_base.cpp
parentMerge pull request #12437 from ameerj/gl-amd-fixes (diff)
parenthid_core: Move hid to it's own subproject (diff)
downloadyuzu-12fd2ae86d78c69d5bce6ab5b5ba26a4b265ac92.tar
yuzu-12fd2ae86d78c69d5bce6ab5b5ba26a4b265ac92.tar.gz
yuzu-12fd2ae86d78c69d5bce6ab5b5ba26a4b265ac92.tar.bz2
yuzu-12fd2ae86d78c69d5bce6ab5b5ba26a4b265ac92.tar.lz
yuzu-12fd2ae86d78c69d5bce6ab5b5ba26a4b265ac92.tar.xz
yuzu-12fd2ae86d78c69d5bce6ab5b5ba26a4b265ac92.tar.zst
yuzu-12fd2ae86d78c69d5bce6ab5b5ba26a4b265ac92.zip
Diffstat (limited to 'src/hid_core/resources/controller_base.cpp')
-rw-r--r--src/hid_core/resources/controller_base.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/hid_core/resources/controller_base.cpp b/src/hid_core/resources/controller_base.cpp
new file mode 100644
index 000000000..df5f5c884
--- /dev/null
+++ b/src/hid_core/resources/controller_base.cpp
@@ -0,0 +1,41 @@
+// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "hid_core/resources/controller_base.h"
+
+namespace Service::HID {
+
+ControllerBase::ControllerBase(Core::HID::HIDCore& hid_core_) : hid_core(hid_core_) {}
+ControllerBase::~ControllerBase() = default;
+
+Result ControllerBase::Activate() {
+ if (is_activated) {
+ return ResultSuccess;
+ }
+ is_activated = true;
+ OnInit();
+ return ResultSuccess;
+}
+
+Result ControllerBase::Activate(u64 aruid) {
+ return Activate();
+}
+
+void ControllerBase::DeactivateController() {
+ if (is_activated) {
+ OnRelease();
+ }
+ is_activated = false;
+}
+
+bool ControllerBase::IsControllerActivated() const {
+ return is_activated;
+}
+
+void ControllerBase::SetAppletResource(std::shared_ptr<AppletResource> resource,
+ std::recursive_mutex* resource_mutex) {
+ applet_resource = resource;
+ shared_mutex = resource_mutex;
+}
+
+} // namespace Service::HID