Time to kill off some deadwood.

First to go is devtag_get_device() (what a stupid name).
Use machine->device() instead.

This was strictly a bulk replace:
Search: devtag_get_device([ \t]*)\(([ \t]*)([^,]+),[ \t]*
Replace: \3->device\1\(\2
This commit is contained in:
Aaron Giles 2010-07-07 19:27:01 +00:00
parent b797437b3b
commit 65f8a15555
653 changed files with 2451 additions and 2452 deletions

View File

@ -56,7 +56,6 @@
#define DERIVED_CLOCK(num, den) (0xff000000 | ((num) << 12) | ((den) << 0))
// shorthand for accessing devices by machine/type/tag
#define devtag_get_device(mach,tag) (mach)->device(tag)
#define devtag_reset(mach,tag) (mach)->device(tag)->reset()

View File

@ -803,7 +803,7 @@ static DEVICE_START( mos6560 )
const mos6560_interface *intf = (mos6560_interface *)device->baseconfig().static_config();
int width, height;
mos6560->screen = downcast<screen_device *>(devtag_get_device(device->machine, intf->screen));
mos6560->screen = downcast<screen_device *>(device->machine->device(intf->screen));
width = mos6560->screen->width();
height = mos6560->screen->height();

View File

@ -44,7 +44,7 @@ WRITE8_DEVICE_HANDLER( blockade_sound_freq_w )
WRITE8_HANDLER( blockade_env_on_w )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
if (BLOCKADE_LOG) mame_printf_debug("Boom Start\n");
sample_start(samples, 0,0,0);
return;

View File

@ -127,7 +127,7 @@ static int psgData = 0;
WRITE8_HANDLER( carnival_audio_1_w )
{
static int port1State = 0;
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
int bitsChanged;
int bitsGoneHigh;
int bitsGoneLow;
@ -206,7 +206,7 @@ WRITE8_HANDLER( carnival_audio_1_w )
WRITE8_HANDLER( carnival_audio_2_w )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
int bitsChanged;
int bitsGoneHigh;
int bitsGoneLow;

View File

@ -108,7 +108,7 @@ static WRITE_LINE_DEVICE_HANDLER( ctc_timer_1_w )
{
output[0] ^= 0x7f;
channel_active[0] = 1;
dac_data_w(devtag_get_device(device->machine, "dac1"), output[0]);
dac_data_w(device->machine->device("dac1"), output[0]);
}
}
@ -118,7 +118,7 @@ static WRITE_LINE_DEVICE_HANDLER( ctc_timer_2_w )
{
output[1] ^= 0x7f;
channel_active[1] = 1;
dac_data_w(devtag_get_device(device->machine, "dac2"), output[0]);
dac_data_w(device->machine->device("dac2"), output[0]);
}
}
@ -137,5 +137,5 @@ SOUND_START( cchasm )
sound_flags = 0;
output[0] = 0; output[1] = 0;
ctc = devtag_get_device(machine, "ctc");
ctc = machine->device("ctc");
}

View File

@ -27,7 +27,7 @@ static void cclimber_play_sample(running_machine *machine, int start,int freq,in
int len;
int romlen = memory_region_length(machine, "samples");
const UINT8 *rom = memory_region(machine, "samples");
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
if (!rom) return;

View File

@ -165,7 +165,7 @@ static const samples_interface spacewar_samples_interface =
static void spacewar_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
/* Explosion - rising edge */
if (SOUNDVAL_RISING_EDGE(0x01))
@ -245,7 +245,7 @@ static const samples_interface barrier_samples_interface =
static void barrier_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
/* Player die - rising edge */
if (SOUNDVAL_RISING_EDGE(0x01))
@ -299,7 +299,7 @@ static const samples_interface speedfrk_samples_interface =
static void speedfrk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
/* on the falling edge of bit 0x08, clock the inverse of bit 0x04 into the top of the shiftreg */
if (SOUNDVAL_FALLING_EDGE(0x08))
@ -365,7 +365,7 @@ static const samples_interface starhawk_samples_interface =
static void starhawk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
/* explosion - falling edge */
if (SOUNDVAL_FALLING_EDGE(0x01))
@ -442,7 +442,7 @@ static const samples_interface sundance_samples_interface =
static void sundance_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
/* bong - falling edge */
if (SOUNDVAL_FALLING_EDGE(0x01))
@ -516,7 +516,7 @@ static void tailg_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_
/* the falling edge of bit 0x10 clocks bit 0x08 into the mux selected by bits 0x07 */
if (SOUNDVAL_FALLING_EDGE(0x10))
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
/* update the shift register (actually just a simple mux) */
current_shift = (current_shift & ~(1 << (sound_val & 7))) | (((sound_val >> 3) & 1) << (sound_val & 7));
@ -602,7 +602,7 @@ static const samples_interface warrior_samples_interface =
static void warrior_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
/* normal level - 0=on, 1=off */
if (SOUNDVAL_FALLING_EDGE(0x01))
@ -674,7 +674,7 @@ static const samples_interface armora_samples_interface =
static void armora_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x10))
@ -776,7 +776,7 @@ static const samples_interface ripoff_samples_interface =
static void ripoff_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
/* on the rising edge of bit 0x02, clock bit 0x01 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x02))
@ -864,7 +864,7 @@ static const samples_interface starcas_samples_interface =
static void starcas_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@ -978,7 +978,7 @@ static const samples_interface solarq_samples_interface =
static void solarq_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
static float target_volume, current_volume;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@ -1119,7 +1119,7 @@ static const samples_interface boxingb_samples_interface =
static void boxingb_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x10))
@ -1251,7 +1251,7 @@ static const samples_interface wotw_samples_interface =
static void wotw_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@ -1365,7 +1365,7 @@ static const samples_interface wotwc_samples_interface =
static void wotwc_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@ -1554,7 +1554,7 @@ static MACHINE_RESET( demon_sound )
last_portb_write = 0xff;
/* turn off channel A on AY8910 #0 because it is used as a low-pass filter */
ay8910_set_volume(devtag_get_device(machine, "ay1"), 0, 0);
ay8910_set_volume(machine->device("ay1"), 0, 0);
}
@ -1623,7 +1623,7 @@ MACHINE_DRIVER_END
static WRITE8_HANDLER( qb3_sound_w )
{
UINT16 rega = cpu_get_reg(devtag_get_device(space->machine, "maincpu"), CCPU_A);
UINT16 rega = cpu_get_reg(space->machine->device("maincpu"), CCPU_A);
demon_sound_w(space->machine, 0x00 | (~rega & 0x0f), 0x10);
}

View File

