summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/controllers/debug_pad.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service/hid/controllers/debug_pad.cpp')
-rw-r--r--src/core/hle/service/hid/controllers/debug_pad.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/core/hle/service/hid/controllers/debug_pad.cpp b/src/core/hle/service/hid/controllers/debug_pad.cpp
new file mode 100644
index 000000000..04799b233
--- /dev/null
+++ b/src/core/hle/service/hid/controllers/debug_pad.cpp
@@ -0,0 +1,35 @@
+// Copyright 2018 yuzu emulator team
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include "common/common_types.h"
+#include "common/swap.h"
+#include "core/core_timing.h"
+#include "core/hle/service/hid/controllers/debug_pad.h"
+
+namespace Service::HID {
+void Controller_DebugPad::OnInit() {}
+void Controller_DebugPad::OnRelease() {}
+void Controller_DebugPad::OnUpdate(u8* data, size_t size) {
+ shared_memory.header.timestamp = CoreTiming::GetTicks();
+ shared_memory.header.total_entry_count = 17;
+
+ if (!IsControllerActivated()) {
+ shared_memory.header.entry_count = 0;
+ shared_memory.header.last_entry_index = 0;
+ return;
+ }
+ shared_memory.header.entry_count = 16;
+
+ auto& last_entry = shared_memory.pad_states[shared_memory.header.last_entry_index];
+ shared_memory.header.last_entry_index = (shared_memory.header.last_entry_index + 1) % 17;
+ auto& cur_entry = shared_memory.pad_states[shared_memory.header.last_entry_index];
+
+ cur_entry.sampling_number = last_entry.sampling_number + 1;
+ cur_entry.sampling_number2 = cur_entry.sampling_number;
+ // TODO(ogniK): Update debug pad states
+
+ std::memcpy(data, &shared_memory, sizeof(SharedMemory));
+}
+void Controller_DebugPad::OnLoadInputDevices() {}
+}; // namespace Service::HID