Replaced all occurrences of cputag_get_cpu with devtag_get_device: the former function was just an alias and now cpus are no different from other devices

Removed cputag_get_cpu and cputag_reset (another alias, not even used in the source) from cpuexec.h
This commit is contained in:
Fabio Priuli 2010-01-06 13:26:30 +00:00
parent fb8599a36c
commit a406d628ff
213 changed files with 688 additions and 692 deletions

View File

@ -365,7 +365,7 @@ static CPU_INIT( cquestrot )
cpustate->sram = auto_alloc_array(device->machine, UINT16, 2048); /* Private */
cpustate->device = device;
cpustate->lindevice = cputag_get_cpu(device->machine, rotconfig->lin_cpu_tag);
cpustate->lindevice = devtag_get_device(device->machine, rotconfig->lin_cpu_tag);
cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
cquestrot_state_register(device);
@ -450,7 +450,7 @@ static CPU_INIT( cquestlin )
cpustate->o_stack = auto_alloc_array(device->machine, UINT32, 32768); /* Stack DRAM: 32kx20 */
cpustate->device = device;
cpustate->rotdevice = cputag_get_cpu(device->machine, linconfig->rot_cpu_tag);
cpustate->rotdevice = devtag_get_device(device->machine, linconfig->rot_cpu_tag);
cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
cquestlin_state_register(device);

View File

