Example #1
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);
		}
	}
Example #2
0
/******************* Timer timeouts *************************/
static void via_t1_timeout (int which)
{
	struct via6522 *v = via + which;


	if (T1_CONTINUOUS (v->acr))
    {
		if (T1_SET_PB7(v->acr))
			v->out_b ^= 0x80;
		timer_reset (v->t1, V_CYCLES_TO_TIME(TIMER1_VALUE(v) + IFR_DELAY));
    }
	else
    {
		if (T1_SET_PB7(v->acr))
			v->out_b |= 0x80;
		v->t1 = 0;
		v->time1=timer_get_time();
    }
	if (v->intf->out_b_func && v->ddr_b)
		v->intf->out_b_func(0, v->out_b & v->ddr_b);

	if (!(v->ifr & INT_T1))
		via_set_int (v, INT_T1);
}