diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2024-01-01 21:02:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-01 21:02:13 +0100 |
commit | 59d81ae614a42588dbd7eaf4b7e029ab168886c9 (patch) | |
tree | a5d636853c0871b700ebccf1c5d4fc6726046a31 /src/core/hle/service/hid/controllers/digitizer.cpp | |
parent | Merge pull request #12518 from t895/theme-settings (diff) | |
parent | service: hid: Use applet resource to get latest shared memory handle (diff) | |
download | yuzu-59d81ae614a42588dbd7eaf4b7e029ab168886c9.tar yuzu-59d81ae614a42588dbd7eaf4b7e029ab168886c9.tar.gz yuzu-59d81ae614a42588dbd7eaf4b7e029ab168886c9.tar.bz2 yuzu-59d81ae614a42588dbd7eaf4b7e029ab168886c9.tar.lz yuzu-59d81ae614a42588dbd7eaf4b7e029ab168886c9.tar.xz yuzu-59d81ae614a42588dbd7eaf4b7e029ab168886c9.tar.zst yuzu-59d81ae614a42588dbd7eaf4b7e029ab168886c9.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/hid/controllers/digitizer.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/core/hle/service/hid/controllers/digitizer.cpp b/src/core/hle/service/hid/controllers/digitizer.cpp new file mode 100644 index 000000000..c01580fd6 --- /dev/null +++ b/src/core/hle/service/hid/controllers/digitizer.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 "core/hle/service/hid/controllers/applet_resource.h" +#include "core/hle/service/hid/controllers/digitizer.h" +#include "core/hle/service/hid/controllers/types/shared_memory_format.h" + +namespace Service::HID { + +Digitizer::Digitizer(Core::HID::HIDCore& hid_core_) : ControllerBase{hid_core_} {} + +Digitizer::~Digitizer() = default; + +void Digitizer::OnInit() {} + +void Digitizer::OnRelease() {} + +void Digitizer::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) { + return; + } + + auto& header = data->shared_memory_format->digitizer.header; + header.timestamp = core_timing.GetGlobalTimeNs().count(); + header.total_entry_count = 17; + header.entry_count = 0; + header.last_entry_index = 0; +} + +} // namespace Service::HID |