@ -231,7 +231,7 @@ void cpuexec_init(running_machine *machine)
min_quantum = ATTOTIME_IN_HZ(60);
if (machine->config->perfect_cpu_quantum != NULL)
{
const device_config *cpu = cputag_get_cpu(machine, machine->config->perfect_cpu_quantum);
const device_config *cpu = devtag_get_device(machine, machine->config->perfect_cpu_quantum);
attotime cpu_quantum;
if (cpu == NULL)

View File

@ -135,24 +135,20 @@ struct _cpu_class_header
#define INTERRUPT_GEN(func) void func(const device_config *device)
/* return a pointer to the given CPU by tag */
#define cputag_get_cpu(mach, tag) devtag_get_device(mach, tag)
/* helpers for using machine/cputag instead of cpu objects */
#define cputag_reset(mach, tag) devtag_reset(mach, tag)
#define cputag_get_index(mach, tag) cpu_get_index(cputag_get_cpu(mach, tag))
#define cputag_get_address_space(mach, tag, space) cpu_get_address_space(cputag_get_cpu(mach, tag), space)
#define cputag_suspend(mach, tag, reason, eat) cpu_suspend(cputag_get_cpu(mach, tag), reason, eat)
#define cputag_resume(mach, tag, reason) cpu_resume(cputag_get_cpu(mach, tag), reason)
#define cputag_is_suspended(mach, tag, reason) cpu_is_suspended(cputag_get_cpu(mach, tag), reason)
#define cputag_get_clock(mach, tag) cpu_get_clock(cputag_get_cpu(mach, tag))
#define cputag_set_clock(mach, tag, clock) cpu_set_clock(cputag_get_cpu(mach, tag), clock)
#define cputag_clocks_to_attotime(mach, tag, clocks) cpu_clocks_to_attotime(cputag_get_cpu(mach, tag), clocks)
#define cputag_attotime_to_clocks(mach, tag, duration) cpu_attotime_to_clocks(cputag_get_cpu(mach, tag), duration)
#define cputag_get_local_time(mach, tag) cpu_get_local_time(cputag_get_cpu(mach, tag))
#define cputag_get_total_cycles(mach, tag) cpu_get_total_cycles(cputag_get_cpu(mach, tag))
#define cputag_set_input_line(mach, tag, line, state) cpu_set_input_line(cputag_get_cpu(mach, tag), line, state)
#define cputag_set_input_line_and_vector(mach, tag, line, state, vec) cpu_set_input_line_and_vector(cputag_get_cpu(mach, tag), line, state, vec)
#define cputag_get_index(mach, tag) cpu_get_index(devtag_get_device(mach, tag))
#define cputag_get_address_space(mach, tag, space) cpu_get_address_space(devtag_get_device(mach, tag), space)
#define cputag_suspend(mach, tag, reason, eat) cpu_suspend(devtag_get_device(mach, tag), reason, eat)
#define cputag_resume(mach, tag, reason) cpu_resume(devtag_get_device(mach, tag), reason)
#define cputag_is_suspended(mach, tag, reason) cpu_is_suspended(devtag_get_device(mach, tag), reason)
#define cputag_get_clock(mach, tag) cpu_get_clock(devtag_get_device(mach, tag))
#define cputag_set_clock(mach, tag, clock) cpu_set_clock(devtag_get_device(mach, tag), clock)
#define cputag_clocks_to_attotime(mach, tag, clocks) cpu_clocks_to_attotime(devtag_get_device(mach, tag), clocks)
#define cputag_attotime_to_clocks(mach, tag, duration) cpu_attotime_to_clocks(devtag_get_device(mach, tag), duration)
#define cputag_get_local_time(mach, tag) cpu_get_local_time(devtag_get_device(mach, tag))
#define cputag_get_total_cycles(mach, tag) cpu_get_total_cycles(devtag_get_device(mach, tag))
#define cputag_set_input_line(mach, tag, line, state) cpu_set_input_line(devtag_get_device(mach, tag), line, state)
#define cputag_set_input_line_and_vector(mach, tag, line, state, vec) cpu_set_input_line_and_vector(devtag_get_device(mach, tag), line, state, vec)

View File

@ -529,7 +529,7 @@ int debug_command_parameter_cpu(running_machine *machine, const char *param, con
}
/* first look for a tag match */
*result = cputag_get_cpu(machine, param);
*result = devtag_get_device(machine, param);
if (*result != NULL)
return TRUE;

View File

@ -487,7 +487,7 @@ static int debug_comment_load_xml(running_machine *machine, mame_file *fp)
for (cpunode = xml_get_sibling(systemnode->child, "cpu"); cpunode; cpunode = xml_get_sibling(cpunode->next, "cpu"))
{
const device_config *cpu = cputag_get_cpu(machine, xml_get_attribute_string(cpunode, "tag", ""));
const device_config *cpu = devtag_get_device(machine, xml_get_attribute_string(cpunode, "tag", ""));
if (cpu != NULL)
{
debug_cpu_comment_group *comments = cpu_get_debug_data(cpu)->comments;

View File

@ -57,7 +57,7 @@ void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_rea
if (device->owner != NULL)
cpu = device_find_child_by_tag(device->owner, config->tag);
else
cpu = cputag_get_cpu(device->machine, config->tag);
cpu = devtag_get_device(device->machine, config->tag);
if (cpu == NULL)
fatalerror("devcb_resolve_read_line: unable to find CPU '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
@ -144,7 +144,7 @@ void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_w
if (device->owner != NULL)
cpu = device_find_child_by_tag(device->owner, config->tag);
else
cpu = cputag_get_cpu(device->machine, config->tag);
cpu = devtag_get_device(device->machine, config->tag);
if (cpu == NULL)
fatalerror("devcb_resolve_write_line: unable to find CPU '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
@ -165,7 +165,7 @@ void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_w
if (device->owner != NULL)
cpu = device_find_child_by_tag(device->owner, config->tag);
else
cpu = cputag_get_cpu(device->machine, config->tag);
cpu = devtag_get_device(device->machine, config->tag);
if (cpu == NULL)
fatalerror("devcb_resolve_write_line: unable to find CPU '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
@ -244,7 +244,7 @@ void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *conf
if (device->owner != NULL)
cpu = device_find_child_by_tag(device->owner, config->tag);
else
cpu = cputag_get_cpu(device->machine, config->tag);
cpu = devtag_get_device(device->machine, config->tag);
if (cpu == NULL)
fatalerror("devcb_resolve_read8: unable to find CPU '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
@ -315,7 +315,7 @@ void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *c
if (device->owner != NULL)
cpu = device_find_child_by_tag(device->owner, config->tag);
else
cpu = cputag_get_cpu(device->machine, config->tag);
cpu = devtag_get_device(device->machine, config->tag);
if (cpu == NULL)
fatalerror("devcb_resolve_write8: unable to find CPU '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);

View File

@ -1808,7 +1808,7 @@ static DEVICE_START( ide_controller )
/* find the bus master space */
if (config->bmcpu != NULL)
{
ide->dma_space = memory_find_address_space(cputag_get_cpu(device->machine, config->bmcpu), config->bmspace);
ide->dma_space = memory_find_address_space(devtag_get_device(device->machine, config->bmcpu), config->bmspace);
assert_always(ide->dma_space != NULL, "IDE controller bus master space not found!");
ide->dma_address_xor = (ide->dma_space->endianness == ENDIANNESS_LITTLE) ? 0 : 3;
}

View File

@ -350,7 +350,7 @@ static void pr8210_init(laserdisc_state *ld)
player->slowtrg = curtime;
/* find our CPU */
player->cpu = cputag_get_cpu(ld->device->machine, device_build_tag(tempstring, ld->device, "pr8210"));
player->cpu = devtag_get_device(ld->device->machine, device_build_tag(tempstring, ld->device, "pr8210"));
astring_free(tempstring);
/* we don't have the Simutrek player overrides */
@ -1082,7 +1082,7 @@ static void simutrek_init(laserdisc_state *ld)
player->simutrek.data_ready = 1;
/* find the Simutrek CPU */
player->simutrek.cpu = cputag_get_cpu(ld->device->machine, device_build_tag(tempstring, ld->device, "simutrek"));
player->simutrek.cpu = devtag_get_device(ld->device->machine, device_build_tag(tempstring, ld->device, "simutrek"));
astring_free(tempstring);
}

View File

@ -233,7 +233,7 @@ static void ldv1000_init(laserdisc_state *ld)
memset(player, 0, sizeof(*player));
/* find our devices */
player->cpu = cputag_get_cpu(ld->device->machine, device_build_tag(tempstring, ld->device, "ldv1000"));
player->cpu = devtag_get_device(ld->device->machine, device_build_tag(tempstring, ld->device, "ldv1000"));
player->ctc = devtag_get_device(ld->device->machine, device_build_tag(tempstring, ld->device, "ldvctc"));
player->multitimer = devtag_get_device(ld->device->machine, device_build_tag(tempstring, ld->device, "multitimer"));
timer_device_set_ptr(player->multitimer, ld);

View File

@ -214,7 +214,7 @@ static void vp931_init(laserdisc_state *ld)
player->data_ready_cb = cbsave;
/* find our devices */
player->cpu = cputag_get_cpu(ld->device->machine, device_build_tag(tempstring, ld->device, "vp931"));
player->cpu = devtag_get_device(ld->device->machine, device_build_tag(tempstring, ld->device, "vp931"));
player->tracktimer = devtag_get_device(ld->device->machine, device_build_tag(tempstring, ld->device, "tracktimer"));
timer_device_set_ptr(player->tracktimer, ld);
astring_free(tempstring);

View File

@ -110,7 +110,7 @@ static void c6280_init(const device_config *device, c6280_t *p, double clk, doub
memset(p, 0, sizeof(c6280_t));
p->device = device;
p->cpudevice = cputag_get_cpu(device->machine, intf->cpu);
p->cpudevice = devtag_get_device(device->machine, intf->cpu);
if (p->cpudevice == NULL)
fatalerror("c6280_init: no CPU found with tag of '%s'\n", device->tag);

View File

@ -436,7 +436,7 @@ static DEVICE_START( cdp1864 )
devcb_resolve_write_line(&cdp1864->out_efx_func, &intf->out_efx_func, device);
/* get the cpu */
cdp1864->cpu = cputag_get_cpu(device->machine, intf->cpu_tag);
cdp1864->cpu = devtag_get_device(device->machine, intf->cpu_tag);
/* get the screen device */
cdp1864->screen = devtag_get_device(device->machine, intf->screen_tag);

View File

@ -886,7 +886,7 @@ static DEVICE_START( cdp1869 )
assert(cdp1869->screen != NULL);
/* get the CPU device */
cdp1869->cpu = cputag_get_cpu(device->machine, cdp1869->intf->cpu_tag);
cdp1869->cpu = devtag_get_device(device->machine, cdp1869->intf->cpu_tag);
assert(cdp1869->cpu != NULL);
/* allocate predisplay timer */

View File

@ -4542,7 +4542,7 @@ static DEVICE_START( voodoo )
v->index = device_list_index(&device->machine->config->devicelist, device->type, device->tag);
v->screen = devtag_get_device(device->machine, config->screen);
assert_always(v->screen != NULL, "Unable to find screen attached to voodoo");
v->cpu = cputag_get_cpu(device->machine, config->cputag);
v->cpu = devtag_get_device(device->machine, config->cputag);
assert_always(v->cpu != NULL, "Unable to find CPU attached to voodoo");
v->type = config->type;
v->chipmask = 0x01;

View File

@ -124,7 +124,7 @@ void atarijsa_init(running_machine *machine, const char *testport, int testmask)
UINT8 *rgn;
/* copy in the parameters */
jsacpu = cputag_get_cpu(machine, "jsa");
jsacpu = devtag_get_device(machine, "jsa");
assert_always(jsacpu != NULL, "Could not find JSA CPU!");
test_port = testport;
test_mask = testmask;

View File

@ -163,7 +163,7 @@ void cage_init(running_machine *machine, offs_t speedup)
memory_set_bankptr(machine, "bank10", memory_region(machine, "cageboot"));
memory_set_bankptr(machine, "bank11", memory_region(machine, "cage"));
cage_cpu = cputag_get_cpu(machine, "cage");
cage_cpu = devtag_get_device(machine, "cage");
cage_cpu_clock_period = ATTOTIME_IN_HZ(cpu_get_clock(cage_cpu));
cage_cpu_h1_clock_period = attotime_mul(cage_cpu_clock_period, 2);

View File

@ -1623,7 +1623,7 @@ MACHINE_DRIVER_END
static WRITE8_HANDLER( qb3_sound_w )
{
UINT16 rega = cpu_get_reg(cputag_get_cpu(space->machine, "maincpu"), CCPU_A);
UINT16 rega = cpu_get_reg(devtag_get_device(space->machine, "maincpu"), CCPU_A);
demon_sound_w(space->machine, 0x00 | (~rega & 0x0f), 0x10);
}

View File

@ -940,7 +940,7 @@ void dcs_init(running_machine *machine)
dcs_sram = NULL;
/* find the DCS CPU and the sound ROMs */
dcs.cpu = cputag_get_cpu(machine, "dcs");
dcs.cpu = devtag_get_device(machine, "dcs");
dcs.program = cpu_get_address_space(dcs.cpu, ADDRESS_SPACE_PROGRAM);
dcs.data = cpu_get_address_space(dcs.cpu, ADDRESS_SPACE_DATA);
dcs.rev = 1;
@ -977,18 +977,18 @@ void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset)
memset(&dcs, 0, sizeof(dcs));
/* find the DCS CPU and the sound ROMs */
dcs.cpu = cputag_get_cpu(machine, "dcs2");
dcs.cpu = devtag_get_device(machine, "dcs2");
dcs.rev = 2;
soundbank_words = 0x1000;
if (dcs.cpu == NULL)
{
dcs.cpu = cputag_get_cpu(machine, "dsio");
dcs.cpu = devtag_get_device(machine, "dsio");
dcs.rev = 3;
soundbank_words = 0x400;
}
if (dcs.cpu == NULL)
{
dcs.cpu = cputag_get_cpu(machine, "denver");
dcs.cpu = devtag_get_device(machine, "denver");
dcs.rev = 4;
soundbank_words = 0x800;
}

View File

@ -337,11 +337,11 @@ WRITE32_HANDLER( jaguar_jerry_regs32_w )
static WRITE32_HANDLER( dsp_flags_w )
{
/* write the data through */
jaguardsp_ctrl_w(cputag_get_cpu(space->machine, "audiocpu"), offset, data, mem_mask);
jaguardsp_ctrl_w(devtag_get_device(space->machine, "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 == cputag_get_cpu(space->machine, "audiocpu") && ACCESSING_BITS_8_15 && (data & 0x400))
if (space->cpu == devtag_get_device(space->machine, "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)

View File

@ -514,7 +514,7 @@ static TIMER_CALLBACK( dma_timer_callback );
static DEVICE_START( common_sh_start )
{
running_machine *machine = device->machine;
const address_space *dmaspace = memory_find_address_space(cputag_get_cpu(machine, "audiocpu"), ADDRESS_SPACE_PROGRAM);
const address_space *dmaspace = memory_find_address_space(devtag_get_device(machine, "audiocpu"), ADDRESS_SPACE_PROGRAM);
int i;
/* determine which sound hardware is installed */
@ -1777,8 +1777,8 @@ static READ16_HANDLER( main_to_sound_comm_r )
static TIMER_CALLBACK( delayed_response_r )
{
int checkpc = param;
int pc = cpu_get_reg(cputag_get_cpu(machine, "master"), Z80_PC);
int oldaf = cpu_get_reg(cputag_get_cpu(machine, "master"), Z80_AF);
int pc = cpu_get_reg(devtag_get_device(machine, "master"), Z80_PC);
int oldaf = cpu_get_reg(devtag_get_device(machine, "master"), Z80_AF);
/* This is pretty cheesy, but necessary. Since the CPUs run in round-robin order,
synchronizing on the write to this register from the slave side does nothing.
@ -1791,7 +1791,7 @@ static TIMER_CALLBACK( delayed_response_r )
if (LOG_COMM) logerror("(Updated sound response latch to %02X)\n", sound_response);
oldaf = (oldaf & 0x00ff) | (sound_response << 8);
cpu_set_reg(cputag_get_cpu(machine, "master"), Z80_AF, oldaf);
cpu_set_reg(devtag_get_device(machine, "master"), Z80_AF, oldaf);
}
else
logerror("ERROR: delayed_response_r - current PC = %04X, checkPC = %04X\n", pc, checkpc);

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;
const device_config *audiocpu = cputag_get_cpu(machine, "audiocpu");
const device_config *audiocpu = devtag_get_device(machine, "audiocpu");
#if USE_8039
UINT8 *SND = memory_region(machine, "audiocpu");

View File

@ -110,7 +110,7 @@ void mcr_sound_init(running_machine *machine, UINT8 config)
/* SSIO */
if (mcr_sound_config & MCR_SSIO)
{
ssio_sound_cpu = cputag_get_cpu(machine, "ssiocpu");
ssio_sound_cpu = devtag_get_device(machine, "ssiocpu");
ssio_compute_ay8910_modulation(machine);
state_save_register_global_array(machine, ssio_data);
state_save_register_global(machine, ssio_status);
@ -123,28 +123,28 @@ void mcr_sound_init(running_machine *machine, UINT8 config)
/* Turbo Chip Squeak */
if (mcr_sound_config & MCR_TURBO_CHIP_SQUEAK)
{
turbocs_sound_cpu = cputag_get_cpu(machine, "tcscpu");
turbocs_sound_cpu = devtag_get_device(machine, "tcscpu");
state_save_register_global(machine, turbocs_status);
}
/* Chip Squeak Deluxe */
if (mcr_sound_config & MCR_CHIP_SQUEAK_DELUXE)
{
csdeluxe_sound_cpu = cputag_get_cpu(machine, "csdcpu");
csdeluxe_sound_cpu = devtag_get_device(machine, "csdcpu");
state_save_register_global(machine, csdeluxe_status);
}
/* Sounds Good */
if (mcr_sound_config & MCR_SOUNDS_GOOD)
{
soundsgood_sound_cpu = cputag_get_cpu(machine, "sgcpu");
soundsgood_sound_cpu = devtag_get_device(machine, "sgcpu");
state_save_register_global(machine, soundsgood_status);
}
/* Squawk n Talk */
if (mcr_sound_config & MCR_SQUAWK_N_TALK)
{
squawkntalk_sound_cpu = cputag_get_cpu(machine, "sntcpu");
squawkntalk_sound_cpu = devtag_get_device(machine, "sntcpu");
state_save_register_global(machine, squawkntalk_tms_command);
state_save_register_global(machine, squawkntalk_tms_strobes);
}

View File

@ -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(cputag_get_cpu(machine, "maincpu"), S2650_FO) )
if( cpu_get_reg(devtag_get_device(machine, "maincpu"), S2650_FO) )
amp += 0x80;
/* calculate frequency for counter #1 */
/* bit 0..3 of 0c01 are ctr preset */

View File

@ -191,7 +191,7 @@ static void spacefev_sound_pins_changed( running_machine *machine )
}
if (changes & ((1 << 0x2) | (1 << 0x3) | (1 << 0x5)))
{
generic_pulse_irq_line(cputag_get_cpu(machine, "audiocpu"), 0);
generic_pulse_irq_line(devtag_get_device(machine, "audiocpu"), 0);
}
}
@ -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(cputag_get_cpu(machine, "audiocpu"), 0);
generic_pulse_irq_line(devtag_get_device(machine, "audiocpu"), 0);
}
}
@ -232,7 +232,7 @@ static void helifire_sound_pins_changed( running_machine *machine )
if (changes & (1 << 6))
{
generic_pulse_irq_line(cputag_get_cpu(machine, "audiocpu"), 0);
generic_pulse_irq_line(devtag_get_device(machine, "audiocpu"), 0);
}
}

View File

@ -206,7 +206,7 @@ static DEVICE_START( namco_52xx )
astring *tempstring = astring_alloc();
/* find our CPU */
state->cpu = cputag_get_cpu(device->machine, device_build_tag(tempstring, device, "mcu"));
state->cpu = devtag_get_device(device->machine, device_build_tag(tempstring, device, "mcu"));
assert(state->cpu != NULL);
astring_free(tempstring);

View File

@ -170,7 +170,7 @@ static DEVICE_START( namco_54xx )
astring *tempstring = astring_alloc();
/* find our CPU */
state->cpu = cputag_get_cpu(device->machine, device_build_tag(tempstring, device, "mcu"));
state->cpu = devtag_get_device(device->machine, device_build_tag(tempstring, device, "mcu"));
assert(state->cpu != NULL);
astring_free(tempstring);

View File

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

View File

@ -165,7 +165,7 @@ WRITE8_HANDLER( frogger_filter_w )
void scramble_sh_init(running_machine *machine)
{
cpu_set_irq_callback(cputag_get_cpu(machine, "audiocpu"), scramble_sh_irq_callback);
cpu_set_irq_callback(devtag_get_device(machine, "audiocpu"), scramble_sh_irq_callback);
/* PR is always 0, D is always 1 */
ttl7474_d_w(devtag_get_device(machine, "konami_7474"), 1);

View File

@ -645,7 +645,7 @@ static DEVICE_START( usb_sound )
int tchan, tgroup;
/* find the CPU we are associated with */
usb.cpu = cputag_get_cpu(machine, "usbcpu");
usb.cpu = devtag_get_device(machine, "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=cputag_get_cpu(machine, "audiocpu");
sound_cpu = devtag_get_device(machine, "audiocpu");
update_irq_lines(machine, VECTOR_INIT);
if (romlength > 0x10000)
memory_configure_bank(machine, "bank1", 0, (romlength - 0x10000) / 0x8000, rom + 0x10000, 0x8000);

View File

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

View File

@ -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(cputag_get_cpu(timer->machine, "audiocpu"), 6, vector_reg);
cpu_set_input_line_vector(devtag_get_device(timer->machine, "audiocpu"), 6, vector_reg);
cputag_set_input_line(timer->machine, "audiocpu", 6, ASSERT_LINE);
imr_status |= 0x08;
}
@ -257,7 +257,7 @@ static SOUND_RESET( taito_f3_soundsystem_reset )
sound_ram[3]=ROM[0x80003];
/* reset CPU to catch any banking of startup vectors */
device_reset(cputag_get_cpu(machine, "audiocpu"));
device_reset(devtag_get_device(machine, "audiocpu"));
//cputag_set_input_line(machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
}

View File

@ -271,7 +271,7 @@ void williams_cvsd_init(running_machine *machine)
int bank;
/* configure the CPU */
sound_cpu = cputag_get_cpu(machine, "cvsdcpu");
sound_cpu = devtag_get_device(machine, "cvsdcpu");
soundalt_cpu = NULL;
/* configure master CPU banks */
@ -303,8 +303,8 @@ void williams_narc_init(running_machine *machine)
int bank;
/* configure the CPU */
sound_cpu = cputag_get_cpu(machine, "narc1cpu");
soundalt_cpu = cputag_get_cpu(machine, "narc2cpu");
sound_cpu = devtag_get_device(machine, "narc1cpu");
soundalt_cpu = devtag_get_device(machine, "narc2cpu");
/* configure master CPU banks */
ROM = memory_region(machine, "narc1cpu");
@ -346,7 +346,7 @@ void williams_adpcm_init(running_machine *machine)
UINT8 *ROM;
/* configure the CPU */
sound_cpu = cputag_get_cpu(machine, "adpcm");
sound_cpu = devtag_get_device(machine, "adpcm");
soundalt_cpu = NULL;
/* configure banks */

View File

@ -256,7 +256,7 @@ static MACHINE_RESET( aliens )
{
aliens_state *state = (aliens_state *)machine->driver_data;
konami_configure_set_lines(cputag_get_cpu(machine, "maincpu"), aliens_banking);
konami_configure_set_lines(devtag_get_device(machine, "maincpu"), aliens_banking);
state->palette_selected = 0;
}

View File

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

View File

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

View File

@ -1084,7 +1084,7 @@ static void init_g1_common(running_machine *machine, offs_t slapstic_base, int s
state_save_register_postload(machine, pitfighb_state_postload, NULL);
}
else if (slapstic != 0)
atarigen_slapstic_init(cputag_get_cpu(machine, "maincpu"), slapstic_base, 0, slapstic);
atarigen_slapstic_init(devtag_get_device(machine, "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(cputag_get_cpu(machine, "maincpu"));
atarigen_sound_int_gen(devtag_get_device(machine, "maincpu"));
else
atarigen_sound_int_ack_w(space,0,0,0xffff);
}

View File

@ -218,7 +218,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(cputag_get_cpu(machine, "audiocpu"));
atarigen_sound_io_reset(devtag_get_device(machine, "audiocpu"));
/* reset the joystick parameters */
state->joystick_value = 0;
@ -2339,7 +2339,7 @@ static DRIVER_INIT( marble )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarigen_slapstic_init(cputag_get_cpu(machine, "maincpu"), 0x080000, 0, 103);
atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 103);
state->joystick_type = 0; /* none */
state->trackball_type = 1; /* rotated */
@ -2350,7 +2350,7 @@ static DRIVER_INIT( peterpak )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarigen_slapstic_init(cputag_get_cpu(machine, "maincpu"), 0x080000, 0, 107);
atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 107);
state->joystick_type = 1; /* digital */
state->trackball_type = 0; /* none */
@ -2361,7 +2361,7 @@ static DRIVER_INIT( indytemp )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarigen_slapstic_init(cputag_get_cpu(machine, "maincpu"), 0x080000, 0, 105);
atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 105);
state->joystick_type = 1; /* digital */
state->trackball_type = 0; /* none */
@ -2372,7 +2372,7 @@ static DRIVER_INIT( roadrunn )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarigen_slapstic_init(cputag_get_cpu(machine, "maincpu"), 0x080000, 0, 108);
atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 108);
state->joystick_type = 2; /* analog */
state->trackball_type = 0; /* none */
@ -2383,7 +2383,7 @@ static DRIVER_INIT( roadb109 )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarigen_slapstic_init(cputag_get_cpu(machine, "maincpu"), 0x080000, 0, 109);
atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x080000, 0, 109);
state->joystick_type = 3; /* pedal */
state->trackball_type = 2; /* steering wheel */
@ -2394,7 +2394,7 @@ static DRIVER_INIT( roadb110 )
{
atarisy1_state *state = (atarisy1_state *)machine->driver_data;
atarigen_slapstic_init(cputag_get_cpu(machine, "maincpu"), 0x080000, 0, 110);
atarigen_slapstic_init(devtag_get_device(machine, "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(const device_config *screen, int scanline)
/* generate the 32V interrupt (IRQ 2) */
if ((scanline % 64) == 0)
if (state->interrupt_enable & 4)
atarigen_scanline_int_gen(cputag_get_cpu(screen->machine, "maincpu"));
atarigen_scanline_int_gen(devtag_get_device(screen->machine, "maincpu"));
}
}
@ -245,7 +245,7 @@ static MACHINE_RESET( atarisy2 )
atarigen_eeprom_reset(&state->atarigen);
slapstic_reset();
atarigen_interrupt_reset(&state->atarigen, update_interrupts);
atarigen_sound_io_reset(cputag_get_cpu(machine, "soundcpu"));
atarigen_sound_io_reset(devtag_get_device(machine, "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);
@ -626,7 +626,7 @@ static WRITE8_HANDLER( sound_reset_w )
return;
/* a large number of signals are reset when this happens */
atarigen_sound_io_reset(cputag_get_cpu(space->machine, "soundcpu"));
atarigen_sound_io_reset(devtag_get_device(space->machine, "soundcpu"));
devtag_reset(space->machine, "ymsnd");
mixer_w(space, 0, 0);
state->tms5220_data = 0;

View File

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

View File

@ -666,7 +666,7 @@ static DRIVER_INIT( backfire )
deco56_decrypt_gfx(machine, "gfx1"); /* 141 */
deco56_decrypt_gfx(machine, "gfx2"); /* 141 */
deco156_decrypt(machine);
cpu_set_clockscale(cputag_get_cpu(machine, "maincpu"), 4.0f); /* core timings aren't accurate */
cpu_set_clockscale(devtag_get_device(machine, "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(const device_config *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(cputag_get_cpu(screen->machine, "audiocpu"));
atarigen_6502_irq_gen(devtag_get_device(screen->machine, "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(cputag_get_cpu(machine, "audiocpu"));
atarigen_sound_io_reset(devtag_get_device(machine, "audiocpu"));
memcpy(state->bank_base, &state->bank_source_data[0x0000], 0x1000);
}
@ -695,7 +695,7 @@ static void scanline_update_bootleg(const device_config *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(cputag_get_cpu(screen->machine, "audiocpu"));
// atarigen_6502_irq_gen(devtag_get_device(screen->machine, "audiocpu"));
}
@ -709,7 +709,7 @@ static MACHINE_RESET( badlandb )
atarigen_interrupt_reset(&state->atarigen, update_interrupts_bootleg);
atarigen_scanline_timer_reset(machine->primary_screen, scanline_update_bootleg, 32);
// atarigen_sound_io_reset(cputag_get_cpu(machine, "audiocpu"));
// atarigen_sound_io_reset(devtag_get_device(machine, "audiocpu"));
// memcpy(state->bank_base, &state->bank_source_data[0x0000], 0x1000);
}

View File

@ -180,7 +180,7 @@ static INTERRUPT_GEN( timer_irq )
sc1_Inputs[2] = input_port_read(device->machine,"STROBE0");
generic_pulse_irq_line(cputag_get_cpu(device->machine, "maincpu"), M6809_IRQ_LINE);
generic_pulse_irq_line(devtag_get_device(device->machine, "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(cputag_get_cpu(space->machine, "maincpu"), M6809_FIRQ_LINE);
generic_pulse_irq_line(devtag_get_device(space->machine, "maincpu"), M6809_FIRQ_LINE);
}
}
}

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(cputag_get_cpu(space->machine, "maincpu"), M6809_FIRQ_LINE);
if ( data ) generic_pulse_irq_line(devtag_get_device(space->machine, "maincpu"), M6809_FIRQ_LINE);
}
///////////////////////////////////////////////////////////////////////////

View File

@ -1293,7 +1293,7 @@ static void irq_init(running_machine *machine)
{
irqreq = 0;
cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), irq_callback);
cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback);
}
static void irq_raise(running_machine *machine, int level)

View File

@ -2071,7 +2071,7 @@ static void decrypt_C10707_cpu(running_machine *machine, const char *cputag)
for (addr = 0; addr < 0x10000; addr++)
decrypt[addr] = swap_bits_5_6(rom[addr]);
if (space->cpu == cputag_get_cpu(machine, "maincpu"))
if (space->cpu == devtag_get_device(machine, "maincpu"))
decrypted = decrypt;
}

View File

@ -68,7 +68,7 @@ static TIMER_CALLBACK( delayed_sound_w )
{
main_to_sound_data = param;
main_to_sound_ready = 1;
cpu_triggerint(cputag_get_cpu(machine, "audiocpu"));
cpu_triggerint(devtag_get_device(machine, "audiocpu"));
/* use a timer to make long transfers faster */
timer_set(machine, ATTOTIME_IN_USEC(50), NULL, 0, 0);

View File

@ -558,7 +558,7 @@ static IRQ_CALLBACK(irq_callback)
static MACHINE_START(calchase)
{
cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), irq_callback);
cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback);
calchase_devices.pit8254 = devtag_get_device( machine, "pit8254" );
calchase_devices.pic8259_1 = devtag_get_device( machine, "pic8259_1" );

View File

@ -256,7 +256,7 @@ static WRITE8_HANDLER(toprollr_rombank_w)
static TIMER_CALLBACK( disable_interrupts )
{
cpu_interrupt_enable(cputag_get_cpu(machine, "maincpu"), 0);
cpu_interrupt_enable(devtag_get_device(machine, "maincpu"), 0);
}

View File

@ -287,7 +287,7 @@ static MACHINE_START( cham24 )
memcpy(&dst[0xc000], &src[0x0f8000], 0x4000);
/* uses 8K swapping, all ROM!*/
memory_install_read_bank(cpu_get_address_space(cputag_get_cpu(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank1");
memory_install_read_bank(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank1");
memory_set_bankptr(machine, "bank1", memory_region(machine, "gfx1"));
/* need nametable ram, though. I doubt this uses more than 2k, but it starts up configured for 4 */
@ -298,7 +298,7 @@ static MACHINE_START( cham24 )
nt_page[3] = nt_ram + 0xc00;
/* and read/write handlers */
memory_install_readwrite8_handler(cpu_get_address_space(cputag_get_cpu(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, nt_r, nt_w);
memory_install_readwrite8_handler(cpu_get_address_space(devtag_get_device(machine, "ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, nt_r, nt_w);
}
static DRIVER_INIT( cham24 )

View File

@ -280,7 +280,7 @@ static READ8_HANDLER( qb3_frame_r )
static WRITE8_HANDLER( qb3_ram_bank_w )
{
memory_set_bank(space->machine, "bank1", cpu_get_reg(cputag_get_cpu(space->machine, "maincpu"), CCPU_P) & 3);
memory_set_bank(space->machine, "bank1", cpu_get_reg(devtag_get_device(space->machine, "maincpu"), CCPU_P) & 3);
}

View File

@ -369,8 +369,8 @@ static MACHINE_RESET( cojag )
jaguar_dsp_resume(machine);
/* halt the CPUs */
jaguargpu_ctrl_w(cputag_get_cpu(machine, "gpu"), G_CTRL, 0, 0xffffffff);
jaguardsp_ctrl_w(cputag_get_cpu(machine, "audiocpu"), D_CTRL, 0, 0xffffffff);
jaguargpu_ctrl_w(devtag_get_device(machine, "gpu"), G_CTRL, 0, 0xffffffff);
jaguardsp_ctrl_w(devtag_get_device(machine, "audiocpu"), D_CTRL, 0, 0xffffffff);
}
@ -413,8 +413,8 @@ static WRITE32_HANDLER( misc_control_w )
jaguar_dsp_resume(space->machine);
/* halt the CPUs */
jaguargpu_ctrl_w(cputag_get_cpu(space->machine, "gpu"), G_CTRL, 0, 0xffffffff);
jaguardsp_ctrl_w(cputag_get_cpu(space->machine, "audiocpu"), D_CTRL, 0, 0xffffffff);
jaguargpu_ctrl_w(devtag_get_device(space->machine, "gpu"), G_CTRL, 0, 0xffffffff);
jaguardsp_ctrl_w(devtag_get_device(space->machine, "audiocpu"), D_CTRL, 0, 0xffffffff);
}
/* adjust banking */
@ -437,13 +437,13 @@ static WRITE32_HANDLER( misc_control_w )
static READ32_HANDLER( gpuctrl_r )
{
return jaguargpu_ctrl_r(cputag_get_cpu(space->machine, "gpu"), offset);
return jaguargpu_ctrl_r(devtag_get_device(space->machine, "gpu"), offset);
}
static WRITE32_HANDLER( gpuctrl_w )
{
jaguargpu_ctrl_w(cputag_get_cpu(space->machine, "gpu"), offset, data, mem_mask);
jaguargpu_ctrl_w(devtag_get_device(space->machine, "gpu"), offset, data, mem_mask);
}
@ -456,13 +456,13 @@ static WRITE32_HANDLER( gpuctrl_w )
static READ32_HANDLER( dspctrl_r )
{
return jaguardsp_ctrl_r(cputag_get_cpu(space->machine, "audiocpu"), offset);
return jaguardsp_ctrl_r(devtag_get_device(space->machine, "audiocpu"), offset);
}
static WRITE32_HANDLER( dspctrl_w )
{
jaguardsp_ctrl_w(cputag_get_cpu(space->machine, "audiocpu"), offset, data, mem_mask);
jaguardsp_ctrl_w(devtag_get_device(space->machine, "audiocpu"), offset, data, mem_mask);
}
@ -1501,7 +1501,7 @@ ROM_END
static void cojag_common_init(running_machine *machine, UINT16 gpu_jump_offs, UINT16 spin_pc)
{
/* copy over the ROM */
cojag_is_r3000 = (cpu_get_type(cputag_get_cpu(machine, "maincpu")) == CPU_R3041BE);
cojag_is_r3000 = (cpu_get_type(devtag_get_device(machine, "maincpu")) == CPU_R3041BE);
/* install synchronization hooks for GPU */
if (cojag_is_r3000)

View File

@ -7596,7 +7596,7 @@ static DRIVER_INIT( cps2 )
state->scancount = 0;
state->cps2networkpresent = 0;
cpu_set_clockscale(cputag_get_cpu(machine, "maincpu"), 0.7375f); /* RAM access waitstates etc. aren't emulated - slow the CPU to compensate */
cpu_set_clockscale(devtag_get_device(machine, "maincpu"), 0.7375f); /* RAM access waitstates etc. aren't emulated - slow the CPU to compensate */
}
static DRIVER_INIT( ssf2tb )

View File

@ -694,7 +694,7 @@ static DRIVER_INIT( cps3 )
if (!cps3_user5region) cps3_user5region = auto_alloc_array(machine, UINT8, USER5REGION_LENGTH);
// set strict verify
sh2drc_set_options(cputag_get_cpu(machine, "maincpu"), SH2DRC_STRICT_VERIFY);
sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_STRICT_VERIFY);
cps3_decrypt_bios(machine);
decrypted_gamerom = auto_alloc_array(machine, UINT32, 0x1000000/4);

View File

@ -163,7 +163,7 @@ static WRITE8_HANDLER( port_sound_w )
const device_config *sn = devtag_get_device(space->machine, "snsnd");
/* D0 - interrupt enable - also goes to PC3259 as /HTCTRL */
cpu_interrupt_enable(cputag_get_cpu(space->machine, "maincpu"), (data & 0x01) ? TRUE : FALSE);
cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), (data & 0x01) ? TRUE : FALSE);
crbaloon_set_clear_collision_address((data & 0x01) ? TRUE : FALSE);
/* D1 - SOUND STOP */

View File

@ -272,7 +272,7 @@ static MACHINE_START( crimfght )
static MACHINE_RESET( crimfght )
{
konami_configure_set_lines(cputag_get_cpu(machine, "maincpu"), crimfght_banking);
konami_configure_set_lines(devtag_get_device(machine, "maincpu"), crimfght_banking);
}
static MACHINE_DRIVER_START( crimfght )

View File

@ -504,7 +504,7 @@ static MACHINE_START(crystal)
{
int i;
cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), icallback);
cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), icallback);
for (i = 0; i < 4; i++)
Timer[i] = timer_alloc(machine, Timercb, (void*)(FPTR)i);
@ -519,7 +519,7 @@ static MACHINE_RESET(crystal)
memset(vidregs, 0, 0x10000);
FlipCount = 0;
IntHigh = 0;
cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), icallback);
cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), icallback);
Bank = 0;
memory_set_bankptr(machine, "bank1", memory_region(machine, "user1") + 0);
FlashCmd = 0xff;

