summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/hid.cpp
diff options
context:
space:
mode:
authorgerman <german@thesoftwareartisans.com>2021-02-01 01:39:52 +0100
committergerman <german@thesoftwareartisans.com>2021-02-01 01:52:38 +0100
commit2489547dc5bfd57ccadc392daff9a1b980a06680 (patch)
tree0785373231f4a30cd10a457784ab41d8f763d23d /src/core/hle/service/hid/hid.cpp
parentFix connect and disconnect controller events (diff)
downloadyuzu-2489547dc5bfd57ccadc392daff9a1b980a06680.tar
yuzu-2489547dc5bfd57ccadc392daff9a1b980a06680.tar.gz
yuzu-2489547dc5bfd57ccadc392daff9a1b980a06680.tar.bz2
yuzu-2489547dc5bfd57ccadc392daff9a1b980a06680.tar.lz
yuzu-2489547dc5bfd57ccadc392daff9a1b980a06680.tar.xz
yuzu-2489547dc5bfd57ccadc392daff9a1b980a06680.tar.zst
yuzu-2489547dc5bfd57ccadc392daff9a1b980a06680.zip
Diffstat (limited to 'src/core/hle/service/hid/hid.cpp')
-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 8d95f74e6..60e63626d 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);