summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/video.cpp
diff options
context:
space:
mode:
author antonioginer <antonioginer@users.noreply.github.com>2019-11-16 22:06:13 +0100
committer R. Belmont <rb6502@users.noreply.github.com>2019-11-16 16:06:13 -0500
commiteab5bcac0029e4e298e1f194133c21580098508d (patch)
tree6f7f3fd423089b85f15b09956ce7912f180bed0b /src/emu/video.cpp
parent7fc2f6805118f1e25c5e0b2a971f31e4f1b3b251 (diff)
Remove up to one frame of input latency. (#5901)
* Remove up to one frame of input latency. Makes MAME virtually lagless on VRR monitors. * Use empty parentheses and clean interface member calls * Add new option -instant_blit to make this feature optional * Rename new option to -lowlatency, -ll
Diffstat (limited to 'src/emu/video.cpp')
-rw-r--r--src/emu/video.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/emu/video.cpp b/src/emu/video.cpp
index d8bea693005..fa0efb88a89 100644
--- a/src/emu/video.cpp
+++ b/src/emu/video.cpp
@@ -91,6 +91,7 @@ video_manager::video_manager(running_machine &machine)
, m_seconds_to_run(machine.options().seconds_to_run())
, m_auto_frameskip(machine.options().auto_frameskip())
, m_speed(original_speed_setting())
+ , m_low_latency(machine.options().low_latency())
, m_empty_skip_count(0)
, m_frameskip_level(machine.options().frameskip())
, m_frameskip_counter(0)
@@ -229,7 +230,7 @@ void video_manager::frame_update(bool from_debugger)
// if we're throttling, synchronize before rendering
attotime current_time = machine().time();
- if (!from_debugger && !skipped_it && effective_throttle())
+ if (!from_debugger && !skipped_it && !m_low_latency && effective_throttle())
update_throttle(current_time);
// ask the OSD to update
@@ -237,6 +238,13 @@ void video_manager::frame_update(bool from_debugger)
machine().osd().update(!from_debugger && skipped_it);
g_profiler.stop();
+ // we synchronize after rendering instead of before, if low latency mode is enabled
+ if (!from_debugger && !skipped_it && m_low_latency && effective_throttle())
+ update_throttle(current_time);
+
+ // get most recent input now
+ machine().osd().input_update();
+
emulator_info::periodic_check();
// perform tasks for this frame