Exemple #1
0
static WRITE8_HANDLER( bogeyman_8910_control_w )
{
	static int last;

	// bit 0 is flipscreen
	flip_screen_set(data & 0x01);

	// bit 5 goes to 8910 #0 BDIR pin
	if ((last & 0x20) == 0x20 && (data & 0x20) == 0x00)
	{
		// bit 4 goes to the 8910 #0 BC1 pin
		if (last & 0x10)
			AY8910_control_port_0_w(0,psg_latch);
		else
			AY8910_write_port_0_w(0,psg_latch);
	}

	// bit 7 goes to 8910 #1 BDIR pin
	if ((last & 0x80) == 0x80 && (data & 0x80) == 0x00)
	{
		// bit 6 goes to the 8910 #1 BC1 pin
		if (last & 0x40)
			AY8910_control_port_1_w(0,psg_latch);
		else
			AY8910_write_port_1_w(0,psg_latch);
	}

	last = data;
}
Exemple #2
0
void carnival_music_port_2_w( int offset, int data )
{
        static int psgSelect = 0;
        int newSelect;

        newSelect = data & ( MUSIC_PORT2_PSG_BDIR | MUSIC_PORT2_PSG_BC1 );
        if ( psgSelect != newSelect )
        {
                psgSelect = newSelect;

                switch ( psgSelect )
                {
                case PSG_BC_INACTIVE:
                        /* do nowt */
                        break;


                case PSG_BC_READ:
                        /* not very sensible for a write */
                        break;


                case PSG_BC_WRITE:
                        AY8910_write_port_0_w( 0, psgData );
                        break;


                case PSG_BC_LATCH_ADDRESS:
                        AY8910_control_port_0_w( 0, psgData );
                        break;
                }
        }
}
Exemple #3
0
static WRITE_HANDLER( dogfgt_soundcontrol_w )
{
	static int last;


	/* bit 5 goes to 8910 #0 BDIR pin  */
	if ((last & 0x20) == 0x20 && (data & 0x20) == 0x00)
	{
		/* bit 4 goes to the 8910 #0 BC1 pin */
		if (last & 0x10)
			AY8910_control_port_0_w(0,soundlatch);
		else
			AY8910_write_port_0_w(0,soundlatch);
	}
	/* bit 7 goes to 8910 #1 BDIR pin  */
	if ((last & 0x80) == 0x80 && (data & 0x80) == 0x00)
	{
		/* bit 6 goes to the 8910 #1 BC1 pin */
		if (last & 0x40)
			AY8910_control_port_1_w(0,soundlatch);
		else
			AY8910_write_port_1_w(0,soundlatch);
	}

	last = data;
}
Exemple #4
0
static WRITE_HANDLER( irem_port2_w )
{
	/* write latch */
	if ((port2 & 0x01) && !(data & 0x01))
	{
		/* control or data port? */
		if (port2 & 0x04)
		{
			/* PSG 0 or 1? */
			if (port2 & 0x08)
				AY8910_control_port_0_w(0,port1);
			if (port2 & 0x10)
				AY8910_control_port_1_w(0,port1);
		}
		else
		{
			/* PSG 0 or 1? */
			if (port2 & 0x08)
				AY8910_write_port_0_w(0,port1);
			if (port2 & 0x10)
				AY8910_write_port_1_w(0,port1);
		}
	}
	port2 = data;
}
Exemple #5
0
void mystston_8910_control_w(int offset,int data)
{
	static int last;


	/* bit 5 goes to 8910 #0 BDIR pin  */
	if ((last & 0x20) == 0x20 && (data & 0x20) == 0x00)
	{
		/* bit 4 goes to the 8910 #0 BC1 pin */
		if (last & 0x10)
			AY8910_control_port_0_w(0,psg_latch);
		else
			AY8910_write_port_0_w(0,psg_latch);
	}
	/* bit 7 goes to 8910 #1 BDIR pin  */
	if ((last & 0x80) == 0x80 && (data & 0x80) == 0x00)
	{
		/* bit 6 goes to the 8910 #1 BC1 pin */
		if (last & 0x40)
			AY8910_control_port_1_w(0,psg_latch);
		else
			AY8910_write_port_1_w(0,psg_latch);
	}

	last = data;
}
Exemple #6
0
/* read/write data depending on state of bdir, bc1 pins and data output to psg */
static void oric_psg_connection_refresh(void)
{
	if (oric_psg_control!=0)
	{
		switch (oric_psg_control)
		{
			/* write register data */
			case 2:
			{
				AY8910_write_port_0_w (0, oric_via_port_a_data);
			}
			break;
			/* write register index */
			case 3:
			{
				AY8910_control_port_0_w (0, oric_via_port_a_data);
			}
			break;

			default:
				break;
		}

		return;
	}
}
Exemple #7
0
static WRITE8_HANDLER(ay1_sel)
{
	if(activecpu_get_previouspc()==0x309)
	{
		AY8910_control_port_0_w(0,nAyCtrl);
		AY8910_write_port_0_w(0,nAyData);
	}
}
Exemple #8
0
static WRITE8_HANDLER( sound_control_w )
{
	static int last;
	if ((last & 0x04) == 0x04 && (data & 0x4) == 0x00)
	{
		if (last & 0x01)
			AY8910_control_port_0_w(0,soundlatch);
		else
			AY8910_write_port_0_w(0,soundlatch);
	}
	last=data;
}
Exemple #9
0
static WRITE8_HANDLER( sound_control_w )
{
/*
    AY 3-8910 :

    D0 - BC1
    D1 - BC2
    D2 - BDIR
    D3 - /Reset

*/
	if ((data &7)==7) AY8910_control_port_0_w(0,ay_data);
	if ((data &7)==6) AY8910_write_port_0_w(0,ay_data);
}
Exemple #10
0
static WRITE_HANDLER( snddata_w )
{
	if ((p2 & 0xf0) == 0xe0)
		AY8910_control_port_0_w(0,offset);
	else if ((p2 & 0xf0) == 0xa0)
		AY8910_write_port_0_w(0,offset);
	else if ((p1 & 0xe0) == 0x60)
		AY8910_control_port_1_w(0,offset);
	else if ((p1 & 0xe0) == 0x40)
		AY8910_write_port_1_w(0,offset);
	else // if ((p2 & 0xf0) != 0x70)
		/* the port address is the data, while the data seems to be control bits */
		logerror("%04x: snddata_w ctrl = %02x, p1 = %02x, p2 = %02x, data = %02x\n",activecpu_get_pc(),data,p1,p2,offset);
}
static WRITE8_HANDLER( snddata_w )
{
	int num_ays = (sndti_to_sndnum(SOUND_AY8910, 1) != -1) ? 2 : 1;
	if ((p2 & 0xf0) == 0xe0)
		AY8910_control_port_0_w(0,offset);
	else if ((p2 & 0xf0) == 0xa0)
		AY8910_write_port_0_w(0,offset);
	else if (num_ays == 2 && (p1 & 0xe0) == 0x60)
		AY8910_control_port_1_w(0,offset);
	else if (num_ays == 2 && (p1 & 0xe0) == 0x40)
		AY8910_write_port_1_w(0,offset);
	else /* if ((p2 & 0xf0) != 0x70) */
		/* the port address is the data, while the data seems to be control bits */
		logerror("%04x: snddata_w ctrl = %02x, p1 = %02x, p2 = %02x, data = %02x\n",activecpu_get_pc(),data,p1,p2,offset);
}
Exemple #12
0
void kanga_moja(int port, int val)
{
/* does this really work, or is there a problem with the PSG code,
   it seems like one channel is completely missing from the output
*/

  Z80_Regs regs;
  Z80_GetRegs(&regs);

  if (regs.BC.D==0x8000)
    AY8910_control_port_0_w(port,val);
  else /* it must be 0x7000 ;-) -V- */
    AY8910_write_port_0_w(port,val);

}
Exemple #13
0
void stooges_sound_control_w(int offset,int data)
{
	static int last;

	common_sound_control_w(offset, data);

	/* bit 2 goes to 8913 BDIR pin  */
	if ((last & 0x04) == 0x04 && (data & 0x04) == 0x00)
	{
		/* bit 3 selects which of the two 8913 to enable */
		if (data & 0x08)
		{
			/* bit 4 goes to the 8913 BC1 pin */
			if (data & 0x10)
				AY8910_control_port_0_w(0,psg_latch);
			else
				AY8910_write_port_0_w(0,psg_latch);
		}
		else
		{
			/* bit 4 goes to the 8913 BC1 pin */
			if (data & 0x10)
				AY8910_control_port_1_w(0,psg_latch);
			else
				AY8910_write_port_1_w(0,psg_latch);
		}
	}

	/* bit 5 goes to the speech chip DIRECT DATA TEST pin */

	/* bit 6 = speech chip DATA PRESENT pin; high then low to make the chip read data */
	if ((last & 0x40) == 0x40 && (data & 0x40) == 0x00)
	{
	}

	/* bit 7 goes to the speech chip RESET pin */

	last = data & 0x44;
}
Exemple #14
0
static WRITE8_HANDLER( mermaid_AY8910_write_port_w )
{
	if (mermaid_AY8910_enable[0]) AY8910_write_port_0_w(offset, data);
	if (mermaid_AY8910_enable[1]) AY8910_write_port_1_w(offset, data);
}
Exemple #15
0
ADDRESS_MAP_END

static WRITE8_HANDLER( mrflea_data0_w ){
	AY8910_control_port_0_w( offset, mrflea_select0 );
	AY8910_write_port_0_w( offset, data );
}