Changed refreshspeed target to 0.25Hz below rate provided, in order to guarantee that

inexact timings do not lead to sound stuttering.
This commit is contained in:
Aaron Giles 2008-09-03 17:44:08 +00:00
parent 8d6c8cf5e8
commit 95aec1fffb

View File

@ -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;
}
}