In some of the READ/WRITE_DEVICE*_HANDLERS, use space instead

of driver to fetch the machine. This helps highlight where the
actual driver dependencies are.
This commit is contained in:
Aaron Giles 2012-09-17 16:00:04 +00:00
parent 5ddbca3e7a
commit 2ba95646d7
28 changed files with 134 additions and 134 deletions

View File

@ -625,9 +625,9 @@ WRITE8_DEVICE_HANDLER( polaris_sh_port_2_w )
WRITE8_DEVICE_HANDLER( polaris_sh_port_3_w )
{
_8080bw_state *state = device->machine().driver_data<_8080bw_state>();
_8080bw_state *state = space.machine().driver_data<_8080bw_state>();
coin_lockout_global_w(device->machine(), data & 0x04); /* SX8 */
coin_lockout_global_w(space.machine(), data & 0x04); /* SX8 */
state->m_c8080bw_flip_screen = data & 0x20; /* SX11 */

View File

@ -720,7 +720,7 @@ static WRITE8_DEVICE_HANDLER( ym2151_ctl_w )
{
ym2151_ct1 = data&0x1;
ym2151_ct2 = (data&0x2)>>1;
update_all_volumes(device->machine());
update_all_volumes(space.machine());
}

View File

@ -392,7 +392,7 @@ WRITE8_DEVICE_HANDLER( bzone_sounds_w )
discrete_sound_w(device, space, BZ_INPUT, data);
output_set_value("startled", (data >> 6) & 1);
device->machine().sound().system_enable(data & 0x20);
space.machine().sound().system_enable(data & 0x20);
}

View File

@ -1333,7 +1333,7 @@ static void demon_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_
static READ8_DEVICE_HANDLER( sound_porta_r )
{
cinemat_state *state = device->machine().driver_data<cinemat_state>();
cinemat_state *state = space.machine().driver_data<cinemat_state>();
/* bits 0-3 are the sound data; bit 4 is the data ready */
return state->m_sound_fifo[state->m_sound_fifo_out] | ((state->m_sound_fifo_in != state->m_sound_fifo_out) << 4);
}
@ -1341,14 +1341,14 @@ static READ8_DEVICE_HANDLER( sound_porta_r )
static READ8_DEVICE_HANDLER( sound_portb_r )
{
cinemat_state *state = device->machine().driver_data<cinemat_state>();
cinemat_state *state = space.machine().driver_data<cinemat_state>();
return state->m_last_portb_write;
}
static WRITE8_DEVICE_HANDLER( sound_portb_w )
{
cinemat_state *state = device->machine().driver_data<cinemat_state>();
cinemat_state *state = space.machine().driver_data<cinemat_state>();
/* watch for a 0->1 edge on bit 0 ("shift out") to advance the data pointer */
if ((data & 1) != (state->m_last_portb_write & 1) && (data & 1) != 0)
state->m_sound_fifo_out = (state->m_sound_fifo_out + 1) % 16;
@ -1359,7 +1359,7 @@ static WRITE8_DEVICE_HANDLER( sound_portb_w )
/* bit 2 controls the global mute */
if ((data & 4) != (state->m_last_portb_write & 4))
device->machine().sound().system_mute(data & 4);
space.machine().sound().system_mute(data & 4);
/* remember the last value written */
state->m_last_portb_write = data;

View File

@ -1245,7 +1245,7 @@ static READ8_DEVICE_HANDLER( dkong_voice_status_r )
static READ8_DEVICE_HANDLER( dkong_tune_r )
{
dkong_state *state = device->machine().driver_data<dkong_state>();
dkong_state *state = space.machine().driver_data<dkong_state>();
UINT8 page = latch8_r(state->m_dev_vp2, space, 0) & 0x47;
if ( page & 0x40 )
@ -1254,7 +1254,7 @@ static READ8_DEVICE_HANDLER( dkong_tune_r )
}
else
{
/* printf("%s:rom access\n",device->machine().describe_context()); */
/* printf("%s:rom access\n",space.machine().describe_context()); */
return (state->m_snd_rom[0x1000 + (page & 7) * 256 + offset]);
}
}

View File

