Example #1
0
UINT8 pia6821_device::port_a_r()
{
	UINT8 ret = get_in_a_value();

	// IRQ flags implicitly cleared by a read
	m_irq_a1 = FALSE;
	m_irq_a2 = FALSE;
	update_interrupts();

	// CA2 is configured as output and in read strobe mode
	if(C2_OUTPUT(m_ctl_a) && C2_STROBE_MODE(m_ctl_a))
	{
		// this will cause a transition low
		set_out_ca2(FALSE);

		// if the CA2 strobe is cleared by the E, reset it right away
		if(STROBE_E_RESET(m_ctl_a))
		{
			set_out_ca2(TRUE);
		}
	}

	LOG(("PIA #%s: port A read = %02X\n", tag(), ret));

	return ret;
}
Example #2
0
static UINT8 port_a_r(const device_config *device)
{
	pia6821_state *p = get_token(device);

	UINT8 ret = get_in_a_value(device);

	/* IRQ flags implicitly cleared by a read */
	p->irq_a1 = FALSE;
	p->irq_a2 = FALSE;
	update_interrupts(device);

	/* CA2 is configured as output and in read strobe mode */
	if (C2_OUTPUT(p->ctl_a) && C2_STROBE_MODE(p->ctl_a))
	{
		/* this will cause a transition low */
		set_out_ca2(device, FALSE);

		/* if the CA2 strobe is cleared by the E, reset it right away */
		if (STROBE_E_RESET(p->ctl_a))
			set_out_ca2(device, TRUE);
	}

	LOG(("PIA #%s: port A read = %02X\n", device->tag, ret));

	return ret;
}
Example #3
0
void pia6821_device::control_a_w(UINT8 data)
{
	// bit 7 and 6 are read only
	data &= 0x3f;

	LOG(("PIA #%s: control A write = %02X\n", tag(), data));

	// update the control register
	m_ctl_a = data;

	// CA2 is configured as output
	if(C2_OUTPUT(m_ctl_a))
	{
		int temp;

		if(C2_SET_MODE(m_ctl_a))
		{
			// set/reset mode - bit value determines the new output
			temp = C2_SET(m_ctl_a);
		}
		else
		{
			// strobe mode - output is always high unless strobed
			temp = TRUE;
		}

		set_out_ca2(temp);
	}

	// update externals
	update_interrupts();
}
Example #4
0
static void control_a_w(const device_config *device, UINT8 data)
{
	pia6821_state *p = get_token(device);

	/* bit 7 and 6 are read only */
	data &= 0x3f;

	LOG(("PIA #%s: control A write = %02X\n", device->tag, data));

	/* update the control register */
	p->ctl_a = data;

	/* CA2 is configured as output */
	if (C2_OUTPUT(p->ctl_a))
	{
		int temp;

		if (C2_SET_MODE(p->ctl_a))
			/* set/reset mode - bit value determines the new output */
			temp = C2_SET(p->ctl_a);
		else
			/* strobe mode - output is always high unless strobed */
			temp = TRUE;

		set_out_ca2(device, temp);
	}

	/* update externals */
	update_interrupts(device);
}