static WRITE8_DEVICE_HANDLER( draco_sound_g_w ) { cidelsa_state *state = (cidelsa_state *)device->machine->driver_data; /* G1 G0 description 0 0 IAB inactive 0 1 DWS write to PSG 1 0 DTB read from PSG 1 1 INTAK latch address */ switch (data) { case 0x01: ay8910_data_w(device, 0, state->draco_ay_latch); break; case 0x02: state->draco_ay_latch = ay8910_r(device, 0); break; case 0x03: ay8910_address_w(device, 0, state->draco_ay_latch); break; } }
UINT8 a2bus_arcboard_device::read_c0nx(address_space &space, UINT8 offset) { switch (offset) { case 0: return m_tms->vram_read(space, 0); case 1: return m_tms->register_read(space, 0); case 6: return ay8910_r(m_ay, space, 0); } return 0xff; }
/* this port is also used to read printer data */ static READ8_DEVICE_HANDLER ( oric_via_in_a_func ) { oric_state *state = device->machine().driver_data<oric_state>(); address_space *space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM ); /*logerror("port a read\r\n"); */ /* access psg? */ if (state->m_psg_control!=0) { /* if psg is in read register state return reg data */ if (state->m_psg_control==0x01) { return ay8910_r(space->machine().device("ay8912"), 0); } /* return high-impedance */ return 0x0ff; } /* correct?? */ return state->m_via_port_a_data; }
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; } }
static READ8_DEVICE_HANDLER( zaccaria_port0a_r ) { return ay8910_r(device->machine->device((active_8910 == 0) ? "ay1" : "ay2"), 0); }
static READ8_DEVICE_HANDLER( zaccaria_port0a_r ) { laserbat_state *state = device->machine().driver_data<laserbat_state>(); device_t *ay = (state->m_active_8910 == 0) ? state->m_ay1 : state->m_ay2; return ay8910_r(ay, 0); }
static READ8_DEVICE_HANDLER( zaccaria_port0a_r ) { zaccaria_state *state = device->machine().driver_data<zaccaria_state>(); return ay8910_r(device->machine().device((state->m_active_8910 == 0) ? "ay1" : "ay2"), 0); }
static READ8_DEVICE_HANDLER( zaccaria_port0a_r ) { laserbat_state *state = (laserbat_state *)device->machine->driver_data; running_device *ay = (state->active_8910 == 0) ? state->ay1 : state->ay2; return ay8910_r(ay, 0); }