View File

@ -110,8 +110,8 @@ static VIDEO_UPDATE( cubeqst )
for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
{
int i;
int num_entries = cubeqcpu_get_ptr_ram_val(cputag_get_cpu(screen->machine, "line_cpu"), y);
UINT32 *stk_ram = cubeqcpu_get_stack_ram(cputag_get_cpu(screen->machine, "line_cpu"));
int num_entries = cubeqcpu_get_ptr_ram_val(devtag_get_device(screen->machine, "line_cpu"), y);
UINT32 *stk_ram = cubeqcpu_get_stack_ram(devtag_get_device(screen->machine, "line_cpu"));
UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
UINT32 pen;
@ -240,10 +240,10 @@ static WRITE16_HANDLER( control_w )
static TIMER_CALLBACK( delayed_bank_swap )
{
cubeqcpu_swap_line_banks(cputag_get_cpu(machine, "line_cpu"));
cubeqcpu_swap_line_banks(devtag_get_device(machine, "line_cpu"));
/* TODO: This is a little dubious */
cubeqcpu_clear_stack(cputag_get_cpu(machine, "line_cpu"));
cubeqcpu_clear_stack(devtag_get_device(machine, "line_cpu"));
}
@ -375,22 +375,22 @@ INPUT_PORTS_END
static READ16_HANDLER( read_rotram )
{
return cubeqcpu_rotram_r(cputag_get_cpu(space->machine, "rotate_cpu"), offset, mem_mask);
return cubeqcpu_rotram_r(devtag_get_device(space->machine, "rotate_cpu"), offset, mem_mask);
}
static WRITE16_HANDLER( write_rotram )
{
cubeqcpu_rotram_w(cputag_get_cpu(space->machine, "rotate_cpu"), offset, data, mem_mask);
cubeqcpu_rotram_w(devtag_get_device(space->machine, "rotate_cpu"), offset, data, mem_mask);
}
static READ16_HANDLER( read_sndram )
{
return cubeqcpu_sndram_r(cputag_get_cpu(space->machine, "sound_cpu"), offset, mem_mask);
return cubeqcpu_sndram_r(devtag_get_device(space->machine, "sound_cpu"), offset, mem_mask);
}
static WRITE16_HANDLER( write_sndram )
{
cubeqcpu_sndram_w(cputag_get_cpu(space->machine, "sound_cpu"), offset, data, mem_mask);
cubeqcpu_sndram_w(devtag_get_device(space->machine, "sound_cpu"), offset, data, mem_mask);
}
static ADDRESS_MAP_START( m68k_program_map, ADDRESS_SPACE_PROGRAM, 16 )

View File

@ -1176,11 +1176,11 @@ static DRIVER_INIT( cd32 )
static void cndypuzl_input_hack(running_machine *machine)
{
if(cpu_get_pc(cputag_get_cpu(machine,"maincpu")) < amiga_chip_ram_size)
if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size)
{
// amiga_chip_ram_w(0x051c02, 0x0000);
UINT32 r_A5 = cpu_get_reg(cputag_get_cpu(machine,"maincpu"), M68K_A5);
UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5);
amiga_chip_ram_w(r_A5 - 0x7ebe, 0x0000);
}
}
@ -1193,11 +1193,11 @@ static DRIVER_INIT(cndypuzl)
static void haremchl_input_hack(running_machine *machine)
{
if(cpu_get_pc(cputag_get_cpu(machine,"maincpu")) < amiga_chip_ram_size)
if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size)
{
// amiga_chip_ram_w8(0x002907, 0x00);
UINT32 r_A5 = cpu_get_reg(cputag_get_cpu(machine,"maincpu"), M68K_A5);
UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5);
UINT32 r_A2 = (amiga_chip_ram_r(r_A5 - 0x7f00 + 0) << 16) | (amiga_chip_ram_r(r_A5 - 0x7f00 + 2));
amiga_chip_ram_w8(r_A2 + 0x1f, 0x00);
}
@ -1211,11 +1211,11 @@ static DRIVER_INIT(haremchl)
static void lsrquiz_input_hack(running_machine *machine)
{
if(cpu_get_pc(cputag_get_cpu(machine,"maincpu")) < amiga_chip_ram_size)
if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size)
{
// amiga_chip_ram_w8(0x001e1b, 0x00);
UINT32 r_A5 = cpu_get_reg(cputag_get_cpu(machine,"maincpu"), M68K_A5);
UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5);
UINT32 r_A2 = (amiga_chip_ram_r(r_A5 - 0x7fe0 + 0) << 16) | (amiga_chip_ram_r(r_A5 - 0x7fe0 + 2));
amiga_chip_ram_w8(r_A2 + 0x13, 0x00);
}
@ -1230,11 +1230,11 @@ static DRIVER_INIT(lsrquiz)
/* The hack isn't working if you exit the test mode with P1 button 2 ! */
static void lsrquiz2_input_hack(running_machine *machine)
{
if(cpu_get_pc(cputag_get_cpu(machine,"maincpu")) < amiga_chip_ram_size)
if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size)
{
// amiga_chip_ram_w8(0x046107, 0x00);
UINT32 r_A5 = cpu_get_reg(cputag_get_cpu(machine,"maincpu"), M68K_A5);
UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5);
UINT32 r_A2 = (amiga_chip_ram_r(r_A5 - 0x7fdc + 0) << 16) | (amiga_chip_ram_r(r_A5 - 0x7fdc + 2));
amiga_chip_ram_w8(r_A2 + 0x17, 0x00);
}
@ -1248,11 +1248,11 @@ static DRIVER_INIT(lsrquiz2)
static void lasstixx_input_hack(running_machine *machine)
{
if(cpu_get_pc(cputag_get_cpu(machine,"maincpu")) < amiga_chip_ram_size)
if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size)
{
// amiga_chip_ram_w8(0x00281c, 0x00);
UINT32 r_A5 = cpu_get_reg(cputag_get_cpu(machine,"maincpu"), M68K_A5);
UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5);
UINT32 r_A2 = (amiga_chip_ram_r(r_A5 - 0x7fa2 + 0) << 16) | (amiga_chip_ram_r(r_A5 - 0x7fa2 + 2));
amiga_chip_ram_w8(r_A2 + 0x24, 0x00);
}
@ -1266,11 +1266,11 @@ static DRIVER_INIT(lasstixx)
static void mgnumber_input_hack(running_machine *machine)
{
if(cpu_get_pc(cputag_get_cpu(machine,"maincpu")) < amiga_chip_ram_size)
if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size)
{
// amiga_chip_ram_w(0x04bfa0, 0x0000);
UINT32 r_A5 = cpu_get_reg(cputag_get_cpu(machine,"maincpu"), M68K_A5);
UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5);
amiga_chip_ram_w(r_A5 - 0x7ed8, 0x0000);
}
}
@ -1283,11 +1283,11 @@ static DRIVER_INIT(mgnumber)
static void mgprem11_input_hack(running_machine *machine)
{
if(cpu_get_pc(cputag_get_cpu(machine,"maincpu")) < amiga_chip_ram_size)
if(cpu_get_pc(devtag_get_device(machine,"maincpu")) < amiga_chip_ram_size)
{
// amiga_chip_ram_w8(0x044f7e, 0x00);
UINT32 r_A5 = cpu_get_reg(cputag_get_cpu(machine,"maincpu"), M68K_A5);
UINT32 r_A5 = cpu_get_reg(devtag_get_device(machine,"maincpu"), M68K_A5);
amiga_chip_ram_w8(r_A5 - 0x7eca, 0x00);
}
}

