mirror of
https://github.com/holub/mame
synced 2025-07-11 04:35:04 +03:00
Take advantage of attotime_div.
This commit is contained in:
parent
d90d36b49f
commit
ebb34351e4
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user