mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-10-12 03:07:46 +00:00
hid_core: Move hid to it's own subproject
This commit is contained in:
parent
8da33ba38a
commit
146975c880
141 changed files with 479 additions and 436 deletions
39
src/hid_core/resources/digitizer/digitizer.cpp
Normal file
39
src/hid_core/resources/digitizer/digitizer.cpp
Normal file
|
@ -0,0 +1,39 @@
|
|||
// 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/digitizer/digitizer.h"
|
||||
#include "hid_core/resources/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;
|
||||
}
|
||||
|
||||
std::scoped_lock shared_lock{*shared_mutex};
|
||||
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->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
|
Loading…
Add table
Add a link
Reference in a new issue