summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-09-03 17:44:08 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-09-03 17:44:08 +0000
commit95aec1fffb62bde1cb44b724064dbaa0f6f2b8e8 (patch)
tree28085412fa97a915e8a2f753ae0ee81b4866640d
parent8d6c8cf5e88c7dd573a338c839357b2f4a470c37 (diff)
Changed refreshspeed target to 0.25Hz below rate provided, in order to guarantee that
inexact timings do not lead to sound stuttering.
-rw-r--r--src/emu/video.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/emu/video.c b/src/emu/video.c
index 0d27b56dcf9..a86704da38a 100644
--- a/src/emu/video.c
+++ b/src/emu/video.c
@@ -2073,13 +2073,15 @@ static void update_refresh_speed(running_machine *machine)
}
/* compute a target speed as an integral percentage */
- target_speed = floor(minrefresh * 100.0 / ATTOSECONDS_TO_HZ(min_frame_period));
+ /* note that we lop 0.25Hz off of the minrefresh when doing the computation to allow for
+ the fact that most refresh rates are not accurate to 10 digits... */
+ target_speed = floor((minrefresh - 0.25f) * 100.0 / ATTOSECONDS_TO_HZ(min_frame_period));
target_speed = MIN(target_speed, original_speed);
/* if we changed, log that verbosely */
if (target_speed != global.speed)
{
- mame_printf_verbose("Adjusting target speed to %d%%\n", target_speed);
+ mame_printf_verbose("Adjusting target speed to %d%% (hw=%.2fHz, game=%.2fHz, adjusted=%.2fHz)\n", target_speed, minrefresh, ATTOSECONDS_TO_HZ(min_frame_period), ATTOSECONDS_TO_HZ(min_frame_period * 100 / target_speed));
global.speed = target_speed;
}
}