View File

@ -65,7 +65,7 @@ static MACHINE_RESET( cyberbal )
atarigen_slapstic_reset(&state->atarigen);
atarigen_interrupt_reset(&state->atarigen, update_interrupts);
atarigen_scanline_timer_reset(machine->primary_screen, cyberbal_scanline_update, 8);
atarigen_sound_io_reset(cputag_get_cpu(machine, "audiocpu"));
atarigen_sound_io_reset(devtag_get_device(machine, "audiocpu"));
cyberbal_sound_reset(machine);
@ -999,7 +999,7 @@ static DRIVER_INIT( cyberbal )
{
cyberbal_state *state = (cyberbal_state *)machine->driver_data;
state->atarigen.eeprom_default = default_eeprom;
atarigen_slapstic_init(cputag_get_cpu(machine, "maincpu"), 0x018000, 0, 0);
atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x018000, 0, 0);
}
@ -1007,7 +1007,7 @@ static DRIVER_INIT( cyberbt )
{
cyberbal_state *state = (cyberbal_state *)machine->driver_data;
state->atarigen.eeprom_default = default_eeprom;
atarigen_slapstic_init(cputag_get_cpu(machine, "maincpu"), 0x018000, 0, 116);
atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x018000, 0, 116);
}

View File

@ -719,11 +719,11 @@ static READ32_HANDLER( avengrgs_speedup_r )
static DRIVER_INIT( avengrgs )
{
// init options
sh2drc_set_options(cputag_get_cpu(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS);
sh2drc_set_options(devtag_get_device(machine, "maincpu"), SH2DRC_FASTEST_OPTIONS);
// set up speed cheat
sh2drc_add_pcflush(cputag_get_cpu(machine, "maincpu"), 0x3234);
sh2drc_add_pcflush(cputag_get_cpu(machine, "maincpu"), 0x32dc);
sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x3234);
sh2drc_add_pcflush(devtag_get_device(machine, "maincpu"), 0x32dc);
mainCpuIsArm = 0;
memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x01089a0, 0x01089a3, 0, 0, avengrgs_speedup_r );
@ -735,7 +735,7 @@ static DRIVER_INIT( mlc )
/* The timing in the ARM core isn't as accurate as it should be, so bump up the
effective clock rate here to compensate otherwise we have slowdowns in
Skull Fung where there probably shouldn't be. */
cpu_set_clockscale(cputag_get_cpu(machine, "maincpu"), 2.0f);
cpu_set_clockscale(devtag_get_device(machine, "maincpu"), 2.0f);
mainCpuIsArm = 1;
deco156_decrypt(machine);
descramble_sound(machine);

