diff --git a/src/emu/machine.c b/src/emu/machine.c index 39804ad5bdb..b2ecab42591 100644 --- a/src/emu/machine.c +++ b/src/emu/machine.c @@ -1351,12 +1351,12 @@ void system_time::full_time::set(struct tm &t) static running_machine * jsmess_machine; -void js_main_loop() { - device_scheduler * scheduler; - scheduler = &(jsmess_machine->scheduler()); - attotime stoptime = scheduler->time() + attotime(0,HZ_TO_ATTOSECONDS(60)); - while (scheduler->time() < stoptime) { - scheduler->timeslice(); +void js_main_loop() +{ + attotime stoptime(jsmess_machine->scheduler().time() + attotime(0,HZ_TO_ATTOSECONDS(60))); + while (jsmess_machine->scheduler().time()) < stoptime) + { + jsmess_machine->scheduler().timeslice(); } } diff --git a/src/emu/schedule.c b/src/emu/schedule.c index 3b480d4c3c3..f94b2919b5d 100644 --- a/src/emu/schedule.c +++ b/src/emu/schedule.c @@ -434,7 +434,7 @@ void device_scheduler::timeslice() while (m_basetime < m_timer_list->m_expire) { // by default, assume our target is the end of the next quantum - attotime target = m_basetime + attotime(0, m_quantum_list.first()->m_actual); + attotime target(m_basetime + attotime(0, m_quantum_list.first()->m_actual)); // however, if the next timer is going to fire before then, override if (m_timer_list->m_expire < target)