From ee847f8ff0b1b0aec39c1b78c010bc0c08a0a613 Mon Sep 17 00:00:00 2001 From: Narr the Reg Date: Thu, 4 Jan 2024 20:37:43 -0600 Subject: hid_core: Move hid to it's own subproject --- src/hid_core/resources/unique_pad/unique_pad.cpp | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/hid_core/resources/unique_pad/unique_pad.cpp (limited to 'src/hid_core/resources/unique_pad/unique_pad.cpp') diff --git a/src/hid_core/resources/unique_pad/unique_pad.cpp b/src/hid_core/resources/unique_pad/unique_pad.cpp new file mode 100644 index 000000000..892bbe3c9 --- /dev/null +++ b/src/hid_core/resources/unique_pad/unique_pad.cpp @@ -0,0 +1,38 @@ +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/core_timing.h" +#include "hid_core/resources/applet_resource.h" +#include "hid_core/resources/shared_memory_format.h" +#include "hid_core/resources/unique_pad/unique_pad.h" + +namespace Service::HID { + +UniquePad::UniquePad(Core::HID::HIDCore& hid_core_) : ControllerBase{hid_core_} {} + +UniquePad::~UniquePad() = default; + +void UniquePad::OnInit() {} + +void UniquePad::OnRelease() {} + +void UniquePad::OnUpdate(const Core::Timing::CoreTiming& core_timing) { + if (!smart_update) { + return; + } + + const u64 aruid = applet_resource->GetActiveAruid(); + auto* data = applet_resource->GetAruidData(aruid); + + if (data == nullptr || !data->flag.is_assigned) { + return; + } + + auto& header = data->shared_memory_format->capture_button.header; + header.timestamp = core_timing.GetGlobalTimeNs().count(); + header.total_entry_count = 17; + header.entry_count = 0; + header.last_entry_index = 0; +} + +} // namespace Service::HID -- cgit v1.2.3