View File

@ -75,7 +75,7 @@ static NVRAM_HANDLER( dderby )
static WRITE8_HANDLER( dderby_sound_w )
{
soundlatch_w(space,0,data);
cpu_set_input_line(cputag_get_cpu(space->machine, "audiocpu"), 0, HOLD_LINE);
cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
}
static UINT8 io_port[8];

View File

@ -569,7 +569,7 @@ static DRIVER_INIT( drgnmst )
data_lo = drgnmst_asciitohex((drgnmst_PICROM_HEX[src_pos + 3]));
data |= (data_hi << 12) | (data_lo << 8);
pic16c5x_set_config(cputag_get_cpu(machine, "audiocpu"), data);
pic16c5x_set_config(devtag_get_device(machine, "audiocpu"), data);
src_pos = 0x7fff; /* Force Exit */
}

View File

@ -42,7 +42,7 @@ static void update_interrupts(running_machine *machine)
cputag_set_input_line(machine, "maincpu", 4, state->atarigen.video_int_state ? ASSERT_LINE : CLEAR_LINE);
if (cputag_get_cpu(machine, "extra") != NULL)
if (devtag_get_device(machine, "extra") != NULL)
cputag_set_input_line(machine, "extra", 4, state->atarigen.video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 6, state->atarigen.sound_int_state ? ASSERT_LINE : CLEAR_LINE);
@ -108,7 +108,7 @@ static WRITE16_HANDLER( eprom_latch_w )
{
eprom_state *state = (eprom_state *)space->machine->driver_data;
if (ACCESSING_BITS_0_7 && (cputag_get_cpu(space->machine, "extra") != NULL))
if (ACCESSING_BITS_0_7 && (devtag_get_device(space->machine, "extra") != NULL))
{
/* bit 0: reset extra CPU */
if (data & 1)

View File

@ -130,7 +130,7 @@ static READ8_HANDLER( uart_r )
static READ8_HANDLER( g_status_r )
{
int bank4 = BIT(get_rip_status(cputag_get_cpu(space->machine, "video_cpu")), 2);
int bank4 = BIT(get_rip_status(devtag_get_device(space->machine, "video_cpu")), 2);
int vblank = video_screen_get_vblank(space->machine->primary_screen);
return (!vblank << 7) | (bank4 << 6) | (f_status & 0x2f);
@ -179,7 +179,7 @@ static WRITE8_HANDLER( g_status_w )
static READ8_HANDLER( f_status_r )
{
int vblank = video_screen_get_vblank(space->machine->primary_screen);
UINT8 rip_status = get_rip_status(cputag_get_cpu(space->machine, "video_cpu"));
UINT8 rip_status = get_rip_status(devtag_get_device(space->machine, "video_cpu"));
rip_status = (rip_status & 0x18) | (BIT(rip_status, 6) << 1) | BIT(rip_status, 7);

View File

@ -93,13 +93,13 @@ static UINT8 dac_value[2];
static WRITE16_HANDLER( exterm_host_data_w )
{
tms34010_host_w(cputag_get_cpu(space->machine, "slave"), offset / TOWORD(0x00100000), data);
tms34010_host_w(devtag_get_device(space->machine, "slave"), offset / TOWORD(0x00100000), data);
}
static READ16_HANDLER( exterm_host_data_r )
{
return tms34010_host_r(cputag_get_cpu(space->machine, "slave"), offset / TOWORD(0x00100000));
return tms34010_host_r(devtag_get_device(space->machine, "slave"), offset / TOWORD(0x00100000));
}

View File

@ -1683,10 +1683,10 @@ static UINT32 *work_ram;
static MACHINE_START( firebeat )
{
/* set conservative DRC options */
ppcdrc_set_options(cputag_get_cpu(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
ppcdrc_set_options(devtag_get_device(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
/* configure fast RAM regions for DRC */
ppcdrc_add_fastram(cputag_get_cpu(machine, "maincpu"), 0x00000000, 0x01ffffff, FALSE, work_ram);
ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x01ffffff, FALSE, work_ram);
}
static ADDRESS_MAP_START( firebeat_map, ADDRESS_SPACE_PROGRAM, 32 )
@ -2157,7 +2157,7 @@ static void security_w(const device_config *device, UINT8 data)
{
int r = ibutton_w(data);
if (r >= 0)
ppc4xx_spu_receive_byte(cputag_get_cpu(device->machine, "maincpu"), r);
ppc4xx_spu_receive_byte(devtag_get_device(device->machine, "maincpu"), r);
}
/*****************************************************************************/
@ -2190,7 +2190,7 @@ static void init_firebeat(running_machine *machine)
cur_cab_data = cab_data;
ppc4xx_spu_set_tx_handler(cputag_get_cpu(machine, "maincpu"), security_w);
ppc4xx_spu_set_tx_handler(devtag_get_device(machine, "maincpu"), security_w);
set_ibutton(rom);

View File

@ -66,7 +66,7 @@ static TIMER_CALLBACK( periodic_callback )
{
int scanline = param;
generic_pulse_irq_line(cputag_get_cpu(machine, "maincpu"), 0);
generic_pulse_irq_line(devtag_get_device(machine, "maincpu"), 0);
/* IRQs are generated by inverse 16V signal */
scanline += 32;

View File

@ -121,7 +121,7 @@ static TIMER_DEVICE_CALLBACK( scanline_update )
mystery yet */
/* INT 1 is on 32V */
atarigen_scanline_int_gen(cputag_get_cpu(timer->machine, "maincpu"));
atarigen_scanline_int_gen(devtag_get_device(timer->machine, "maincpu"));
/* advance to the next interrupt */
scanline += 64;

View File

@ -572,7 +572,7 @@ static WRITE16_HANDLER( adsp_rombank_w )
static TIMER_DEVICE_CALLBACK( adsp_autobuffer_irq )
{
/* get the index register */
int reg = cpu_get_reg(cputag_get_cpu(timer->machine, "adsp"), ADSP2100_I0 + adsp_ireg);
int reg = cpu_get_reg(devtag_get_device(timer->machine, "adsp"), ADSP2100_I0 + adsp_ireg);
/* copy the current data into the buffer */
// logerror("ADSP buffer: I%d=%04X incs=%04X size=%04X\n", adsp_ireg, reg, adsp_incs, adsp_size);
@ -589,11 +589,11 @@ static TIMER_DEVICE_CALLBACK( adsp_autobuffer_irq )
reg = adsp_ireg_base;
/* generate the (internal, thats why the pulse) irq */
generic_pulse_irq_line(cputag_get_cpu(timer->machine, "adsp"), ADSP2105_IRQ1);
generic_pulse_irq_line(devtag_get_device(timer->machine, "adsp"), ADSP2105_IRQ1);
}
/* store it */
cpu_set_reg(cputag_get_cpu(timer->machine, "adsp"), ADSP2100_I0 + adsp_ireg, reg);
cpu_set_reg(devtag_get_device(timer->machine, "adsp"), ADSP2100_I0 + adsp_ireg, reg);
}

View File

@ -745,19 +745,19 @@ static WRITE8_HANDLER( bosco_latch_w )
switch (offset)
{
case 0x00: /* IRQ1 */
cpu_interrupt_enable(cputag_get_cpu(space->machine, "maincpu"), bit);
cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit);
if (!bit)
cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
break;
case 0x01: /* IRQ2 */
cpu_interrupt_enable(cputag_get_cpu(space->machine, "sub"), bit);
cpu_interrupt_enable(devtag_get_device(space->machine, "sub"), bit);
if (!bit)
cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
break;
case 0x02: /* NMION */
cpu_interrupt_enable(cputag_get_cpu(space->machine, "sub2"), !bit);
cpu_interrupt_enable(devtag_get_device(space->machine, "sub2"), !bit);
break;
case 0x03: /* RESET */
@ -866,7 +866,7 @@ static TIMER_CALLBACK( cpu3_interrupt_callback )
{
int scanline = param;
nmi_line_pulse(cputag_get_cpu(machine, "sub2"));
nmi_line_pulse(devtag_get_device(machine, "sub2"));
scanline = scanline + 128;
if (scanline >= 272)

View File

@ -445,7 +445,7 @@ static MACHINE_RESET( galivan )
{
galivan_state *state = (galivan_state *)machine->driver_data;
device_reset(cputag_get_cpu(machine, "maincpu"));
device_reset(devtag_get_device(machine, "maincpu"));
// state->layers = 0x60;
state->layers = 0;
@ -459,7 +459,7 @@ static MACHINE_RESET( ninjemak )
{
galivan_state *state = (galivan_state *)machine->driver_data;
device_reset(cputag_get_cpu(machine, "maincpu"));
device_reset(devtag_get_device(machine, "maincpu"));
state->scrollx[0] = state->scrollx[1] = 0;
state->scrolly[0] = state->scrolly[1] = 0;

View File

@ -229,7 +229,7 @@ static void galpani2_mcu_nmi1(running_machine *machine)
static void galpani2_mcu_nmi2(running_machine *machine)
{
galpani2_write_kaneko(cputag_get_cpu(machine, "maincpu"));
galpani2_write_kaneko(devtag_get_device(machine, "maincpu"));
//logerror("%s : MCU executes CHECKs synchro\n", cpuexec_describe_context(machine));
}

View File

@ -605,7 +605,7 @@ static MACHINE_RESET(gamecstl)
{
memory_set_bankptr(machine, "bank1", memory_region(machine, "user1") + 0x30000);
cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), irq_callback);
cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback);
}

View File

@ -184,7 +184,7 @@ static WRITE8_DEVICE_HANDLER( gaplus_snd_sharedram_w )
static WRITE8_HANDLER( gaplus_irq_1_ctrl_w )
{
int bit = !BIT(offset, 11);
cpu_interrupt_enable(cputag_get_cpu(space->machine, "maincpu"), bit);
cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit);
if (!bit)
cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
}
@ -192,7 +192,7 @@ static WRITE8_HANDLER( gaplus_irq_1_ctrl_w )
static WRITE8_HANDLER( gaplus_irq_3_ctrl_w )
{
int bit = !BIT(offset, 13);
cpu_interrupt_enable(cputag_get_cpu(space->machine, "sub2"), bit);
cpu_interrupt_enable(devtag_get_device(space->machine, "sub2"), bit);
if (!bit)
cputag_set_input_line(space->machine, "sub2", 0, CLEAR_LINE);
}
@ -200,7 +200,7 @@ static WRITE8_HANDLER( gaplus_irq_3_ctrl_w )
static WRITE8_HANDLER( gaplus_irq_2_ctrl_w )
{
int bit = offset & 1;
cpu_interrupt_enable(cputag_get_cpu(space->machine, "sub"), bit);
cpu_interrupt_enable(devtag_get_device(space->machine, "sub"), bit);
if (!bit)
cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
}
@ -228,7 +228,7 @@ static WRITE8_HANDLER( gaplus_freset_w )
static MACHINE_RESET( gaplus )
{
/* on reset, VINTON is reset, while the other flags don't seem to be affected */
cpu_interrupt_enable(cputag_get_cpu(machine, "sub"), 0);
cpu_interrupt_enable(devtag_get_device(machine, "sub"), 0);
cputag_set_input_line(machine, "sub", 0, CLEAR_LINE);
}

View File

@ -148,7 +148,7 @@ static void scanline_update(const device_config *screen, int scanline)
/* sound IRQ is on 32V */
if (scanline & 32)
atarigen_6502_irq_gen(cputag_get_cpu(screen->machine, "audiocpu"));
atarigen_6502_irq_gen(devtag_get_device(screen->machine, "audiocpu"));
else
atarigen_6502_irq_ack_r(space, 0);
}
@ -173,7 +173,7 @@ static MACHINE_RESET( gauntlet )
atarigen_slapstic_reset(&state->atarigen);
atarigen_interrupt_reset(&state->atarigen, update_interrupts);
atarigen_scanline_timer_reset(machine->primary_screen, scanline_update, 32);
atarigen_sound_io_reset(cputag_get_cpu(machine, "audiocpu"));
atarigen_sound_io_reset(devtag_get_device(machine, "audiocpu"));
}
@ -1617,7 +1617,7 @@ static void gauntlet_common_init(running_machine *machine, int slapstic, int vin
gauntlet_state *state = (gauntlet_state *)machine->driver_data;
UINT8 *rom = memory_region(machine, "maincpu");
state->atarigen.eeprom_default = NULL;
atarigen_slapstic_init(cputag_get_cpu(machine, "maincpu"), 0x038000, 0, slapstic);
atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), 0x038000, 0, slapstic);
/* swap the top and bottom halves of the main CPU ROM images */
atarigen_swap_mem(rom + 0x000000, rom + 0x008000, 0x8000);

View File

@ -272,7 +272,7 @@ static MACHINE_RESET( gladiator )
{
UINT8 *rom = memory_region(machine, "audiocpu") + 0x10000;
memory_set_bankptr(machine, "bank2",rom);
device_reset(cputag_get_cpu(machine, "audiocpu"));
device_reset(devtag_get_device(machine, "audiocpu"));
}
}

View File

@ -398,10 +398,10 @@ static WRITE8_HANDLER( sysreg_w )
static MACHINE_START( gticlub )
{
/* set conservative DRC options */
ppcdrc_set_options(cputag_get_cpu(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
ppcdrc_set_options(devtag_get_device(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
/* configure fast RAM regions for DRC */
ppcdrc_add_fastram(cputag_get_cpu(machine, "maincpu"), 0x00000000, 0x000fffff, FALSE, work_ram);
ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x000fffff, FALSE, work_ram);
}
static ADDRESS_MAP_START( gticlub_map, ADDRESS_SPACE_PROGRAM, 32 )

View File

@ -3635,14 +3635,14 @@ ROM_END
static void find_cpus(running_machine *machine)
{
harddriv_state *state = (harddriv_state *)machine->driver_data;
state->maincpu = cputag_get_cpu(machine, "maincpu");
state->gsp = cputag_get_cpu(machine, "gsp");
state->msp = cputag_get_cpu(machine, "msp");
state->adsp = cputag_get_cpu(machine, "adsp");
state->soundcpu = cputag_get_cpu(machine, "soundcpu");
state->sounddsp = cputag_get_cpu(machine, "sounddsp");
state->jsacpu = cputag_get_cpu(machine, "jsa");
state->dsp32 = cputag_get_cpu(machine, "dsp32");
state->maincpu = devtag_get_device(machine, "maincpu");
state->gsp = devtag_get_device(machine, "gsp");
state->msp = devtag_get_device(machine, "msp");
state->adsp = devtag_get_device(machine, "adsp");
state->soundcpu = devtag_get_device(machine, "soundcpu");
state->sounddsp = devtag_get_device(machine, "sounddsp");
state->jsacpu = devtag_get_device(machine, "jsa");
state->dsp32 = devtag_get_device(machine, "dsp32");
}

View File

@ -1812,12 +1812,12 @@ static INTERRUPT_GEN( irq_start )
static MACHINE_START(hyperneo)
{
/* set the fastest DRC options */
mips3drc_set_options(cputag_get_cpu(machine, "maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
mips3drc_set_options(devtag_get_device(machine, "maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
/* configure fast RAM regions for DRC */
mips3drc_add_fastram(cputag_get_cpu(machine, "maincpu"), 0x00000000, 0x00ffffff, FALSE, hng_mainram);
mips3drc_add_fastram(cputag_get_cpu(machine, "maincpu"), 0x04000000, 0x05ffffff, TRUE, hng_cart);
mips3drc_add_fastram(cputag_get_cpu(machine, "maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, rombase);
mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x00ffffff, FALSE, hng_mainram);
mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x04000000, 0x05ffffff, TRUE, hng_cart);
mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, rombase);
}

View File

@ -1047,10 +1047,10 @@ static MACHINE_START( hornet )
jvs_sdata = auto_alloc_array_clear(machine, UINT8, 1024);
/* set conservative DRC options */
ppcdrc_set_options(cputag_get_cpu(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
ppcdrc_set_options(devtag_get_device(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
/* configure fast RAM regions for DRC */
ppcdrc_add_fastram(cputag_get_cpu(machine, "maincpu"), 0x00000000, 0x003fffff, FALSE, workram);
ppcdrc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x003fffff, FALSE, workram);
state_save_register_global(machine, led_reg0);
state_save_register_global(machine, led_reg1);
@ -1275,19 +1275,19 @@ static int jvs_encode_data(running_machine *machine, UINT8 *in, int length)
if (b == 0xe0)
{
sum += 0xd0 + 0xdf;
ppc4xx_spu_receive_byte(cputag_get_cpu(machine, "maincpu"), 0xd0);
ppc4xx_spu_receive_byte(cputag_get_cpu(machine, "maincpu"), 0xdf);
ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), 0xd0);
ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), 0xdf);
}
else if (b == 0xd0)
{
sum += 0xd0 + 0xcf;
ppc4xx_spu_receive_byte(cputag_get_cpu(machine, "maincpu"), 0xd0);
ppc4xx_spu_receive_byte(cputag_get_cpu(machine, "maincpu"), 0xcf);
ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), 0xd0);
ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), 0xcf);
}
else
{
sum += b;
ppc4xx_spu_receive_byte(cputag_get_cpu(machine, "maincpu"), b);
ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), b);
}
}
return sum;
@ -1380,11 +1380,11 @@ static void jamma_jvs_cmd_exec(running_machine *machine)
// write jvs return data
sum = 0x00 + (rdata_ptr+1);
ppc4xx_spu_receive_byte(cputag_get_cpu(machine, "maincpu"), 0xe0); // sync
ppc4xx_spu_receive_byte(cputag_get_cpu(machine, "maincpu"), 0x00); // node
ppc4xx_spu_receive_byte(cputag_get_cpu(machine, "maincpu"), rdata_ptr + 1); // num of bytes
ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), 0xe0); // sync
ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), 0x00); // node
ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), rdata_ptr + 1); // num of bytes
sum += jvs_encode_data(machine, rdata, rdata_ptr);
ppc4xx_spu_receive_byte(cputag_get_cpu(machine, "maincpu"), sum - 1); // checksum
ppc4xx_spu_receive_byte(devtag_get_device(machine, "maincpu"), sum - 1); // checksum
jvs_sdata_ptr = 0;
}
@ -1399,7 +1399,7 @@ static DRIVER_INIT(hornet)
led_reg0 = led_reg1 = 0x7f;
ppc4xx_spu_set_tx_handler(cputag_get_cpu(machine, "maincpu"), jamma_jvs_w);
ppc4xx_spu_set_tx_handler(devtag_get_device(machine, "maincpu"), jamma_jvs_w);
}
static DRIVER_INIT(hornet_2board)
@ -1410,7 +1410,7 @@ static DRIVER_INIT(hornet_2board)
led_reg0 = led_reg1 = 0x7f;
ppc4xx_spu_set_tx_handler(cputag_get_cpu(machine, "maincpu"), jamma_jvs_w);
ppc4xx_spu_set_tx_handler(devtag_get_device(machine, "maincpu"), jamma_jvs_w);
}
/*****************************************************************************/

