summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu
diff options
context:
space:
mode:
author Fabio Priuli <etabeta78@users.noreply.github.com>2010-01-06 13:26:30 +0000
committer Fabio Priuli <etabeta78@users.noreply.github.com>2010-01-06 13:26:30 +0000
commita406d628ff583793027c2e8cfa00650f6abcd0b4 (patch)
tree2076e600f64b4c0cb4f96a4b4b044eea3b550be1 /src/emu
parentfb8599a36c74c106bda3166ece33c7d96379ed0c (diff)
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
Diffstat (limited to 'src/emu')
-rw-r--r--src/emu/cpu/cubeqcpu/cubeqcpu.c4
-rw-r--r--src/emu/cpuexec.c2
-rw-r--r--src/emu/cpuexec.h30
-rw-r--r--src/emu/debug/debugcmd.c2
-rw-r--r--src/emu/debug/debugcmt.c2
-rw-r--r--src/emu/devcb.c10
-rw-r--r--src/emu/machine/idectrl.c2
-rw-r--r--src/emu/machine/ldpr8210.c4
-rw-r--r--src/emu/machine/ldv1000.c2
-rw-r--r--src/emu/machine/ldvp931.c2
-rw-r--r--src/emu/sound/c6280.c2
-rw-r--r--src/emu/sound/cdp1864.c2
-rw-r--r--src/emu/sound/cdp1869.c2
-rw-r--r--src/emu/video/voodoo.c2
14 files changed, 32 insertions, 36 deletions
diff --git a/src/emu/cpu/cubeqcpu/cubeqcpu.c b/src/emu/cpu/cubeqcpu/cubeqcpu.c
index a375d7f5def..f52ae9379f7 100644
--- a/src/emu/cpu/cubeqcpu/cubeqcpu.c
+++ b/src/emu/cpu/cubeqcpu/cubeqcpu.c
@@ -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);
diff --git a/src/emu/cpuexec.c b/src/emu/cpuexec.c
index fe9035bf308..a2895f0c31c 100644
--- a/src/emu/cpuexec.c
+++ b/src/emu/cpuexec.c
@@ -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)
diff --git a/src/emu/cpuexec.h b/src/emu/cpuexec.h
index 39a5987d825..4c468bbd3e1 100644
--- a/src/emu/cpuexec.h
+++ b/src/emu/cpuexec.h
@@ -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)
diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c
index 4f00d1dfd21..bc661c1a10e 100644
--- a/src/emu/debug/debugcmd.c
+++ b/src/emu/debug/debugcmd.c
@@ -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;
diff --git a/src/emu/debug/debugcmt.c b/src/emu/debug/debugcmt.c
index 92c900d78dd..ae5e3b5830e 100644
--- a/src/emu/debug/debugcmt.c
+++ b/src/emu/debug/debugcmt.c
@@ -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;
diff --git a/src/emu/devcb.c b/src/emu/devcb.c
index 1c3261e279f..29ad2bb10e4 100644
--- a/src/emu/devcb.c
+++ b/src/emu/devcb.c
@@ -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);
diff --git a/src/emu/machine/idectrl.c b/src/emu/machine/idectrl.c
index 4c8b668c32b..7e2ccc01555 100644
--- a/src/emu/machine/idectrl.c
+++ b/src/emu/machine/idectrl.c
@@ -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;
}
diff --git a/src/emu/machine/ldpr8210.c b/src/emu/machine/ldpr8210.c
index 47320671d72..eae443eb851 100644
--- a/src/emu/machine/ldpr8210.c
+++ b/src/emu/machine/ldpr8210.c
@@ -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);
}
diff --git a/src/emu/machine/ldv1000.c b/src/emu/machine/ldv1000.c
index df074f9044d..302e05f768b 100644
--- a/src/emu/machine/ldv1000.c
+++ b/src/emu/machine/ldv1000.c
@@ -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);
diff --git a/src/emu/machine/ldvp931.c b/src/emu/machine/ldvp931.c
index 05cd8ffdef0..cb2c0ab4245 100644
--- a/src/emu/machine/ldvp931.c
+++ b/src/emu/machine/ldvp931.c
@@ -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);
diff --git a/src/emu/sound/c6280.c b/src/emu/sound/c6280.c
index fc9feadd895..de6184ee2e9 100644
--- a/src/emu/sound/c6280.c
+++ b/src/emu/sound/c6280.c
@@ -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);
diff --git a/src/emu/sound/cdp1864.c b/src/emu/sound/cdp1864.c
index d833e9a2ac4..ceac8e3ed5b 100644
--- a/src/emu/sound/cdp1864.c
+++ b/src/emu/sound/cdp1864.c
@@ -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);
diff --git a/src/emu/sound/cdp1869.c b/src/emu/sound/cdp1869.c
index a304dc58519..8aa7e5bd833 100644
--- a/src/emu/sound/cdp1869.c
+++ b/src/emu/sound/cdp1869.c
@@ -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 */
diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c
index 3f637083bbb..0d746043c0a 100644
--- a/src/emu/video/voodoo.c
+++ b/src/emu/video/voodoo.c
@@ -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;