@ -154,7 +154,7 @@ WRITE16_HANDLER( cyberbal_sound_68k_w )
WRITE16_HANDLER( cyberbal_sound_68k_dac_w )
{
cyberbal_state *state = (cyberbal_state *)space->machine->driver_data;
running_device *dac = devtag_get_device(space->machine, (offset & 8) ? "dac2" : "dac1");
running_device *dac = space->machine->device((offset & 8) ? "dac2" : "dac1");
dac_data_16_w(dac, (((data >> 3) & 0x800) | ((data >> 2) & 0x7ff)) << 4);
if (state->fast_68k_int)

View File

@ -56,7 +56,7 @@ enum
WRITE8_HANDLER( depthch_audio_w )
{
static int port1State = 0;
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
int bitsChanged;
int bitsGoneHigh;
int bitsGoneLow;

View File

@ -114,7 +114,7 @@ static double freq_to_step;
static WRITE_LINE_DEVICE_HANDLER( update_irq_state )
{
running_device *pia = devtag_get_device(device->machine, "pia1");
running_device *pia = device->machine->device("pia1");
cputag_set_input_line(device->machine, "audiocpu", M6502_IRQ_LINE, (pia6821_get_irq_b(pia) | riot_irq_state) ? ASSERT_LINE : CLEAR_LINE);
}
@ -462,7 +462,7 @@ static WRITE8_DEVICE_HANDLER( r6532_porta_w )
if (has_tms5220)
{
running_device *tms = devtag_get_device(device->machine, "tms");
running_device *tms = device->machine->device("tms");
logerror("(%f)%s:TMS5220 data write = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpuexec_describe_context(device->machine), riot6532_porta_out_get(riot));
tms5220_data_w(tms, 0, data);
}
@ -472,7 +472,7 @@ static READ8_DEVICE_HANDLER( r6532_porta_r )
{
if (has_tms5220)
{
running_device *tms = devtag_get_device(device->machine, "tms");
running_device *tms = device->machine->device("tms");
logerror("(%f)%s:TMS5220 status read = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpuexec_describe_context(device->machine), tms5220_status_r(tms, 0));
return tms5220_status_r(tms, 0);
}
@ -484,7 +484,7 @@ static WRITE8_DEVICE_HANDLER( r6532_portb_w )
{
if (has_tms5220)
{
running_device *tms = devtag_get_device(device->machine, "tms");
running_device *tms = device->machine->device("tms");
tms5220_rsq_w(tms, data & 0x01);
tms5220_wsq_w(tms, (data >> 1) & 0x01);
@ -497,7 +497,7 @@ static READ8_DEVICE_HANDLER( r6532_portb_r )
UINT8 newdata = riot6532_portb_in_get(device);
if (has_tms5220)
{
running_device *tms = devtag_get_device(device->machine, "tms");
running_device *tms = device->machine->device("tms");
newdata &= ~0x0c;
if (tms5220_readyq_r(tms)) newdata |= 0x04;
if (tms5220_intq_r(tms)) newdata |= 0x08;
@ -764,13 +764,13 @@ static DEVICE_START( venture_common_sh_start )
DEVICE_START_CALL(common_sh_start);
riot = devtag_get_device(machine, "riot");
riot = machine->device("riot");
has_sh8253 = TRUE;
has_tms5220 = FALSE;
/* determine which sound hardware is installed */
has_mc3417 = (devtag_get_device(device->machine, "cvsd") != NULL);
has_mc3417 = (device->machine->device("cvsd") != NULL);
/* 8253 */
freq_to_step = (double)(1 << 24) / (double)SH8253_CLOCK;
@ -860,7 +860,7 @@ MACHINE_DRIVER_END
static WRITE8_HANDLER( mtrap_voiceio_w )
{
if (!(offset & 0x10))
hc55516_digit_w(devtag_get_device(space->machine, "cvsd"), data & 1);
hc55516_digit_w(space->machine->device("cvsd"), data & 1);
if (!(offset & 0x20))
riot6532_portb_in_set(riot, data & 1, 0xff);
@ -879,7 +879,7 @@ static READ8_HANDLER( mtrap_voiceio_r )
}
if (!(offset & 0x40))
return hc55516_clock_state_r(devtag_get_device(space->machine, "cvsd")) << 7;
return hc55516_clock_state_r(space->machine->device("cvsd")) << 7;
return 0;
}
@ -925,7 +925,7 @@ static UINT8 victory_sound_response_ack_clk; /* 7474 @ F4 */
READ8_HANDLER( victory_sound_response_r )
{
running_device *pia1 = devtag_get_device(space->machine, "pia1");
running_device *pia1 = space->machine->device("pia1");
UINT8 ret = pia6821_get_output_b(pia1);
if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound response read = %02X\n", cpu_get_previouspc(space->cpu), ret);
@ -938,7 +938,7 @@ READ8_HANDLER( victory_sound_response_r )
READ8_HANDLER( victory_sound_status_r )
{
running_device *pia1 = devtag_get_device(space->machine, "pia1");
running_device *pia1 = space->machine->device("pia1");
UINT8 ret = (pia6821_ca1_r(pia1, 0) << 7) | (pia6821_cb1_r(pia1, 0) << 6);
if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound status read = %02X\n", cpu_get_previouspc(space->cpu), ret);
@ -949,7 +949,7 @@ READ8_HANDLER( victory_sound_status_r )
static TIMER_CALLBACK( delayed_command_w )
{
running_device *pia1 = devtag_get_device(machine, "pia1");
running_device *pia1 = machine->device("pia1");
pia6821_set_input_a(pia1, param, 0);
pia6821_ca1_w(pia1, 0, 0);
}
@ -1010,7 +1010,7 @@ static DEVICE_START( victory_sound )
static DEVICE_RESET( victory_sound )
{
running_device *pia1 = devtag_get_device(device->machine, "pia1");
running_device *pia1 = device->machine->device("pia1");
DEVICE_RESET_CALL(common_sh_reset);
pia1->reset();

View File

@ -116,7 +116,7 @@ static int plural = 0;
READ8_HANDLER( gorf_speech_r )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
int Phoneme,Intonation;
int i = 0;
@ -182,6 +182,6 @@ READ8_HANDLER( gorf_speech_r )
CUSTOM_INPUT( gorf_speech_status_r )
{
running_device *samples = devtag_get_device(field->port->machine, "samples");
running_device *samples = field->port->machine->device("samples");
return !sample_playing(samples, 0);
}

View File

@ -55,7 +55,7 @@ static void trigger_sample(running_device *samples, UINT8 data);
WRITE8_HANDLER( gottlieb_sh_w )
{
running_device *riot = devtag_get_device(space->machine, "riot");
running_device *riot = space->machine->device("riot");
/* identify rev1 boards by the presence of a 6532 RIOT device */
if (riot != NULL)
@ -74,7 +74,7 @@ WRITE8_HANDLER( gottlieb_sh_w )
static void gottlieb1_sh_w(running_device *riot, UINT8 data)
{
running_device *samples = devtag_get_device(riot->machine, "samples");
running_device *samples = riot->machine->device("samples");
int pa7 = (data & 0x0f) != 0xf;
int pa0_5 = ~data & 0x3f;
@ -196,7 +196,7 @@ static void trigger_sample(running_device *samples, UINT8 data)
#ifdef UNUSED_FUNCTION
void gottlieb_knocker(running_machine *machine)
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
if (!strcmp(machine->gamedrv->name,"reactor")) /* reactor */
{
}
@ -244,7 +244,7 @@ logerror("Votrax: intonation %d, phoneme %02x %s\n",data >> 6,data & 0x3f,Phonem
{
if (votrax_queuepos > 1)
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
int last = -1;
int i;
char phonemes[200];
@ -469,7 +469,7 @@ static WRITE8_HANDLER( nmi_rate_w )
static CUSTOM_INPUT( speech_drq_custom_r )
{
return sp0250_drq_r(devtag_get_device(field->port->machine, "spsnd"));
return sp0250_drq_r(field->port->machine->device("spsnd"));
}
@ -497,7 +497,7 @@ static WRITE8_HANDLER( speech_control_w )
{
/* bit 3 selects which of the two 8913 to enable */
/* bit 4 goes to the 8913 BC1 pin */
running_device *ay = devtag_get_device(space->machine, (data & 0x08) ? "ay1" : "ay2");
running_device *ay = space->machine->device((data & 0x08) ? "ay1" : "ay2");
ay8910_data_address_w(ay, data >> 4, *psg_latch);
}
@ -506,7 +506,7 @@ static WRITE8_HANDLER( speech_control_w )
/* bit 6 = speech chip DATA PRESENT pin; high then low to make the chip read data */
if ((previous & 0x40) == 0 && (data & 0x40) != 0)
{
running_device *sp = devtag_get_device(space->machine, "spsnd");
running_device *sp = space->machine->device("spsnd");
sp0250_w(sp, 0, *sp0250_latch);
}

View File

@ -91,7 +91,7 @@ DEVICE_GET_INFO( gridlee_sound )
WRITE8_HANDLER( gridlee_sound_w )
{
static UINT8 sound_data[24];
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
stream_update(gridlee_stream);

View File

@ -66,7 +66,7 @@ enum
WRITE8_HANDLER( invinco_audio_w )
{
static int port2State = 0;
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
int bitsChanged;
//int bitsGoneHigh;
int bitsGoneLow;

View File

@ -22,10 +22,10 @@ static SOUND_START( irem_audio )
{
irem_z80_state *state = (irem_z80_state *)machine->driver_data;
state->adpcm1 = devtag_get_device(machine, "msm1");
state->adpcm2 = devtag_get_device(machine, "msm2");
state->ay1 = devtag_get_device(machine, "ay1");
state->ay2 = devtag_get_device(machine, "ay2");
state->adpcm1 = machine->device("msm1");
state->adpcm2 = machine->device("msm2");
state->ay1 = machine->device("ay1");
state->ay2 = machine->device("ay2");
state_save_register_global(machine, state->port1);
state_save_register_global(machine, state->port2);

View File

@ -339,11 +339,11 @@ WRITE32_HANDLER( jaguar_jerry_regs32_w )
static WRITE32_HANDLER( dsp_flags_w )
{
/* write the data through */
jaguardsp_ctrl_w(devtag_get_device(space->machine, "audiocpu"), offset, data, mem_mask);
jaguardsp_ctrl_w(space->machine->device("audiocpu"), offset, data, mem_mask);
/* if they were clearing the A2S interrupt, see if we are headed for the spin */
/* loop with R22 != 0; if we are, just start spinning again */
if (space->cpu == devtag_get_device(space->machine, "audiocpu") && ACCESSING_BITS_8_15 && (data & 0x400))
if (space->cpu == space->machine->device("audiocpu") && ACCESSING_BITS_8_15 && (data & 0x400))
{
/* see if we're going back to the spin loop */
if (!(data & 0x04000) && cpu_get_reg(space->cpu, JAGUAR_R22) != 0)
@ -416,12 +416,12 @@ WRITE32_HANDLER( jaguar_serial_w )
{
/* right DAC */
case 2:
dac_signed_data_16_w(devtag_get_device(space->machine, "dac2"), (data & 0xffff) ^ 0x8000);
dac_signed_data_16_w(space->machine->device("dac2"), (data & 0xffff) ^ 0x8000);
break;
/* left DAC */
case 3:
dac_signed_data_16_w(devtag_get_device(space->machine, "dac1"), (data & 0xffff) ^ 0x8000);
dac_signed_data_16_w(space->machine->device("dac1"), (data & 0xffff) ^ 0x8000);
break;
/* frequency register */

View File

@ -147,7 +147,7 @@ static WRITE8_HANDLER( speech_strobe_w )
if ((new_speech_strobe_state != state->speech_strobe_state) && new_speech_strobe_state)
{
running_device *tms = devtag_get_device(space->machine, "tms");
running_device *tms = space->machine->device("tms");
tms5220_data_w(tms, 0, *state->speech_data);
}
state->speech_strobe_state = new_speech_strobe_state;
@ -156,7 +156,7 @@ static WRITE8_HANDLER( speech_strobe_w )
static READ8_HANDLER( speech_ready_r )
{
return (tms5220_readyq_r(devtag_get_device(space->machine, "tms"))) << 7;
return (tms5220_readyq_r(space->machine->device("tms"))) << 7;
}

View File

@ -518,7 +518,7 @@ static DEVICE_START( common_sh_start )
int i;
/* determine which sound hardware is installed */
has_ym2151 = (devtag_get_device(device->machine, "ymsnd") != NULL);
has_ym2151 = (device->machine->device("ymsnd") != NULL);
/* allocate separate streams for the DMA and non-DMA DACs */
dma_stream = stream_create(device, 0, 1, OUTPUT_RATE, (void *)dmaspace, leland_80186_dma_update);
@ -2049,7 +2049,7 @@ static READ16_HANDLER( peripheral_r )
if (!has_ym2151)
return pit8254_r(space, offset | 0x40, mem_mask);
else
return ym2151_r(devtag_get_device(space->machine, "ymsnd"), offset);
return ym2151_r(space->machine->device("ymsnd"), offset);
case 4:
if (is_redline)
@ -2085,7 +2085,7 @@ static WRITE16_HANDLER( peripheral_w )
if (!has_ym2151)
pit8254_w(space, offset | 0x40, data, mem_mask);
else
ym2151_w(devtag_get_device(space->machine, "ymsnd"), offset, data);
ym2151_w(space->machine->device("ymsnd"), offset, data);
break;
case 4:

View File

@ -466,7 +466,7 @@ static void set_ea(const address_space *space, int ea)
static SOUND_START( mario )
{
mario_state *state = (mario_state *)machine->driver_data;
running_device *audiocpu = devtag_get_device(machine, "audiocpu");
running_device *audiocpu = machine->device("audiocpu");
#if USE_8039
UINT8 *SND = memory_region(machine, "audiocpu");
@ -629,7 +629,7 @@ WRITE8_HANDLER( mario_sh3_w )
I8035_P1_W_AH(space,3,data & 1);
break;
case 7: /* skid */
discrete_sound_w(devtag_get_device(space->machine, "discrete"),DS_SOUND7_INP,data & 1);
discrete_sound_w(space->machine->device("discrete"),DS_SOUND7_INP,data & 1);
break;
}
}

View File

@ -108,7 +108,7 @@ void mcr_sound_init(running_machine *machine, UINT8 config)
/* SSIO */
if (mcr_sound_config & MCR_SSIO)
{
ssio_sound_cpu = devtag_get_device(machine, "ssiocpu");
ssio_sound_cpu = machine->device("ssiocpu");
ssio_compute_ay8910_modulation(machine);
state_save_register_global_array(machine, ssio_data);
state_save_register_global(machine, ssio_status);
@ -121,28 +121,28 @@ void mcr_sound_init(running_machine *machine, UINT8 config)
/* Turbo Chip Squeak */
if (mcr_sound_config & MCR_TURBO_CHIP_SQUEAK)
{
turbocs_sound_cpu = devtag_get_device(machine, "tcscpu");
turbocs_sound_cpu = machine->device("tcscpu");
state_save_register_global(machine, turbocs_status);
}
/* Chip Squeak Deluxe */
if (mcr_sound_config & MCR_CHIP_SQUEAK_DELUXE)
{
csdeluxe_sound_cpu = devtag_get_device(machine, "csdcpu");
csdeluxe_sound_cpu = machine->device("csdcpu");
state_save_register_global(machine, csdeluxe_status);
}
/* Sounds Good */
if (mcr_sound_config & MCR_SOUNDS_GOOD)
{
soundsgood_sound_cpu = devtag_get_device(machine, "sgcpu");
soundsgood_sound_cpu = machine->device("sgcpu");
state_save_register_global(machine, soundsgood_status);
}
/* Squawk n Talk */
if (mcr_sound_config & MCR_SQUAWK_N_TALK)
{
squawkntalk_sound_cpu = devtag_get_device(machine, "sntcpu");
squawkntalk_sound_cpu = machine->device("sntcpu");
state_save_register_global(machine, squawkntalk_tms_command);
state_save_register_global(machine, squawkntalk_tms_strobes);
}
@ -316,8 +316,8 @@ static TIMER_CALLBACK( ssio_delayed_data_w )
static void ssio_update_volumes(running_machine *machine)
{
running_device *ay0 = devtag_get_device(machine, "ssio.1");
running_device *ay1 = devtag_get_device(machine, "ssio.2");
running_device *ay0 = machine->device("ssio.1");
running_device *ay1 = machine->device("ssio.2");
ay8910_set_volume(ay0, 0, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][0]]);
ay8910_set_volume(ay0, 1, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][1]]);
ay8910_set_volume(ay0, 2, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][2]]);
@ -491,7 +491,7 @@ MACHINE_DRIVER_END
static WRITE8_DEVICE_HANDLER( csdeluxe_porta_w )
{
dacval = (dacval & ~0x3fc) | (data << 2);
dac_signed_data_16_w(devtag_get_device(device->machine, "csddac"), dacval << 6);
dac_signed_data_16_w(device->machine->device("csddac"), dacval << 6);
}
static WRITE8_DEVICE_HANDLER( csdeluxe_portb_w )
@ -499,7 +499,7 @@ static WRITE8_DEVICE_HANDLER( csdeluxe_portb_w )
UINT8 z_mask = pia6821_get_port_b_z_mask(device);
dacval = (dacval & ~0x003) | (data >> 6);
dac_signed_data_16_w(devtag_get_device(device->machine, "csddac"), dacval << 6);
dac_signed_data_16_w(device->machine->device("csddac"), dacval << 6);
if (~z_mask & 0x10) csdeluxe_status = (csdeluxe_status & ~1) | ((data >> 4) & 1);
if (~z_mask & 0x20) csdeluxe_status = (csdeluxe_status & ~2) | ((data >> 4) & 2);
@ -514,7 +514,7 @@ static WRITE_LINE_DEVICE_HANDLER( csdeluxe_irq )
static TIMER_CALLBACK( csdeluxe_delayed_data_w )
{
running_device *pia = devtag_get_device(machine, "csdpia");
running_device *pia = machine->device("csdpia");
pia6821_portb_w(pia, 0, param & 0x0f);
pia6821_ca1_w(pia, 0, ~param & 0x10);
@ -629,7 +629,7 @@ MACHINE_DRIVER_END
static WRITE8_DEVICE_HANDLER( soundsgood_porta_w )
{
dacval = (dacval & ~0x3fc) | (data << 2);
dac_signed_data_16_w(devtag_get_device(device->machine, "sgdac"), dacval << 6);
dac_signed_data_16_w(device->machine->device("sgdac"), dacval << 6);
}
static WRITE8_DEVICE_HANDLER( soundsgood_portb_w )
@ -637,7 +637,7 @@ static WRITE8_DEVICE_HANDLER( soundsgood_portb_w )
UINT8 z_mask = pia6821_get_port_b_z_mask(device);
dacval = (dacval & ~0x003) | (data >> 6);
dac_signed_data_16_w(devtag_get_device(device->machine, "sgdac"), dacval << 6);
dac_signed_data_16_w(device->machine->device("sgdac"), dacval << 6);
if (~z_mask & 0x10) soundsgood_status = (soundsgood_status & ~1) | ((data >> 4) & 1);
if (~z_mask & 0x20) soundsgood_status = (soundsgood_status & ~2) | ((data >> 4) & 2);
@ -652,7 +652,7 @@ static WRITE_LINE_DEVICE_HANDLER( soundsgood_irq )
static TIMER_CALLBACK( soundsgood_delayed_data_w )
{
running_device *pia = devtag_get_device(machine, "sgpia");
running_device *pia = machine->device("sgpia");
pia6821_portb_w(pia, 0, (param >> 1) & 0x0f);
pia6821_ca1_w(pia, 0, ~param & 0x01);
@ -737,13 +737,13 @@ MACHINE_DRIVER_END
static WRITE8_DEVICE_HANDLER( turbocs_porta_w )
{
dacval = (dacval & ~0x3fc) | (data << 2);
dac_signed_data_16_w(devtag_get_device(device->machine, "tcsdac"), dacval << 6);
dac_signed_data_16_w(device->machine->device("tcsdac"), dacval << 6);
}
static WRITE8_DEVICE_HANDLER( turbocs_portb_w )
{
dacval = (dacval & ~0x003) | (data >> 6);
dac_signed_data_16_w(devtag_get_device(device->machine, "tcsdac"), dacval << 6);
dac_signed_data_16_w(device->machine->device("tcsdac"), dacval << 6);
turbocs_status = (data >> 4) & 3;
}
@ -756,7 +756,7 @@ static WRITE_LINE_DEVICE_HANDLER( turbocs_irq )
static TIMER_CALLBACK( turbocs_delayed_data_w )
{
running_device *pia = devtag_get_device(machine, "tcspia");
running_device *pia = machine->device("tcspia");
pia6821_portb_w(pia, 0, (param >> 1) & 0x0f);
pia6821_ca1_w(pia, 0, ~param & 0x01);
@ -853,7 +853,7 @@ static WRITE8_DEVICE_HANDLER( squawkntalk_porta2_w )
static WRITE8_DEVICE_HANDLER( squawkntalk_portb2_w )
{
running_device *tms = devtag_get_device(device->machine, "sntspeech");
running_device *tms = device->machine->device("sntspeech");
/* bits 0-1 select read/write strobes on the TMS5200 */
data &= 0x03;
@ -884,8 +884,8 @@ static WRITE8_DEVICE_HANDLER( squawkntalk_portb2_w )
static WRITE_LINE_DEVICE_HANDLER( squawkntalk_irq )
{
running_device *pia0 = devtag_get_device(device->machine, "sntpia0");
running_device *pia1 = devtag_get_device(device->machine, "sntpia1");
running_device *pia0 = device->machine->device("sntpia0");
running_device *pia1 = device->machine->device("sntpia1");
int combined_state = pia6821_get_irq_a(pia0) | pia6821_get_irq_b(pia0) | pia6821_get_irq_a(pia1) | pia6821_get_irq_b(pia1);
cpu_set_input_line(squawkntalk_sound_cpu, M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
@ -893,7 +893,7 @@ static WRITE_LINE_DEVICE_HANDLER( squawkntalk_irq )
static TIMER_CALLBACK( squawkntalk_delayed_data_w )
{
running_device *pia0 = devtag_get_device(machine, "sntpia0");
running_device *pia0 = machine->device("sntpia0");
pia6821_porta_w(pia0, 0, ~param & 0x0f);
pia6821_cb1_w(pia0, 0, ~param & 0x10);

View File

@ -60,7 +60,7 @@ SAMPLES_START( meadows_sh_start )
/************************************/
void meadows_sh_update(running_machine *machine)
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
int preset, amp;
if (latched_0c01 != meadows_0c01 || latched_0c03 != meadows_0c03)
@ -68,7 +68,7 @@ void meadows_sh_update(running_machine *machine)
/* amplitude is a combination of the upper 4 bits of 0c01 */
/* and bit 4 merged from S2650's flag output */
amp = ((meadows_0c03 & ENABLE_CTR1) == 0) ? 0 : (meadows_0c01 & 0xf0) >> 1;
if( cpu_get_reg(devtag_get_device(machine, "maincpu"), S2650_FO) )
if( cpu_get_reg(machine->device("maincpu"), S2650_FO) )
amp += 0x80;
/* calculate frequency for counter #1 */
/* bit 0..3 of 0c01 are ctr preset */
@ -104,9 +104,9 @@ void meadows_sh_update(running_machine *machine)
dac_enable = meadows_0c03 & ENABLE_DAC;
if (dac_enable)
dac_data_w(devtag_get_device(machine, "dac"), meadows_dac);
dac_data_w(machine->device("dac"), meadows_dac);
else
dac_data_w(devtag_get_device(machine, "dac"), 0);
dac_data_w(machine->device("dac"), 0);
}
latched_0c01 = meadows_0c01;
@ -121,9 +121,9 @@ void meadows_sh_dac_w(running_machine *machine, int data)
{
meadows_dac = data;
if (dac_enable)
dac_data_w(devtag_get_device(machine, "dac"), meadows_dac);
dac_data_w(machine->device("dac"), meadows_dac);
else
dac_data_w(devtag_get_device(machine, "dac"), 0);
dac_data_w(machine->device("dac"), 0);
}

View File

@ -185,7 +185,7 @@ void micro3d_noise_sh_w(running_machine *machine, UINT8 data)
if (~data & 8)
{
running_device *device = devtag_get_device(machine, data & 4 ? "noise_2" : "noise_1");
running_device *device = machine->device(data & 4 ? "noise_2" : "noise_1");
noise_state *nstate = (noise_state *)downcast<legacy_device_base *>(device)->token();
if (state->dac_data != nstate->dac[data & 3])
@ -397,7 +397,7 @@ WRITE8_HANDLER( micro3d_sound_io_w )
}
case 0x03:
{
running_device *upd = devtag_get_device(space->machine, "upd7759");
running_device *upd = space->machine->device("upd7759");
upd7759_set_bank_base(upd, (data & 0x4) ? 0x20000 : 0);
upd7759_reset_w(upd, (data & 0x10) ? 0 : 1);
break;
@ -412,7 +412,7 @@ READ8_HANDLER( micro3d_sound_io_r )
switch (offset)
{
case 0x01: return (state->sound_port_latch[offset] & 0x7f) | input_port_read(space->machine, "SOUND_SW");
case 0x03: return (state->sound_port_latch[offset] & 0xf7) | (upd7759_busy_r(devtag_get_device(space->machine, "upd7759")) ? 0x08 : 0);
case 0x03: return (state->sound_port_latch[offset] & 0xf7) | (upd7759_busy_r(space->machine->device("upd7759")) ? 0x08 : 0);
default: return 0;
}
}

View File

@ -159,13 +159,13 @@ static void stop_mono_flop( running_device *sn, int n )
static TIMER_CALLBACK( stop_mono_flop_callback )
{
stop_mono_flop(devtag_get_device(machine, "snsnd"), param);
stop_mono_flop(machine->device("snsnd"), param);
}
static void spacefev_sound_pins_changed( running_machine *machine )
{
running_device *sn = devtag_get_device(machine, "snsnd");
running_device *sn = machine->device("snsnd");
n8080_state *state = (n8080_state *)machine->driver_data;
UINT16 changes = ~state->curr_sound_pins & state->prev_sound_pins;
@ -191,14 +191,14 @@ static void spacefev_sound_pins_changed( running_machine *machine )
}
if (changes & ((1 << 0x2) | (1 << 0x3) | (1 << 0x5)))
{
generic_pulse_irq_line(devtag_get_device(machine, "audiocpu"), 0);
generic_pulse_irq_line(machine->device("audiocpu"), 0);
}
}
static void sheriff_sound_pins_changed( running_machine *machine )
{
running_device *sn = devtag_get_device(machine, "snsnd");
running_device *sn = machine->device("snsnd");
n8080_state *state = (n8080_state *)machine->driver_data;
UINT16 changes = ~state->curr_sound_pins & state->prev_sound_pins;
@ -216,7 +216,7 @@ static void sheriff_sound_pins_changed( running_machine *machine )
}
if (changes & ((1 << 0x2) | (1 << 0x3) | (1 << 0x5)))
{
generic_pulse_irq_line(devtag_get_device(machine, "audiocpu"), 0);
generic_pulse_irq_line(machine->device("audiocpu"), 0);
}
}
@ -232,7 +232,7 @@ static void helifire_sound_pins_changed( running_machine *machine )
if (changes & (1 << 6))
{
generic_pulse_irq_line(devtag_get_device(machine, "audiocpu"), 0);
generic_pulse_irq_line(machine->device("audiocpu"), 0);
}
}
@ -403,14 +403,14 @@ static READ8_HANDLER( helifire_8035_p2_r )
static WRITE8_HANDLER( n8080_dac_w )
{
dac_data_w(devtag_get_device(space->machine, "dac"), data & 0x80);
dac_data_w(space->machine->device("dac"), data & 0x80);
}
static WRITE8_HANDLER( helifire_dac_w )
{
n8080_state *state = (n8080_state *)space->machine->driver_data;
dac_data_w(devtag_get_device(space->machine, "dac"), data * state->helifire_dac_volume);
dac_data_w(space->machine->device("dac"), data * state->helifire_dac_volume);
}
@ -437,7 +437,7 @@ static WRITE8_HANDLER( helifire_sound_ctrl_w )
static TIMER_DEVICE_CALLBACK( spacefev_vco_voltage_timer )
{
running_device *sn = devtag_get_device(timer.machine, "snsnd");
running_device *sn = timer.machine->device("snsnd");
n8080_state *state = (n8080_state *)timer.machine->driver_data;
double voltage = 0;

View File

@ -210,7 +210,7 @@ static DEVICE_START( namco_52xx )
/* find the attached discrete sound device */
assert(intf->discrete != NULL);
state->discrete = devtag_get_device(device->machine, intf->discrete);
state->discrete = device->machine->device(intf->discrete);
assert(state->discrete != NULL);
state->basenode = intf->firstnode;

View File

@ -174,7 +174,7 @@ static DEVICE_START( namco_54xx )
/* find the attached discrete sound device */
assert(config->discrete != NULL);
state->discrete = devtag_get_device(device->machine, config->discrete);
state->discrete = device->machine->device(config->discrete);
assert(state->discrete != NULL);
state->basenode = config->firstnode;
}

View File

@ -88,7 +88,7 @@ void namcoc7x_on_driver_init(running_machine *machine)
memset(pROM, 0, 4);
// install speedup cheat
for (cpu = devtag_get_device(machine, "maincpu"); cpu != NULL; cpu = cpu->typenext())
for (cpu = machine->device("maincpu"); cpu != NULL; cpu = cpu->typenext())
if (cpu->type() == M37702)
memory_install_readwrite16_handler(cpu_get_address_space(cpu, ADDRESS_SPACE_PROGRAM), 0x82, 0x83, 0, 0, speedup_r, speedup_w);
}

View File

@ -511,7 +511,7 @@ WRITE8_DEVICE_HANDLER( phoenix_sound_control_b_w )
discrete_sound_w(device, PHOENIX_EFFECT_1_FREQ, data & 0x10);
/* update the tune that the MM6221AA is playing */
mm6221aa_tune_w(devtag_get_device(device->machine, "tms"), data >> 6);
mm6221aa_tune_w(device->machine->device("tms"), data >> 6);
}
static DEVICE_START( phoenix_sound )

View File

@ -436,7 +436,7 @@ WRITE8_HANDLER( pleiads_sound_control_b_w )
if (pitch == 3)
pitch = 2; /* 2 and 3 are the same */
tms36xx_note_w(devtag_get_device(space->machine, "tms"), pitch, note);
tms36xx_note_w(space->machine->device("tms"), pitch, note);
stream_update(channel);
sound_latch_b = data;

View File

@ -48,7 +48,7 @@ void polyplay_set_channel2(int active)
void polyplay_play_channel1(running_machine *machine, int data)
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
if (data) {
freq1 = 2457600 / 16 / data / 8;
sample_set_volume(samples, 0, channel_playing1 * 1.0);
@ -62,7 +62,7 @@ void polyplay_play_channel1(running_machine *machine, int data)
void polyplay_play_channel2(running_machine *machine, int data)
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
if (data) {
freq2 = 2457600 / 16 / data / 8;
sample_set_volume(samples, 1, channel_playing2 * 1.0);

View File

@ -88,7 +88,7 @@ static int port1State = 0;
WRITE8_HANDLER( pulsar_audio_1_w )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
int bitsChanged;
//int bitsGoneHigh;
int bitsGoneLow;
@ -139,7 +139,7 @@ WRITE8_HANDLER( pulsar_audio_1_w )
WRITE8_HANDLER( pulsar_audio_2_w )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
static int port2State = 0;
int bitsChanged;
int bitsGoneHigh;

View File

@ -170,13 +170,13 @@ WRITE8_HANDLER( redalert_voice_command_w )
static WRITE_LINE_DEVICE_HANDLER( sod_callback )
{
hc55516_digit_w(devtag_get_device(device->machine, "cvsd"), state);
hc55516_digit_w(device->machine->device("cvsd"), state);
}
static READ_LINE_DEVICE_HANDLER( sid_callback )
{
return hc55516_clock_state_r(devtag_get_device(device->machine, "cvsd"));
return hc55516_clock_state_r(device->machine->device("cvsd"));
}
@ -309,8 +309,8 @@ static READ8_DEVICE_HANDLER( demoneye_ay8910_latch_2_r )
static WRITE8_DEVICE_HANDLER( demoneye_ay8910_data_w )
{
running_device *ay1 = devtag_get_device(device->machine, "ay1");
running_device *ay2 = devtag_get_device(device->machine, "ay2");
running_device *ay1 = device->machine->device("ay1");
running_device *ay2 = device->machine->device("ay2");
switch (ay8910_latch_1 & 0x03)
{

View File

@ -79,7 +79,7 @@ READ8_DEVICE_HANDLER( frogger_portB_r )
WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w )
{
running_device *target = devtag_get_device(device->machine, "konami_7474");
running_device *target = device->machine->device("konami_7474");
/* the complement of bit 3 is connected to the flip-flop's clock */
ttl7474_clock_w(target, (~data & 0x08) >> 3);
@ -90,7 +90,7 @@ WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w )
WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w )
{
running_device *target = devtag_get_device(device->machine, "konami_7474");
running_device *target = device->machine->device("konami_7474");
/* the complement of bit 3 is connected to the flip-flop's clock */
ttl7474_clock_w(target, (~data & 0x08) >> 3);
@ -98,7 +98,7 @@ WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w )
static IRQ_CALLBACK(scramble_sh_irq_callback)
{
running_device *target = devtag_get_device(device->machine, "konami_7474");
running_device *target = device->machine->device("konami_7474");
/* interrupt acknowledge clears the flip-flop --
we need to pulse the CLR line because MAME's core never clears this
@ -144,27 +144,27 @@ static void filter_w(running_device *device, int data)
WRITE8_HANDLER( scramble_filter_w )
{
filter_w(devtag_get_device(space->machine, "filter.1.0"), (offset >> 0) & 3);
filter_w(devtag_get_device(space->machine, "filter.1.1"), (offset >> 2) & 3);
filter_w(devtag_get_device(space->machine, "filter.1.2"), (offset >> 4) & 3);
filter_w(devtag_get_device(space->machine, "filter.0.0"), (offset >> 6) & 3);
filter_w(devtag_get_device(space->machine, "filter.0.1"), (offset >> 8) & 3);
filter_w(devtag_get_device(space->machine, "filter.0.2"), (offset >> 10) & 3);
filter_w(space->machine->device("filter.1.0"), (offset >> 0) & 3);
filter_w(space->machine->device("filter.1.1"), (offset >> 2) & 3);
filter_w(space->machine->device("filter.1.2"), (offset >> 4) & 3);
filter_w(space->machine->device("filter.0.0"), (offset >> 6) & 3);
filter_w(space->machine->device("filter.0.1"), (offset >> 8) & 3);
filter_w(space->machine->device("filter.0.2"), (offset >> 10) & 3);
}
WRITE8_HANDLER( frogger_filter_w )
{
filter_w(devtag_get_device(space->machine, "filter.0.0"), (offset >> 6) & 3);
filter_w(devtag_get_device(space->machine, "filter.0.1"), (offset >> 8) & 3);
filter_w(devtag_get_device(space->machine, "filter.0.2"), (offset >> 10) & 3);
filter_w(space->machine->device("filter.0.0"), (offset >> 6) & 3);
filter_w(space->machine->device("filter.0.1"), (offset >> 8) & 3);
filter_w(space->machine->device("filter.0.2"), (offset >> 10) & 3);
}
void scramble_sh_init(running_machine *machine)
{
cpu_set_irq_callback(devtag_get_device(machine, "audiocpu"), scramble_sh_irq_callback);
cpu_set_irq_callback(machine->device("audiocpu"), scramble_sh_irq_callback);
/* PR is always 0, D is always 1 */
ttl7474_d_w(devtag_get_device(machine, "konami_7474"), 1);
ttl7474_d_w(machine->device("konami_7474"), 1);
}

View File

@ -246,7 +246,7 @@ WRITE8_HANDLER( astrob_sound_w )
{
120.0f, 82.0f, 62.0f, 56.0f, 47.0f, 39.0f, 33.0f, 27.0f, 24.0f, 22.0f
};
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
float freq_factor;
UINT8 diff = data ^ sound_state[offset];
@ -478,7 +478,7 @@ static SOUND_START( 005 )
static WRITE8_DEVICE_HANDLER( sega005_sound_a_w )
{
running_device *samples = devtag_get_device(device->machine, "samples");
running_device *samples = device->machine->device("samples");
UINT8 diff = data ^ sound_state[0];
sound_state[0] = data;
@ -706,7 +706,7 @@ static SOUND_START( spaceod )
WRITE8_HANDLER( spaceod_sound_w )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
UINT8 diff = data ^ sound_state[offset];
sound_state[offset] = data;
@ -891,7 +891,7 @@ static SOUND_START( monsterb )
static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w )
{
running_device *tms = devtag_get_device(device->machine, "music");
running_device *tms = device->machine->device("music");
int enable_val;
/* Lower four data lines get decoded into 13 control lines */
@ -912,7 +912,7 @@ static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w )
static WRITE8_DEVICE_HANDLER( monsterb_sound_b_w )
{
running_device *samples = devtag_get_device(device->machine, "samples");
running_device *samples = device->machine->device("samples");
UINT8 diff = data ^ sound_state[1];
sound_state[1] = data;

View File

@ -137,7 +137,7 @@ d0 crafts joining
WRITE8_HANDLER( elim1_sh_w )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
data ^= 0xff;
/* Play fireball sample */
@ -171,7 +171,7 @@ WRITE8_HANDLER( elim1_sh_w )
WRITE8_HANDLER( elim2_sh_w )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
data ^= 0xff;
/* Play thrust sample */
@ -198,7 +198,7 @@ WRITE8_HANDLER( elim2_sh_w )
WRITE8_HANDLER( zektor1_sh_w )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
data ^= 0xff;
@ -233,7 +233,7 @@ WRITE8_HANDLER( zektor1_sh_w )
WRITE8_HANDLER( zektor2_sh_w )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
data ^= 0xff;
/* Play thrust sample */
@ -261,7 +261,7 @@ WRITE8_HANDLER( zektor2_sh_w )
WRITE8_HANDLER( spacfury1_sh_w )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
data ^= 0xff;
/* craft growing */
@ -298,7 +298,7 @@ WRITE8_HANDLER( spacfury1_sh_w )
WRITE8_HANDLER( spacfury2_sh_w )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
data ^= 0xff;
/* craft joining */

View File

@ -645,7 +645,7 @@ static DEVICE_START( usb_sound )
int tchan, tgroup;
/* find the CPU we are associated with */
usb.cpu = devtag_get_device(machine, "usbcpu");
usb.cpu = machine->device("usbcpu");
assert(usb.cpu != NULL);
/* allocate work RAM */

View File

@ -334,7 +334,7 @@ MACHINE_RESET( seibu_sound )
int romlength = memory_region_length(machine, "audiocpu");
UINT8 *rom = memory_region(machine, "audiocpu");
sound_cpu = devtag_get_device(machine, "audiocpu");
sound_cpu = machine->device("audiocpu");
update_irq_lines(machine, VECTOR_INIT);
if (romlength > 0x10000)
memory_configure_bank(machine, "bank1", 0, (romlength - 0x10000) / 0x8000, rom + 0x10000, 0x8000);

View File

@ -59,7 +59,7 @@ WRITE8_HANDLER( senjyo_volume_w )
static TIMER_CALLBACK( senjyo_sh_update )
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
/* ctc2 timer single tone generator frequency */
z80ctc_device *ctc = machine->device<z80ctc_device>("z80ctc");

View File

@ -652,7 +652,7 @@ int snk6502_music0_playing(void)
WRITE8_HANDLER( sasuke_sound_w )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
switch (offset)
{
case 0:
@ -718,7 +718,7 @@ WRITE8_HANDLER( sasuke_sound_w )
WRITE8_HANDLER( satansat_sound_w )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
switch (offset)
{
case 0:
@ -781,7 +781,7 @@ WRITE8_HANDLER( satansat_sound_w )
WRITE8_HANDLER( vanguard_sound_w )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
switch (offset)
{
case 0:
@ -827,7 +827,7 @@ WRITE8_HANDLER( vanguard_sound_w )
}
/* SHOT B */
sn76477_enable_w(devtag_get_device(space->machine, "sn76477.2"), (data & 0x40) ? 0 : 1);
sn76477_enable_w(space->machine->device("sn76477.2"), (data & 0x40) ? 0 : 1);
LastPort1 = data;
break;
@ -917,7 +917,7 @@ WRITE8_HANDLER( fantasy_sound_w )
}
/* BOMB */
discrete_sound_w(devtag_get_device(space->machine, "discrete"), FANTASY_BOMB_EN, data & 0x80);
discrete_sound_w(space->machine->device("discrete"), FANTASY_BOMB_EN, data & 0x80);
LastPort1 = data;
break;
@ -1034,7 +1034,7 @@ static void snk6502_speech_w(running_machine *machine, UINT8 data, const UINT16
if ((data & HD38880_CTP) && (data & HD38880_CMV))
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
data &= HD68880_SYBS;
switch (hd38880_cmd)
@ -1053,7 +1053,7 @@ static void snk6502_speech_w(running_machine *machine, UINT8 data, const UINT16
{
if (table[i] && table[i] == hd38880_addr)
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
sample_start(samples, 0, start + i, 0);
break;
}

View File

@ -36,7 +36,7 @@ READ8_HANDLER( spacefb_audio_t1_r )
WRITE8_HANDLER( spacefb_port_1_w )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
cputag_set_input_line(space->machine, "audiocpu", 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);

View File

@ -21,7 +21,7 @@ static running_device *riot;
SOUND_START( starwars )
{
riot = devtag_get_device(machine, "riot");
riot = machine->device("riot");
}
@ -46,7 +46,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(devtag_get_device(device->machine, "tms")) << 2);
return (olddata & 0xc0) | 0x10 | (tms5220_readyq_r(device->machine->device("tms")) << 2);
}

View File

@ -191,7 +191,7 @@ static TIMER_CALLBACK( setirq_callback )
break;
}
cpu = devtag_get_device(machine, CPUTAG_T5182);
cpu = machine->device(CPUTAG_T5182);
if (cpu == NULL)
return;

View File

@ -48,7 +48,7 @@ static WRITE16_HANDLER( f3_es5505_bank_w )
/* mask out unused bits */
data &= max_banks_this_game;
es5505_voice_bank_w(devtag_get_device(space->machine, "ensoniq"),offset,data<<20);
es5505_voice_bank_w(space->machine->device("ensoniq"),offset,data<<20);
}
static WRITE16_HANDLER( f3_volume_w )
@ -74,7 +74,7 @@ static TIMER_DEVICE_CALLBACK( taito_en_timer_callback )
/* Only cause IRQ if the mask is set to allow it */
if (m68681_imr & 0x08)
{
cpu_set_input_line_vector(devtag_get_device(timer.machine, "audiocpu"), 6, vector_reg);
cpu_set_input_line_vector(timer.machine->device("audiocpu"), 6, vector_reg);
cputag_set_input_line(timer.machine, "audiocpu", 6, ASSERT_LINE);
imr_status |= 0x08;
}

View File

@ -290,8 +290,8 @@ static DEVICE_START( tc0140syt )
const tc0140syt_interface *intf = get_interface(device);
/* use the given gfx set */
tc0140syt->mastercpu = devtag_get_device(device->machine, intf->master);
tc0140syt->slavecpu = devtag_get_device(device->machine, intf->slave);
tc0140syt->mastercpu = device->machine->device(intf->master);
tc0140syt->slavecpu = device->machine->device(intf->slave);
state_save_register_device_item(device, 0, tc0140syt->mainmode);
state_save_register_device_item(device, 0, tc0140syt->submode);

View File

@ -61,11 +61,11 @@ static void adjust_sample(running_device *samples, UINT8 freq)
WRITE8_HANDLER( targ_audio_1_w )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
/* CPU music */
if ((data & 0x01) != (port_1_last & 0x01))
dac_data_w(devtag_get_device(space->machine, "dac"),(data & 0x01) * 0xff);
dac_data_w(space->machine->device("dac"),(data & 0x01) * 0xff);
/* shot */
if (FALLING_EDGE(0x02) && !sample_playing(samples, 0)) sample_start(samples, 0,1,0);
@ -114,7 +114,7 @@ WRITE8_HANDLER( targ_audio_2_w )
{
if ((data & 0x01) && !(port_2_last & 0x01))
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
UINT8 *prom = memory_region(space->machine, "targ");
tone_pointer = (tone_pointer + 1) & 0x0f;
@ -128,7 +128,7 @@ WRITE8_HANDLER( targ_audio_2_w )
WRITE8_HANDLER( spectar_audio_2_w )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
adjust_sample(samples, data);
}
@ -147,7 +147,7 @@ static const char *const sample_names[] =
static void common_audio_start(running_machine *machine, int freq)
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
max_freq = freq;
tone_freq = 0;

View File

@ -31,12 +31,12 @@ static SOUND_START( timeplt )
timeplt_state *state = (timeplt_state *)machine->driver_data;
state->soundcpu = machine->device<cpu_device>("tpsound");
state->filter_0_0 = devtag_get_device(machine, "filter.0.0");
state->filter_0_1 = devtag_get_device(machine, "filter.0.1");
state->filter_0_2 = devtag_get_device(machine, "filter.0.2");
state->filter_1_0 = devtag_get_device(machine, "filter.1.0");
state->filter_1_1 = devtag_get_device(machine, "filter.1.1");
state->filter_1_2 = devtag_get_device(machine, "filter.1.2");
state->filter_0_0 = machine->device("filter.0.0");
state->filter_0_1 = machine->device("filter.0.1");
state->filter_0_2 = machine->device("filter.0.2");
state->filter_1_0 = machine->device("filter.1.0");
state->filter_1_1 = machine->device("filter.1.1");
state->filter_1_2 = machine->device("filter.1.2");
state->last_irq_state = 0;
state_save_register_global(machine, state->last_irq_state);

View File

@ -40,7 +40,7 @@ static int last_sound_a;
static TIMER_CALLBACK( update_sound_a )
{
running_device *discrete = devtag_get_device(machine, "discrete");
running_device *discrete = machine->device("discrete");
int data = param;
/* missing short crash sample, but I've never seen it triggered */
@ -73,7 +73,7 @@ if (!((data >> 4) & 1)) mame_printf_debug("/TRIG4\n");
WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
{
#if (!DISCRETE_TEST)
running_device *samples = devtag_get_device(device->machine, "samples");
running_device *samples = device->machine->device("samples");
#endif
turbo_state *state = (turbo_state *)device->machine->driver_data;
UINT8 diff = data ^ state->sound_state[0];
@ -123,7 +123,7 @@ WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
WRITE8_DEVICE_HANDLER( turbo_sound_b_w )
{
running_device *samples = devtag_get_device(device->machine, "samples");
running_device *samples = device->machine->device("samples");
turbo_state *state = (turbo_state *)device->machine->driver_data;
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@ -146,7 +146,7 @@ WRITE8_DEVICE_HANDLER( turbo_sound_b_w )
WRITE8_DEVICE_HANDLER( turbo_sound_c_w )
{
running_device *samples = devtag_get_device(device->machine, "samples");
running_device *samples = device->machine->device("samples");
turbo_state *state = (turbo_state *)device->machine->driver_data;
/* OSEL1-2 */
@ -327,7 +327,7 @@ INLINE void subroc3d_update_volume(running_device *samples, int leftchan, UINT8
WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w )
{
running_device *samples = devtag_get_device(device->machine, "samples");
running_device *samples = device->machine->device("samples");
turbo_state *state = (turbo_state *)device->machine->driver_data;
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@ -383,7 +383,7 @@ WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w )
WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w )
{
running_device *samples = devtag_get_device(device->machine, "samples");
running_device *samples = device->machine->device("samples");
turbo_state *state = (turbo_state *)device->machine->driver_data;
UINT8 diff = data ^ state->sound_state[2];
state->sound_state[2] = data;
@ -508,7 +508,7 @@ static void buckrog_update_samples(turbo_state *state, running_device *samples)
WRITE8_DEVICE_HANDLER( buckrog_sound_a_w )
{
running_device *samples = devtag_get_device(device->machine, "samples");
running_device *samples = device->machine->device("samples");
turbo_state *state = (turbo_state *)device->machine->driver_data;
UINT8 diff = data ^ state->sound_state[0];
state->sound_state[0] = data;
@ -534,7 +534,7 @@ WRITE8_DEVICE_HANDLER( buckrog_sound_a_w )
WRITE8_DEVICE_HANDLER( buckrog_sound_b_w )
{
running_device *samples = devtag_get_device(device->machine, "samples");
running_device *samples = device->machine->device("samples");
turbo_state *state = (turbo_state *)device->machine->driver_data;
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;

View File

@ -412,8 +412,8 @@ WRITE8_DEVICE_HANDLER( bb_ym2_a_w )
WRITE8_DEVICE_HANDLER( bb_ym2_b_w )
{
running_device *ym1 = devtag_get_device(device->machine, "ym1");
running_device *ym2 = devtag_get_device(device->machine, "ym2");
running_device *ym1 = device->machine->device("ym1");
running_device *ym2 = device->machine->device("ym2");
double gain;
stream_update(stream);

View File

@ -132,7 +132,7 @@ MACHINE_DRIVER_END
static TIMER_CALLBACK( frogs_croak_callback )
{
running_device *samples = devtag_get_device(machine, "samples");
running_device *samples = machine->device("samples");
sample_stop(samples, 2);
}
@ -145,8 +145,8 @@ MACHINE_START( frogs_audio )
WRITE8_HANDLER( frogs_audio_w )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *discrete = devtag_get_device(space->machine, "discrete");
running_device *samples = space->machine->device("samples");
running_device *discrete = space->machine->device("discrete");
static int last_croak = 0;
static int last_buzzz = 0;
int new_croak = data & 0x08;
@ -462,7 +462,7 @@ MACHINE_DRIVER_END
WRITE8_HANDLER( headon_audio_w )
{
running_device *discrete = devtag_get_device(space->machine, "discrete");
running_device *discrete = space->machine->device("discrete");
if (discrete == NULL)
return;
discrete_sound_w(discrete, HEADON_HISPEED_PC_EN, data & 0x01);
@ -477,7 +477,7 @@ WRITE8_HANDLER( headon_audio_w )
WRITE8_HANDLER( invho2_audio_w )
{
running_device *discrete = devtag_get_device(space->machine, "discrete");
running_device *discrete = space->machine->device("discrete");
if (discrete == NULL)
return;
discrete_sound_w(discrete, HEADON_HISPEED_PC_EN, data & 0x10);

View File

@ -270,7 +270,7 @@ void williams_cvsd_init(running_machine *machine)
int bank;
/* configure the CPU */
sound_cpu = devtag_get_device(machine, "cvsdcpu");
sound_cpu = machine->device("cvsdcpu");
soundalt_cpu = NULL;
/* configure master CPU banks */
@ -288,7 +288,7 @@ void williams_cvsd_init(running_machine *machine)
memory_set_bank(machine, "bank5", 0);
/* reset the IRQ state */
pia6821_ca1_w(devtag_get_device(machine, "cvsdpia"), 0, 1);
pia6821_ca1_w(machine->device("cvsdpia"), 0, 1);
/* register for save states */
state_save_register_global(machine, williams_sound_int_state);
@ -302,8 +302,8 @@ void williams_narc_init(running_machine *machine)
int bank;
/* configure the CPU */
sound_cpu = devtag_get_device(machine, "narc1cpu");
soundalt_cpu = devtag_get_device(machine, "narc2cpu");
sound_cpu = machine->device("narc1cpu");
soundalt_cpu = machine->device("narc2cpu");
/* configure master CPU banks */
ROM = memory_region(machine, "narc1cpu");
@ -345,7 +345,7 @@ void williams_adpcm_init(running_machine *machine)
UINT8 *ROM;
/* configure the CPU */
sound_cpu = devtag_get_device(machine, "adpcm");
sound_cpu = machine->device("adpcm");
soundalt_cpu = NULL;
/* configure banks */
@ -407,7 +407,7 @@ static void init_audio_state(running_machine *machine)
static void cvsd_ym2151_irq(running_device *device, int state)
{
pia6821_ca1_w(devtag_get_device(device->machine, "cvsdpia"), 0, !state);
pia6821_ca1_w(device->machine->device("cvsdpia"), 0, !state);
}
@ -471,7 +471,7 @@ static WRITE8_DEVICE_HANDLER( cvsd_clock_set_w )
static TIMER_CALLBACK( williams_cvsd_delayed_data_w )
{
running_device *pia = devtag_get_device(machine, "cvsdpia");
running_device *pia = machine->device("cvsdpia");
pia6821_portb_w(pia, 0, param & 0xff);
pia6821_cb1_w(pia, 0, (param >> 8) & 1);
pia6821_cb2_w(pia, 0, (param >> 9) & 1);

View File

@ -108,7 +108,7 @@ static int plural;
READ8_HANDLER( wow_speech_r )
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
int Phoneme/*, Intonation*/;
int i = 0;
@ -177,6 +177,6 @@ READ8_HANDLER( wow_speech_r )
CUSTOM_INPUT( wow_speech_status_r )
{
running_device *samples = devtag_get_device(field->port->machine, "samples");
running_device *samples = field->port->machine->device("samples");
return !sample_playing(samples, 0);
}

View File

@ -114,7 +114,7 @@ MACHINE_DRIVER_END
WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w )
{
zaxxon_state *state = (zaxxon_state *)device->machine->driver_data;
running_device *samples = devtag_get_device(device->machine, "samples");
running_device *samples = device->machine->device("samples");
UINT8 diff = data ^ state->sound_state[0];
state->sound_state[0] = data;
@ -150,7 +150,7 @@ WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w )
WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w )
{
zaxxon_state *state = (zaxxon_state *)device->machine->driver_data;
running_device *samples = devtag_get_device(device->machine, "samples");
running_device *samples = device->machine->device("samples");
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@ -168,7 +168,7 @@ WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w )
WRITE8_DEVICE_HANDLER( zaxxon_sound_c_w )
{
zaxxon_state *state = (zaxxon_state *)device->machine->driver_data;
running_device *samples = devtag_get_device(device->machine, "samples");
running_device *samples = device->machine->device("samples");
UINT8 diff = data ^ state->sound_state[2];
state->sound_state[2] = data;
@ -226,7 +226,7 @@ MACHINE_DRIVER_END
WRITE8_DEVICE_HANDLER( congo_sound_b_w )
{
zaxxon_state *state = (zaxxon_state *)device->machine->driver_data;
running_device *samples = devtag_get_device(device->machine, "samples");
running_device *samples = device->machine->device("samples");
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@ -240,7 +240,7 @@ WRITE8_DEVICE_HANDLER( congo_sound_b_w )
WRITE8_DEVICE_HANDLER( congo_sound_c_w )
{
zaxxon_state *state = (zaxxon_state *)device->machine->driver_data;
running_device *samples = devtag_get_device(device->machine, "samples");
running_device *samples = device->machine->device("samples");
UINT8 diff = data ^ state->sound_state[2];
state->sound_state[2] = data;

View File

@ -238,7 +238,7 @@ static MACHINE_START( 1942 )
{
_1942_state *state = (_1942_state *)machine->driver_data;
state->audiocpu = devtag_get_device(machine, "audiocpu");
state->audiocpu = machine->device("audiocpu");
state_save_register_global(machine, state->palette_bank);
state_save_register_global_array(machine, state->scroll);

View File

@ -280,8 +280,8 @@ static MACHINE_START( 20pacgal )
{
_20pacgal_state *state = (_20pacgal_state *)machine->driver_data;
state->maincpu = devtag_get_device(machine, "maincpu");
state->eeprom = devtag_get_device(machine, "eeprom");
state->maincpu = machine->device("maincpu");
state->eeprom = machine->device("eeprom");
state_save_register_global(machine, state->game_selected);
state_save_register_global_pointer(machine, state->ram_48000, 0x2000);

View File

@ -429,7 +429,7 @@ static MACHINE_START( drill )
{
_2mindril_state *state = (_2mindril_state *)machine->driver_data;
state->maincpu = devtag_get_device(machine, "maincpu");
state->maincpu = machine->device("maincpu");
state_save_register_global(machine, state->defender_sensor);
state_save_register_global(machine, state->shutter_sensor);

View File

@ -999,8 +999,8 @@ static MACHINE_START( common )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
state->audiocpu = devtag_get_device(machine, "audiocpu");
state->mcu = devtag_get_device(machine, "mcu");
state->audiocpu = machine->device("audiocpu");
state->mcu = machine->device("mcu");
/* video */
state_save_register_global(machine, state->pix1);

View File

@ -1228,7 +1228,7 @@ static DRIVER_INIT( fclown )
/* Assigning AY-3-8910 sound device */
ay8910 = devtag_get_device(machine, "ay8910");
ay8910 = machine->device("ay8910");
}

View File

@ -76,13 +76,13 @@ static READ8_HANDLER( test_r )
static READ8_HANDLER(lions_via_r)
{
running_device *via_0 = devtag_get_device(space->machine, "via6522_0");
running_device *via_0 = space->machine->device("via6522_0");
return via_r(via_0, offset);
}
static WRITE8_HANDLER(lions_via_w)
{
running_device *via_0 = devtag_get_device(space->machine, "via6522_0");
running_device *via_0 = space->machine->device("via6522_0");
via_w(via_0, offset, data);
}

View File

@ -317,12 +317,12 @@ static MACHINE_START( 88games )
{
_88games_state *state = (_88games_state *)machine->driver_data;
state->audiocpu = devtag_get_device(machine, "audiocpu");
state->k052109 = devtag_get_device(machine, "k052109");
state->k051960 = devtag_get_device(machine, "k051960");
state->k051316 = devtag_get_device(machine, "k051316");
state->upd_1 = devtag_get_device(machine, "upd1");
state->upd_2 = devtag_get_device(machine, "upd2");
state->audiocpu = machine->device("audiocpu");
state->k052109 = machine->device("k052109");
state->k051960 = machine->device("k051960");
state->k051316 = machine->device("k051316");
state->upd_1 = machine->device("upd1");
state->upd_2 = machine->device("upd2");
state_save_register_global(machine, state->videobank);
state_save_register_global(machine, state->zoomreadroms);
@ -337,7 +337,7 @@ static MACHINE_RESET( 88games )
{
_88games_state *state = (_88games_state *)machine->driver_data;
konami_configure_set_lines(devtag_get_device(machine, "maincpu"), k88games_banking);
konami_configure_set_lines(machine->device("maincpu"), k88games_banking);
machine->generic.paletteram.u8 = &memory_region(machine, "maincpu")[0x20000];
state->videobank = 0;

View File

@ -293,10 +293,10 @@ static READ16_HANDLER(ac_devices_r)
return input_port_read(space->machine, "IN0");
case 0x0014/2:
case 0x0016/2:
return okim6295_r(devtag_get_device(space->machine, "oki1"),0);
return okim6295_r(space->machine->device("oki1"),0);
case 0x0018/2:
case 0x001a/2:
return okim6295_r(devtag_get_device(space->machine, "oki2"),0);
return okim6295_r(space->machine->device("oki2"),0);
case 0x0040/2:
/*
"Upper switch / Under Switch"
@ -385,12 +385,12 @@ static WRITE16_HANDLER(ac_devices_w)
case 0x14/2:
case 0x16/2:
if(ACCESSING_BITS_0_7)
okim6295_w(devtag_get_device(space->machine, "oki1"),0,data);
okim6295_w(space->machine->device("oki1"),0,data);
break;
case 0x18/2:
case 0x1a/2:
if(ACCESSING_BITS_0_7)
okim6295_w(devtag_get_device(space->machine, "oki2"),0,data);
okim6295_w(space->machine->device("oki2"),0,data);
break;
case 0x1c/2:
/*IRQ mask?*/

View File

@ -280,8 +280,8 @@ static MACHINE_START( actfancr )
{
actfancr_state *state = (actfancr_state *)machine->driver_data;
state->maincpu = devtag_get_device(machine, "maincpu");
state->audiocpu = devtag_get_device(machine, "audiocpu");
state->maincpu = machine->device("maincpu");
state->audiocpu = machine->device("audiocpu");
}
static MACHINE_START( triothep )

View File

@ -206,9 +206,9 @@ static MACHINE_START( skattv )
adp_state *state = (adp_state *)machine->driver_data;
microtouch_init(machine, microtouch_tx, 0);
state->maincpu = devtag_get_device(machine, "maincpu");
state->duart = devtag_get_device(machine, "duart68681");
state->hd63484 = devtag_get_device(machine, "hd63484");
state->maincpu = machine->device("maincpu");
state->duart = machine->device("duart68681");
state->hd63484 = machine->device("hd63484");
state_save_register_global(machine, state->mux_data);
state_save_register_global(machine, state->register_active);
@ -227,7 +227,7 @@ static MACHINE_START( skattv )
UINT16 *rom = (UINT16*)memory_region(machine, "gfx1");
int i;
running_device *hd63484 = devtag_get_device(machine, "hd63484");
running_device *hd63484 = machine->device("hd63484");
for(i = 0; i < 0x40000/2; ++i)
{

View File

@ -1301,7 +1301,7 @@ static MACHINE_START( common )
{
aerofgt_state *state = (aerofgt_state *)machine->driver_data;
state->audiocpu = devtag_get_device(machine, "audiocpu");
state->audiocpu = machine->device("audiocpu");
state_save_register_global(machine, state->pending_command);
}

View File

@ -587,10 +587,10 @@ static MACHINE_START( airbustr )
memory_configure_bank(machine, "bank3", 0, 3, &AUDIO[0x00000], 0x4000);
memory_configure_bank(machine, "bank3", 3, 5, &AUDIO[0x10000], 0x4000);
state->master = devtag_get_device(machine, "master");
state->slave = devtag_get_device(machine, "slave");
state->audiocpu = devtag_get_device(machine, "audiocpu");
state->pandora = devtag_get_device(machine, "pandora");
state->master = machine->device("master");
state->slave = machine->device("slave");
state->audiocpu = machine->device("audiocpu");
state->pandora = machine->device("pandora");
state_save_register_global(machine, state->soundlatch_status);
state_save_register_global(machine, state->soundlatch2_status);

View File

@ -86,7 +86,7 @@ static VIDEO_START( alg )
static MACHINE_START( alg )
{
laserdisc = devtag_get_device(machine, "laserdisc");
laserdisc = machine->device("laserdisc");
serial_timer = timer_alloc(machine, response_timer, NULL);
serial_timer_active = FALSE;

View File

@ -243,11 +243,11 @@ static MACHINE_START( aliens )
memory_configure_bank(machine, "bank1", 0, 20, &ROM[0x10000], 0x2000);
memory_set_bank(machine, "bank1", 0);
state->maincpu = devtag_get_device(machine, "maincpu");
state->audiocpu = devtag_get_device(machine, "audiocpu");
state->k007232 = devtag_get_device(machine, "k007232");
state->k052109 = devtag_get_device(machine, "k052109");
state->k051960 = devtag_get_device(machine, "k051960");
state->maincpu = machine->device("maincpu");
state->audiocpu = machine->device("audiocpu");
state->k007232 = machine->device("k007232");
state->k052109 = machine->device("k052109");
state->k051960 = machine->device("k051960");
state_save_register_global(machine, state->palette_selected);
}
@ -256,7 +256,7 @@ static MACHINE_RESET( aliens )
{
aliens_state *state = (aliens_state *)machine->driver_data;
konami_configure_set_lines(devtag_get_device(machine, "maincpu"), aliens_banking);
konami_configure_set_lines(machine->device("maincpu"), aliens_banking);
state->palette_selected = 0;
}

View File

@ -1854,7 +1854,7 @@ static MACHINE_START( common )
{
alpha68k_state *state = (alpha68k_state *)machine->driver_data;
state->audiocpu = devtag_get_device(machine, "audiocpu");
state->audiocpu = machine->device("audiocpu");
state_save_register_global(machine, state->trigstate);
state_save_register_global(machine, state->deposits1);

View File

@ -254,7 +254,7 @@ static MACHINE_START( amspdwy )
{
amspdwy_state *state = (amspdwy_state *)machine->driver_data;
state->audiocpu = devtag_get_device(machine, "audiocpu");
state->audiocpu = machine->device("audiocpu");
state_save_register_global(machine, state->flipscreen);
state_save_register_global_array(machine, state->wheel_old);

View File

@ -579,7 +579,7 @@ static MACHINE_START( angelkds )
{
angelkds_state *state = (angelkds_state *)machine->driver_data;
state->subcpu = devtag_get_device(machine, "sub");
state->subcpu = machine->device("sub");
state_save_register_global(machine, state->layer_ctrl);
state_save_register_global(machine, state->txbank);

View File

@ -404,7 +404,7 @@ static MACHINE_START( appoooh )
{
appoooh_state *state = (appoooh_state *)machine->driver_data;
state->adpcm = devtag_get_device(machine, "msm");
state->adpcm = machine->device("msm");
state_save_register_global(machine, state->adpcm_data);
state_save_register_global(machine, state->adpcm_address);

View File

@ -342,7 +342,7 @@ static MACHINE_START( aquarium )
{
aquarium_state *state = (aquarium_state *)machine->driver_data;
state->audiocpu = devtag_get_device(machine, "audiocpu");
state->audiocpu = machine->device("audiocpu");
state_save_register_global(machine, state->aquarium_snd_ack);
}

View File

@ -92,7 +92,7 @@ static void scanline_update(screen_device &screen, int scanline)
{
/* generate 32V signals */
if ((scanline & 32) == 0)
atarigen_scanline_int_gen(devtag_get_device(screen.machine, "maincpu"));
atarigen_scanline_int_gen(screen.machine->device("maincpu"));
}

View File

@ -380,13 +380,13 @@ static READ8_DEVICE_HANDLER(via_a_r)
if (ay8910_1&0x03) // SW1 read.
{
psg_ret = ay8910_r(devtag_get_device(device->machine, "ay1"), 0);
psg_ret = ay8910_r(device->machine->device("ay1"), 0);
//logerror("PSG porta ay1 returned %02X\n",psg_ret);
}
else if (ay8910_2&0x03) //i don't think we read anything from Port A on ay2, Can be removed once game works ok.
{
psg_ret = ay8910_r(devtag_get_device(device->machine, "ay2"), 0);
psg_ret = ay8910_r(device->machine->device("ay2"), 0);
//logerror("PSG porta ay2 returned %02X\n",psg_ret);
}
return psg_ret;
@ -493,14 +493,14 @@ static WRITE8_DEVICE_HANDLER(via_b_w)
case 0x06: //WRITE
{
ay8910_data_w( devtag_get_device(device->machine, "ay1"), 0 , psg_data );
ay8910_data_w( device->machine->device("ay1"), 0 , psg_data );
//logerror("VIA Port A write data ay1: %02X\n",psg_data);
break;
}
case 0x07: //LATCH Address (set register)
{
ay8910_address_w( devtag_get_device(device->machine, "ay1"), 0 , psg_data );
ay8910_address_w( device->machine->device("ay1"), 0 , psg_data );
//logerror("VIA Port B write register ay1: %02X\n",psg_data);
break;
}
@ -526,14 +526,14 @@ static WRITE8_DEVICE_HANDLER(via_b_w)
case 0x06: //WRITE
{
ay8910_data_w( devtag_get_device(device->machine, "ay2"), 0 , psg_data );
ay8910_data_w( device->machine->device("ay2"), 0 , psg_data );
//logerror("VIA Port A write data ay2: %02X\n",psg_data);
break;
}
case 0x07: //LATCH Address (set register)
{
ay8910_address_w( devtag_get_device(device->machine, "ay2"), 0 , psg_data );
ay8910_address_w( device->machine->device("ay2"), 0 , psg_data );
//logerror("VIA Port B write register ay2: %02X\n",psg_data);
break;
}
@ -1142,7 +1142,7 @@ static DRIVER_INIT( aristmk4 )
static MACHINE_START( aristmk4 )
{
samples = devtag_get_device(machine, "samples");
samples = machine->device("samples");
state_save_register_global_pointer(machine, nvram,0x1000); // nvram
}
@ -1153,10 +1153,10 @@ static MACHINE_RESET( aristmk4 )
switch(input_port_read(machine, "LK13")) // cpu speed cotrol.. 3mhz or 1.5mhz
{
case 0x00:
cpu_set_clock(devtag_get_device(machine, "maincpu"), MAIN_CLOCK/4); // 3 Mhz
cpu_set_clock(machine->device("maincpu"), MAIN_CLOCK/4); // 3 Mhz
break;
case 0x10:
cpu_set_clock(devtag_get_device(machine, "maincpu"), MAIN_CLOCK/8); // 1.5 Mhz
cpu_set_clock(machine->device("maincpu"), MAIN_CLOCK/8); // 1.5 Mhz
break;
}

View File

@ -45,7 +45,7 @@ static MACHINE_START( aristmk5 )
archimedes_init(machine);
// reset the DAC to centerline
dac_signed_data_w(devtag_get_device(machine, "dac"), 0x80);
dac_signed_data_w(machine->device("dac"), 0x80);
}
static MACHINE_RESET( aristmk5 )

View File

@ -910,7 +910,7 @@ static MACHINE_START( arkanoid )
{
arkanoid_state *state = (arkanoid_state *)machine->driver_data;
state->mcu = devtag_get_device(machine, "mcu");
state->mcu = machine->device("mcu");
state_save_register_global(machine, state->bootleg_cmd);

View File

@ -106,13 +106,13 @@ static MACHINE_RESET( artmagic )
static READ16_HANDLER( tms_host_r )
{
return tms34010_host_r(devtag_get_device(space->machine, "tms"), offset);
return tms34010_host_r(space->machine->device("tms"), offset);
}
static WRITE16_HANDLER( tms_host_w )
{
tms34010_host_w(devtag_get_device(space->machine, "tms"), offset, data);
tms34010_host_w(space->machine->device("tms"), offset, data);
}

View File

@ -334,7 +334,7 @@ static MACHINE_START( ashnojoe )
{
ashnojoe_state *state = (ashnojoe_state *)machine->driver_data;
state->audiocpu = devtag_get_device(machine, "audiocpu");
state->audiocpu = machine->device("audiocpu");
state_save_register_global(machine, state->adpcm_byte);
state_save_register_global(machine, state->soundlatch_status);

View File

@ -253,12 +253,12 @@ static MACHINE_START( asterix )
{
asterix_state *state = (asterix_state *)machine->driver_data;
state->maincpu = devtag_get_device(machine, "maincpu");
state->audiocpu = devtag_get_device(machine, "audiocpu");
state->k053260 = devtag_get_device(machine, "k053260");
state->k056832 = devtag_get_device(machine, "k056832");
state->k053244 = devtag_get_device(machine, "k053244");
state->k053251 = devtag_get_device(machine, "k053251");
state->maincpu = machine->device("maincpu");
state->audiocpu = machine->device("audiocpu");
state->k053260 = machine->device("k053260");
state->k056832 = machine->device("k056832");
state->k053244 = machine->device("k053244");
state->k053251 = machine->device("k053251");
state_save_register_global(machine, state->cur_control2);
state_save_register_global_array(machine, state->prot);

View File

@ -228,10 +228,10 @@ static MACHINE_START( kamikaze )
{
astinvad_state *state = (astinvad_state *)machine->driver_data;
state->maincpu = devtag_get_device(machine, "maincpu");
state->ppi8255_0 = devtag_get_device(machine, "ppi8255_0");
state->ppi8255_1 = devtag_get_device(machine, "ppi8255_1");
state->samples = devtag_get_device(machine, "samples");
state->maincpu = machine->device("maincpu");
state->ppi8255_0 = machine->device("ppi8255_0");
state->ppi8255_1 = machine->device("ppi8255_1");
state->samples = machine->device("samples");
state->int_timer = timer_alloc(machine, kamizake_int_gen, NULL);
timer_adjust_oneshot(state->int_timer, machine->primary_screen->time_until_pos(128), 128);
@ -256,8 +256,8 @@ static MACHINE_START( spaceint )
{
astinvad_state *state = (astinvad_state *)machine->driver_data;
state->maincpu = devtag_get_device(machine, "maincpu");
state->samples = devtag_get_device(machine, "samples");
state->maincpu = machine->device("maincpu");
state->samples = machine->device("samples");
state_save_register_global(machine, state->screen_flip);
state_save_register_global_array(machine, state->sound_state);

View File

@ -207,7 +207,7 @@ static WRITE8_HANDLER( seawolf2_lamps_w )
static WRITE8_HANDLER( seawolf2_sound_1_w ) // Port 40
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
UINT8 rising_bits = data & ~port_1_last;
port_1_last = data;
@ -222,7 +222,7 @@ static WRITE8_HANDLER( seawolf2_sound_1_w ) // Port 40
static WRITE8_HANDLER( seawolf2_sound_2_w ) // Port 41
{
running_device *samples = devtag_get_device(space->machine, "samples");
running_device *samples = space->machine->device("samples");
UINT8 rising_bits = data & ~port_2_last;
port_2_last = data;
@ -337,8 +337,8 @@ static READ8_HANDLER( gorf_io_1_r )
case 4: astrocade_sparkle[2] = data; break;
case 5: astrocade_sparkle[3] = data; break;
case 6:
sound_set_output_gain(devtag_get_device(space->machine, "astrocade1"), 0, data ? 0.0 : 1.0);
sound_set_output_gain(devtag_get_device(space->machine, "samples"), 0, data ? 1.0 : 0.0);
sound_set_output_gain(space->machine->device("astrocade1"), 0, data ? 0.0 : 1.0);
sound_set_output_gain(space->machine->device("samples"), 0, data ? 1.0 : 0.0);
break;
case 7: mame_printf_debug("io_1:%d\n", data); break;
}

View File

@ -237,10 +237,10 @@ static WRITE16_HANDLER( skilldrp_outputs_w )
coin_counter_w(space->machine, 0, (data & 0x0001)); // key in |
coin_counter_w(space->machine, 0, (data & 0x0002)); // coin in |- manual shows 1 in- and 1 out- counter
coin_counter_w(space->machine, 1, (data & 0x0004)); // key out |
ticket_dispenser_w(devtag_get_device(space->machine, "hopper"), 0, (data & 0x0008)<<4); // hopper motor?
ticket_dispenser_w(space->machine->device("hopper"), 0, (data & 0x0008)<<4); // hopper motor?
// (data & 0x0010) // hopper?
set_led_status(space->machine, 0, (data & 0x0020)); // error lamp (coin/hopper jam: "call attendant")
ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, data & 0x0080); // ticket motor?
ticket_dispenser_w(space->machine->device("ticket"), 0, data & 0x0080); // ticket motor?
}
if (ACCESSING_BITS_8_15)
{

View File

@ -500,8 +500,8 @@ static MACHINE_START( astrof )
/* the 74175 outputs all HI's if not otherwise set */
astrof_set_video_control_2(machine, 0xff);
state->maincpu = devtag_get_device(machine, "maincpu");
state->samples = devtag_get_device(machine, "samples");
state->maincpu = machine->device("maincpu");
state->samples = machine->device("samples");
/* register for state saving */
state_save_register_global(machine, state->red_on);
@ -534,7 +534,7 @@ static MACHINE_START( spfghmk2 )
/* the 74175 outputs all HI's if not otherwise set */
spfghmk2_set_video_control_2(machine, 0xff);
state->maincpu = devtag_get_device(machine, "maincpu");
state->maincpu = machine->device("maincpu");
/* the red background circuit is disabled */
state->red_on = FALSE;
@ -553,8 +553,8 @@ static MACHINE_START( tomahawk )
/* the 74175 outputs all HI's if not otherwise set */
tomahawk_set_video_control_2(machine, 0xff);
state->maincpu = devtag_get_device(machine, "maincpu");
state->sn = devtag_get_device(machine, "snsnd");
state->maincpu = machine->device("maincpu");
state->sn = machine->device("snsnd");
/* register for state saving */
state_save_register_global(machine, state->red_on);

View File

@ -837,10 +837,10 @@ static MACHINE_START( asuka )
{
asuka_state *state = (asuka_state *)machine->driver_data;
state->maincpu = devtag_get_device(machine, "maincpu");
state->audiocpu = devtag_get_device(machine, "audiocpu");
state->pc090oj = devtag_get_device(machine, "pc090oj");
state->tc0100scn = devtag_get_device(machine, "tc0100scn");
state->maincpu = machine->device("maincpu");
state->audiocpu = machine->device("audiocpu");
state->pc090oj = machine->device("pc090oj");
state->tc0100scn = machine->device("tc0100scn");
/* configure the banks */
memory_configure_bank(machine, "bank1", 0, 1, memory_region(machine, "audiocpu"), 0);

View File

@ -509,7 +509,7 @@ static MACHINE_START( atarifb )
{
atarifb_state *state = (atarifb_state *)machine->driver_data;
state->maincpu = devtag_get_device(machine, "maincpu");
state->maincpu = machine->device("maincpu");
state_save_register_global(machine, state->CTRLD);
state_save_register_global(machine, state->sign_x_1);

View File

@ -1180,7 +1180,7 @@ static void init_g1_common(running_machine *machine, offs_t slapstic_base, int s
state_save_register_postload(machine, pitfightb_state_postload, NULL);
}
else if (slapstic != 0)
atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), slapstic_base, 0, slapstic);
atarigen_slapstic_init(machine->device("maincpu"), slapstic_base, 0, slapstic);
atarijsa_init(machine, "IN0", 0x4000);
state->is_pitfight = is_pitfight;

View File

@ -84,7 +84,7 @@ static void cage_irq_callback(running_machine *machine, int reason)
const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
if (reason)
atarigen_sound_int_gen(devtag_get_device(machine, "maincpu"));
atarigen_sound_int_gen(machine->device("maincpu"));
else
atarigen_sound_int_ack_w(space,0,0,0xffff);
}

View File

@ -215,7 +215,7 @@ static MACHINE_RESET( atarisy1 )
atarigen_eeprom_reset(&state->atarigen);
atarigen_slapstic_reset(&state->atarigen);
atarigen_interrupt_reset(&state->atarigen, update_interrupts);
atarigen_sound_io_reset(devtag_get_device(machine, "audiocpu"));
atarigen_sound_io_reset(machine->device("audiocpu"));
/* reset the joystick parameters */
state->joystick_value = 0;
@ -388,33 +388,33 @@ static READ8_HANDLER( switch_6502_r )
static WRITE8_DEVICE_HANDLER( via_pa_w )
{
tms5220_data_w(devtag_get_device(device->machine, "tms"), 0, data);
tms5220_data_w(device->machine->device("tms"), 0, data);
}
static READ8_DEVICE_HANDLER( via_pa_r )
{
return tms5220_status_r(devtag_get_device(device->machine, "tms"), 0);
return tms5220_status_r(device->machine->device("tms"), 0);
}
static WRITE8_DEVICE_HANDLER( via_pb_w )
{
/* write strobe */
tms5220_wsq_w(devtag_get_device(device->machine, "tms"), data & 1);
tms5220_wsq_w(device->machine->device("tms"), data & 1);
/* read strobe */
tms5220_rsq_w(devtag_get_device(device->machine, "tms"), (data & 2)>>1);
tms5220_rsq_w(device->machine->device("tms"), (data & 2)>>1);
/* bit 4 is connected to an up-counter, clocked by SYCLKB */
data = 5 | ((data >> 3) & 2);
tms5220_set_frequency(devtag_get_device(device->machine, "tms"), ATARI_CLOCK_14MHz/2 / (16 - data));
tms5220_set_frequency(device->machine->device("tms"), ATARI_CLOCK_14MHz/2 / (16 - data));
}
static READ8_DEVICE_HANDLER( via_pb_r )
{
return (tms5220_readyq_r(devtag_get_device(device->machine, "tms")) << 2) | (tms5220_intq_r(devtag_get_device(device->machine, "tms")) << 3);
return (tms5220_readyq_r(device->machine->device("tms")) << 2) | (tms5220_intq_r(device->machine->device("tms")) << 3);
}
@ -2327,7 +2327,7 @@ static DRIVER_INIT( marble )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 103);
atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 103);
state->joystick_type = 0; /* none */
state->trackball_type = 1; /* rotated */
@ -2338,7 +2338,7 @@ static DRIVER_INIT( peterpak )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 107);
atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 107);
state->joystick_type = 1; /* digital */
state->trackball_type = 0; /* none */
@ -2349,7 +2349,7 @@ static DRIVER_INIT( indytemp )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 105);
atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 105);
state->joystick_type = 1; /* digital */
state->trackball_type = 0; /* none */
@ -2360,7 +2360,7 @@ static DRIVER_INIT( roadrunn )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 108);
atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 108);
state->joystick_type = 2; /* analog */
state->trackball_type = 0; /* none */
@ -2371,7 +2371,7 @@ static DRIVER_INIT( roadb109 )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 109);
atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 109);
state->joystick_type = 3; /* pedal */
state->trackball_type = 2; /* steering wheel */
@ -2382,7 +2382,7 @@ static DRIVER_INIT( roadb110 )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 110);
atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 110);
state->joystick_type = 3; /* pedal */
state->trackball_type = 2; /* steering wheel */

View File

@ -196,7 +196,7 @@ static void scanline_update(screen_device &screen, int scanline)
/* generate the 32V interrupt (IRQ 2) */
if ((scanline % 64) == 0)
if (state->interrupt_enable & 4)
atarigen_scanline_int_gen(devtag_get_device(screen.machine, "maincpu"));
atarigen_scanline_int_gen(screen.machine->device("maincpu"));
}
}
@ -243,7 +243,7 @@ static MACHINE_RESET( atarisy2 )
atarigen_eeprom_reset(&state->atarigen);
slapstic_reset();
atarigen_interrupt_reset(&state->atarigen, update_interrupts);
atarigen_sound_io_reset(devtag_get_device(machine, "soundcpu"));
atarigen_sound_io_reset(machine->device("soundcpu"));
atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 64);
memory_set_direct_update_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), atarisy2_direct_handler);
@ -379,7 +379,7 @@ static READ8_HANDLER( switch_6502_r )
if (state->atarigen.cpu_to_sound_ready) result |= 0x01;
if (state->atarigen.sound_to_cpu_ready) result |= 0x02;
if ((state->has_tms5220) && (tms5220_readyq_r(devtag_get_device(space->machine, "tms")) == 0))
if ((state->has_tms5220) && (tms5220_readyq_r(space->machine->device("tms")) == 0))
result &= ~0x04;
if (!(input_port_read(space->machine, "1801") & 0x80)) result |= 0x10;
@ -394,7 +394,7 @@ static WRITE8_HANDLER( switch_6502_w )
if (state->has_tms5220)
{
data = 12 | ((data >> 5) & 1);
tms5220_set_frequency(devtag_get_device(space->machine, "tms"), MASTER_CLOCK/4 / (16 - data) / 2);
tms5220_set_frequency(space->machine->device("tms"), MASTER_CLOCK/4 / (16 - data) / 2);
}
}
@ -623,7 +623,7 @@ static WRITE8_HANDLER( sound_reset_w )
return;
/* a large number of signals are reset when this happens */
atarigen_sound_io_reset(devtag_get_device(space->machine, "soundcpu"));
atarigen_sound_io_reset(space->machine->device("soundcpu"));
devtag_reset(space->machine, "ymsnd");
if (state->has_tms5220)
{
@ -684,7 +684,7 @@ static WRITE8_HANDLER( tms5220_w )
atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
if (state->has_tms5220)
{
tms5220_data_w(devtag_get_device(space->machine, "tms"), 0, data);
tms5220_data_w(space->machine->device("tms"), 0, data);
}
}
@ -693,7 +693,7 @@ static WRITE8_HANDLER( tms5220_strobe_w )
atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
if (state->has_tms5220)
{
tms5220_wsq_w(devtag_get_device(space->machine, "tms"), 1-(offset & 1));
tms5220_wsq_w(space->machine->device("tms"), 1-(offset & 1));
}
}
@ -3053,7 +3053,7 @@ static DRIVER_INIT( paperboy )
state->pedal_count = 0;
state->has_tms5220 = 1;
tms5220_rsq_w(devtag_get_device(machine, "tms"), 1); // /RS is tied high on sys2 hw
tms5220_rsq_w(machine->device("tms"), 1); // /RS is tied high on sys2 hw
}
@ -3094,7 +3094,7 @@ static DRIVER_INIT( 720 )
state->pedal_count = -1;
state->has_tms5220 = 1;
tms5220_rsq_w(devtag_get_device(machine, "tms"), 1); // /RS is tied high on sys2 hw
tms5220_rsq_w(machine->device("tms"), 1); // /RS is tied high on sys2 hw
}
@ -3250,7 +3250,7 @@ static DRIVER_INIT( apb )
state->pedal_count = 2;
state->has_tms5220 = 1;
tms5220_rsq_w(devtag_get_device(machine, "tms"), 1); // /RS is tied high on sys2 hw
tms5220_rsq_w(machine->device("tms"), 1); // /RS is tied high on sys2 hw
}

View File

@ -36,7 +36,7 @@ static IRQ_CALLBACK(aztarac_irq_callback)
static MACHINE_RESET( aztarac )
{
cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), aztarac_irq_callback);
cpu_set_irq_callback(machine->device("maincpu"), aztarac_irq_callback);
}

View File

@ -471,11 +471,11 @@ static MACHINE_START( backfire )
{
backfire_state *state = (backfire_state *)machine->driver_data;
state->maincpu = devtag_get_device(machine, "maincpu");
state->deco16ic = devtag_get_device(machine, "deco_custom");
state->lscreen = devtag_get_device(machine, "lscreen");
state->rscreen = devtag_get_device(machine, "rscreen");
state->eeprom = devtag_get_device(machine, "eeprom");
state->maincpu = machine->device("maincpu");
state->deco16ic = machine->device("deco_custom");
state->lscreen = machine->device("lscreen");
state->rscreen = machine->device("rscreen");
state->eeprom = machine->device("eeprom");
}
static MACHINE_DRIVER_START( backfire )
@ -691,7 +691,7 @@ static DRIVER_INIT( backfire )
deco56_decrypt_gfx(machine, "gfx1"); /* 141 */
deco56_decrypt_gfx(machine, "gfx2"); /* 141 */
deco156_decrypt(machine);
cpu_set_clockscale(devtag_get_device(machine, "maincpu"), 4.0f); /* core timings aren't accurate */
cpu_set_clockscale(machine->device("maincpu"), 4.0f); /* core timings aren't accurate */
descramble_sound(machine);
memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0170018, 0x017001b, 0, 0, backfire_speedup_r );
}

View File

@ -192,7 +192,7 @@ static void scanline_update(screen_device &screen, int scanline)
if (scanline & 32)
atarigen_6502_irq_ack_r(space, 0);
else if (!(input_port_read(screen.machine, "FE4000") & 0x40))
atarigen_6502_irq_gen(devtag_get_device(screen.machine, "audiocpu"));
atarigen_6502_irq_gen(screen.machine->device("audiocpu"));
}
@ -216,7 +216,7 @@ static MACHINE_RESET( badlands )
atarigen_interrupt_reset(&state->atarigen, update_interrupts);
atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 32);
atarigen_sound_io_reset(devtag_get_device(machine, "audiocpu"));
atarigen_sound_io_reset(machine->device("audiocpu"));
memcpy(state->bank_base, &state->bank_source_data[0x0000], 0x1000);
}
@ -695,7 +695,7 @@ static void scanline_update_bootleg(screen_device &screen, int scanline)
// if (scanline & 32)
// atarigen_6502_irq_ack_r(screen->machine, 0);
// else if (!(input_port_read(machine, "FE4000") & 0x40))
// atarigen_6502_irq_gen(devtag_get_device(screen->machine, "audiocpu"));
// atarigen_6502_irq_gen(screen->machine->device("audiocpu"));
}
@ -709,7 +709,7 @@ static MACHINE_RESET( badlandsb )
atarigen_interrupt_reset(&state->atarigen, update_interrupts_bootleg);
atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update_bootleg, 32);
// atarigen_sound_io_reset(devtag_get_device(machine, "audiocpu"));
// atarigen_sound_io_reset(machine->device("audiocpu"));
// memcpy(state->bank_base, &state->bank_source_data[0x0000], 0x1000);
}

View File

@ -278,8 +278,8 @@ static MACHINE_START( battlane )
{
battlane_state *state = (battlane_state *)machine->driver_data;
state->maincpu = devtag_get_device(machine, "maincpu");
state->subcpu = devtag_get_device(machine, "sub");
state->maincpu = machine->device("maincpu");
state->subcpu = machine->device("sub");
state_save_register_global(machine, state->video_ctrl);
state_save_register_global(machine, state->cpu_control);

View File

@ -225,9 +225,9 @@ static MACHINE_START( battlnts )
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
state->audiocpu = devtag_get_device(machine, "audiocpu");
state->k007342 = devtag_get_device(machine, "k007342");
state->k007420 = devtag_get_device(machine, "k007420");
state->audiocpu = machine->device("audiocpu");
state->k007342 = machine->device("k007342");
state->k007420 = machine->device("k007420");
state_save_register_global(machine, state->spritebank);
state_save_register_global_array(machine, state->layer_colorbase);

View File

@ -135,7 +135,7 @@ static MACHINE_START( beaminv )
beaminv_state *state = (beaminv_state *)machine->driver_data;
create_interrupt_timer(machine);
state->maincpu = devtag_get_device(machine, "maincpu");
state->maincpu = machine->device("maincpu");
/* setup for save states */
state_save_register_global(machine, state->controller_select);

View File

@ -474,7 +474,7 @@ static WRITE8_HANDLER( berzerk_audio_w )
{
/* offset 4 writes to the S14001A */
case 4:
device = devtag_get_device(space->machine, "speech");
device = space->machine->device("speech");
switch (data >> 6)
{
/* write data to the S14001 */
@ -492,7 +492,7 @@ static WRITE8_HANDLER( berzerk_audio_w )
break;
case 1:
device = devtag_get_device(space->machine, "speech");
device = space->machine->device("speech");
/* volume */
s14001a_set_volume(device, ((data & 0x38) >> 3) + 1);
@ -524,7 +524,7 @@ static WRITE8_HANDLER( berzerk_audio_w )
static READ8_HANDLER( berzerk_audio_r )
{
running_device *device = devtag_get_device(space->machine, "speech");
running_device *device = space->machine->device("speech");
switch (offset)
{
/* offset 4 reads from the S14001A */

View File

@ -180,7 +180,7 @@ static INTERRUPT_GEN( timer_irq )
sc1_Inputs[2] = input_port_read(device->machine,"STROBE0");
generic_pulse_irq_line(devtag_get_device(device->machine, "maincpu"), M6809_IRQ_LINE);
generic_pulse_irq_line(device->machine->device("maincpu"), M6809_IRQ_LINE);
}
}
@ -277,7 +277,7 @@ static WRITE8_HANDLER( mmtr_w )
if ( changed & (1 << i) )
{
Mechmtr_update(i, cycles, data & (1 << i) );
generic_pulse_irq_line(devtag_get_device(space->machine, "maincpu"), M6809_FIRQ_LINE);
generic_pulse_irq_line(space->machine->device("maincpu"), M6809_FIRQ_LINE);
}
}
}

View File

@ -698,8 +698,8 @@ static WRITE8_HANDLER( volume_override_w )
if ( old != volume_override )
{
running_device *ym = devtag_get_device(space->machine, "ymsnd");
running_device *upd = devtag_get_device(space->machine, "upd");
running_device *ym = space->machine->device("ymsnd");
running_device *upd = space->machine->device("upd");
float percent = volume_override? 1.0f : (32-global_volume)/32.0f;
sound_set_output_gain(ym, 0, percent);
@ -776,7 +776,7 @@ static READ8_HANDLER( vfd_status_hop_r ) // on video games, hopper inputs are co
}
}
if ( !upd7759_busy_r(devtag_get_device(space->machine, "upd")) ) result |= 0x80; // update sound busy input
if ( !upd7759_busy_r(space->machine->device("upd")) ) result |= 0x80; // update sound busy input
return result;
}
@ -812,8 +812,8 @@ static WRITE8_HANDLER( expansion_latch_w )
}
{
running_device *ym = devtag_get_device(space->machine, "ymsnd");
running_device *upd = devtag_get_device(space->machine, "upd");
running_device *ym = space->machine->device("ymsnd");
running_device *upd = space->machine->device("upd");
float percent = volume_override ? 1.0f : (32-global_volume)/32.0f;
sound_set_output_gain(ym, 0, percent);
@ -2666,7 +2666,7 @@ static READ8_HANDLER( vfd_status_r )
int result = optic_pattern;
if ( !upd7759_busy_r(devtag_get_device(space->machine, "upd")) ) result |= 0x80;
if ( !upd7759_busy_r(space->machine->device("upd")) ) result |= 0x80;
return result;
}
@ -2680,7 +2680,7 @@ static READ8_HANDLER( vfd_status_dm01_r )
int result = optic_pattern;
if ( !upd7759_busy_r(devtag_get_device(space->machine, "upd")) ) result |= 0x80;
if ( !upd7759_busy_r(space->machine->device("upd")) ) result |= 0x80;
if ( BFM_dm01_busy() ) result |= 0x40;

View File

@ -226,7 +226,7 @@ static WRITE8_HANDLER( mmtr_w )
for (i=0; i<8; i++)
if ( changed & (1 << i) ) Mechmtr_update(i, cycles, data & (1 << i) );
if ( data ) generic_pulse_irq_line(devtag_get_device(space->machine, "maincpu"), M6809_FIRQ_LINE);
if ( data ) generic_pulse_irq_line(space->machine->device("maincpu"), M6809_FIRQ_LINE);
}
///////////////////////////////////////////////////////////////////////////

View File

@ -434,8 +434,8 @@ static MACHINE_START( bigevglf )
{
bigevglf_state *state = (bigevglf_state *)machine->driver_data;
state->audiocpu = devtag_get_device(machine, "audiocpu");
state->mcu = devtag_get_device(machine, "mcu");
state->audiocpu = machine->device("audiocpu");
state->mcu = machine->device("mcu");
state_save_register_global(machine, state->vidram_bank);
state_save_register_global(machine, state->plane_selected);

View File

@ -402,10 +402,10 @@ static MACHINE_START( bishi )
{
bishi_state *state = (bishi_state *)machine->driver_data;
state->maincpu = devtag_get_device(machine, "maincpu");
state->k056832 = devtag_get_device(machine, "k056832");
state->k054338 = devtag_get_device(machine, "k054338");
state->k055555 = devtag_get_device(machine, "k055555");
state->maincpu = machine->device("maincpu");
state->k056832 = machine->device("k056832");
state->k054338 = machine->device("k054338");
state->k055555 = machine->device("k055555");
state_save_register_global(machine, state->cur_control);
state_save_register_global(machine, state->cur_control2);

View File

@ -413,7 +413,7 @@ static MACHINE_START( bking )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
state->audiocpu = devtag_get_device(machine, "audiocpu");
state->audiocpu = machine->device("audiocpu");
/* video */
state_save_register_global_array(machine, state->pc3259_output);
@ -439,7 +439,7 @@ static MACHINE_START( bking3 )
{
buggychl_state *state = (buggychl_state *)machine->driver_data;
state->mcu = devtag_get_device(machine, "mcu");
state->mcu = machine->device("mcu");
MACHINE_START_CALL(bking);

Some files were not shown because too many files have changed in this diff Show More