@ -528,11 +528,11 @@ static WRITE8_DEVICE_HANDLER( r6532_porta_w )
{
exidy_sound_state *state = get_safe_token(device);
if (state->m_cvsd != NULL)
device->machine().device("cvsdcpu")->execute().set_input_line(INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
space.machine().device("cvsdcpu")->execute().set_input_line(INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
if (state->m_tms != NULL)
{
logerror("(%f)%s:TMS5220 data write = %02X\n", device->machine().time().as_double(), device->machine().describe_context(), riot6532_porta_out_get(state->m_riot));
logerror("(%f)%s:TMS5220 data write = %02X\n", space.machine().time().as_double(), space.machine().describe_context(), riot6532_porta_out_get(state->m_riot));
tms5220_data_w(state->m_tms, space, 0, data);
}
}
@ -542,7 +542,7 @@ static READ8_DEVICE_HANDLER( r6532_porta_r )
exidy_sound_state *state = get_safe_token(device);
if (state->m_tms != NULL)
{
logerror("(%f)%s:TMS5220 status read = %02X\n", device->machine().time().as_double(), device->machine().describe_context(), tms5220_status_r(state->m_tms, space, 0));
logerror("(%f)%s:TMS5220 status read = %02X\n", space.machine().time().as_double(), space.machine().describe_context(), tms5220_status_r(state->m_tms, space, 0));
return tms5220_status_r(state->m_tms, space, 0);
}
else
@ -1074,7 +1074,7 @@ WRITE8_DEVICE_HANDLER( victory_sound_command_w )
if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound command = %02X\n", state->m_maincpu->pcbase(), data);
device->machine().scheduler().synchronize(FUNC(delayed_command_w), data, state->m_pia1);
space.machine().scheduler().synchronize(FUNC(delayed_command_w), data, state->m_pia1);
}
@ -1082,7 +1082,7 @@ static WRITE8_DEVICE_HANDLER( victory_sound_irq_clear_w )
{
exidy_sound_state *state = get_safe_token(device);
if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound IRQ clear = %02X\n", device->machine().describe_context(), data);
if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound IRQ clear = %02X\n", space.machine().describe_context(), data);
if (!data) state->m_pia1->ca1_w(1);
}
@ -1092,7 +1092,7 @@ static WRITE8_DEVICE_HANDLER( victory_main_ack_w )
{
exidy_sound_state *state = get_safe_token(device);
if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound Main ACK W = %02X\n", device->machine().describe_context(), data);
if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound Main ACK W = %02X\n", space.machine().describe_context(), data);
if (state->m_victory_sound_response_ack_clk && !data)
state->m_pia1->cb1_w(1);

View File

@ -377,7 +377,7 @@ static READ8_DEVICE_HANDLER( sound_command_r )
{
exidy440_audio_state *state = get_safe_token(device);
/* clear the FIRQ that got us here and acknowledge the read to the main CPU */
device->machine().device("audiocpu")->execute().set_input_line(1, CLEAR_LINE);
space.machine().device("audiocpu")->execute().set_input_line(1, CLEAR_LINE);
state->sound_command_ack = 1;
return state->sound_command;
@ -436,7 +436,7 @@ static WRITE8_DEVICE_HANDLER( sound_volume_w )
static WRITE8_DEVICE_HANDLER( sound_interrupt_clear_w )
{
device->machine().device("audiocpu")->execute().set_input_line(0, CLEAR_LINE);
space.machine().device("audiocpu")->execute().set_input_line(0, CLEAR_LINE);
}

View File

@ -11,7 +11,7 @@
WRITE8_DEVICE_HANDLER( firetrk_skid_reset_w )
{
firetrk_state *state = device->machine().driver_data<firetrk_state>();
firetrk_state *state = space.machine().driver_data<firetrk_state>();
state->m_skid[0] = 0;
state->m_skid[1] = 0;

View File

@ -295,7 +295,7 @@ READ16_MEMBER(harddriv_state::hdsnddsp_get_bio)
WRITE16_DEVICE_HANDLER( hdsnddsp_dac_w )
{
harddriv_state *state = device->machine().driver_data<harddriv_state>();
harddriv_state *state = space.machine().driver_data<harddriv_state>();
/* DAC L */
if (!state->m_dacmute)

View File

@ -44,7 +44,7 @@ static DEVICE_RESET( hyprolyb_adpcm )
WRITE8_DEVICE_HANDLER( hyprolyb_adpcm_w )
{
hyprolyb_adpcm_state *state = get_safe_token(device);
driver_device *drvstate = device->machine().driver_data<driver_device>();
driver_device *drvstate = space.machine().driver_data<driver_device>();
drvstate->soundlatch2_byte_w(*state->m_space, offset, data);
state->m_adpcm_ready = 0x80;
}
@ -83,7 +83,7 @@ static READ8_DEVICE_HANDLER( hyprolyb_adpcm_ready_r )
static READ8_DEVICE_HANDLER( hyprolyb_adpcm_data_r )
{
hyprolyb_adpcm_state *state = get_safe_token(device);
driver_device *drvstate = device->machine().driver_data<driver_device>();
driver_device *drvstate = space.machine().driver_data<driver_device>();
state->m_adpcm_ready = 0x00;
return drvstate->soundlatch2_byte_r(*state->m_space, offset);
}

View File

@ -152,25 +152,25 @@ WRITE16_DEVICE_HANDLER( m72_sound_command_w )
if (ACCESSING_BITS_0_7)
{
m72_audio_state *state = get_safe_token(device);
driver_device *drvstate = device->machine().driver_data<driver_device>();
driver_device *drvstate = space.machine().driver_data<driver_device>();
drvstate->soundlatch_byte_w(*state->space, offset, data);
device->machine().scheduler().synchronize(FUNC(setvector_callback), Z80_ASSERT, state);
space.machine().scheduler().synchronize(FUNC(setvector_callback), Z80_ASSERT, state);
}
}
WRITE8_DEVICE_HANDLER( m72_sound_command_byte_w )
{
m72_audio_state *state = get_safe_token(device);
driver_device *drvstate = device->machine().driver_data<driver_device>();
driver_device *drvstate = space.machine().driver_data<driver_device>();
drvstate->soundlatch_byte_w(*state->space, offset, data);
device->machine().scheduler().synchronize(FUNC(setvector_callback), Z80_ASSERT, state);
space.machine().scheduler().synchronize(FUNC(setvector_callback), Z80_ASSERT, state);
}
WRITE8_DEVICE_HANDLER( m72_sound_irq_ack_w )
{
m72_audio_state *state = get_safe_token(device);
device->machine().scheduler().synchronize(FUNC(setvector_callback), Z80_CLEAR, state);
space.machine().scheduler().synchronize(FUNC(setvector_callback), Z80_CLEAR, state);
}

View File

@ -338,7 +338,7 @@ WRITE8_DEVICE_HANDLER( tornbase_audio_w )
/* if (data & 0x10) enable CHEER sound */
if (tornbase_get_cabinet_type(device->machine()) == TORNBASE_CAB_TYPE_UPRIGHT_OLD)
if (tornbase_get_cabinet_type(space.machine()) == TORNBASE_CAB_TYPE_UPRIGHT_OLD)
{
/* if (data & 0x20) enable WHISTLE sound */
@ -351,7 +351,7 @@ WRITE8_DEVICE_HANDLER( tornbase_audio_w )
/* if (data & 0x40) enable WHISTLE sound */
}
coin_counter_w(device->machine(), 0, (data >> 7) & 0x01);
coin_counter_w(space.machine(), 0, (data >> 7) & 0x01);
}
@ -824,7 +824,7 @@ WRITE8_DEVICE_HANDLER( boothill_audio_w )
{
/* D0 and D1 are not connected */
coin_counter_w(device->machine(), 0, (data >> 2) & 0x01);
coin_counter_w(space.machine(), 0, (data >> 2) & 0x01);
discrete_sound_w(device, space, BOOTHILL_GAME_ON_EN, (data >> 3) & 0x01);
@ -1055,9 +1055,9 @@ WRITE8_DEVICE_HANDLER( checkmat_audio_w )
discrete_sound_w(device, space, CHECKMAT_BOOM_EN, (data >> 1) & 0x01);
coin_counter_w(device->machine(), 0, (data >> 2) & 0x01);
coin_counter_w(space.machine(), 0, (data >> 2) & 0x01);
device->machine().sound().system_enable((data >> 3) & 0x01);
space.machine().sound().system_enable((data >> 3) & 0x01);
discrete_sound_w(device, space, CHECKMAT_TONE_DATA_45, (data >> 4) & 0x03);
discrete_sound_w(device, space, CHECKMAT_TONE_DATA_67, (data >> 6) & 0x03);
@ -1264,7 +1264,7 @@ WRITE8_DEVICE_HANDLER( desertgu_audio_1_w )
{
/* D0 and D1 are not connected */
coin_counter_w(device->machine(), 0, (data >> 2) & 0x01);
coin_counter_w(space.machine(), 0, (data >> 2) & 0x01);
discrete_sound_w(device, space, DESERTGU_GAME_ON_EN, (data >> 3) & 0x01);
@ -1280,7 +1280,7 @@ WRITE8_DEVICE_HANDLER( desertgu_audio_1_w )
WRITE8_DEVICE_HANDLER( desertgu_audio_2_w )
{
mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
mw8080bw_state *state = space.machine().driver_data<mw8080bw_state>();
discrete_sound_w(device, space, DESERTGU_ROADRUNNER_BEEP_BEEP_EN, (data >> 0) & 0x01);
@ -1539,7 +1539,7 @@ WRITE8_DEVICE_HANDLER( dplay_audio_w )
discrete_sound_w(device, space, DPLAY_GAME_ON_EN, (data >> 4) & 0x01);
coin_counter_w(device->machine(), 0, (data >> 5) & 0x01);
coin_counter_w(space.machine(), 0, (data >> 5) & 0x01);
/* D6 and D7 are not connected */
}
@ -1948,7 +1948,7 @@ WRITE8_MEMBER(mw8080bw_state::clowns_audio_1_w)
WRITE8_DEVICE_HANDLER( clowns_audio_2_w )
{
mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
mw8080bw_state *state = space.machine().driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->m_port_2_last;
discrete_sound_w(device, space, CLOWNS_POP_BOTTOM_EN, (data >> 0) & 0x01);
@ -1957,7 +1957,7 @@ WRITE8_DEVICE_HANDLER( clowns_audio_2_w )
discrete_sound_w(device, space, CLOWNS_POP_TOP_EN, (data >> 2) & 0x01);
device->machine().sound().system_enable((data >> 3) & 0x01);
space.machine().sound().system_enable((data >> 3) & 0x01);
discrete_sound_w(device, space, CLOWNS_SPRINGBOARD_HIT_EN, (data >> 4) & 0x01);
@ -2304,13 +2304,13 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( spacwalk_audio_1_w )
{
mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
mw8080bw_state *state = space.machine().driver_data<mw8080bw_state>();
coin_counter_w(device->machine(), 0, (data >> 0) & 0x01);
coin_counter_w(space.machine(), 0, (data >> 0) & 0x01);
state->m_clowns_controller_select = (data >> 1) & 0x01;
device->machine().sound().system_enable((data >> 2) & 0x01);
space.machine().sound().system_enable((data >> 2) & 0x01);
discrete_sound_w(device, space, SPACWALK_SPACE_SHIP_EN, (data >> 3) & 0x01);
}
@ -2540,7 +2540,7 @@ WRITE8_DEVICE_HANDLER( shuffle_audio_1_w )
discrete_sound_w(device, space, SHUFFLE_ROLLOVER_EN, (data >> 1) & 0x01);
device->machine().sound().system_enable((data >> 2) & 0x01);
space.machine().sound().system_enable((data >> 2) & 0x01);
discrete_sound_w(device, space, NODE_29, (data >> 3) & 0x07);
@ -2556,7 +2556,7 @@ WRITE8_DEVICE_HANDLER( shuffle_audio_2_w )
{
discrete_sound_w(device, space, SHUFFLE_FOUL_EN, (data >> 0) & 0x01);
coin_counter_w(device->machine(), 0, (data >> 1) & 0x01);
coin_counter_w(space.machine(), 0, (data >> 1) & 0x01);
/* D2-D7 are not connected */
}
@ -2718,9 +2718,9 @@ WRITE8_DEVICE_HANDLER( dogpatch_audio_w )
{
/* D0, D1 and D7 are not used */
coin_counter_w(device->machine(), 0, (data >> 2) & 0x01);
coin_counter_w(space.machine(), 0, (data >> 2) & 0x01);
device->machine().sound().system_enable((data >> 3) & 0x01);
space.machine().sound().system_enable((data >> 3) & 0x01);
discrete_sound_w(device, space, DOGPATCH_GAME_ON_EN, (data >> 3) & 0x01);
discrete_sound_w(device, space, DOGPATCH_LEFT_SHOT_EN, (data >> 4) & 0x01);
@ -3254,7 +3254,7 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( spcenctr_audio_1_w )
{
device->machine().sound().system_enable((data >> 0) & 0x01);
space.machine().sound().system_enable((data >> 0) & 0x01);
/* D1 is marked as 'OPTIONAL SWITCH VIDEO FOR COCKTAIL',
but it is never set by the software */
@ -3267,7 +3267,7 @@ WRITE8_DEVICE_HANDLER( spcenctr_audio_1_w )
WRITE8_DEVICE_HANDLER( spcenctr_audio_2_w )
{
mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
mw8080bw_state *state = space.machine().driver_data<mw8080bw_state>();
/* set WIND SOUND FREQ(data & 0x0f) 0, if no wind */
@ -3283,7 +3283,7 @@ WRITE8_DEVICE_HANDLER( spcenctr_audio_2_w )
WRITE8_DEVICE_HANDLER( spcenctr_audio_3_w )
{
mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
mw8080bw_state *state = space.machine().driver_data<mw8080bw_state>();
/* if (data & 0x01) enable SCREECH (hit the sides) sound */
@ -3465,9 +3465,9 @@ WRITE8_DEVICE_HANDLER( bowler_audio_1_w )
{
/* D0 - selects controller on the cocktail PCB */
coin_counter_w(device->machine(), 0, (data >> 1) & 0x01);
coin_counter_w(space.machine(), 0, (data >> 1) & 0x01);
device->machine().sound().system_enable((data >> 2) & 0x01);
space.machine().sound().system_enable((data >> 2) & 0x01);
discrete_sound_w(device, space, BOWLER_FOWL_EN, (data >> 3) & 0x01);
@ -4186,7 +4186,7 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( invaders_audio_1_w )
{
mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
mw8080bw_state *state = space.machine().driver_data<mw8080bw_state>();
sn76477_enable_w(state->m_sn, (~data >> 0) & 0x01); /* saucer sound */
@ -4195,7 +4195,7 @@ WRITE8_DEVICE_HANDLER( invaders_audio_1_w )
discrete_sound_w(device, space, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08);
discrete_sound_w(device, space, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10);
device->machine().sound().system_enable(data & 0x20);
space.machine().sound().system_enable(data & 0x20);
/* D6 and D7 are not connected */
}
@ -4203,13 +4203,13 @@ WRITE8_DEVICE_HANDLER( invaders_audio_1_w )
WRITE8_DEVICE_HANDLER( invaders_audio_2_w )
{
mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
mw8080bw_state *state = space.machine().driver_data<mw8080bw_state>();
discrete_sound_w(device, space, INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f);
discrete_sound_w(device, space, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10);
/* the flip screen line is only connected on the cocktail PCB */
if (invaders_is_cabinet_cocktail(device->machine()))
if (invaders_is_cabinet_cocktail(space.machine()))
{
state->m_invaders_flip_screen = (data >> 5) & 0x01;
}
@ -4819,7 +4819,7 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( invad2ct_audio_1_w )
{
mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
mw8080bw_state *state = space.machine().driver_data<mw8080bw_state>();
sn76477_enable_w(state->m_sn1, (~data >> 0) & 0x01); /* saucer sound */
@ -4828,7 +4828,7 @@ WRITE8_DEVICE_HANDLER( invad2ct_audio_1_w )
discrete_sound_w(device, space, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08);
discrete_sound_w(device, space, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10);
device->machine().sound().system_enable(data & 0x20);
space.machine().sound().system_enable(data & 0x20);
/* D6 and D7 are not connected */
}
@ -4845,7 +4845,7 @@ WRITE8_DEVICE_HANDLER( invad2ct_audio_2_w )
WRITE8_DEVICE_HANDLER( invad2ct_audio_3_w )
{
mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
mw8080bw_state *state = space.machine().driver_data<mw8080bw_state>();
sn76477_enable_w(state->m_sn2, (~data >> 0) & 0x01); /* saucer sound */

View File

@ -141,7 +141,7 @@ WRITE8_DEVICE_HANDLER( namco_52xx_write )
{
namco_52xx_state *state = get_safe_token(device);
device->machine().scheduler().synchronize(FUNC(namco_52xx_latch_callback), data, (void *)device);
space.machine().scheduler().synchronize(FUNC(namco_52xx_latch_callback), data, (void *)device);
state->m_cpu->execute().set_input_line(0, ASSERT_LINE);
@ -153,7 +153,7 @@ WRITE8_DEVICE_HANDLER( namco_52xx_write )
/* the 52xx uses TSTI to check for an interrupt; it also may be handling
a timer interrupt, so we need to ensure the IRQ line is held long enough */
device->machine().scheduler().timer_set(attotime::from_usec(5*21), FUNC(namco_52xx_irq_clear), 0, (void *)device);
space.machine().scheduler().timer_set(attotime::from_usec(5*21), FUNC(namco_52xx_irq_clear), 0, (void *)device);
}

View File

@ -119,7 +119,7 @@ WRITE8_DEVICE_HANDLER( namco_54xx_write )
{
namco_54xx_state *state = get_safe_token(device);
device->machine().scheduler().synchronize(FUNC(namco_54xx_latch_callback), data, (void *)device);
space.machine().scheduler().synchronize(FUNC(namco_54xx_latch_callback), data, (void *)device);
state->m_cpu->execute().set_input_line(0, ASSERT_LINE);
@ -128,7 +128,7 @@ WRITE8_DEVICE_HANDLER( namco_54xx_write )
// The input clock to the 06XX interface chip is 64H, that is
// 18432000/6/64 = 48kHz, so it makes sense for the irq line to be
// asserted for one clock cycle ~= 21us.
device->machine().scheduler().timer_set(attotime::from_usec(21), FUNC(namco_54xx_irq_clear), 0, (void *)device);
space.machine().scheduler().timer_set(attotime::from_usec(21), FUNC(namco_54xx_irq_clear), 0, (void *)device);
}

View File

@ -109,14 +109,14 @@ static TIMER_CALLBACK( deferred_sndpia1_porta_w )
static WRITE8_DEVICE_HANDLER( sync_sndpia1_porta_w )
{
/* we need to synchronize this so the sound CPU doesn't drop anything important */
device->machine().scheduler().synchronize(FUNC(deferred_sndpia1_porta_w), data, (void *)downcast<pia6821_device *>(device));
space.machine().scheduler().synchronize(FUNC(deferred_sndpia1_porta_w), data, (void *)downcast<pia6821_device *>(device));
}
static WRITE8_DEVICE_HANDLER( slither_coinctl_w )
{
coin_lockout_w(device->machine(), 0, (~data >> 6) & 1);
coin_counter_w(device->machine(), 0, (data >> 5) & 1);
coin_lockout_w(space.machine(), 0, (~data >> 6) & 1);
coin_counter_w(space.machine(), 0, (data >> 5) & 1);
}

View File

@ -288,23 +288,23 @@ WRITE8_MEMBER(redalert_state::demoneye_audio_command_w)
static WRITE8_DEVICE_HANDLER( demoneye_ay8910_latch_1_w )
{
redalert_state *state = device->machine().driver_data<redalert_state>();
redalert_state *state = space.machine().driver_data<redalert_state>();
state->m_ay8910_latch_1 = data;
}
static READ8_DEVICE_HANDLER( demoneye_ay8910_latch_2_r )
{
redalert_state *state = device->machine().driver_data<redalert_state>();
redalert_state *state = space.machine().driver_data<redalert_state>();
return state->m_ay8910_latch_2;
}
static WRITE8_DEVICE_HANDLER( demoneye_ay8910_data_w )
{
redalert_state *state = device->machine().driver_data<redalert_state>();
device_t *ay1 = device->machine().device("ay1");
device_t *ay2 = device->machine().device("ay2");
redalert_state *state = space.machine().driver_data<redalert_state>();
device_t *ay1 = space.machine().device("ay1");
device_t *ay2 = space.machine().device("ay2");
switch (state->m_ay8910_latch_1 & 0x03)
{

View File

@ -45,7 +45,7 @@ static const int scramble_timer[10] =
READ8_DEVICE_HANDLER( scramble_portB_r )
{
return scramble_timer[(device->machine().device<cpu_device>("audiocpu")->total_cycles()/512) % 10];
return scramble_timer[(space.machine().device<cpu_device>("audiocpu")->total_cycles()/512) % 10];
}
@ -74,23 +74,23 @@ static const int frogger_timer[10] =
READ8_DEVICE_HANDLER( frogger_portB_r )
{
return frogger_timer[(device->machine().device<cpu_device>("audiocpu")->total_cycles()/512) % 10];
return frogger_timer[(space.machine().device<cpu_device>("audiocpu")->total_cycles()/512) % 10];
}
WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w )
{
ttl7474_device *target = device->machine().device<ttl7474_device>("konami_7474");
ttl7474_device *target = space.machine().device<ttl7474_device>("konami_7474");
/* the complement of bit 3 is connected to the flip-flop's clock */
target->clock_w((~data & 0x08) >> 3);
/* bit 4 is sound disable */
device->machine().sound().system_mute((data & 0x10) >> 4);
space.machine().sound().system_mute((data & 0x10) >> 4);
}
WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w )
{
ttl7474_device *target = device->machine().device<ttl7474_device>("konami_7474");
ttl7474_device *target = space.machine().device<ttl7474_device>("konami_7474");
/* the complement of bit 3 is connected to the flip-flop's clock */
target->clock_w((~data & 0x08) >> 3);
@ -125,9 +125,9 @@ WRITE8_MEMBER(scramble_state::hotshock_sh_irqtrigger_w)
READ8_DEVICE_HANDLER( hotshock_soundlatch_r )
{
driver_device *drvstate = device->machine().driver_data<driver_device>();
device->machine().device("audiocpu")->execute().set_input_line(0, CLEAR_LINE);
return drvstate->soundlatch_byte_r(*device->machine().device("audiocpu")->memory().space(AS_PROGRAM),0);
driver_device *drvstate = space.machine().driver_data<driver_device>();
space.machine().device("audiocpu")->execute().set_input_line(0, CLEAR_LINE);
return drvstate->soundlatch_byte_r(*space.machine().device("audiocpu")->memory().space(AS_PROGRAM),0);
}
static void filter_w(device_t *device, int data)

View File

@ -508,8 +508,8 @@ static SOUND_START( sega005 )
static WRITE8_DEVICE_HANDLER( sega005_sound_a_w )
{
segag80r_state *state = device->machine().driver_data<segag80r_state>();
samples_device *samples = device->machine().device<samples_device>("samples");
segag80r_state *state = space.machine().driver_data<segag80r_state>();
samples_device *samples = space.machine().device<samples_device>("samples");
UINT8 diff = data ^ state->m_sound_state[0];
state->m_sound_state[0] = data;
@ -567,7 +567,7 @@ INLINE void sega005_update_sound_data(running_machine &machine)
static WRITE8_DEVICE_HANDLER( sega005_sound_b_w )
{
segag80r_state *state = device->machine().driver_data<segag80r_state>();
segag80r_state *state = space.machine().driver_data<segag80r_state>();
/*
D6: manual timer clock (0->1)
D5: 0 = manual timer, 1 = auto timer
@ -597,7 +597,7 @@ static WRITE8_DEVICE_HANDLER( sega005_sound_b_w )
state->m_sound_addr = (state->m_sound_addr & 0x780) | ((state->m_sound_addr + 1) & 0x07f);
/* update the sound data */
sega005_update_sound_data(device->machine());
sega005_update_sound_data(space.machine());
}
@ -913,14 +913,14 @@ static SOUND_START( monsterb )
static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w )
{
device_t *tms = device->machine().device("music");
device_t *tms = space.machine().device("music");
int enable_val;
/* Lower four data lines get decoded into 13 control lines */
tms36xx_note_w(tms, 0, data & 15);
/* Top four data lines address an 82S123 ROM that enables/disables voices */
enable_val = device->machine().root_device().memregion("prom")->base()[(data & 0xF0) >> 4];
enable_val = space.machine().root_device().memregion("prom")->base()[(data & 0xF0) >> 4];
tms3617_enable_w(tms, enable_val >> 2);
}
@ -934,8 +934,8 @@ static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w )
static WRITE8_DEVICE_HANDLER( monsterb_sound_b_w )
{
segag80r_state *state = device->machine().driver_data<segag80r_state>();
samples_device *samples = device->machine().device<samples_device>("samples");
segag80r_state *state = space.machine().driver_data<segag80r_state>();
samples_device *samples = space.machine().device<samples_device>("samples");
UINT8 diff = data ^ state->m_sound_state[1];
state->m_sound_state[1] = data;
@ -958,14 +958,14 @@ static WRITE8_DEVICE_HANDLER( monsterb_sound_b_w )
static READ8_DEVICE_HANDLER( n7751_status_r )
{
segag80r_state *state = device->machine().driver_data<segag80r_state>();
segag80r_state *state = space.machine().driver_data<segag80r_state>();
return state->m_n7751_busy << 4;
}
static WRITE8_DEVICE_HANDLER( n7751_command_w )
{
segag80r_state *state = device->machine().driver_data<segag80r_state>();
segag80r_state *state = space.machine().driver_data<segag80r_state>();
/*
Z80 7751 control port
@ -973,14 +973,14 @@ static WRITE8_DEVICE_HANDLER( n7751_command_w )
D3 = /INT line
*/
state->m_n7751_command = data & 0x07;
device->machine().device("audiocpu")->execute().set_input_line(0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE);
device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
space.machine().device("audiocpu")->execute().set_input_line(0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE);
space.machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
static WRITE8_DEVICE_HANDLER( n7751_rom_control_w )
{
segag80r_state *state = device->machine().driver_data<segag80r_state>();
segag80r_state *state = space.machine().driver_data<segag80r_state>();
/* P4 - address lines 0-3 */
/* P5 - address lines 4-7 */
/* P6 - address lines 8-11 */
@ -1030,7 +1030,7 @@ READ8_MEMBER(segag80r_state::n7751_command_r)
static WRITE8_DEVICE_HANDLER( n7751_p2_w )
{
segag80r_state *state = device->machine().driver_data<segag80r_state>();
segag80r_state *state = space.machine().driver_data<segag80r_state>();
/* write to P2; low 4 bits go to 8243 */
i8243_p2_w(device, space, offset, data & 0x0f);

View File

@ -315,7 +315,7 @@ WRITE8_DEVICE_HANDLER( sega_speech_data_w )
{
speech_state *state = get_safe_speech(device);
device->machine().scheduler().synchronize(FUNC(delayed_speech_w), data, state);
space.machine().scheduler().synchronize(FUNC(delayed_speech_w), data, state);
}
@ -492,10 +492,10 @@ WRITE8_DEVICE_HANDLER( sega_usb_data_w )
usb_state *usb = get_safe_token(device);
LOG(("%04X:usb_data_w = %02X\n", usb->maincpu->safe_pc(), data));
device->machine().scheduler().synchronize(FUNC(delayed_usb_data_w), data, usb);
space.machine().scheduler().synchronize(FUNC(delayed_usb_data_w), data, usb);
/* boost the interleave so that sequences can be sent */
device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(250));
space.machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(250));
}

View File

@ -14,7 +14,7 @@ const z80_daisy_config senjyo_daisy_chain[] =
static READ8_DEVICE_HANDLER( pio_pa_r )
{
senjyo_state *state = device->machine().driver_data<senjyo_state>();
senjyo_state *state = space.machine().driver_data<senjyo_state>();
return state->m_sound_cmd;
}

View File

@ -295,7 +295,7 @@ WRITE8_DEVICE_HANDLER( skyraid_sound_w )
discrete_sound_w(device, space, SKYRAID_PLANE_SWEEP_EN, data & 0x01);
discrete_sound_w(device, space, SKYRAID_MISSILE_EN, data & 0x02);
discrete_sound_w(device, space, SKYRAID_EXPLOSION_EN, data & 0x04);
set_led_status(device->machine(), 0, !(data & 0x08));
set_led_status(space.machine(), 0, !(data & 0x08));
discrete_sound_w(device, space, SKYRAID_PLANE_ON_EN, data & 0x10);
discrete_sound_w(device, space, SKYRAID_ATTRACT_EN, data & 0x20);
}

View File

@ -1196,7 +1196,7 @@ WRITE8_DEVICE_HANDLER( spc_io_w )
case 0x7: /* Port 3 */
// mame_printf_debug("SPC: %02x to APU @ %d (PC=%x)\n", data, offset & 3, space.device().safe_pc());
spc700->port_out[offset - 4] = data;
device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
space.machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
break;
case 0xa: /* Timer 0 */
case 0xb: /* Timer 1 */

View File

@ -44,7 +44,7 @@ static READ8_DEVICE_HANDLER( r6532_porta_r )
/* Note: bit 4 is always set to avoid sound self test */
UINT8 olddata = riot6532_porta_in_get(device);
return (olddata & 0xc0) | 0x10 | (tms5220_readyq_r(device->machine().device("tms")) << 2);
return (olddata & 0xc0) | 0x10 | (tms5220_readyq_r(space.machine().device("tms")) << 2);
}

View File

@ -13,7 +13,7 @@
WRITE8_DEVICE_HANDLER( suna8_play_samples_w )
{
suna8_state *state = device->machine().driver_data<suna8_state>();
suna8_state *state = space.machine().driver_data<suna8_state>();
if( data )
{
samples_device *samples = downcast<samples_device *>(device);
@ -31,7 +31,7 @@ WRITE8_DEVICE_HANDLER( suna8_play_samples_w )
WRITE8_DEVICE_HANDLER( rranger_play_samples_w )
{
suna8_state *state = device->machine().driver_data<suna8_state>();
suna8_state *state = space.machine().driver_data<suna8_state>();
if( data )
{
if(( state->m_sample != 0 ) && ( ~data & 0x30 )) // don't play state->m_sample zero when the bit is active
@ -44,7 +44,7 @@ WRITE8_DEVICE_HANDLER( rranger_play_samples_w )
WRITE8_DEVICE_HANDLER( suna8_samples_number_w )
{
suna8_state *state = device->machine().driver_data<suna8_state>();
suna8_state *state = space.machine().driver_data<suna8_state>();
state->m_sample = data & 0xf;
}

View File

@ -83,7 +83,7 @@ READ8_DEVICE_HANDLER( trackfld_speech_r )
WRITE8_DEVICE_HANDLER( trackfld_sound_w )
{
device_t *audio = device->machine().device("trackfld_audio");
device_t *audio = space.machine().device("trackfld_audio");
trackfld_audio_state *state = get_safe_token(audio);
int changes = offset ^ state->m_last_addr;
@ -116,7 +116,7 @@ READ8_HANDLER( hyperspt_sh_timer_r )
WRITE8_DEVICE_HANDLER( hyperspt_sound_w )
{
device_t *audio = device->machine().device("trackfld_audio");
device_t *audio = space.machine().device("trackfld_audio");
trackfld_audio_state *state = get_safe_token(audio);
int changes = offset ^ state->m_last_addr;

View File

@ -72,9 +72,9 @@ if (!((data >> 4) & 1)) mame_printf_debug("/TRIG4\n");
WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
{
#if (!DISCRETE_TEST)
samples_device *samples = device->machine().device<samples_device>("samples");
samples_device *samples = space.machine().device<samples_device>("samples");
#endif
turbo_state *state = device->machine().driver_data<turbo_state>();
turbo_state *state = space.machine().driver_data<turbo_state>();
#if (!DISCRETE_TEST)
UINT8 diff = data ^ state->m_sound_state[0];
#endif
@ -124,8 +124,8 @@ WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
WRITE8_DEVICE_HANDLER( turbo_sound_b_w )
{
samples_device *samples = device->machine().device<samples_device>("samples");
turbo_state *state = device->machine().driver_data<turbo_state>();
samples_device *samples = space.machine().device<samples_device>("samples");
turbo_state *state = space.machine().driver_data<turbo_state>();
UINT8 diff = data ^ state->m_sound_state[1];
state->m_sound_state[1] = data;
@ -147,8 +147,8 @@ WRITE8_DEVICE_HANDLER( turbo_sound_b_w )
WRITE8_DEVICE_HANDLER( turbo_sound_c_w )
{
samples_device *samples = device->machine().device<samples_device>("samples");
turbo_state *state = device->machine().driver_data<turbo_state>();
samples_device *samples = space.machine().device<samples_device>("samples");
turbo_state *state = space.machine().driver_data<turbo_state>();
/* OSEL1-2 */
state->m_turbo_osel = (state->m_turbo_osel & 1) | ((data & 3) << 1);
@ -297,7 +297,7 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( subroc3d_sound_a_w )
{
turbo_state *state = device->machine().driver_data<turbo_state>();
turbo_state *state = space.machine().driver_data<turbo_state>();
state->m_sound_state[0] = data;
/* DIS0-3 contained in bits 0-3 */
@ -327,8 +327,8 @@ INLINE void subroc3d_update_volume(samples_device *samples, int leftchan, UINT8
WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w )
{
samples_device *samples = device->machine().device<samples_device>("samples");
turbo_state *state = device->machine().driver_data<turbo_state>();
samples_device *samples = space.machine().device<samples_device>("samples");
turbo_state *state = space.machine().driver_data<turbo_state>();
UINT8 diff = data ^ state->m_sound_state[1];
state->m_sound_state[1] = data;
@ -383,8 +383,8 @@ WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w )
WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w )
{
samples_device *samples = device->machine().device<samples_device>("samples");
turbo_state *state = device->machine().driver_data<turbo_state>();
samples_device *samples = space.machine().device<samples_device>("samples");
turbo_state *state = space.machine().driver_data<turbo_state>();
UINT8 diff = data ^ state->m_sound_state[2];
state->m_sound_state[2] = data;
@ -415,7 +415,7 @@ WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w )
samples->set_volume(11, (data & 0x40) ? 0 : 1.0);
/* /GAME START */
device->machine().sound().system_mute(data & 0x80);
space.machine().sound().system_mute(data & 0x80);
}
@ -507,8 +507,8 @@ static void buckrog_update_samples(turbo_state *state, samples_device *samples)
WRITE8_DEVICE_HANDLER( buckrog_sound_a_w )
{
samples_device *samples = device->machine().device<samples_device>("samples");
turbo_state *state = device->machine().driver_data<turbo_state>();
samples_device *samples = space.machine().device<samples_device>("samples");
turbo_state *state = space.machine().driver_data<turbo_state>();
UINT8 diff = data ^ state->m_sound_state[0];
state->m_sound_state[0] = data;
@ -533,8 +533,8 @@ WRITE8_DEVICE_HANDLER( buckrog_sound_a_w )
WRITE8_DEVICE_HANDLER( buckrog_sound_b_w )
{
samples_device *samples = device->machine().device<samples_device>("samples");
turbo_state *state = device->machine().driver_data<turbo_state>();
samples_device *samples = space.machine().device<samples_device>("samples");
turbo_state *state = space.machine().driver_data<turbo_state>();
UINT8 diff = data ^ state->m_sound_state[1];
state->m_sound_state[1] = data;
@ -569,7 +569,7 @@ WRITE8_DEVICE_HANDLER( buckrog_sound_b_w )
if ((diff & 0x40) && !(data & 0x40) && samples->playing(5)) samples->stop(5);
/* GAME ON */
device->machine().sound().system_enable(data & 0x80);
space.machine().sound().system_enable(data & 0x80);
}

View File

@ -417,18 +417,18 @@ WRITE8_DEVICE_HANDLER( bb_ym2_a_w )
WRITE8_DEVICE_HANDLER( bb_ym2_b_w )
{
tx1_sound_state *state = get_safe_token(device);
device_t *ym1 = device->machine().device("ym1");
device_t *ym2 = device->machine().device("ym2");
device_t *ym1 = space.machine().device("ym1");
device_t *ym2 = space.machine().device("ym2");
double gain;
state->m_stream->update();
state->m_ym2_outputb = data ^ 0xff;
if (!strcmp(device->machine().system().name, "buggyboyjr"))
if (!strcmp(space.machine().system().name, "buggyboyjr"))
{
coin_counter_w(device->machine(), 0, data & 0x01);
coin_counter_w(device->machine(), 1, data & 0x02);
coin_counter_w(space.machine(), 0, data & 0x01);
coin_counter_w(space.machine(), 1, data & 0x02);
}
/*

View File

@ -112,8 +112,8 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w )
{
zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
samples_device *samples = device->machine().device<samples_device>("samples");
zaxxon_state *state = space.machine().driver_data<zaxxon_state>();
samples_device *samples = space.machine().device<samples_device>("samples");
UINT8 diff = data ^ state->m_sound_state[0];
state->m_sound_state[0] = data;
@ -148,8 +148,8 @@ WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w )
WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w )
{
zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
samples_device *samples = device->machine().device<samples_device>("samples");
zaxxon_state *state = space.machine().driver_data<zaxxon_state>();
samples_device *samples = space.machine().device<samples_device>("samples");
UINT8 diff = data ^ state->m_sound_state[1];
state->m_sound_state[1] = data;
@ -166,8 +166,8 @@ WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w )
WRITE8_DEVICE_HANDLER( zaxxon_sound_c_w )
{
zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
samples_device *samples = device->machine().device<samples_device>("samples");
zaxxon_state *state = space.machine().driver_data<zaxxon_state>();
samples_device *samples = space.machine().device<samples_device>("samples");
UINT8 diff = data ^ state->m_sound_state[2];
state->m_sound_state[2] = data;
@ -223,8 +223,8 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( congo_sound_b_w )
{
zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
samples_device *samples = device->machine().device<samples_device>("samples");
zaxxon_state *state = space.machine().driver_data<zaxxon_state>();
samples_device *samples = space.machine().device<samples_device>("samples");
UINT8 diff = data ^ state->m_sound_state[1];
state->m_sound_state[1] = data;
@ -237,8 +237,8 @@ WRITE8_DEVICE_HANDLER( congo_sound_b_w )
WRITE8_DEVICE_HANDLER( congo_sound_c_w )
{
zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
samples_device *samples = device->machine().device<samples_device>("samples");
zaxxon_state *state = space.machine().driver_data<zaxxon_state>();
samples_device *samples = space.machine().device<samples_device>("samples");
UINT8 diff = data ^ state->m_sound_state[2];
state->m_sound_state[2] = data;