示例#1
0
void bitbanger_device::timer_input(void)
{
	if(m_input_buffer_cursor == m_input_buffer_size)
	{
		/* get more data */
		bytes_to_bits_81N();

		if(m_input_buffer_size == 0)
		{
			/* no more data, wait and try again */
			m_idle_delay = min(m_idle_delay + attotime::from_msec(100), attotime::from_seconds(1));
			m_input_timer->adjust(m_idle_delay);

			if( m_mode == BITBANGER_MODEM )
				set_input_line(1);
			else
				set_input_line(0);
			return;
		}
		else
		{
			m_idle_delay = m_current_baud;
			m_input_timer->adjust(m_idle_delay, 0, m_idle_delay);
		}
	}

	/* send bit to driver */
	set_input_line(m_input_buffer[(m_input_buffer_cursor)++]);
}
示例#2
0
文件: diexec.cpp 项目: system11b/mame
void device_execute_interface::pulse_input_line(int irqline, const attotime &duration)
{
	assert(duration > attotime::zero);
	set_input_line(irqline, ASSERT_LINE);

	attotime target_time = local_time() + duration;
	m_scheduler->timer_set(target_time - m_scheduler->time(), timer_expired_delegate(FUNC(device_execute_interface::irq_pulse_clear), this), irqline);
}
示例#3
0
void m68340_cpu_device::update_ipl()
{
	uint8_t new_ipl = std::max({
		pit_irq_level(),
		m_serial->irq_level(),
		m_timer[0]->irq_level(),
		m_timer[1]->irq_level()
	});
	if (m_ipl != new_ipl)
	{
		if (m_ipl != 0)
			set_input_line(m_ipl, CLEAR_LINE);
		LOGMASKED(LOG_IPL, "Changing interrupt level from %d to %d\n", m_ipl, new_ipl);
		m_ipl = new_ipl;
		if (m_ipl != 0)
			set_input_line(m_ipl, ASSERT_LINE);
	}
}
示例#4
0
文件: m68705.cpp 项目: Dagarman/mame
void m68705_device::burn_cycles(unsigned count)
{
	// handle internal timer/counter source
	if (!tcr_tin()) // TODO: check tcr_tie() and gate on TIMER if appropriate
	{
		unsigned const ps_opt(tcr_ps());
		unsigned const ps_mask((1 << ps_opt) - 1);
		unsigned const decrements((count + (m_prescaler & ps_mask)) >> ps_opt);

		if ((m_tdr ? unsigned(m_tdr) : 256U) <= decrements)
		{
			LOGTIMER("timer/counter expired%s%s\n", tcr_tir() ? " [overrun]" : "", tcr_tim() ? " [masked]" : "");
			m_tcr |= 0x80;
			if (!tcr_tim())
				set_input_line(M68705_INT_TIMER, ASSERT_LINE);
		}
		m_prescaler = (count + m_prescaler) & 0x7f;
		m_tdr = (m_tdr - decrements) & 0xff;
	}