Exemplo n.º 1
0
void via6522_device::shift()
{
	if (SO_O2_CONTROL(m_acr) || SO_T2_CONTROL(m_acr))
	{
		m_out_cb2 = (m_sr >> 7) & 1;
		m_sr =  (m_sr << 1) | m_out_cb2;

		devcb_call_write_line(&m_out_cb2_func, m_out_cb2);

		m_in_cb1=1;

		/* this should be one cycle wide */
		devcb_call_write_line(&m_out_cb1_func, 0);
		devcb_call_write_line(&m_out_cb1_func, 1);

		m_shift_counter = (m_shift_counter + 1) % 8;

		if (m_shift_counter)
        {
			if (SO_O2_CONTROL(m_acr)) {
				timer_adjust_oneshot(m_shift_timer, cycles_to_time(2), 0);
			} else {
				timer_adjust_oneshot(m_shift_timer, cycles_to_time((m_t2ll + 2)*2), 0);
			}
        }
		else
		{
			if (!(m_ifr & INT_SR))
            {
				set_int(INT_SR);
            }
		}
	}
Exemplo n.º 2
0
void via6522_device::shift()
{
	if (SO_O2_CONTROL(m_acr) || SO_T2_CONTROL(m_acr))
	{
		m_out_cb2 = (m_sr >> 7) & 1;
		m_sr =  (m_sr << 1) | m_out_cb2;

		m_out_cb2_func(m_out_cb2);

		m_in_cb1=1;

		/* this should be one cycle wide */
		m_out_cb1_func(0);
		m_out_cb1_func(1);

		m_shift_counter = (m_shift_counter + 1) % 8;

		if (m_shift_counter)
		{
			if (SO_O2_CONTROL(m_acr)) {
				m_shift_timer->adjust(clocks_to_attotime(2));
			} else {
				m_shift_timer->adjust(clocks_to_attotime((m_t2ll + 2)*2));
			}
		}
		else
		{
			if (!(m_ifr & INT_SR))
			{
				set_int(INT_SR);
			}
		}
	}
Exemplo n.º 3
0
static void via_shift (int which)
{
	struct via6522 *v = via + which;

	if (SO_O2_CONTROL(v->acr))
	{
		v->out_cb2 = (v->sr >> 7) & 1;
		v->sr =  (v->sr << 1) | v->out_cb2;

		if (v->intf->out_cb2_func)
			v->intf->out_cb2_func(0, v->out_cb2);

		v->in_cb1=1;
		if (v->intf->out_cb1_func)
		{
			/* this should be one cycle wide */
			v->intf->out_cb1_func(0, 0);
			v->intf->out_cb1_func(0, 1);
		}

		v->shift_counter = (v->shift_counter + 1) % 8;

		if (v->shift_counter)
			timer_set(V_CYCLES_TO_TIME(2), which, via_shift);
		else
		{
			if (!(v->ifr & INT_SR))
				via_set_int(which, INT_SR);
		}
	}