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; }
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; }
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; }
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; }
static WRITE8_HANDLER(ay2_sel) { if(activecpu_get_previouspc()==0x309) { AY8910_control_port_1_w(0,nAyCtrl); AY8910_write_port_1_w(0,nAyData); } }
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); }
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; }
static WRITE_HANDLER( gsword_AY8910_control_port_1_w ) { AY8910_control_port_1_w(offset,data); fake8910_1 = data; }
static void gsword_AY8910_control_port_1_w(int offset,int data) { AY8910_control_port_1_w(offset,data); fake8910_1 = data; }
static WRITE8_HANDLER( mermaid_AY8910_control_port_w ) { if (mermaid_AY8910_enable[0]) AY8910_control_port_0_w(offset, data); if (mermaid_AY8910_enable[1]) AY8910_control_port_1_w(offset, data); }
static WRITE8_HANDLER( mrflea_data2_w ){ AY8910_control_port_1_w( offset, mrflea_select2 ); AY8910_write_port_1_w( offset, data ); }