void device_execute_interface::interface_pre_start() { // bind delegates m_vblank_interrupt.bind_relative_to(device()); m_timed_interrupt.bind_relative_to(device()); // m_driver_irq.bind_relative_to(device()); // fill in the initial states execute_interface_iterator iter(device().machine().root_device()); int index = iter.indexof(*this); m_suspend = SUSPEND_REASON_RESET; m_profiler = profile_type(index + PROFILER_DEVICE_FIRST); m_inttrigger = index + TRIGGER_INT; // fill in the input states and IRQ callback information for (int line = 0; line < ARRAY_LENGTH(m_input); line++) m_input[line].start(this, line); // allocate timers if we need them if (m_timed_interrupt_period != attotime::zero) m_timedint_timer = device().machine().scheduler().timer_alloc(FUNC(static_trigger_periodic_interrupt), (void *)this); // register for save states device().save_item(NAME(m_suspend)); device().save_item(NAME(m_nextsuspend)); device().save_item(NAME(m_eatcycles)); device().save_item(NAME(m_nexteatcycles)); device().save_item(NAME(m_trigger)); device().save_item(NAME(m_totalcycles)); device().save_item(NAME(m_localtime)); }
void device_execute_interface::interface_pre_start() { // fill in the initial states int index = device().machine->m_devicelist.indexof(m_device); m_suspend = SUSPEND_REASON_RESET; m_profiler = profile_type(index + PROFILER_DEVICE_FIRST); m_inttrigger = index + TRIGGER_INT; // fill in the input states and IRQ callback information for (int line = 0; line < ARRAY_LENGTH(m_input); line++) m_input[line].start(this, line); // allocate timers if we need them if (m_execute_config.m_vblank_interrupts_per_frame > 1) m_partial_frame_timer = device().machine->scheduler().timer_alloc(FUNC(static_trigger_partial_frame_interrupt), (void *)this); if (m_execute_config.m_timed_interrupt_period != attotime::zero) m_timedint_timer = device().machine->scheduler().timer_alloc(FUNC(static_trigger_periodic_interrupt), (void *)this); // register for save states m_device.save_item(NAME(m_suspend)); m_device.save_item(NAME(m_nextsuspend)); m_device.save_item(NAME(m_eatcycles)); m_device.save_item(NAME(m_nexteatcycles)); m_device.save_item(NAME(m_trigger)); m_device.save_item(NAME(m_totalcycles)); m_device.save_item(NAME(m_localtime)); m_device.save_item(NAME(m_iloops)); }
void device_execute_interface::interface_pre_start() { m_scheduler = &device().machine().scheduler(); // bind delegates m_vblank_interrupt.bind_relative_to(*device().owner()); m_timed_interrupt.bind_relative_to(*device().owner()); m_driver_irq.bind_relative_to(*device().owner()); // fill in the initial states int const index = device_iterator(device().machine().root_device()).indexof(*this); m_suspend = SUSPEND_REASON_RESET; m_profiler = profile_type(index + PROFILER_DEVICE_FIRST); m_inttrigger = index + TRIGGER_INT; // allocate timers if we need them if (m_timed_interrupt_period != attotime::zero) m_timedint_timer = m_scheduler->timer_alloc(timer_expired_delegate(FUNC(device_execute_interface::trigger_periodic_interrupt), this)); }