summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/hle/service/hid/hid.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 5efc1237e..4cee4838c 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -126,14 +126,23 @@ void IAppletResource::UpdateControllers(std::uintptr_t user_data,
126 controller->OnUpdate(core_timing, shared_mem->GetPointer(), SHARED_MEMORY_SIZE); 126 controller->OnUpdate(core_timing, shared_mem->GetPointer(), SHARED_MEMORY_SIZE);
127 } 127 }
128 128
129 // If ns_late is higher than the update rate ignore the delay
130 if (ns_late > motion_update_ns) {
131 ns_late = {};
132 }
133
129 core_timing.ScheduleEvent(pad_update_ns - ns_late, pad_update_event); 134 core_timing.ScheduleEvent(pad_update_ns - ns_late, pad_update_event);
130} 135}
131 136
132void IAppletResource::UpdateMotion(std::uintptr_t user_data, std::chrono::nanoseconds ns_late) { 137void IAppletResource::UpdateMotion(std::uintptr_t user_data, std::chrono::nanoseconds ns_late) {
133 auto& core_timing = system.CoreTiming(); 138 auto& core_timing = system.CoreTiming();
134 139
135 for (const auto& controller : controllers) { 140 controllers[static_cast<size_t>(HidController::NPad)]->OnMotionUpdate(
136 controller->OnMotionUpdate(core_timing, shared_mem->GetPointer(), SHARED_MEMORY_SIZE); 141 core_timing, shared_mem->GetPointer(), SHARED_MEMORY_SIZE);
142
143 // If ns_late is higher than the update rate ignore the delay
144 if (ns_late > motion_update_ns) {
145 ns_late = {};
137 } 146 }
138 147
139 core_timing.ScheduleEvent(motion_update_ns - ns_late, motion_update_event); 148 core_timing.ScheduleEvent(motion_update_ns - ns_late, motion_update_event);