static WRITE8_HANDLER(circusc_sound_w) { circusc_state *state = space->machine().driver_data<circusc_state>(); switch (offset & 7) { /* CS2 */ case 0: state->m_sn_latch = data; break; /* CS3 */ case 1: sn76496_w(state->m_sn1, 0, state->m_sn_latch); break; /* CS4 */ case 2: sn76496_w(state->m_sn2, 0, state->m_sn_latch); break; /* CS5 */ case 3: dac_w(state->m_dac, 0, data); break; /* CS6 */ case 4: discrete_sound_w(state->m_discrete, NODE_05, (offset & 0x20) >> 5); discrete_sound_w(state->m_discrete, NODE_06, (offset & 0x18) >> 3); discrete_sound_w(state->m_discrete, NODE_07, (offset & 0x40) >> 6); break; } }
static WRITE8_HANDLER( spcforce_SN76496_select_w ) { spcforce_SN76496_select = data; if (~data & 0x40) sn76496_w(devtag_get_device(space->machine, "sn1"), 0, spcforce_SN76496_latch); if (~data & 0x20) sn76496_w(devtag_get_device(space->machine, "sn2"), 0, spcforce_SN76496_latch); if (~data & 0x10) sn76496_w(devtag_get_device(space->machine, "sn3"), 0, spcforce_SN76496_latch); }
static WRITE8_HANDLER( spcforce_SN76496_select_w ) { spcforce_state *state = space->machine->driver_data<spcforce_state>(); state->sn76496_select = data; if (~data & 0x40) sn76496_w(space->machine->device("sn1"), 0, state->sn76496_latch); if (~data & 0x20) sn76496_w(space->machine->device("sn2"), 0, state->sn76496_latch); if (~data & 0x10) sn76496_w(space->machine->device("sn3"), 0, state->sn76496_latch); }
static WRITE8_HANDLER( sound_select_w ) { lasso_state *state = space->machine().driver_data<lasso_state>(); UINT8 to_write = BITSWAP8(*state->m_chip_data, 0, 1, 2, 3, 4, 5, 6, 7); if (~data & 0x01) /* chip #0 */ sn76496_w(state->m_sn_1, 0, to_write); if (~data & 0x02) /* chip #1 */ sn76496_w(state->m_sn_2, 0, to_write); }