Merge pull request #341 from Wolf-Fivousix/master

Slight speedup to device_scheduler::timeslice(); JSMESS cleanups
This commit is contained in:
Justin Kerk 2015-09-24 12:34:29 -07:00
commit e96f45034d
2 changed files with 7 additions and 7 deletions

View File

@ -1351,12 +1351,12 @@ void system_time::full_time::set(struct tm &t)
static running_machine * jsmess_machine; static running_machine * jsmess_machine;
void js_main_loop() { void js_main_loop()
device_scheduler * scheduler; {
scheduler = &(jsmess_machine->scheduler()); attotime stoptime(jsmess_machine->scheduler().time() + attotime(0,HZ_TO_ATTOSECONDS(60)));
attotime stoptime = scheduler->time() + attotime(0,HZ_TO_ATTOSECONDS(60)); while (jsmess_machine->scheduler().time()) < stoptime)
while (scheduler->time() < stoptime) { {
scheduler->timeslice(); jsmess_machine->scheduler().timeslice();
} }
} }

View File

@ -434,7 +434,7 @@ void device_scheduler::timeslice()
while (m_basetime < m_timer_list->m_expire) while (m_basetime < m_timer_list->m_expire)
{ {
// by default, assume our target is the end of the next quantum // 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 // however, if the next timer is going to fire before then, override
if (m_timer_list->m_expire < target) if (m_timer_list->m_expire < target)