Пример #1
0
static UINT8 ppi8255_read_port(running_device *device, int port)
{
	ppi8255_t	*ppi8255 = get_safe_token(device);
	UINT8 result = 0x00;

	if (ppi8255->in_mask[port])
	{
		if (ppi8255->port_read[port].read != NULL)
			ppi8255_input(device, port, devcb_call_read8(&ppi8255->port_read[port], 0));

		result |= ppi8255->read[port] & ppi8255->in_mask[port];
	}
	result |= ppi8255->latch[port] & ppi8255->out_mask[port];

	switch (port)
	{
	case 0:
		/* clear input buffer full flag */
		ppi8255->ibf_a = 0;
		break;

	case 1:
		/* clear input buffer full flag */
		ppi8255->ibf_b = 0;
		break;

	case 2:
		/* read special port 2 signals */
		ppi8255_get_handshake_signals(ppi8255, 1, &result);
		break;
	}

	return result;
}
Пример #2
0
UINT8 ppi8255_device::ppi8255_read_port(int port)
{
	UINT8 result = 0x00;

	if (m_in_mask[port])
	{
		ppi8255_input(port, m_port_read[port](0));
		result |= m_read[port] & m_in_mask[port];
	}
	result |= m_latch[port] & m_out_mask[port];

	switch (port)
	{
	case 0:
		/* clear input buffer full flag */
		m_ibf_a = 0;
		break;

	case 1:
		/* clear input buffer full flag */
		m_ibf_b = 0;
		break;

	case 2:
		/* read special port 2 signals */
		ppi8255_get_handshake_signals(1, &result);
		break;
	}

	return result;
}
Пример #3
0
void ppi8255_set_port_c( running_device *device, UINT8 data ) { ppi8255_input(device, 2, data); }