diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2023-12-31 07:42:23 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2023-12-31 17:51:01 +0100 |
commit | 865abfc37c5b3e8945d833bd44db428ad720bd58 (patch) | |
tree | af37ccf552aad0403898fb371e639393efe7b9d4 /src/core/hle/service/hid/controllers/touchscreen.cpp | |
parent | Merge pull request #12509 from liamwhite/ktrace (diff) | |
download | yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.tar yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.tar.gz yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.tar.bz2 yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.tar.lz yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.tar.xz yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.tar.zst yuzu-865abfc37c5b3e8945d833bd44db428ad720bd58.zip |
Diffstat (limited to 'src/core/hle/service/hid/controllers/touchscreen.cpp')
-rw-r--r-- | src/core/hle/service/hid/controllers/touchscreen.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/core/hle/service/hid/controllers/touchscreen.cpp b/src/core/hle/service/hid/controllers/touchscreen.cpp index 469750006..291dc707e 100644 --- a/src/core/hle/service/hid/controllers/touchscreen.cpp +++ b/src/core/hle/service/hid/controllers/touchscreen.cpp @@ -8,15 +8,14 @@ #include "core/frontend/emu_window.h" #include "core/hid/emulated_console.h" #include "core/hid/hid_core.h" -#include "core/hle/service/hid/controllers/shared_memory_format.h" +#include "core/hle/service/hid/controllers/applet_resource.h" #include "core/hle/service/hid/controllers/touchscreen.h" +#include "core/hle/service/hid/controllers/types/shared_memory_format.h" namespace Service::HID { -TouchScreen::TouchScreen(Core::HID::HIDCore& hid_core_, - TouchScreenSharedMemoryFormat& touch_shared_memory) - : ControllerBase{hid_core_}, shared_memory{touch_shared_memory}, - touchscreen_width(Layout::ScreenUndocked::Width), +TouchScreen::TouchScreen(Core::HID::HIDCore& hid_core_) + : ControllerBase{hid_core_}, touchscreen_width(Layout::ScreenUndocked::Width), touchscreen_height(Layout::ScreenUndocked::Height) { console = hid_core.GetEmulatedConsole(); } @@ -28,6 +27,14 @@ void TouchScreen::OnInit() {} void TouchScreen::OnRelease() {} void TouchScreen::OnUpdate(const Core::Timing::CoreTiming& core_timing) { + const u64 aruid = applet_resource->GetActiveAruid(); + auto* data = applet_resource->GetAruidData(aruid); + + if (data == nullptr) { + return; + } + + TouchScreenSharedMemoryFormat& shared_memory = data->shared_memory_format->touch_screen; shared_memory.touch_screen_lifo.timestamp = core_timing.GetGlobalTimeNs().count(); if (!IsControllerActivated()) { |