void device_execute_interface::interface_clock_changed() { // a clock of zero disables the device if (device().clock() == 0) { suspend(SUSPEND_REASON_CLOCK, true); return; } // if we were suspended because we had no clock, enable us now if (suspended(SUSPEND_REASON_CLOCK)) resume(SUSPEND_REASON_CLOCK); // recompute cps and spc m_cycles_per_second = clocks_to_cycles(device().clock()); m_attoseconds_per_cycle = HZ_TO_ATTOSECONDS(m_cycles_per_second); // update the device's divisor INT64 attos = m_attoseconds_per_cycle; m_divshift = 0; while (attos >= (1UL << 31)) { m_divshift++; attos >>= 1; } m_divisor = attos; // re-compute the perfect interleave factor m_scheduler->compute_perfect_interleave(); }
attoseconds_t device_execute_interface::minimum_quantum() const { // if we don't have that information, compute it attoseconds_t basetick = m_attoseconds_per_cycle; if (basetick == 0) basetick = HZ_TO_ATTOSECONDS(clocks_to_cycles(device().clock())); // apply the minimum cycle count return basetick * min_cycles(); }
attoseconds_t device_execute_interface::minimum_quantum() const { // if we don't have a clock, return a huge factor if (device().clock() == 0) return ATTOSECONDS_PER_SECOND - 1; // if we don't have the quantum time, compute it attoseconds_t basetick = m_attoseconds_per_cycle; if (basetick == 0) basetick = HZ_TO_ATTOSECONDS(clocks_to_cycles(device().clock())); // apply the minimum cycle count return basetick * min_cycles(); }
void device_execute_interface::interface_clock_changed() { // recompute cps and spc m_cycles_per_second = clocks_to_cycles(device().clock()); m_attoseconds_per_cycle = HZ_TO_ATTOSECONDS(m_cycles_per_second); // update the device's divisor INT64 attos = m_attoseconds_per_cycle; m_divshift = 0; while (attos >= (1UL << 31)) { m_divshift++; attos >>= 1; } m_divisor = attos; // re-compute the perfect interleave factor device().machine().scheduler().compute_perfect_interleave(); }