summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/controllers/debug_pad.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/debug_pad.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/debug_pad.cpp')
-rw-r--r--src/core/hle/service/hid/controllers/debug_pad.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/core/hle/service/hid/controllers/debug_pad.cpp b/src/core/hle/service/hid/controllers/debug_pad.cpp
index 7d2370b4f..1811cf620 100644
--- a/src/core/hle/service/hid/controllers/debug_pad.cpp
+++ b/src/core/hle/service/hid/controllers/debug_pad.cpp
@@ -6,14 +6,13 @@
#include "core/hid/emulated_controller.h"
#include "core/hid/hid_core.h"
#include "core/hid/hid_types.h"
+#include "core/hle/service/hid/controllers/applet_resource.h"
#include "core/hle/service/hid/controllers/debug_pad.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 {
-DebugPad::DebugPad(Core::HID::HIDCore& hid_core_,
- DebugPadSharedMemoryFormat& debug_pad_shared_memory)
- : ControllerBase{hid_core_}, shared_memory{debug_pad_shared_memory} {
+DebugPad::DebugPad(Core::HID::HIDCore& hid_core_) : ControllerBase{hid_core_} {
controller = hid_core.GetEmulatedController(Core::HID::NpadIdType::Other);
}
@@ -24,6 +23,15 @@ void DebugPad::OnInit() {}
void DebugPad::OnRelease() {}
void DebugPad::OnUpdate(const Core::Timing::CoreTiming& core_timing) {
+ const u64 aruid = applet_resource->GetActiveAruid();
+ auto* data = applet_resource->GetAruidData(aruid);
+
+ if (data == nullptr) {
+ return;
+ }
+
+ DebugPadSharedMemoryFormat& shared_memory = data->shared_memory_format->debug_pad;
+
if (!IsControllerActivated()) {
shared_memory.debug_pad_lifo.buffer_count = 0;
shared_memory.debug_pad_lifo.buffer_tail = 0;