summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/controllers/mouse.cpp
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2023-12-31 07:42:23 +0100
committerNarr the Reg <juangerman-13@hotmail.com>2023-12-31 17:51:01 +0100
commit865abfc37c5b3e8945d833bd44db428ad720bd58 (patch)
treeaf37ccf552aad0403898fb371e639393efe7b9d4 /src/core/hle/service/hid/controllers/mouse.cpp
parentMerge pull request #12509 from liamwhite/ktrace (diff)
downloadyuzu-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/mouse.cpp')
-rw-r--r--src/core/hle/service/hid/controllers/mouse.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/core/hle/service/hid/controllers/mouse.cpp b/src/core/hle/service/hid/controllers/mouse.cpp
index de5b2c804..58deafbc5 100644
--- a/src/core/hle/service/hid/controllers/mouse.cpp
+++ b/src/core/hle/service/hid/controllers/mouse.cpp
@@ -5,13 +5,13 @@
#include "core/frontend/emu_window.h"
#include "core/hid/emulated_devices.h"
#include "core/hid/hid_core.h"
+#include "core/hle/service/hid/controllers/applet_resource.h"
#include "core/hle/service/hid/controllers/mouse.h"
-#include "core/hle/service/hid/controllers/shared_memory_format.h"
+#include "core/hle/service/hid/controllers/types/shared_memory_format.h"
namespace Service::HID {
-Mouse::Mouse(Core::HID::HIDCore& hid_core_, MouseSharedMemoryFormat& mouse_shared_memory)
- : ControllerBase{hid_core_}, shared_memory{mouse_shared_memory} {
+Mouse::Mouse(Core::HID::HIDCore& hid_core_) : ControllerBase{hid_core_} {
emulated_devices = hid_core.GetEmulatedDevices();
}
@@ -21,6 +21,15 @@ void Mouse::OnInit() {}
void Mouse::OnRelease() {}
void Mouse::OnUpdate(const Core::Timing::CoreTiming& core_timing) {
+ const u64 aruid = applet_resource->GetActiveAruid();
+ auto* data = applet_resource->GetAruidData(aruid);
+
+ if (data == nullptr) {
+ return;
+ }
+
+ MouseSharedMemoryFormat& shared_memory = data->shared_memory_format->mouse;
+
if (!IsControllerActivated()) {
shared_memory.mouse_lifo.buffer_count = 0;
shared_memory.mouse_lifo.buffer_tail = 0;