diff options
author | german77 <juangerman-13@hotmail.com> | 2024-01-07 16:05:12 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2024-01-12 02:35:04 +0100 |
commit | b5dac5f525e8d5884506ebd98a530e237b518480 (patch) | |
tree | 6ceee925ba897dc3450bdad209982f0be4bc3f7a /src/hid_core/resources/abstracted_pad/abstract_palma_handler.cpp | |
parent | Merge pull request #12653 from liamwhite/once-more (diff) | |
download | yuzu-b5dac5f525e8d5884506ebd98a530e237b518480.tar yuzu-b5dac5f525e8d5884506ebd98a530e237b518480.tar.gz yuzu-b5dac5f525e8d5884506ebd98a530e237b518480.tar.bz2 yuzu-b5dac5f525e8d5884506ebd98a530e237b518480.tar.lz yuzu-b5dac5f525e8d5884506ebd98a530e237b518480.tar.xz yuzu-b5dac5f525e8d5884506ebd98a530e237b518480.tar.zst yuzu-b5dac5f525e8d5884506ebd98a530e237b518480.zip |
Diffstat (limited to '')
-rw-r--r-- | src/hid_core/resources/abstracted_pad/abstract_palma_handler.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/hid_core/resources/abstracted_pad/abstract_palma_handler.cpp b/src/hid_core/resources/abstracted_pad/abstract_palma_handler.cpp new file mode 100644 index 000000000..04d276d61 --- /dev/null +++ b/src/hid_core/resources/abstracted_pad/abstract_palma_handler.cpp @@ -0,0 +1,47 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "hid_core/hid_result.h" +#include "hid_core/resources/abstracted_pad/abstract_palma_handler.h" +#include "hid_core/resources/abstracted_pad/abstract_properties_handler.h" + +namespace Service::HID { + +NpadAbstractPalmaHandler::NpadAbstractPalmaHandler() {} + +NpadAbstractPalmaHandler::~NpadAbstractPalmaHandler() = default; + +void NpadAbstractPalmaHandler::SetAbstractPadHolder(NpadAbstractedPadHolder* holder) { + abstract_pad_holder = holder; +} + +void NpadAbstractPalmaHandler::SetPropertiesHandler(NpadAbstractPropertiesHandler* handler) { + properties_handler = handler; + return; +} + +void NpadAbstractPalmaHandler::SetPalmaResource(PalmaResource* resource) { + palma_resource = resource; +} + +Result NpadAbstractPalmaHandler::IncrementRefCounter() { + if (ref_counter == std::numeric_limits<s32>::max() - 1) { + return ResultNpadHandlerOverflow; + } + ref_counter++; + return ResultSuccess; +} + +Result NpadAbstractPalmaHandler::DecrementRefCounter() { + if (ref_counter == 0) { + return ResultNpadHandlerNotInitialized; + } + ref_counter--; + return ResultSuccess; +} + +void NpadAbstractPalmaHandler::UpdatePalmaState() { + // TODO +} + +} // namespace Service::HID |