Пример #1
0
static WRITE8_DEVICE_HANDLER( sound_control_w )
{
	_4enraya_state *state = device->machine().driver_data<_4enraya_state>();

	if ((state->m_last_snd_ctrl & 0x04) == 0x04 && (data & 0x4) == 0x00)
		ay8910_data_address_w(device, state->m_last_snd_ctrl, state->m_soundlatch);

	state->m_last_snd_ctrl = data;
}
Пример #2
0
static WRITE8_DEVICE_HANDLER( zaccaria_port0b_w )
{

	/* bit 1 goes to 8910 #0 BDIR pin  */
	if ((last_port0b & 0x02) == 0x02 && (data & 0x02) == 0x00)
	{
		/* bit 0 goes to the 8910 #0 BC1 pin */
		ay8910_data_address_w(device->machine->device("ay1"), last_port0b, port0a);
	}
	else if ((last_port0b & 0x02) == 0x00 && (data & 0x02) == 0x02)
	{
		/* bit 0 goes to the 8910 #0 BC1 pin */
		if (last_port0b & 0x01)
			active_8910 = 0;
	}
	/* bit 3 goes to 8910 #1 BDIR pin  */
	if ((last_port0b & 0x08) == 0x08 && (data & 0x08) == 0x00)
	{
		/* bit 2 goes to the 8910 #1 BC1 pin */
		ay8910_data_address_w(device->machine->device("ay2"), last_port0b >> 2, port0a);
	}
Пример #3
0
static WRITE8_DEVICE_HANDLER( zaccaria_port0b_w )
{
	zaccaria_state *state = device->machine().driver_data<zaccaria_state>();

	/* bit 1 goes to 8910 #0 BDIR pin  */
	if ((state->m_last_port0b & 0x02) == 0x02 && (data & 0x02) == 0x00)
	{
		/* bit 0 goes to the 8910 #0 BC1 pin */
		ay8910_data_address_w(device->machine().device("ay1"), state->m_last_port0b, state->m_port0a);
	}
	else if ((state->m_last_port0b & 0x02) == 0x00 && (data & 0x02) == 0x02)
	{
		/* bit 0 goes to the 8910 #0 BC1 pin */
		if (state->m_last_port0b & 0x01)
			state->m_active_8910 = 0;
	}
	/* bit 3 goes to 8910 #1 BDIR pin  */
	if ((state->m_last_port0b & 0x08) == 0x08 && (data & 0x08) == 0x00)
	{
		/* bit 2 goes to the 8910 #1 BC1 pin */
		ay8910_data_address_w(device->machine().device("ay2"), state->m_last_port0b >> 2, state->m_port0a);
	}
Пример #4
0
static WRITE8_DEVICE_HANDLER( redalert_AY8910_w )
{
	/* BC2 is connected to a pull-up resistor, so BC2=1 always */
	switch (data & 0x03)
	{
		/* BC1=0, BDIR=0 : inactive */
		case 0x00:
			break;

		/* BC1=1, BDIR=0 : read from PSG */
		case 0x01:
			ay8910_latch_1 = ay8910_r(device, 0);
			break;

		/* BC1=0, BDIR=1 : write to PSG */
		/* BC1=1, BDIR=1 : latch address */
		case 0x02:
		case 0x03:
		default:
			ay8910_data_address_w(device, data, ay8910_latch_2);
			break;
	}
}