summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-01-30 17:44:14 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-01-30 17:44:14 +0000
commitebb34351e46faf42a538b8982d9b0538d3b0ac86 (patch)
tree3fd8ac7f92a859dee903c2cfda51b48a82da855c
parentd90d36b49ffdc34f32da75c3f3433dd740c423b2 (diff)
Take advantage of attotime_div.
-rw-r--r--src/emu/video.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/emu/video.c b/src/emu/video.c
index 82964ab4761..8d78f0f7d0d 100644
--- a/src/emu/video.c
+++ b/src/emu/video.c
@@ -1418,13 +1418,8 @@ static void update_throttle(attotime emutime)
/* apply speed factor to emu time */
if (global.speed != 0 && global.speed != 100)
{
- /* multiply emutime by 100 */
- emutime = attotime_mul(emutime, 100);
-
- /* divide emutime by the global speed factor */
- emutime.attoseconds /= global.speed;
- emutime.attoseconds += (emutime.seconds % global.speed) * (ATTOSECONDS_PER_SECOND / global.speed);
- emutime.seconds /= global.speed;
+ /* multiply emutime by 100, then divide by the global speed factor */
+ emutime = attotime_div(attotime_mul(emutime, 100), global.speed);
}
/* compute conversion factors up front */