View File

@ -592,7 +592,7 @@ static const via6522_interface via_interface =
void itech8_update_interrupts(running_machine *machine, int periodic, int tms34061, int blitter)
{
cpu_type main_cpu_type = cpu_get_type(cputag_get_cpu(machine, "maincpu"));
cpu_type main_cpu_type = cpu_get_type(devtag_get_device(machine, "maincpu"));
/* update the states */
if (periodic != -1) periodic_int = periodic;
@ -671,13 +671,13 @@ static MACHINE_START( sstrike )
static MACHINE_RESET( itech8 )
{
cpu_type main_cpu_type = cpu_get_type(cputag_get_cpu(machine, "maincpu"));
cpu_type main_cpu_type = cpu_get_type(devtag_get_device(machine, "maincpu"));
/* make sure bank 0 is selected */
if (main_cpu_type == CPU_M6809 || main_cpu_type == CPU_HD6309)
{
memory_set_bankptr(machine, "bank1", &memory_region(machine, "maincpu")[0x4000]);
device_reset(cputag_get_cpu(machine, "maincpu"));
device_reset(devtag_get_device(machine, "maincpu"));
}
/* reset the palette chip */

View File

@ -355,7 +355,7 @@ static MACHINE_RESET( jackal )
// HACK: running at the nominal clock rate, music stops working
// at the beginning of the game. This fixes it.
cpu_set_clockscale(cputag_get_cpu(machine, "slave"), 1.2f);
cpu_set_clockscale(devtag_get_device(machine, "slave"), 1.2f);
state->rambank = rgn;
state->spritebank = rgn;

View File

@ -198,12 +198,12 @@ static MACHINE_RESET( jpmimpct )
static WRITE16_HANDLER( m68k_tms_w )
{
tms34010_host_w(cputag_get_cpu(space->machine, "dsp"), offset, data);
tms34010_host_w(devtag_get_device(space->machine, "dsp"), offset, data);
}
static READ16_HANDLER( m68k_tms_r )
{
return tms34010_host_r(cputag_get_cpu(space->machine, "dsp"), offset);
return tms34010_host_r(devtag_get_device(space->machine, "dsp"), offset);
}

View File

@ -106,7 +106,7 @@
static WRITE8_HANDLER( jrpacman_interrupt_vector_w )
{
cpu_set_input_line_vector(cputag_get_cpu(space->machine, "maincpu"), 0, data);
cpu_set_input_line_vector(devtag_get_device(space->machine, "maincpu"), 0, data);
cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
}

View File

@ -190,12 +190,12 @@ static MACHINE_START( kinst )
}
/* set the fastest DRC options */
mips3drc_set_options(cputag_get_cpu(machine, "maincpu"), MIPS3DRC_FASTEST_OPTIONS);
mips3drc_set_options(devtag_get_device(machine, "maincpu"), MIPS3DRC_FASTEST_OPTIONS);
/* configure fast RAM regions for DRC */
mips3drc_add_fastram(cputag_get_cpu(machine, "maincpu"), 0x08000000, 0x087fffff, FALSE, rambase2);
mips3drc_add_fastram(cputag_get_cpu(machine, "maincpu"), 0x00000000, 0x0007ffff, FALSE, rambase);
mips3drc_add_fastram(cputag_get_cpu(machine, "maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, rombase);
mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x08000000, 0x087fffff, FALSE, rambase2);
mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x00000000, 0x0007ffff, FALSE, rambase);
mips3drc_add_fastram(devtag_get_device(machine, "maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, rombase);
}

View File

@ -41,7 +41,7 @@ static void scanline_update(const device_config *screen, int scanline)
{
/* generate 32V signals */
if ((scanline & 32) == 0 && !(input_port_read(screen->machine, "P1") & 0x800))
atarigen_scanline_int_gen(cputag_get_cpu(screen->machine, "maincpu"));
atarigen_scanline_int_gen(devtag_get_device(screen->machine, "maincpu"));
}

View File

@ -1259,27 +1259,27 @@ static INTERRUPT_GEN(tms_sync)
static READ16_HANDLER(tms57002_data_word_r)
{
return tms57002_data_r(cputag_get_cpu(space->machine, "dasp"), 0);
return tms57002_data_r(devtag_get_device(space->machine, "dasp"), 0);
}
static WRITE16_HANDLER(tms57002_data_word_w)
{
if (ACCESSING_BITS_0_7)
tms57002_data_w(cputag_get_cpu(space->machine, "dasp"), 0, data);
tms57002_data_w(devtag_get_device(space->machine, "dasp"), 0, data);
}
static READ16_HANDLER(tms57002_status_word_r)
{
return (tms57002_dready_r(cputag_get_cpu(space->machine, "dasp"), 0) ? 4 : 0) |
(tms57002_empty_r(cputag_get_cpu(space->machine, "dasp"), 0) ? 1 : 0);
return (tms57002_dready_r(devtag_get_device(space->machine, "dasp"), 0) ? 4 : 0) |
(tms57002_empty_r(devtag_get_device(space->machine, "dasp"), 0) ? 1 : 0);
}
static WRITE16_HANDLER(tms57002_control_word_w)
{
if (ACCESSING_BITS_0_7)
{
tms57002_pload_w(cputag_get_cpu(space->machine, "dasp"), 0, data & 4);
tms57002_cload_w(cputag_get_cpu(space->machine, "dasp"), 0, data & 8);
tms57002_pload_w(devtag_get_device(space->machine, "dasp"), 0, data & 4);
tms57002_cload_w(devtag_get_device(space->machine, "dasp"), 0, data & 8);
cputag_set_input_line(space->machine, "dasp", INPUT_LINE_RESET, !(data & 16) ? ASSERT_LINE : CLEAR_LINE);
}
}

View File

@ -1075,7 +1075,7 @@ static READ64_HANDLER(cpu_r)
if (ACCESSING_BITS_32_63)
{
r = (UINT64)((space->cpu != cputag_get_cpu(space->machine, "maincpu")) ? 0x80000000 : 0);
r = (UINT64)((space->cpu != devtag_get_device(space->machine, "maincpu")) ? 0x80000000 : 0);
//r |= 0x40000000; // sets Video-LowRes !?
return r << 32;
}

View File

@ -467,7 +467,7 @@ static MACHINE_RESET( kyugo )
kyugo_state *state = (kyugo_state *)machine->driver_data;
const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
// must start with interrupts and sub CPU disabled
cpu_interrupt_enable(cputag_get_cpu(machine, "maincpu"), 0);
cpu_interrupt_enable(devtag_get_device(machine, "maincpu"), 0);
kyugo_sub_cpu_control_w(space, 0, 0);
state->scroll_x_lo = 0;

View File

@ -119,9 +119,9 @@ static TIMER_CALLBACK( setvector_callback )
}
if (irqvector & 0x2) /* YM2151 has precedence */
cpu_set_input_line_vector(cputag_get_cpu(machine, "soundcpu"), 0, 0x18);
cpu_set_input_line_vector(devtag_get_device(machine, "soundcpu"), 0, 0x18);
else if (irqvector & 0x1) /* V30 */
cpu_set_input_line_vector(cputag_get_cpu(machine, "soundcpu"), 0, 0x19);
cpu_set_input_line_vector(devtag_get_device(machine, "soundcpu"), 0, 0x19);
if (irqvector == 0) /* no IRQs pending */
cputag_set_input_line(machine, "soundcpu", 0, CLEAR_LINE);

View File

@ -219,8 +219,8 @@ static WRITE16_HANDLER( m72_main_mcu_w)
protection_ram[offset] = val;
cputag_set_input_line(space->machine, "mcu", 0, ASSERT_LINE);
/* Line driven, most likely by write line */
//timer_set(space->machine, cpu_clocks_to_attotime(cputag_get_cpu(space->machine, "mcu"), 2), NULL, 0, mcu_irq0_clear);
//timer_set(space->machine, cpu_clocks_to_attotime(cputag_get_cpu(space->machine, "mcu"), 0), NULL, 0, mcu_irq0_raise);
//timer_set(space->machine, cpu_clocks_to_attotime(devtag_get_device(space->machine, "mcu"), 2), NULL, 0, mcu_irq0_clear);
//timer_set(space->machine, cpu_clocks_to_attotime(devtag_get_device(space->machine, "mcu"), 0), NULL, 0, mcu_irq0_raise);
}
else
timer_call_after_resynch( space->machine, protection_ram, (offset<<16) | val, delayed_ram16_w);

