summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/input/input_common.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2023-02-24 19:31:12 +1100
committer Vas Crabb <vas@vastheman.com>2023-02-24 19:31:12 +1100
commit65aeb63a2a1f4f65a6fa0dedabba1b852a189f96 (patch)
tree42a56bcf4d22b624dbb117946e376981e691a5f0 /src/osd/modules/input/input_common.cpp
parent3b5dbeea3bad50ad04c966de4afffb864a9856d0 (diff)
Update accumulating relative inputs exactly once per frame.
This fixes "amplification" effects that would happen if the frame rate rose above 100 Hz (whether by unthrottling or otherwise). Synchronise with wall clock any time inputs are read. Not doing this has weird effects on relative inputs with frame skipping and contributes to unresponsiveness of menus. Reduce visual latency for mouse movement on menus when paused or skipping frames. The rest of the code changes to menus won't provide benefits until draw can happen after event handling.
Diffstat (limited to 'src/osd/modules/input/input_common.cpp')
-rw-r--r--src/osd/modules/input/input_common.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/osd/modules/input/input_common.cpp b/src/osd/modules/input/input_common.cpp
index 53f053e6d1b..ec9521ab4b8 100644
--- a/src/osd/modules/input/input_common.cpp
+++ b/src/osd/modules/input/input_common.cpp
@@ -286,16 +286,16 @@ void input_module_base::input_init(running_machine &machine)
m_manager = &machine.input();
}
-void input_module_base::poll_if_necessary()
+void input_module_base::poll_if_necessary(bool relative_reset)
{
timepoint_type const now = m_clock.now();
- if (now >= (m_last_poll + std::chrono::milliseconds(MIN_POLLING_INTERVAL)))
+ if (relative_reset || (now >= (m_last_poll + std::chrono::milliseconds(MIN_POLLING_INTERVAL))))
{
// grab the current time
m_last_poll = now;
before_poll();
- poll();
+ poll(relative_reset);
}
}