// start/stop public void start(profile_type type) { if (enabled()) { real_start(type); } }
//------------------------------------------------- // real_start - mark the beginning of a // profiler entry //------------------------------------------------- void real_start(profile_type type) { // fail if we overflow if (m_filoptrIdx >= m_filo.Length - 1) //if (m_filoptr >= &m_filo[ARRAY_LENGTH(m_filo) - 1]) { throw new emu_fatalerror("Profiler FILO overflow (type = {0})\n", type); } // get current tick count osd_ticks_t curticks = (UInt64)get_profile_ticks(); // update previous entry m_data[m_filo[m_filoptrIdx].type] += curticks - m_filo[m_filoptrIdx].start; // move to next entry m_filoptrIdx++; // m_filoptr++; // fill in this entry m_filo[m_filoptrIdx].type = (int)type; m_filo[m_filoptrIdx].start = curticks; }
//------------------------------------------------- // interface_pre_start - work to be done prior to // actually starting a device //------------------------------------------------- public override void interface_pre_start() { m_scheduler = device().machine().scheduler(); // bind delegates //m_vblank_interrupt.resolve(); //m_timed_interrupt.resolve(); //m_driver_irq.resolve(); // fill in the initial states int index = new device_enumerator(device().machine().root_device()).indexof(device()); m_suspend = SUSPEND_REASON_RESET; m_profiler = (profile_type)(index + profile_type.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(trigger_periodic_interrupt, this); } }
public attoseconds_t m_attoseconds_per_cycle; // attoseconds per adjusted clock cycle // construction/destruction //------------------------------------------------- // device_execute_interface - constructor //------------------------------------------------- public device_execute_interface(machine_config mconfig, device_t device) : base(device, "execute") { m_scheduler = null; m_disabled = false; m_vblank_interrupt = null; m_vblank_interrupt_screen = null; m_timed_interrupt = null; m_timed_interrupt_period = attotime.zero; m_nextexec = null; m_driver_irq = null; m_timedint_timer = null; m_profiler = profile_type.PROFILER_IDLE; m_icountptr = null; m_cycles_running = 0; m_cycles_stolen = 0; m_suspend = 0; m_nextsuspend = 0; m_eatcycles = 0; m_nexteatcycles = 0; m_trigger = 0; m_inttrigger = 0; m_totalcycles = 0; m_divisor = 0; m_divshift = 0; m_cycles_per_second = 0; m_attoseconds_per_cycle = 0; for (int line = 0; line < m_input.Length; line++) { m_input[line] = new device_input(); } // configure the fast accessor assert(device.interfaces().m_execute == null); device.interfaces().m_execute = this; }
// start/stop public void start(profile_type type) { }