View File

@ -333,9 +333,9 @@ static TIMER_CALLBACK( setvector_callback )
}
if (irqvector & 0x2) /* YM2151 has precedence */
cpu_set_input_line_vector(cputag_get_cpu(machine, "soundcpu"), 0, 0x18);
cpu_set_input_line_vector(devtag_get_device(machine, "soundcpu"), 0, 0x18);
else if (irqvector & 0x1) /* V30 */
cpu_set_input_line_vector(cputag_get_cpu(machine, "soundcpu"), 0, 0x19);
cpu_set_input_line_vector(devtag_get_device(machine, "soundcpu"), 0, 0x19);
if (irqvector == 0) /* no IRQs pending */
cputag_set_input_line(machine, "soundcpu", 0, CLEAR_LINE);

View File

@ -606,7 +606,7 @@ static MACHINE_RESET( magicard )
UINT16 *src = (UINT16*)memory_region( machine, "maincpu" );
UINT16 *dst = magicram;
memcpy (dst, src, 0x80000);
device_reset(cputag_get_cpu(machine, "maincpu"));
device_reset(devtag_get_device(machine, "maincpu"));
}

View File

@ -151,7 +151,7 @@ static WRITE8_HANDLER( port40_w )
// Bits 1-3 are all set high upon death, until the game continues
// Bit 6 is used only in Malzak II, and is set high after checking
// the selected version
// logerror("S2650 [0x%04x]: port 0x40 write: 0x%02x\n", cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")), data);
// logerror("S2650 [0x%04x]: port 0x40 write: 0x%02x\n", cpu_get_pc(devtag_get_device(space->machine, "maincpu")), data);
memory_set_bank(space->machine, "bank1", (data & 0x40) >> 6);
}

