summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-02-02 03:46:26 +0100
committerGitHub <noreply@github.com>2021-02-02 03:46:26 +0100
commitd4ebc9a120d0131d9fbbf428d8468662de7d962c (patch)
tree5112f6095c49bc158754d3782344a0853ce290b2 /src/core/hle
parentMerge pull request #5864 from MerryMage/is-thumb (diff)
parentOnly update motion for npad and prevent over scheduling events (diff)
downloadyuzu-d4ebc9a120d0131d9fbbf428d8468662de7d962c.tar
yuzu-d4ebc9a120d0131d9fbbf428d8468662de7d962c.tar.gz
yuzu-d4ebc9a120d0131d9fbbf428d8468662de7d962c.tar.bz2
yuzu-d4ebc9a120d0131d9fbbf428d8468662de7d962c.tar.lz
yuzu-d4ebc9a120d0131d9fbbf428d8468662de7d962c.tar.xz
yuzu-d4ebc9a120d0131d9fbbf428d8468662de7d962c.tar.zst
yuzu-d4ebc9a120d0131d9fbbf428d8468662de7d962c.zip
Diffstat (limited to 'src/core/hle')
-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,
controller->OnUpdate(core_timing, shared_mem->GetPointer(), SHARED_MEMORY_SIZE);
}
+ // If ns_late is higher than the update rate ignore the delay
+ if (ns_late > motion_update_ns) {
+ ns_late = {};
+ }
+
core_timing.ScheduleEvent(pad_update_ns - ns_late, pad_update_event);
}
void IAppletResource::UpdateMotion(std::uintptr_t user_data, std::chrono::nanoseconds ns_late) {
auto& core_timing = system.CoreTiming();
- for (const auto& controller : controllers) {
- controller->OnMotionUpdate(core_timing, shared_mem->GetPointer(), SHARED_MEMORY_SIZE);
+ controllers[static_cast<size_t>(HidController::NPad)]->OnMotionUpdate(
+ core_timing, shared_mem->GetPointer(), SHARED_MEMORY_SIZE);
+
+ // If ns_late is higher than the update rate ignore the delay
+ if (ns_late > motion_update_ns) {
+ ns_late = {};
}
core_timing.ScheduleEvent(motion_update_ns - ns_late, motion_update_event);