summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/devcb.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2009-03-02 10:59:37 +0000
committer Aaron Giles <aaron@aarongiles.com>2009-03-02 10:59:37 +0000
commit1dcd75d039272b7aff43a42f5fee6d9a8d822fe9 (patch)
tree78e1c567dfa6e032141d26f41f7a6526713ad26d /src/emu/devcb.c
parent4ad8ec54f87813301e92291447feb34893c8b417 (diff)
Removed device types from device queries that use tags, under the
assumption that all device tags are unique. Specifically, the following no longer need to provide a device type: AM_DEVREAD/WRITE DEVCB_DEVICE_HANDLER devtag_get_device devtag_reset device_list_find_by_tag as well as several device interfaces that referenced other devices. Also fixed assertion due to overflow in the recent sound fix.
Diffstat (limited to 'src/emu/devcb.c')
-rw-r--r--src/emu/devcb.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/emu/devcb.c b/src/emu/devcb.c
index 2f6fc3fc043..efe68e179f8 100644
--- a/src/emu/devcb.c
+++ b/src/emu/devcb.c
@@ -65,11 +65,11 @@ void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_rea
}
/* device handlers */
- else if (config->type != NULL && (config->readline != NULL || config->readdevice != NULL))
+ else if ((config->type == DEVCB_TYPE_DEVICE || config->type == DEVCB_TYPE_SELF) && (config->readline != NULL || config->readdevice != NULL))
{
- resolved->target = (config->type == DEVCB_TYPE_SELF) ? device : devtag_get_device(device->machine, config->type, config->tag);
+ resolved->target = (config->type == DEVCB_TYPE_SELF) ? device : devtag_get_device(device->machine, config->tag);
if (resolved->target == NULL)
- fatalerror("devcb_resolve_read_line: unable to find %s '%s' (requested by %s '%s')", devtype_get_name(config->type), config->tag, device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_read_line: unable to find device '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
/* read_line to read_line is direct */
if (config->readline != NULL)
@@ -141,11 +141,11 @@ void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_w
}
/* device handlers */
- else if (config->type != NULL && (config->writeline != NULL || config->writedevice != NULL))
+ else if ((config->type == DEVCB_TYPE_DEVICE || config->type == DEVCB_TYPE_SELF) && (config->writeline != NULL || config->writedevice != NULL))
{
- resolved->target = (config->type == DEVCB_TYPE_SELF) ? device : devtag_get_device(device->machine, config->type, config->tag);
+ resolved->target = (config->type == DEVCB_TYPE_SELF) ? device : devtag_get_device(device->machine, config->tag);
if (resolved->target == NULL)
- fatalerror("devcb_resolve_write_line: unable to find %s '%s' (requested by %s '%s')", devtype_get_name(config->type), config->tag, device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_write_line: unable to find device '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
/* write_line to write_line is direct */
if (config->writeline != NULL)
@@ -208,11 +208,11 @@ void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *conf
}
/* device handlers */
- else if (config->type != NULL && (config->readline != NULL || config->readdevice != NULL))
+ else if ((config->type == DEVCB_TYPE_DEVICE || config->type == DEVCB_TYPE_SELF) && (config->readline != NULL || config->readdevice != NULL))
{
- resolved->target = (config->type == DEVCB_TYPE_SELF) ? device : devtag_get_device(device->machine, config->type, config->tag);
+ resolved->target = (config->type == DEVCB_TYPE_SELF) ? device : devtag_get_device(device->machine, config->tag);
if (resolved->target == NULL)
- fatalerror("devcb_resolve_read8: unable to find %s '%s' (requested by %s '%s')", devtype_get_name(config->type), config->tag, device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_read8: unable to find device '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
/* read8 to read8 is direct */
if (config->readdevice != NULL)
@@ -261,11 +261,11 @@ void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *c
}
/* device handlers */
- else if (config->type != NULL && (config->writeline != NULL || config->writedevice != NULL))
+ else if ((config->type == DEVCB_TYPE_DEVICE || config->type == DEVCB_TYPE_SELF) && (config->writeline != NULL || config->writedevice != NULL))
{
- resolved->target = (config->type == DEVCB_TYPE_SELF) ? device : devtag_get_device(device->machine, config->type, config->tag);
+ resolved->target = (config->type == DEVCB_TYPE_SELF) ? device : devtag_get_device(device->machine, config->tag);
if (resolved->target == NULL)
- fatalerror("devcb_resolve_write8: unable to find %s '%s' (requested by %s '%s')", devtype_get_name(config->type), config->tag, device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_write8: unable to find device '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
/* write8 to write8 is direct */
if (config->writedevice != NULL)