From 6777c616528346148c50331b77271e0d841521fe Mon Sep 17 00:00:00 2001 From: hap Date: Sun, 14 Jun 2020 17:19:50 +0200 Subject: video: frameskip setting is now upper frameskip limit when autoframeskip setting was enabled (nw) --- src/emu/emuopts.cpp | 2 +- src/emu/video.cpp | 9 +++++++-- src/emu/video.h | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp index a0ff529462e..440121e5136 100644 --- a/src/emu/emuopts.cpp +++ b/src/emu/emuopts.cpp @@ -82,7 +82,7 @@ const options_entry emu_options::s_option_entries[] = // performance options { nullptr, nullptr, OPTION_HEADER, "CORE PERFORMANCE OPTIONS" }, { OPTION_AUTOFRAMESKIP ";afs", "0", OPTION_BOOLEAN, "enable automatic frameskip adjustment to maintain emulation speed" }, - { OPTION_FRAMESKIP ";fs(0-10)", "0", OPTION_INTEGER, "set frameskip to fixed value, 0-10 (autoframeskip must be disabled)" }, + { OPTION_FRAMESKIP ";fs(0-10)", "0", OPTION_INTEGER, "set frameskip to fixed value, 0-10 (upper limit with autoframeskip)" }, { OPTION_SECONDS_TO_RUN ";str", "0", OPTION_INTEGER, "number of emulated seconds to run before automatically exiting" }, { OPTION_THROTTLE, "1", OPTION_BOOLEAN, "throttle emulation to keep system running in sync with real time" }, { OPTION_SLEEP, "1", OPTION_BOOLEAN, "enable sleeping, which gives time back to other applications when idle" }, diff --git a/src/emu/video.cpp b/src/emu/video.cpp index eb277180c32..4516570aad5 100644 --- a/src/emu/video.cpp +++ b/src/emu/video.cpp @@ -92,7 +92,8 @@ video_manager::video_manager(running_machine &machine) , 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_max(m_auto_frameskip ? machine.options().frameskip() : 0) + , m_frameskip_level(m_auto_frameskip ? 0 : machine.options().frameskip()) , m_frameskip_counter(0) , m_frameskip_adjust(0) , m_skipping_this_frame(false) @@ -921,7 +922,11 @@ void video_manager::update_frameskip() while (m_frameskip_adjust <= -2) { m_frameskip_adjust += 2; - if (m_frameskip_level < MAX_FRAMESKIP) + u8 max = m_frameskip_max; + if (max == 0 || max > MAX_FRAMESKIP) + max = MAX_FRAMESKIP; + + if (m_frameskip_level < max) m_frameskip_level++; } } diff --git a/src/emu/video.h b/src/emu/video.h index 2fe7786afb5..0dec74fa5a7 100644 --- a/src/emu/video.h +++ b/src/emu/video.h @@ -156,6 +156,7 @@ private: // frameskipping u8 m_empty_skip_count; // number of empty frames we have skipped + u8 m_frameskip_max; // maximum frameskip level u8 m_frameskip_level; // current frameskip level u8 m_frameskip_counter; // counter that counts through the frameskip steps s8 m_frameskip_adjust; -- cgit v1.2.3