View File

@ -594,13 +594,13 @@ static WRITE8_HANDLER( superpac_latch_w )
switch (offset & 0x0e)
{
case 0x00: /* INT ON 2 */
cpu_interrupt_enable(cputag_get_cpu(space->machine, "sub"), bit);
cpu_interrupt_enable(devtag_get_device(space->machine, "sub"), bit);
if (!bit)
cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
break;
case 0x02: /* INT ON */
cpu_interrupt_enable(cputag_get_cpu(space->machine, "maincpu"), bit);
cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit);
if (!bit)
cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
break;
@ -638,19 +638,19 @@ static WRITE8_HANDLER( phozon_latch_w )
switch (offset & 0x0e)
{
case 0x00:
cpu_interrupt_enable(cputag_get_cpu(space->machine, "sub"), bit);
cpu_interrupt_enable(devtag_get_device(space->machine, "sub"), bit);
if (!bit)
cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
break;
case 0x02:
cpu_interrupt_enable(cputag_get_cpu(space->machine, "maincpu"), bit);
cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit);
if (!bit)
cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
break;
case 0x04:
cpu_interrupt_enable(cputag_get_cpu(space->machine, "sub2"), bit);
cpu_interrupt_enable(devtag_get_device(space->machine, "sub2"), bit);
if (!bit)
cputag_set_input_line(space->machine, "sub2", 0, CLEAR_LINE);
break;
@ -686,13 +686,13 @@ static WRITE8_HANDLER( mappy_latch_w )
switch (offset & 0x0e)
{
case 0x00: /* INT ON 2 */
cpu_interrupt_enable(cputag_get_cpu(space->machine, "sub"), bit);
cpu_interrupt_enable(devtag_get_device(space->machine, "sub"), bit);
if (!bit)
cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
break;
case 0x02: /* INT ON */
cpu_interrupt_enable(cputag_get_cpu(space->machine, "maincpu"), bit);
cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), bit);
if (!bit)
cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
break;

View File

@ -154,7 +154,7 @@ static TIMER_DEVICE_CALLBACK( mcu_timer_proc )
if ( (tcr & 0x40) == 0 )
{
//timer interrupt!
generic_pulse_irq_line(cputag_get_cpu(timer->machine, "mcu"), M68705_INT_TIMER);
generic_pulse_irq_line(devtag_get_device(timer->machine, "mcu"), M68705_INT_TIMER);
}
}
}

View File

@ -969,8 +969,8 @@ static MACHINE_START( maygayv1 )
// duart_68681_init(DUART_CLOCK, duart_irq_handler, duart_tx);
i8051_set_serial_tx_callback(cputag_get_cpu(machine, "soundcpu"), data_from_i8031);
i8051_set_serial_rx_callback(cputag_get_cpu(machine, "soundcpu"), data_to_i8031);
i8051_set_serial_tx_callback(devtag_get_device(machine, "soundcpu"), data_from_i8031);
i8051_set_serial_rx_callback(devtag_get_device(machine, "soundcpu"), data_to_i8031);
}
static MACHINE_RESET( maygayv1 )

View File

@ -1387,7 +1387,7 @@ static MACHINE_RESET( mazerbla )
{
game_id = MAZERBLA;
zpu_int_vector = 0xff;
cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), irq_callback);
cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback);
}
@ -1396,7 +1396,7 @@ static MACHINE_RESET( greatgun )
UINT8 *rom = memory_region(machine, "sub2");
game_id = GREATGUN;
zpu_int_vector = 0xff;
cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), irq_callback);
cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), irq_callback);
// patch VCU test

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