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.
This commit is contained in:
Aaron Giles 2009-03-02 10:59:37 +00:00
parent 4ad8ec54f8
commit 1dcd75d039
1019 changed files with 5306 additions and 5369 deletions

View File

@ -682,7 +682,7 @@ static CPU_INIT( tms34010 )
tms->irq_callback = irqcallback;
tms->device = device;
tms->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
tms->screen = devtag_get_device(device->machine, VIDEO_SCREEN, configdata->screen_tag);
tms->screen = devtag_get_device(device->machine, configdata->screen_tag);
/* set up the state table */
tms->state = state_table_template;

View File

@ -27,11 +27,11 @@ z80_daisy_state *z80daisy_init(const device_config *cpudevice, const z80_daisy_c
z80_daisy_state **tailptr = &head;
/* create a linked list of devices */
for ( ; daisy->devtype != NULL; daisy++)
for ( ; daisy->devname != NULL; daisy++)
{
*tailptr = auto_malloc(sizeof(**tailptr));
(*tailptr)->next = NULL;
(*tailptr)->device = devtag_get_device(cpudevice->machine, daisy->devtype, device_inherit_tag(tempstring, cpudevice->tag, daisy->devname));
(*tailptr)->device = devtag_get_device(cpudevice->machine, device_inherit_tag(tempstring, cpudevice->tag, daisy->devname));
if ((*tailptr)->device == NULL)
fatalerror("Unable to locate device '%s'", daisy->devname);
(*tailptr)->irq_state = (z80_daisy_irq_state)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_IRQ_STATE);

View File

@ -50,7 +50,6 @@ typedef struct _z80_daisy_state z80_daisy_state;
typedef struct _z80_daisy_chain z80_daisy_chain;
struct _z80_daisy_chain
{
device_type devtype; /* type of device */
const char * devname; /* name of the device */
};

View File

@ -588,7 +588,7 @@ static DEVICE_RESET( cpu )
/* new style - use screen tag directly */
if (config->vblank_interrupt_screen != NULL)
screen = devtag_get_device(device->machine, VIDEO_SCREEN, config->vblank_interrupt_screen);
screen = devtag_get_device(device->machine, config->vblank_interrupt_screen);
/* old style 'hack' setup - use screen #0 */
else

View File

@ -93,10 +93,10 @@ struct _cpu_class_header
MDRV_DEVICE_CONFIG_DATAPTR(cpu_config, type, CPU_##_type)
#define MDRV_CPU_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, CPU)
MDRV_DEVICE_REMOVE(_tag)
#define MDRV_CPU_MODIFY(_tag) \
MDRV_DEVICE_MODIFY(_tag, CPU)
MDRV_DEVICE_MODIFY(_tag)
#define MDRV_CPU_TYPE(_type) \
MDRV_DEVICE_CONFIG_DATAPTR(cpu_config, type, CPU_##_type)
@ -105,7 +105,7 @@ struct _cpu_class_header
MDRV_DEVICE_CLOCK(_clock)
#define MDRV_CPU_REPLACE(_tag, _type, _clock) \
MDRV_DEVICE_MODIFY(_tag, CPU) \
MDRV_DEVICE_MODIFY(_tag) \
MDRV_DEVICE_CONFIG_DATAPTR(cpu_config, type, CPU_##_type) \
MDRV_DEVICE_CLOCK(_clock)
@ -145,10 +145,10 @@ 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, CPU, 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, CPU, tag)
#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)

View File

@ -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)

View File

@ -47,10 +47,12 @@
CONSTANTS
***************************************************************************/
#define DEVCB_TYPE_SELF ((device_type)1)
#define DEVCB_TYPE_INPUT ((device_type)2)
#define DEVCB_TYPE_MEMORY(space) ((device_type)(4 + (space)))
#define DEVCB_TYPE_CPU_LINE(line) ((device_type)(4 + ADDRESS_SPACES + (line)))
#define DEVCB_TYPE_NULL (0)
#define DEVCB_TYPE_SELF (1)
#define DEVCB_TYPE_INPUT (2)
#define DEVCB_TYPE_DEVICE (3)
#define DEVCB_TYPE_MEMORY(space) (4 + (space))
#define DEVCB_TYPE_CPU_LINE(line) (4 + ADDRESS_SPACES + (line))
@ -58,15 +60,15 @@
MACROS
***************************************************************************/
#define DEVCB_NULL { 0 }
#define DEVCB_NULL { DEVCB_TYPE_NULL }
/* standard line or read/write handlers with the calling device passed */
#define DEVCB_LINE(func) { DEVCB_TYPE_SELF, NULL, (func), NULL, NULL }
#define DEVCB_HANDLER(func) { DEVCB_TYPE_SELF, NULL, NULL, (func), NULL }
/* line or read/write handlers for another device */
#define DEVCB_DEVICE_LINE(type,tag,func) { type, tag, (func), NULL, NULL }
#define DEVCB_DEVICE_HANDLER(type,tag,func) { type, tag, NULL, (func), NULL }
#define DEVCB_DEVICE_LINE(tag,func) { DEVCB_TYPE_DEVICE, tag, (func), NULL, NULL }
#define DEVCB_DEVICE_HANDLER(tag,func) { DEVCB_TYPE_DEVICE, tag, NULL, (func), NULL }
/* read/write handlers for a given CPU's address space */
#define DEVCB_MEMORY_HANDLER(cpu,space,func) { DEVCB_TYPE_MEMORY(ADDRESS_SPACE_##space), (cpu), NULL, NULL, (func) }
@ -97,7 +99,7 @@ typedef void (*write_line_device_func)(const device_config *device, int state);
typedef struct _devcb_read_line devcb_read_line;
struct _devcb_read_line
{
device_type type; /* device type of target, or one of the special DEVCB_TYPE values */
UINT32 type; /* one of the special DEVCB_TYPE values */
const char * tag; /* tag of target, where appropriate */
read_line_device_func readline; /* read line function */
read8_device_func readdevice; /* read device function */
@ -122,7 +124,7 @@ struct _devcb_resolved_read_line
typedef struct _devcb_write_line devcb_write_line;
struct _devcb_write_line
{
device_type type; /* device type of target, or one of the special DEVCB_TYPE values */
UINT32 type; /* one of the special DEVCB_TYPE values */
const char * tag; /* tag of target, where appropriate */
write_line_device_func writeline; /* write line function */
write8_device_func writedevice; /* write device function */
@ -148,7 +150,7 @@ struct _devcb_resolved_write_line
typedef struct _devcb_read8 devcb_read8;
struct _devcb_read8
{
device_type type; /* device type of target, or one of the special DEVCB_TYPE values */
UINT32 type; /* one of the special DEVCB_TYPE values */
const char * tag; /* tag of target, where appropriate */
read_line_device_func readline; /* read line function */
read8_device_func readdevice; /* read device function */
@ -174,7 +176,7 @@ struct _devcb_resolved_read8
typedef struct _devcb_write8 devcb_write8;
struct _devcb_write8
{
device_type type; /* device type of target, or one of the special DEVCB_TYPE values */
UINT32 type; /* one of the special DEVCB_TYPE values */
const char * tag; /* tag of target, where appropriate */
write_line_device_func writeline; /* write line function */
write8_device_func writedevice; /* write device function */

View File

@ -168,25 +168,24 @@ device_config *device_list_add(device_config **listheadptr, const device_config
device list
-------------------------------------------------*/
void device_list_remove(device_config **listheadptr, device_type type, const char *tag)
void device_list_remove(device_config **listheadptr, const char *tag)
{
device_config **devptr, **tempdevptr;
device_config *device, *tempdevice;
assert(listheadptr != NULL);
assert(type != NULL);
assert(tag != NULL);
/* find the device in the list */
for (devptr = listheadptr; *devptr != NULL; devptr = &(*devptr)->next)
if (type == (*devptr)->type && strcmp(tag, (*devptr)->tag) == 0)
if (strcmp(tag, (*devptr)->tag) == 0)
break;
device = *devptr;
if (device == NULL)
fatalerror("Attempted to remove non-existant device: type=%s tag=%s\n", devtype_get_name(type), tag);
fatalerror("Attempted to remove non-existant device: tag=%s\n", tag);
/* before removing us from the global list, remove us from the type list */
tempdevice = (device_config *)device_list_first(*listheadptr, type);
tempdevice = (device_config *)device_list_first(*listheadptr, device->type);
for (tempdevptr = &tempdevice; *tempdevptr != device; tempdevptr = &(*tempdevptr)->typenext) ;
assert(*tempdevptr == device);
*tempdevptr = device->typenext;
@ -317,28 +316,16 @@ const device_config *device_list_next(const device_config *prevdevice, device_ty
DEVICE_TYPE_WILDCARD is allowed
-------------------------------------------------*/
const device_config *device_list_find_by_tag(const device_config *listhead, device_type type, const char *tag)
const device_config *device_list_find_by_tag(const device_config *listhead, const char *tag)
{
const device_config *curdev;
assert(tag != NULL);
/* locate among all devices */
if (type == DEVICE_TYPE_WILDCARD)
{
for (curdev = listhead; curdev != NULL; curdev = curdev->next)
if (strcmp(tag, curdev->tag) == 0)
return curdev;
}
/* locate among all devices of a given type */
else
{
for (curdev = listhead; curdev != NULL && curdev->type != type; curdev = curdev->next) ;
for ( ; curdev != NULL; curdev = curdev->typenext)
if (strcmp(tag, curdev->tag) == 0)
return curdev;
}
for (curdev = listhead; curdev != NULL; curdev = curdev->next)
if (strcmp(tag, curdev->tag) == 0)
return curdev;
/* fail */
return NULL;
@ -467,28 +454,6 @@ const device_config *device_list_class_next(const device_config *prevdevice, dev
}
/*-------------------------------------------------
device_list_class_find_by_tag - retrieve a
device configuration based on a class and tag
-------------------------------------------------*/
const device_config *device_list_class_find_by_tag(const device_config *listhead, device_class devclass, const char *tag)
{
const device_config *curdev;
assert(tag != NULL);
/* locate among all devices of a given class */
for (curdev = listhead; curdev != NULL && curdev->devclass != devclass; curdev = curdev->next) ;
for ( ; curdev != NULL; curdev = curdev->classnext)
if (strcmp(tag, curdev->tag) == 0)
return curdev;
/* fail */
return NULL;
}
/*-------------------------------------------------
device_list_class_index - return the index of a
device based on its class and tag

View File

@ -139,18 +139,18 @@ enum
/* shorthand for accessing devices by machine/type/tag */
#define devtag_get_device(mach,type,tag) device_list_find_by_tag((mach)->config->devicelist, type, tag)
#define devtag_get_device(mach,tag) device_list_find_by_tag((mach)->config->devicelist, tag)
#define devtag_reset(mach,type,tag) device_reset(devtag_get_device(mach, type, tag))
#define devtag_reset(mach,tag) device_reset(devtag_get_device(mach, tag))
#define devtag_get_info_int(mach,type,tag,state) device_get_info_int(devtag_get_device(mach, type, tag), state)
#define devtag_get_info_ptr(mach,type,tag,state) device_get_info_ptr(devtag_get_device(mach, type, tag), state)
#define devtag_get_info_fct(mach,type,tag,state) device_get_info_fct(devtag_get_device(mach, type, tag), state)
#define devtag_get_info_string(mach,type,tag,state) device_get_info_string(devtag_get_device(mach, type, tag), state)
#define devtag_get_info_int(mach,tag,state) device_get_info_int(devtag_get_device(mach, tag), state)
#define devtag_get_info_ptr(mach,tag,state) device_get_info_ptr(devtag_get_device(mach, tag), state)
#define devtag_get_info_fct(mach,tag,state) device_get_info_fct(devtag_get_device(mach, tag), state)
#define devtag_get_info_string(mach,tag,state) device_get_info_string(devtag_get_device(mach, tag), state)
#define devtag_set_info_int(mach,type,tag,state,data) device_set_info_int(devtag_get_device(mach, type, tag), state, data)
#define devtag_set_info_ptr(mach,type,tag,state,data) device_set_info_ptr(devtag_get_device(mach, type, tag), state, data)
#define devtag_set_info_fct(mach,type,tag,state,data) device_set_info_fct(devtag_get_device(mach, type, tag), state, data)
#define devtag_set_info_int(mach,tag,state,data) device_set_info_int(devtag_get_device(mach, tag), state, data)
#define devtag_set_info_ptr(mach,tag,state,data) device_set_info_ptr(devtag_get_device(mach, tag), state, data)
#define devtag_set_info_fct(mach,tag,state,data) device_set_info_fct(devtag_get_device(mach, tag), state, data)
/* shorthand for getting standard data about device types */
@ -170,11 +170,11 @@ enum
/* shorthand for getting standard data about devices by machine/type/tag */
#define devtag_get_name(mach,type,tag) devtag_get_info_string(mach, type, tag, DEVINFO_STR_NAME)
#define devtag_get_family(mach,type,tag) devtag_get_info_string(mach, type, tag, DEVINFO_STR_FAMILY)
#define devtag_get_version(mach,type,tag) devtag_get_info_string(mach, type, tag, DEVINFO_STR_VERSION)
#define devtag_get_source_file(mach,type,tag) devtag_get_info_string(mach, type, tag, DEVINFO_STR_SOURCE_FILE)
#define devtag_get_credits(mach,type,tag) devtag_get_info_string(mach, type, tag, DEVINFO_STR_CREDITS)
#define devtag_get_name(mach,tag) devtag_get_info_string(mach, tag, DEVINFO_STR_NAME)
#define devtag_get_family(mach,tag) devtag_get_info_string(mach, tag, DEVINFO_STR_FAMILY)
#define devtag_get_version(mach,tag) devtag_get_info_string(mach, tag, DEVINFO_STR_VERSION)
#define devtag_get_source_file(mach,tag) devtag_get_info_string(mach, tag, DEVINFO_STR_SOURCE_FILE)
#define devtag_get_credits(mach,tag) devtag_get_info_string(mach, tag, DEVINFO_STR_CREDITS)
@ -271,7 +271,7 @@ struct _device_config
device_config *device_list_add(device_config **listheadptr, const device_config *owner, device_type type, const char *tag, UINT32 clock);
/* remove a device from a device list */
void device_list_remove(device_config **listheadptr, device_type type, const char *tag);
void device_list_remove(device_config **listheadptr, const char *tag);
/* build a tag that combines the device's name and the given tag */
const char *device_build_tag(astring *dest, const device_config *device, const char *tag);
@ -292,8 +292,8 @@ const device_config *device_list_first(const device_config *listhead, device_typ
/* return the next device in the list of a given type; DEVICE_TYPE_WILDCARD is allowed */
const device_config *device_list_next(const device_config *prevdevice, device_type type);
/* retrieve a device configuration based on a type and tag; DEVICE_TYPE_WILDCARD is allowed */
const device_config *device_list_find_by_tag(const device_config *listhead, device_type type, const char *tag);
/* retrieve a device configuration based on a tag */
const device_config *device_list_find_by_tag(const device_config *listhead, const char *tag);
/* return the index of a device based on its type and tag; DEVICE_TYPE_WILDCARD is allowed */
int device_list_index(const device_config *listhead, device_type type, const char *tag);
@ -314,9 +314,6 @@ const device_config *device_list_class_first(const device_config *listhead, devi
/* return the next device in the list of a given class */
const device_config *device_list_class_next(const device_config *prevdevice, device_class devclass);
/* retrieve a device configuration based on a class and tag */
const device_config *device_list_class_find_by_tag(const device_config *listhead, device_class devclass, const char *tag);
/* return the index of a device based on its class and tag */
int device_list_class_index(const device_config *listhead, device_class devclass, const char *tag);

View File

@ -28,7 +28,7 @@
MDRV_DEVICE_CONFIG(_intrf)
#define MDRV_VIA6522_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, VIA6522)
MDRV_DEVICE_REMOVE(_tag)
#define VIA_PB 0
#define VIA_PA 1

View File

@ -25,15 +25,15 @@
MDRV_DEVICE_ADD(_tag, _variant, _clock) \
MDRV_DEVICE_CONFIG(_config)
#define MDRV_CIA6526_REMOVE(_tag, _variant) \
MDRV_DEVICE_REMOVE(_tag, _variant)
#define MDRV_CIA6526_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag)
#define MDRV_CIA8520_ADD(_tag, _clock, _config) \
MDRV_DEVICE_ADD(_tag, CIA8520, _clock) \
MDRV_DEVICE_CONFIG(_config)
#define MDRV_CIA8520_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, CIA8520)
MDRV_DEVICE_REMOVE(_tag)

View File

@ -38,7 +38,7 @@ struct _riot6532_interface
MDRV_DEVICE_CONFIG(_intrf)
#define MDRV_RIOT6532_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, RIOT6532)
MDRV_DEVICE_REMOVE(_tag)

View File

@ -111,21 +111,21 @@ int pianew_get_irq_b(const device_config *device);
MDRV_DEVICE_CONFIG(_intrf)
#define MDRV_PIA6821_MODIFY(_tag, _intrf) \
MDRV_DEVICE_MODIFY(_tag, PIA6821) \
MDRV_DEVICE_MODIFY(_tag) \
MDRV_DEVICE_CONFIG(_intrf)
#define MDRV_PIA6821_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, PIA6821)
MDRV_DEVICE_REMOVE(_tag)
#define MDRV_PIA6822_ADD(_tag, _intrf) \
MDRV_DEVICE_ADD(_tag, PIA6822, 0) \
MDRV_DEVICE_CONFIG(_intrf)
#define MDRV_PIA6822_MODIFY(_tag, _intrf) \
MDRV_DEVICE_MODIFY(_tag, PIA6822) \
MDRV_DEVICE_MODIFY(_tag) \
MDRV_DEVICE_CONFIG(_intrf)
#define MDRV_PIA6822_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, PIA6821)
MDRV_DEVICE_REMOVE(_tag)
#endif /* __6821NEW_H__ */

View File

@ -31,7 +31,7 @@
MDRV_DEVICE_CONFIG(_config)
#define MDRV_ACIA6850_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, ACIA6850)
MDRV_DEVICE_REMOVE(_tag)
#define ACIA6850_INTERFACE(_name) \
const acia6850_interface(_name) =

View File

@ -18,7 +18,7 @@ DEVICE_GET_INFO(duart68681);
MDRV_DEVICE_CONFIG(_config)
#define MDRV_DUART_68681_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, DUART68681)
MDRV_DEVICE_REMOVE(_tag)
READ8_DEVICE_HANDLER(duart68681_r);

View File

@ -53,7 +53,7 @@
MDRV_DEVICE_CONFIG(_config)
#define MDRV_TTL74123_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, TTL74123)
MDRV_DEVICE_REMOVE(_tag)
/* constants for the different ways the cap/res can be connected.

View File

@ -40,11 +40,11 @@ struct _ppi8255_interface
MDRV_DEVICE_CONFIG(_intrf)
#define MDRV_PPI8255_RECONFIG(_tag, _intrf) \
MDRV_DEVICE_MODIFY(_tag, PPI8255) \
MDRV_DEVICE_MODIFY(_tag) \
MDRV_DEVICE_CONFIG(_intrf)
#define MDRV_PPI8255_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, PPI8255)
MDRV_DEVICE_REMOVE(_tag)

View File

@ -14,7 +14,7 @@
MDRV_DEVICE_CONFIG(_config)
#define MDRV_DMA8257_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, DMA8257)
MDRV_DEVICE_REMOVE(_tag)
#define DMA8257_STATUS_UPDATE 0x10

View File

@ -22,7 +22,7 @@ DEVICE_GET_INFO(at28c16);
MDRV_DEVICE_CONFIG_DATAPTR(at28c16_config, id, _id)
#define MDRV_AT28C16_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, AT28C16)
MDRV_DEVICE_REMOVE(_tag)
extern void at28c16_a9_12v( const device_config *device, int a9_12v );

View File

@ -40,7 +40,7 @@
MDRV_DEVICE_CONFIG(_config)
#define MDRV_CDP1852_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, CDP1852)
MDRV_DEVICE_REMOVE(_tag)
#define CDP1852_INTERFACE(_name) \
const cdp1852_interface (_name)=

View File

@ -43,7 +43,7 @@ struct _i8243_config
MDRV_DEVICE_CONFIG_DATAPTR(i8243_config, writehandler, _write)
#define MDRV_I8243_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, I8243)
MDRV_DEVICE_REMOVE(_tag)

View File

@ -50,7 +50,7 @@ struct _ide_config
MDRV_DEVICE_CONFIG_DATA32(ide_config, bmspace, ADDRESS_SPACE_##_space)
#define MDRV_IDE_CONTROLLER_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, IDE_CONTROLLER)
MDRV_DEVICE_REMOVE(_tag)

View File

@ -127,8 +127,8 @@ struct _laserdisc_config
MDRV_DEVICE_CONFIG_DATAFP32(laserdisc_config, overscalex, _scalex, 24) \
MDRV_DEVICE_CONFIG_DATAFP32(laserdisc_config, overscaley, _scaley, 24)
#define MDRV_LASERDISC_REMOVE(_tag, _type) \
MDRV_DEVICE_REMOVE(_tag, _type)
#define MDRV_LASERDISC_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag)
/* use these to add laserdisc screens with proper video update parameters */

View File

@ -45,7 +45,7 @@ static void update(const device_config *device, UINT8 new_val, UINT8 mask)
UINT8 changed = old_val ^ latch8->value;
for (i=0; i<8; i++)
if (((changed & (1<<i)) != 0) && latch8->intf->node_map[i] != 0)
discrete_sound_w(devtag_get_device(device->machine, SOUND, latch8->intf->node_device[i]), latch8->intf->node_map[i] , (latch8->value >> i) & 1);
discrete_sound_w(devtag_get_device(device->machine, latch8->intf->node_device[i]), latch8->intf->node_map[i] , (latch8->value >> i) & 1);
}
}
@ -208,7 +208,6 @@ static DEVICE_START( latch8 )
if (latch8->devices[i] != NULL)
fatalerror("Device %s: Bit %d already has a handler.\n", device->tag, i);
latch8->devices[i] = devtag_get_device(device->machine,
latch8->intf->devread[i].type,
latch8->intf->devread[i].tag);
if (latch8->devices[i] == NULL)
fatalerror("Device %s: Unable to find device %s\n", device->tag, latch8->intf->devread[i].tag);

View File

@ -26,7 +26,6 @@ struct _latch8_devread
{
/* only for byte reads, does not affect bit reads and node_map */
UINT32 from_bit;
device_type type;
const char *tag;
read8_device_func devread_handler;
read8_space_func read_handler;
@ -70,9 +69,8 @@ struct _latch8_config
MDRV_DEVICE_CONFIG_DATA32_ARRAY(latch8_config, node_map, _bit, _node)
/* Upon read, replace bits by reading from another device handler */
#define MDRV_LATCH8_DEVREAD(_bit, _type, _tag, _handler, _from_bit) \
#define MDRV_LATCH8_DEVREAD(_bit, _tag, _handler, _from_bit) \
MDRV_DEVICE_CONFIG_DATA32_ARRAY_MEMBER(latch8_config, devread, _bit, latch8_devread, from_bit, _from_bit) \
MDRV_DEVICE_CONFIG_DATAPTR_ARRAY_MEMBER(latch8_config, devread, _bit, latch8_devread, type, _type) \
MDRV_DEVICE_CONFIG_DATAPTR_ARRAY_MEMBER(latch8_config, devread, _bit, latch8_devread, tag, _tag) \
MDRV_DEVICE_CONFIG_DATAPTR_ARRAY_MEMBER(latch8_config, devread, _bit, latch8_devread, devread_handler, _handler) \
@ -83,21 +81,21 @@ struct _latch8_config
/* remove device */
#define MDRV_LATCH8_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(LATCH8, _type)
MDRV_DEVICE_REMOVE(_tag)
/* Accessor macros */
#define AM_LATCH8_READ(_tag) \
AM_DEVREAD(LATCH8, _tag, latch8_r)
AM_DEVREAD(_tag, latch8_r)
#define AM_LATCH8_READBIT(_tag, _bit) \
AM_DEVREAD(LATCH8, _tag, latch8_bit ## _bit ## _q_r)
AM_DEVREAD(_tag, latch8_bit ## _bit ## _q_r)
#define AM_LATCH8_WRITE(_tag) \
AM_DEVWRITE(LATCH8, _tag, latch8_w)
AM_DEVWRITE(_tag, latch8_w)
#define AM_LATCH8_READWRITE(_tag) \
AM_DEVREADWRITE(LATCH8, _tag, latch8_r, latch8_w)
AM_DEVREADWRITE(_tag, latch8_r, latch8_w)
/* device interface */
DEVICE_GET_INFO( latch8 );

View File

@ -1066,7 +1066,7 @@ static void configuration_load(running_machine *machine, int config_type, xml_da
for (ldnode = xml_get_sibling(parentnode->child, "device"); ldnode != NULL; ldnode = xml_get_sibling(ldnode->next, "device"))
{
const char *devtag = xml_get_attribute_string(ldnode, "tag", "");
const device_config *device = device_list_find_by_tag(machine->config->devicelist, LASERDISC, devtag);
const device_config *device = devtag_get_device(machine, devtag);
if (device != NULL)
{
laserdisc_state *ld = get_safe_token(device);
@ -1430,7 +1430,7 @@ static void init_audio(const device_config *device)
ldcore_data *ldcore = ld->core;
/* find the custom audio */
ldcore->audiocustom = devtag_get_device(device->machine, SOUND, ldcore->config.sound);
ldcore->audiocustom = devtag_get_device(device->machine, ldcore->config.sound);
/* allocate audio buffers */
ldcore->audiomaxsamples = ((UINT64)ldcore->samplerate * 1000000 + ldcore->fps_times_1million - 1) / ldcore->fps_times_1million;
@ -1458,7 +1458,7 @@ static DEVICE_START( laserdisc )
int index;
/* ensure that our screen is started first */
ld->screen = devtag_get_device(device->machine, VIDEO_SCREEN, config->screen);
ld->screen = devtag_get_device(device->machine, config->screen);
assert(ld->screen != NULL);
if (!ld->screen->started)
{

View File

@ -120,8 +120,8 @@ static WRITE8_DEVICE_HANDLER( ppi1_portc_w );
static ADDRESS_MAP_START( ldv1000_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x1fff) AM_MIRROR(0x6000) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x3800) AM_RAM
AM_RANGE(0xc000, 0xc003) AM_MIRROR(0x9ff0) AM_DEVREADWRITE(PPI8255, "ldvppi0", ppi8255_r, ppi8255_w)
AM_RANGE(0xc004, 0xc007) AM_MIRROR(0x9ff0) AM_DEVREADWRITE(PPI8255, "ldvppi1", ppi8255_r, ppi8255_w)
AM_RANGE(0xc000, 0xc003) AM_MIRROR(0x9ff0) AM_DEVREADWRITE("ldvppi0", ppi8255_r, ppi8255_w)
AM_RANGE(0xc004, 0xc007) AM_MIRROR(0x9ff0) AM_DEVREADWRITE("ldvppi1", ppi8255_r, ppi8255_w)
ADDRESS_MAP_END
@ -130,7 +130,7 @@ static ADDRESS_MAP_START( ldv1000_portmap, ADDRESS_SPACE_IO, 8 )
AM_RANGE(0x00, 0x07) AM_MIRROR(0x38) AM_READWRITE(decoder_display_port_r, decoder_display_port_w)
AM_RANGE(0x40, 0x40) AM_MIRROR(0x3f) AM_READ(controller_r)
AM_RANGE(0x80, 0x80) AM_MIRROR(0x3f) AM_WRITE(controller_w)
AM_RANGE(0xc0, 0xc3) AM_MIRROR(0x3c) AM_DEVREADWRITE(Z80CTC, "ldvctc", z80ctc_r, z80ctc_w)
AM_RANGE(0xc0, 0xc3) AM_MIRROR(0x3c) AM_DEVREADWRITE("ldvctc", z80ctc_r, z80ctc_w)
ADDRESS_MAP_END
@ -157,7 +157,7 @@ static const z80ctc_interface ctcintf =
static const z80_daisy_chain daisy_chain[] =
{
{ Z80CTC, "ldvctc" },
{ "ldvctc" },
{ NULL }
};
@ -231,8 +231,8 @@ static void ldv1000_init(laserdisc_state *ld)
/* find our devices */
player->cpu = cputag_get_cpu(ld->device->machine, device_build_tag(tempstring, ld->device, "ldv1000"));
player->ctc = devtag_get_device(ld->device->machine, Z80CTC, device_build_tag(tempstring, ld->device, "ldvctc"));
player->multitimer = devtag_get_device(ld->device->machine, TIMER, device_build_tag(tempstring, ld->device, "multitimer"));
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);
astring_free(tempstring);
}

View File

@ -215,7 +215,7 @@ static void vp931_init(laserdisc_state *ld)
/* find our devices */
player->cpu = cputag_get_cpu(ld->device->machine, device_build_tag(tempstring, ld->device, "vp931"));
player->tracktimer = devtag_get_device(ld->device->machine, TIMER, device_build_tag(tempstring, ld->device, "tracktimer"));
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

@ -19,7 +19,7 @@
MDRV_DEVICE_ADD(_tag, MSM6242, 0)
#define MDRV_MSM6242_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, MSM6242)
MDRV_DEVICE_REMOVE(_tag)
/* device interface */

View File

@ -218,7 +218,7 @@ static DEVICE_START( pci_bus )
/* find all our devices */
for (devicenum = 0; devicenum < ARRAY_LENGTH(pcibus->device); devicenum++)
if (pcibus->config->device[devicenum].devtag != NULL)
pcibus->device[devicenum] = devtag_get_device(device->machine, pcibus->config->device[devicenum].devtype, pcibus->config->device[devicenum].devtag);
pcibus->device[devicenum] = devtag_get_device(device->machine, pcibus->config->device[devicenum].devtag);
/* register pci states */
state_save_register_device_item(device, 0, pcibus->address);

View File

@ -20,7 +20,6 @@ typedef void (*pci_write_func)(const device_config *pcibus, const device_config
typedef struct _pci_device_entry pci_device_entry;
struct _pci_device_entry
{
device_type devtype;
const char * devtag;
pci_read_func read_callback;
pci_write_func write_callback;
@ -43,8 +42,7 @@ struct _pci_bus_config
MDRV_DEVICE_ADD(_tag, PCI_BUS, 0) \
MDRV_DEVICE_CONFIG_DATA32(pci_bus_config, busnum, _busnum)
#define MDRV_PCI_BUS_DEVICE(_devnum, _devtype, _devtag, _configread, _configwrite) \
MDRV_DEVICE_CONFIG_DATAPTR_ARRAY_MEMBER(pci_bus_config, device, _devnum, pci_device_entry, devtype, _devtype) \
#define MDRV_PCI_BUS_DEVICE(_devnum, _devtag, _configread, _configwrite) \
MDRV_DEVICE_CONFIG_DATAPTR_ARRAY_MEMBER(pci_bus_config, device, _devnum, pci_device_entry, devtag, _devtag) \
MDRV_DEVICE_CONFIG_DATAPTR_ARRAY_MEMBER(pci_bus_config, device, _devnum, pci_device_entry, read_callback, _configread) \
MDRV_DEVICE_CONFIG_DATAPTR_ARRAY_MEMBER(pci_bus_config, device, _devnum, pci_device_entry, write_callback, _configwrite)

View File

@ -693,7 +693,7 @@ static void scsicd_alloc_instance( SCSIInstance *scsiInstance, const char *diskr
#ifdef MESS
/* TODO: get rid of this ifdef MESS section */
our_this->cdrom = mess_cd_get_cdrom_file( device_list_find_by_tag( machine->config->devicelist, CDROM, diskregion ) );
our_this->cdrom = mess_cd_get_cdrom_file( devtag_get_device( machine, diskregion ) );
#else
our_this->cdrom = cdrom_open(get_disk_handle( diskregion ));

View File

@ -235,7 +235,7 @@ static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskr
#ifdef MESS
/* TODO: get rid of this ifdef MESS section */
our_this->disk = mess_hd_get_hard_disk_file( device_list_find_by_tag( machine->config->devicelist, HARDDISK, diskregion ) );
our_this->disk = mess_hd_get_hard_disk_file( devtag_get_device( machine, diskregion ) );
#else
our_this->disk = hard_disk_open(get_disk_handle( diskregion ));

View File

@ -38,10 +38,10 @@ struct _smc91c9x_config
MDRV_DEVICE_CONFIG_DATAPTR(smc91c9x_config, interrupt, _callback)
#define MDRV_SMC91C94_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, SMC91C94)
MDRV_DEVICE_REMOVE(_tag)
#define MDRV_SMC91C96_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, SMC91C96)
MDRV_DEVICE_REMOVE(_tag)

View File

@ -25,7 +25,7 @@ DEVICE_GET_INFO(m48t02);
MDRV_DEVICE_ADD(_tag, M48T02, 0)
#define MDRV_M48T02_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, M48T02)
MDRV_DEVICE_REMOVE(_tag)
#define M48T35 DEVICE_GET_INFO_NAME(m48t35)
@ -35,7 +35,7 @@ DEVICE_GET_INFO(m48t35);
MDRV_DEVICE_ADD(_tag, M48T35, 0)
#define MDRV_M48T35_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, M48T35)
MDRV_DEVICE_REMOVE(_tag)
#define M48T58 DEVICE_GET_INFO_NAME(m48t58)
@ -45,7 +45,7 @@ DEVICE_GET_INFO(m48t58);
MDRV_DEVICE_ADD(_tag, M48T58, 0)
#define MDRV_M48T58_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, M48T58)
MDRV_DEVICE_REMOVE(_tag)
#define MK48T08 DEVICE_GET_INFO_NAME(mk48t08)
@ -55,7 +55,7 @@ DEVICE_GET_INFO(mk48t08);
MDRV_DEVICE_ADD(_tag, MK48T08, 0)
#define MDRV_MK48T08_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, MK48T08)
MDRV_DEVICE_REMOVE(_tag)
/* memory handlers */

View File

@ -21,7 +21,7 @@ DEVICE_GET_INFO(x2212);
MDRV_DEVICE_ADD(_tag, X2212, 0)
#define MDRV_X2212_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, X2212)
MDRV_DEVICE_REMOVE(_tag)
extern void x2212_write( const device_config *device, int offset, int data );

View File

@ -47,7 +47,7 @@ struct _z80ctc_interface
MDRV_DEVICE_CONFIG(_intrf)
#define MDRV_Z80CTC_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, Z80CTC)
MDRV_DEVICE_REMOVE(_tag)

View File

@ -14,7 +14,7 @@
MDRV_DEVICE_CONFIG(_config)
#define MDRV_Z80DMA_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, Z80DMA)
MDRV_DEVICE_REMOVE(_tag)
typedef struct _z80dma_interface z80dma_interface;
struct _z80dma_interface

View File

@ -61,7 +61,7 @@ struct _z80pio_interface
MDRV_DEVICE_CONFIG(_intrf)
#define MDRV_Z80PIO_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, Z80PIO)
MDRV_DEVICE_REMOVE(_tag)

View File

@ -37,7 +37,7 @@ struct _z80sio_interface
MDRV_DEVICE_CONFIG(_intrf)
#define MDRV_Z80SIO_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, Z80SIO)
MDRV_DEVICE_REMOVE(_tag)

View File

@ -36,9 +36,9 @@ static void machine_config_detokenize(machine_config *config, const machine_conf
the given configuration
-------------------------------------------------*/
INLINE void remove_device(device_config **listheadptr, device_type type, const char *tag)
INLINE void remove_device(device_config **listheadptr, const char *tag)
{
device_config *device = (device_config *)device_list_find_by_tag(*listheadptr, type, tag);
device_config *device = (device_config *)device_list_find_by_tag(*listheadptr, tag);
device_custom_config_func custom;
assert(device != NULL);
@ -49,7 +49,7 @@ INLINE void remove_device(device_config **listheadptr, device_type type, const c
(*custom)(device, MCONFIG_TOKEN_DEVICE_CONFIG_CUSTOM_FREE, NULL);
/* remove the device from the list */
device_list_remove(listheadptr, type, tag);
device_list_remove(listheadptr, tag);
}
@ -87,7 +87,7 @@ void machine_config_free(machine_config *config)
{
/* release the device list */
while (config->devicelist != NULL)
remove_device(&config->devicelist, config->devicelist->type, config->devicelist->tag);
remove_device(&config->devicelist, config->devicelist->tag);
/* release the configuration itself */
free(config);
@ -138,18 +138,16 @@ static void machine_config_detokenize(machine_config *config, const machine_conf
break;
case MCONFIG_TOKEN_DEVICE_REMOVE:
devtype = TOKEN_GET_PTR(tokens, devtype);
tag = TOKEN_GET_STRING(tokens);
remove_device(&config->devicelist, devtype, device_build_tag(tempstring, owner, tag));
remove_device(&config->devicelist, device_build_tag(tempstring, owner, tag));
device = NULL;
break;
case MCONFIG_TOKEN_DEVICE_MODIFY:
devtype = TOKEN_GET_PTR(tokens, devtype);
tag = TOKEN_GET_STRING(tokens);
device = (device_config *)device_list_find_by_tag(config->devicelist, devtype, device_build_tag(tempstring, owner, tag));
device = (device_config *)device_list_find_by_tag(config->devicelist, device_build_tag(tempstring, owner, tag));
if (device == NULL)
fatalerror("Unable to find device: type=%s tag=%s\n", devtype_get_name(devtype), astring_c(tempstring));
fatalerror("Unable to find device: tag=%s\n", astring_c(tempstring));
break;
case MCONFIG_TOKEN_DEVICE_CLOCK:

View File

@ -291,14 +291,12 @@ union _machine_config_token
TOKEN_PTR(devtype, _type), \
TOKEN_STRING(_tag),
#define MDRV_DEVICE_REMOVE(_tag, _type) \
#define MDRV_DEVICE_REMOVE(_tag) \
TOKEN_UINT32_PACK1(MCONFIG_TOKEN_DEVICE_REMOVE, 8), \
TOKEN_PTR(devtype, _type), \
TOKEN_STRING(_tag),
#define MDRV_DEVICE_MODIFY(_tag, _type) \
#define MDRV_DEVICE_MODIFY(_tag) \
TOKEN_UINT32_PACK1(MCONFIG_TOKEN_DEVICE_MODIFY, 8), \
TOKEN_PTR(devtype, _type), \
TOKEN_STRING(_tag),

View File

@ -1734,11 +1734,11 @@ static void memory_init_populate(running_machine *machine)
{
int bits = (entry->read_bits == 0) ? space->dbits : entry->read_bits;
void *object = space;
if (entry->read_devtype != NULL)
if (entry->read_devtag != NULL)
{
object = (void *)device_list_find_by_tag(machine->config->devicelist, entry->read_devtype, entry->read_devtag);
object = (void *)device_list_find_by_tag(machine->config->devicelist, entry->read_devtag);
if (object == NULL)
fatalerror("Unidentified object in memory map: type=%s tag=%s\n", devtype_get_name(entry->read_devtype), entry->read_devtag);
fatalerror("Unidentified object in memory map: tag=%s\n", entry->read_devtag);
}
space_map_range_private(space, ROW_READ, bits, entry->read_mask, entry->addrstart, entry->addrend, entry->addrmask, entry->addrmirror, rhandler.generic, object, entry->read_name);
}
@ -1748,11 +1748,11 @@ static void memory_init_populate(running_machine *machine)
{
int bits = (entry->write_bits == 0) ? space->dbits : entry->write_bits;
void *object = space;
if (entry->write_devtype != NULL)
if (entry->write_devtag != NULL)
{
object = (void *)device_list_find_by_tag(machine->config->devicelist, entry->write_devtype, entry->write_devtag);
object = (void *)device_list_find_by_tag(machine->config->devicelist, entry->write_devtag);
if (object == NULL)
fatalerror("Unidentified object in memory map: type=%s tag=%s\n", devtype_get_name(entry->write_devtype), entry->write_devtag);
fatalerror("Unidentified object in memory map: tag=%s\n", entry->write_devtag);
}
space_map_range_private(space, ROW_WRITE, bits, entry->write_mask, entry->addrstart, entry->addrend, entry->addrmask, entry->addrmirror, whandler.generic, object, entry->write_name);
}
@ -2099,7 +2099,6 @@ static void map_detokenize(address_map *map, const game_driver *driver, const ch
TOKEN_GET_UINT32_UNPACK3(tokens, entrytype, 8, entry->read_bits, 8, entry->read_mask, 8);
entry->read = TOKEN_GET_PTR(tokens, read);
entry->read_name = TOKEN_GET_STRING(tokens);
entry->read_devtype = TOKEN_GET_PTR(tokens, devtype);
if (entry->read_devtag_string == NULL)
entry->read_devtag_string = astring_alloc();
entry->read_devtag = device_inherit_tag(entry->read_devtag_string, cputag, TOKEN_GET_STRING(tokens));
@ -2111,7 +2110,6 @@ static void map_detokenize(address_map *map, const game_driver *driver, const ch
TOKEN_GET_UINT32_UNPACK3(tokens, entrytype, 8, entry->write_bits, 8, entry->write_mask, 8);
entry->write = TOKEN_GET_PTR(tokens, write);
entry->write_name = TOKEN_GET_STRING(tokens);
entry->write_devtype = TOKEN_GET_PTR(tokens, devtype);
if (entry->write_devtag_string == NULL)
entry->write_devtag_string = astring_alloc();
entry->write_devtag = device_inherit_tag(entry->write_devtag_string, cputag, TOKEN_GET_STRING(tokens));

View File

@ -221,14 +221,12 @@ struct _address_map_entry
UINT8 read_bits; /* bits for the read handler callback (0=default, 1=8, 2=16, 3=32) */
UINT8 read_mask; /* mask bits indicating which subunits to process */
const char * read_name; /* read handler callback name */
device_type read_devtype; /* read device type for device references */
const char * read_devtag; /* read tag for the relevant device */
const char * read_porttag; /* tag for input port reading */
write_handler write; /* write handler callback */
UINT8 write_bits; /* bits for the write handler callback (0=default, 1=8, 2=16, 3=32) */
UINT8 write_mask; /* mask bits indicating which subunits to process */
const char * write_name; /* write handler callback name */
device_type write_devtype; /* read device type for device references */
const char * write_devtag; /* read tag for the relevant device */
UINT32 share; /* index of a shared memory block */
void ** baseptr; /* receives pointer to memory (optional) */
@ -311,7 +309,6 @@ union _addrmap_token
const addrmap_token * tokenptr;
read_handler read; /* generic read handlers */
write_handler write; /* generic write handlers */
device_type devtype; /* device type */
UINT8 ** memptr; /* memory pointer */
size_t * sizeptr; /* size pointer */
};
@ -329,7 +326,6 @@ union _addrmap8_token
write8_device_func dwrite; /* pointer to native device write handler */
read_handler read; /* generic read handlers */
write_handler write; /* generic write handlers */
device_type devtype; /* device type */
UINT8 ** memptr; /* memory pointer */
size_t * sizeptr; /* size pointer */
};
@ -351,7 +347,6 @@ union _addrmap16_token
write8_device_func dwrite8; /* pointer to 8-bit device write handler */
read_handler read; /* generic read handlers */
write_handler write; /* generic write handlers */
device_type devtype; /* device type */
UINT16 ** memptr; /* memory pointer */
size_t * sizeptr; /* size pointer */
};
@ -377,7 +372,6 @@ union _addrmap32_token
write16_device_func dwrite16; /* pointer to 16-bit device write handler */
read_handler read; /* generic read handlers */
write_handler write; /* generic write handlers */
device_type devtype; /* device type */
UINT32 ** memptr; /* memory pointer */
size_t * sizeptr; /* size pointer */
};
@ -407,7 +401,6 @@ union _addrmap64_token
write32_device_func dwrite32; /* pointer to 32-bit device write handler */
read_handler read; /* generic read handlers */
write_handler write; /* generic write handlers */
device_type devtype; /* device type */
UINT64 ** memptr; /* memory pointer */
size_t * sizeptr; /* size pointer */
};
@ -724,60 +717,52 @@ union _addrmap64_token
TOKEN_PTR(swrite32, _handler), \
TOKEN_STRING(#_handler),
#define AM_DEVREAD(_type, _tag, _handler) \
#define AM_DEVREAD(_tag, _handler) \
TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_DEVICE_READ, 8, 0, 8, 0, 8), \
TOKEN_PTR(dread, _handler), \
TOKEN_STRING(#_handler), \
TOKEN_PTR(devtype, _type), \
TOKEN_STRING(_tag),
#define AM_DEVREAD8(_type, _tag, _handler, _unitmask) \
#define AM_DEVREAD8(_tag, _handler, _unitmask) \
TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_DEVICE_READ, 8, 8, 8, UNITMASK8(_unitmask), 8), \
TOKEN_PTR(dread8, _handler), \
TOKEN_STRING(#_handler), \
TOKEN_PTR(devtype, _type), \
TOKEN_STRING(_tag),
#define AM_DEVREAD16(_type, _tag, _handler, _unitmask) \
#define AM_DEVREAD16(_tag, _handler, _unitmask) \
TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_DEVICE_READ, 8, 16, 8, UNITMASK16(_unitmask), 8), \
TOKEN_PTR(dread16, _handler), \
TOKEN_STRING(#_handler), \
TOKEN_PTR(devtype, _type), \
TOKEN_STRING(_tag),
#define AM_DEVREAD32(_type, _tag, _handler, _unitmask) \
#define AM_DEVREAD32(_tag, _handler, _unitmask) \
TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_DEVICE_READ, 8, 32, 8, UNITMASK32(_unitmask), 8), \
TOKEN_PTR(dread32, _handler), \
TOKEN_STRING(#_handler), \
TOKEN_PTR(devtype, _type), \
TOKEN_STRING(_tag),
#define AM_DEVWRITE(_type, _tag, _handler) \
#define AM_DEVWRITE(_tag, _handler) \
TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_DEVICE_WRITE, 8, 0, 8, 0, 8), \
TOKEN_PTR(dwrite, _handler), \
TOKEN_STRING(#_handler), \
TOKEN_PTR(devtype, _type), \
TOKEN_STRING(_tag),
#define AM_DEVWRITE8(_type, _tag, _handler, _unitmask) \
#define AM_DEVWRITE8(_tag, _handler, _unitmask) \
TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_DEVICE_WRITE, 8, 8, 8, UNITMASK8(_unitmask), 8), \
TOKEN_PTR(dwrite8, _handler), \
TOKEN_STRING(#_handler), \
TOKEN_PTR(devtype, _type), \
TOKEN_STRING(_tag),
#define AM_DEVWRITE16(_type, _tag, _handler, _unitmask) \
#define AM_DEVWRITE16(_tag, _handler, _unitmask) \
TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_DEVICE_WRITE, 8, 16, 8, UNITMASK16(_unitmask), 8), \
TOKEN_PTR(dwrite16, _handler), \
TOKEN_STRING(#_handler), \
TOKEN_PTR(devtype, _type), \
TOKEN_STRING(_tag),
#define AM_DEVWRITE32(_type, _tag, _handler, _unitmask) \
#define AM_DEVWRITE32(_tag, _handler, _unitmask) \
TOKEN_UINT32_PACK3(ADDRMAP_TOKEN_DEVICE_WRITE, 8, 32, 8, UNITMASK32(_unitmask), 8), \
TOKEN_PTR(dwrite32, _handler), \
TOKEN_STRING(#_handler), \
TOKEN_PTR(devtype, _type), \
TOKEN_STRING(_tag),
#define AM_READ_PORT(_tag) \
@ -812,10 +797,10 @@ union _addrmap64_token
#define AM_READWRITE16(_read,_write,_mask) AM_READ16(_read,_mask) AM_WRITE16(_write,_mask)
#define AM_READWRITE32(_read,_write,_mask) AM_READ32(_read,_mask) AM_WRITE32(_write,_mask)
#define AM_DEVREADWRITE(_type,_tag,_read,_write) AM_DEVREAD(_type,_tag,_read) AM_DEVWRITE(_type,_tag,_write)
#define AM_DEVREADWRITE8(_type,_tag,_read,_write,_mask) AM_DEVREAD8(_type,_tag,_read,_mask) AM_DEVWRITE8(_type,_tag,_write,_mask)
#define AM_DEVREADWRITE16(_type,_tag,_read,_write,_mask) AM_DEVREAD16(_type,_tag,_read,_mask) AM_DEVWRITE16(_type,_tag,_write,_mask)
#define AM_DEVREADWRITE32(_type,_tag,_read,_write,_mask) AM_DEVREAD32(_type,_tag,_read,_mask) AM_DEVWRITE32(_type,_tag,_write,_mask)
#define AM_DEVREADWRITE(_tag,_read,_write) AM_DEVREAD(_tag,_read) AM_DEVWRITE(_tag,_write)
#define AM_DEVREADWRITE8(_tag,_read,_write,_mask) AM_DEVREAD8(_tag,_read,_mask) AM_DEVWRITE8(_tag,_write,_mask)
#define AM_DEVREADWRITE16(_tag,_read,_write,_mask) AM_DEVREAD16(_tag,_read,_mask) AM_DEVWRITE16(_tag,_write,_mask)
#define AM_DEVREADWRITE32(_tag,_read,_write,_mask) AM_DEVREAD32(_tag,_read,_mask) AM_DEVWRITE32(_tag,_write,_mask)
#define AM_ROM AM_READ(SMH_ROM)
#define AM_ROMBANK(_bank) AM_READ(SMH_BANK(_bank))

View File

@ -432,8 +432,8 @@ static void route_sound(running_machine *machine)
/* iterate over all routes */
for (route = config->routelist; route != NULL; route = route->next)
{
const device_config *target_speaker = devtag_get_device(machine, SPEAKER_OUTPUT, route->target);
const device_config *target_sound = devtag_get_device(machine, SOUND, route->target);
const device_config *target_speaker = devtag_get_device(machine, route->target);
const device_config *target_sound = devtag_get_device(machine, route->target);
/* if neither found, it's fatal */
if (target_speaker == NULL && target_sound == NULL)
@ -470,8 +470,8 @@ static void route_sound(running_machine *machine)
/* iterate over all routes */
for (route = config->routelist; route != NULL; route = route->next)
{
const device_config *target_speaker = devtag_get_device(machine, SPEAKER_OUTPUT, route->target);
const device_config *target_sound = devtag_get_device(machine, SOUND, route->target);
const device_config *target_speaker = devtag_get_device(machine, route->target);
const device_config *target_sound = devtag_get_device(machine, route->target);
int inputnum = route->input;
sound_stream *stream;
int streamoutput;

View File

@ -91,10 +91,10 @@ struct _speaker_config
MDRV_DEVICE_CONFIG_DATAPTR(sound_config, type, SOUND_##_type)
#define MDRV_SOUND_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, SOUND)
MDRV_DEVICE_REMOVE(_tag)
#define MDRV_SOUND_MODIFY(_tag) \
MDRV_DEVICE_MODIFY(_tag, SOUND)
MDRV_DEVICE_MODIFY(_tag)
#define MDRV_SOUND_TYPE(_type) \
MDRV_DEVICE_CONFIG_DATAPTR(sound_config, type, SOUND_##_type)
@ -103,7 +103,7 @@ struct _speaker_config
MDRV_DEVICE_CLOCK(_clock)
#define MDRV_SOUND_REPLACE(_tag, _type, _clock) \
MDRV_DEVICE_MODIFY(_tag, SOUND) \
MDRV_DEVICE_MODIFY(_tag) \
MDRV_DEVICE_CONFIG_CLEAR() \
MDRV_DEVICE_CONFIG_DATAPTR(sound_config, type, SOUND_##_type) \
MDRV_DEVICE_CLOCK(_clock) \
@ -133,7 +133,7 @@ struct _speaker_config
MDRV_DEVICE_CONFIG_DATAFP32(speaker_config, z, _z, 24)
#define MDRV_SPEAKER_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, SPEAKER_OUTPUT)
MDRV_DEVICE_REMOVE(_tag)
#define MDRV_SPEAKER_STANDARD_MONO(_tag) \
MDRV_SPEAKER_ADD(_tag, 0.0, 0.0, 1.0)

View File

@ -865,7 +865,7 @@ static DEVICE_START( cdp1869 )
cdp1869->wnoff = 1;
/* get the screen device */
cdp1869->screen = devtag_get_device(device->machine, VIDEO_SCREEN, cdp1869->intf->screen_tag);
cdp1869->screen = devtag_get_device(device->machine, cdp1869->intf->screen_tag);
assert(cdp1869->screen != NULL);
/* get the CPU device */

View File

@ -93,7 +93,7 @@
MDRV_DEVICE_CONFIG(_config)
#define MDRV_CDP1869_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, SOUND)
MDRV_DEVICE_REMOVE(_tag)
#define CDP1869_INTERFACE(_name) const cdp1869_interface (_name) =

View File

@ -951,7 +951,7 @@ READ8_HANDLER( quad_pokey_r )
int control = (offset & 0x20) >> 2;
int pokey_reg = (offset % 8) | control;
return pokey_r(devtag_get_device(space->machine, SOUND, devname[pokey_num]), pokey_reg);
return pokey_r(devtag_get_device(space->machine, devname[pokey_num]), pokey_reg);
}
@ -1337,7 +1337,7 @@ WRITE8_HANDLER( quad_pokey_w )
int control = (offset & 0x20) >> 2;
int pokey_reg = (offset % 8) | control;
pokey_w(devtag_get_device(space->machine, SOUND, devname[pokey_num]), pokey_reg, data);
pokey_w(devtag_get_device(space->machine, devname[pokey_num]), pokey_reg, data);
}
void pokey_serin_ready(const device_config *device, int after)

View File

@ -226,7 +226,7 @@ static STREAM_UPDATE( PSXSPU_update )
static void spu_read( running_machine *machine, UINT32 n_address, INT32 n_size )
{
struct psxinfo *chip = get_safe_token(devtag_get_device(machine, SOUND, "spu"));
struct psxinfo *chip = get_safe_token(devtag_get_device(machine, "spu"));
verboselog( machine, 1, "spu_read( %08x, %08x )\n", n_address, n_size );
while( n_size > 0 )
@ -245,7 +245,7 @@ static void spu_read( running_machine *machine, UINT32 n_address, INT32 n_size )
static void spu_write( running_machine *machine, UINT32 n_address, INT32 n_size )
{
struct psxinfo *chip = get_safe_token(devtag_get_device(machine, SOUND, "spu"));
struct psxinfo *chip = get_safe_token(devtag_get_device(machine, "spu"));
verboselog( machine, 1, "spu_write( %08x, %08x )\n", n_address, n_size );
while( n_size > 0 )

View File

@ -727,7 +727,7 @@ static void SCSP_UpdateReg(struct _SCSP *SCSP, int reg)
break;
case 0x6:
case 0x7:
scsp_midi_in(devtag_get_device(space->machine, SOUND, "scsp"), 0, SCSP->udata.data[0x6/2]&0xff, 0);
scsp_midi_in(devtag_get_device(space->machine, "scsp"), 0, SCSP->udata.data[0x6/2]&0xff, 0);
break;
case 0x12:
case 0x13:

View File

@ -60,7 +60,7 @@ static DEVICE_START( wave )
const device_config *image = NULL;
#ifdef MESS
image = device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, device->tag );
image = devtag_get_device( device->machine, device->tag );
#endif
stream_create(device, 0, 1, device->machine->sample_rate, (void *)image, wave_sound_update);
}

View File

@ -920,7 +920,7 @@ static stream_sample_t *generate_resampled_data(stream_input *input, UINT32 nums
source = output->buffer + (basesample - input_stream->output_base_sampindex);
/* determine the current fraction of a sample */
basefrac = (basetime - basesample * input_stream->attoseconds_per_sample) / (input_stream->attoseconds_per_sample >> FRAC_BITS);
basefrac = (basetime - basesample * input_stream->attoseconds_per_sample) / ((input_stream->attoseconds_per_sample + FRAC_ONE - 1) >> FRAC_BITS);
assert(basefrac >= 0);
assert(basefrac < FRAC_ONE);

View File

@ -1079,7 +1079,7 @@ static TIMER_CALLBACK( scanline_timer_device_timer_callback )
timer_config *config = timer->inline_config;
/* get the screen device and verify it */
const device_config *screen = device_list_find_by_tag(timer->machine->config->devicelist, VIDEO_SCREEN, config->screen);
const device_config *screen = devtag_get_device(timer->machine, config->screen);
assert(screen != NULL);
/* first time, start with the first scanline, but do not call the callback */

View File

@ -132,10 +132,10 @@ struct _timer_execution_state
MDRV_DEVICE_CONFIG_DATA32(timer_config, increment, _increment)
#define MDRV_TIMER_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, TIMER_SCREEN)
MDRV_DEVICE_REMOVE(_tag)
#define MDRV_TIMER_MODIFY(_tag) \
MDRV_DEVICE_MODIFY(_tag, TIMER_SCREEN)
MDRV_DEVICE_MODIFY(_tag)
#define MDRV_TIMER_CALLBACK(_callback) \
MDRV_DEVICE_CONFIG_DATAPTR(timer_config, callback, _callback)

View File

@ -841,14 +841,14 @@ static int validate_cpu(int drivnum, const machine_config *config, const input_p
}
/* make sure all devices exist */
if (entry->read_devtype != NULL && device_list_find_by_tag(config->devicelist, entry->read_devtype, entry->read_devtag) == NULL)
if (entry->read_devtag != NULL && device_list_find_by_tag(config->devicelist, entry->read_devtag) == NULL)
{
mame_printf_error("%s: %s CPU '%s' %s space memory map entry references nonexistant device %s '%s'\n", driver->source_file, driver->name, device->tag, address_space_names[spacenum], devtype_get_name(entry->read_devtype), entry->read_devtag);
mame_printf_error("%s: %s CPU '%s' %s space memory map entry references nonexistant device '%s'\n", driver->source_file, driver->name, device->tag, address_space_names[spacenum], entry->read_devtag);
error = TRUE;
}
if (entry->write_devtype != NULL && device_list_find_by_tag(config->devicelist, entry->write_devtype, entry->write_devtag) == NULL)
if (entry->write_devtag != NULL && device_list_find_by_tag(config->devicelist, entry->write_devtag) == NULL)
{
mame_printf_error("%s: %s CPU '%s' %s space memory map entry references nonexistant device %s '%s'\n", driver->source_file, driver->name, device->tag, address_space_names[spacenum], devtype_get_name(entry->write_devtype), entry->write_devtag);
mame_printf_error("%s: %s CPU '%s' %s space memory map entry references nonexistant device '%s'\n", driver->source_file, driver->name, device->tag, address_space_names[spacenum], entry->write_devtag);
error = TRUE;
}
@ -876,7 +876,7 @@ static int validate_cpu(int drivnum, const machine_config *config, const input_p
mame_printf_error("%s: %s cpu '%s' has a new VBLANK interrupt handler with >1 interrupts!\n", driver->source_file, driver->name, device->tag);
error = TRUE;
}
else if (cpuconfig->vblank_interrupt_screen != NULL && device_list_find_by_tag(config->devicelist, VIDEO_SCREEN, cpuconfig->vblank_interrupt_screen) == NULL)
else if (cpuconfig->vblank_interrupt_screen != NULL && device_list_find_by_tag(config->devicelist, cpuconfig->vblank_interrupt_screen) == NULL)
{
mame_printf_error("%s: %s cpu '%s' VBLANK interrupt with a non-existant screen tag (%s)!\n", driver->source_file, driver->name, device->tag, cpuconfig->vblank_interrupt_screen);
error = TRUE;

View File

@ -100,10 +100,10 @@ typedef void (*vblank_state_changed_func)(const device_config *device, void *par
MDRV_DEVICE_CONFIG_DATA32(screen_config, type, SCREEN_TYPE_##_type)
#define MDRV_SCREEN_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, VIDEO_SCREEN)
MDRV_DEVICE_REMOVE(_tag)
#define MDRV_SCREEN_MODIFY(_tag) \
MDRV_DEVICE_MODIFY(_tag, VIDEO_SCREEN)
MDRV_DEVICE_MODIFY(_tag)
#define MDRV_SCREEN_FORMAT(_format) \
MDRV_DEVICE_CONFIG_DATA32(screen_config, format, _format)

View File

@ -759,7 +759,7 @@ static void common_start(const device_config *device, int device_type)
mc6845->hpixels_per_column = mc6845->intf->hpixels_per_column;
/* get the screen device */
mc6845->screen = device_list_find_by_tag(device->machine->config->devicelist, VIDEO_SCREEN, mc6845->intf->screen_tag);
mc6845->screen = devtag_get_device(device->machine, mc6845->intf->screen_tag);
assert(mc6845->screen != NULL);
/* create the timers */

View File

@ -24,8 +24,8 @@
MDRV_DEVICE_ADD(_tag, _variant, _clock) \
MDRV_DEVICE_CONFIG(_config)
#define MDRV_MC6845_REMOVE(_tag, _variant) \
MDRV_DEVICE_REMOVE(_tag, _variant)
#define MDRV_MC6845_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag)

View File

@ -80,7 +80,7 @@ void tms34061_start(running_machine *machine, const struct tms34061_interface *i
/* reset the data */
memset(&tms34061, 0, sizeof(tms34061));
tms34061.intf = *interface;
tms34061.screen = device_list_find_by_tag(machine->config->devicelist, VIDEO_SCREEN, tms34061.intf.screen_tag);
tms34061.screen = devtag_get_device(machine, tms34061.intf.screen_tag);
tms34061.vrammask = tms34061.intf.vramsize - 1;
/* allocate memory for VRAM */

View File

@ -4540,7 +4540,7 @@ static DEVICE_START( voodoo )
/* set the type, and initialize the chip mask */
v->index = device_list_index(device->machine->config->devicelist, device->type, device->tag);
v->screen = devtag_get_device(device->machine, VIDEO_SCREEN, config->screen);
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);
assert_always(v->cpu != NULL, "Unable to find CPU attached to voodoo");

View File

@ -86,10 +86,10 @@ struct _voodoo_config
MDRV_DEVICE_CONFIG_DATAPTR(voodoo_config, cputag, _cputag)
#define MDRV_3DFX_VOODOO_MODIFY(_tag) \
MDRV_DEVICE_MODIFY(_tag, VOODOO_GRAPHICS)
MDRV_DEVICE_MODIFY(_tag)
#define MDRV_3DFX_VOODOO_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, VOODOO_GRAPHICS)
MDRV_DEVICE_REMOVE(_tag)

View File

@ -39,8 +39,8 @@ MACHINE_START( extra_8080bw_sh )
WRITE8_HANDLER( invadpt2_sh_port_1_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *sn = devtag_get_device(space->machine, SOUND, "sn");
const device_config *samples = devtag_get_device(space->machine, "samples");
const device_config *sn = devtag_get_device(space->machine, "sn");
UINT8 rising_bits = data & ~port_1_last_extra;
sn76477_enable_w(sn, !(data & 0x01)); /* SAUCER SOUND */
@ -67,7 +67,7 @@ WRITE8_HANDLER( invadpt2_sh_port_2_w )
D2 = 82K
D3 = 100K */
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
UINT8 rising_bits = data & ~port_2_last_extra;
if (rising_bits & 0x01) sample_start(samples, 4, 3, 0); /* FLEET */
@ -90,9 +90,9 @@ WRITE8_HANDLER( invadpt2_sh_port_2_w )
WRITE8_HANDLER( spcewars_sh_port_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *speaker = devtag_get_device(space->machine, SOUND, "speaker");
const device_config *sn = devtag_get_device(space->machine, SOUND, "sn");
const device_config *samples = devtag_get_device(space->machine, "samples");
const device_config *speaker = devtag_get_device(space->machine, "speaker");
const device_config *sn = devtag_get_device(space->machine, "sn");
UINT8 rising_bits = data & ~port_1_last_extra;
sn76477_enable_w(sn, !(data & 0x01)); /* Saucer Sound */
@ -136,7 +136,7 @@ const samples_interface lrescue_samples_interface =
WRITE8_HANDLER( lrescue_sh_port_1_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
UINT8 rising_bits = data & ~port_1_last_extra;
if (rising_bits & 0x01) sample_start(samples, 0, 3, 0); /* Thrust */
@ -154,8 +154,8 @@ WRITE8_HANDLER( lrescue_sh_port_1_w )
WRITE8_HANDLER( lrescue_sh_port_2_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *speaker = devtag_get_device(space->machine, SOUND, "speaker");
const device_config *samples = devtag_get_device(space->machine, "samples");
const device_config *speaker = devtag_get_device(space->machine, "speaker");
UINT8 rising_bits = data & ~port_2_last_extra;
if (rising_bits & 0x01) sample_start(samples, 1, 8, 0); /* Footstep high tone */
@ -195,7 +195,7 @@ WRITE8_HANDLER( cosmo_sh_port_2_w )
WRITE8_HANDLER( ballbomb_sh_port_1_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
UINT8 rising_bits = data & ~port_1_last_extra;
if (rising_bits & 0x01) sample_start(samples, 1, 2, 0); /* Hit a balloon */
@ -213,7 +213,7 @@ WRITE8_HANDLER( ballbomb_sh_port_1_w )
WRITE8_HANDLER( ballbomb_sh_port_2_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
UINT8 rising_bits = data & ~port_2_last_extra;
if (data & 0x01) sample_start(samples, 0, 7, 0); /* Indicates plane will drop bombs */
@ -273,7 +273,7 @@ WRITE8_HANDLER( indianbt_sh_port_1_w )
{
/* bit 4 occurs every 5.25 seconds during gameplay */
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
UINT8 rising_bits = data & ~port_1_last_extra;
if (rising_bits & 0x01) sample_start(samples, 1, 7, 0); /* Death */
@ -290,7 +290,7 @@ WRITE8_HANDLER( indianbt_sh_port_1_w )
WRITE8_HANDLER( indianbt_sh_port_2_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
UINT8 rising_bits = data & ~port_2_last_extra;
if (rising_bits & 0x01) sample_start(samples, 4, 0, 0); /* Bird dropped an egg, Lasso used */
@ -799,8 +799,8 @@ static const double schaser_effect_rc[8] =
WRITE8_HANDLER( schaser_sh_port_1_w )
{
const device_config *discrete = devtag_get_device(space->machine, SOUND, "discrete");
const device_config *sn = devtag_get_device(space->machine, SOUND, "sn");
const device_config *discrete = devtag_get_device(space->machine, "discrete");
const device_config *sn = devtag_get_device(space->machine, "sn");
static int last_effect = 0;
int effect;
@ -874,7 +874,7 @@ WRITE8_HANDLER( schaser_sh_port_2_w )
bit 4 - Field Control B (SX10)
bit 5 - Flip Screen */
const device_config *discrete = devtag_get_device(space->machine, SOUND, "discrete");
const device_config *discrete = devtag_get_device(space->machine, "discrete");
printf( "schaser_sh_port_2_w: %02x\n", data );
@ -895,7 +895,7 @@ WRITE8_HANDLER( schaser_sh_port_2_w )
static TIMER_CALLBACK( schaser_effect_555_cb )
{
const device_config *sn = devtag_get_device(machine, SOUND, "sn");
const device_config *sn = devtag_get_device(machine, "sn");
int effect = param;
attotime new_time;
/* Toggle 555 output */
@ -963,7 +963,7 @@ MACHINE_RESET( schaser )
WRITE8_HANDLER( rollingc_sh_port_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
UINT8 rising_bits = data & ~port_3_last_extra;
if (rising_bits & 0x02) sample_start(samples, 4, 0, 0); /* Steering */
@ -987,7 +987,7 @@ WRITE8_HANDLER( rollingc_sh_port_w )
WRITE8_HANDLER( invrvnge_sh_port_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
switch (data)
{
case 0x06:
@ -1031,8 +1031,8 @@ WRITE8_HANDLER( invrvnge_sh_port_w )
WRITE8_HANDLER( lupin3_sh_port_1_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *sn = devtag_get_device(space->machine, SOUND, "sn");
const device_config *samples = devtag_get_device(space->machine, "samples");
const device_config *sn = devtag_get_device(space->machine, "sn");
UINT8 rising_bits = data & ~port_1_last_extra;
if (rising_bits & 0x01) sample_start(samples, 0, 6, 0); /* Walking, get money */
@ -1048,7 +1048,7 @@ WRITE8_HANDLER( lupin3_sh_port_1_w )
WRITE8_HANDLER( lupin3_sh_port_2_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
UINT8 rising_bits = data & ~port_2_last_extra;
if (rising_bits & 0x01) sample_start(samples, 0, 3, 0); /* Lands on top of building, wife kicks man */
@ -1075,7 +1075,7 @@ WRITE8_HANDLER( schasrcv_sh_port_1_w )
bit 3 = 1st speedup
Death is a stream of ff's with some fe's thrown in */
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
UINT8 rising_bits = data & ~port_1_last_extra;
if (rising_bits & 0x02) sample_start(samples, 1, 6, 0); /* Ran over a dot */
@ -1086,7 +1086,7 @@ WRITE8_HANDLER( schasrcv_sh_port_1_w )
WRITE8_HANDLER( schasrcv_sh_port_2_w )
{
const device_config *speaker = devtag_get_device(space->machine, SOUND, "speaker");
const device_config *speaker = devtag_get_device(space->machine, "speaker");
speaker_level_w(speaker, (data & 0x01) ? 1 : 0); /* End-of-Level */
@ -1103,7 +1103,7 @@ WRITE8_HANDLER( schasrcv_sh_port_2_w )
WRITE8_HANDLER( yosakdon_sh_port_1_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
UINT8 rising_bits = data & ~port_1_last_extra;
if (rising_bits & 0x01) sample_start(samples, 0, 3, 0); /* Game Over */
@ -1119,8 +1119,8 @@ WRITE8_HANDLER( yosakdon_sh_port_1_w )
WRITE8_HANDLER( yosakdon_sh_port_2_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *sn = devtag_get_device(space->machine, SOUND, "sn");
const device_config *samples = devtag_get_device(space->machine, "samples");
const device_config *sn = devtag_get_device(space->machine, "sn");
UINT8 rising_bits = data & ~port_2_last_extra;
if (rising_bits & 0x01) sample_start(samples, 1, 6, 0); /* Ready? , Game Over */
@ -1145,8 +1145,8 @@ WRITE8_HANDLER( shuttlei_sh_port_1_w )
{
/* bit 3 is high while you are alive and playing */
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *sn = devtag_get_device(space->machine, SOUND, "sn");
const device_config *samples = devtag_get_device(space->machine, "samples");
const device_config *sn = devtag_get_device(space->machine, "sn");
UINT8 rising_bits = data & ~port_1_last_extra;
if (rising_bits & 0x01) sample_start(samples, 4, 4, 0); /* Fleet move */
@ -1159,7 +1159,7 @@ WRITE8_HANDLER( shuttlei_sh_port_1_w )
WRITE8_HANDLER( shuttlei_sh_port_2_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
switch (data)
{
case 0x23:

View File

@ -68,7 +68,7 @@ MACHINE_START( astrof_audio )
WRITE8_HANDLER( astrof_audio_1_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
UINT8 rising_bits = data & ~port_1_last;
if (astrof_death_playing)
@ -114,7 +114,7 @@ WRITE8_HANDLER( astrof_audio_1_w )
WRITE8_HANDLER( astrof_audio_2_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
UINT8 rising_bits = data & ~port_2_last;
/* D0-D2 - explosion select (triggered by D2 of the other port */
@ -219,7 +219,7 @@ MACHINE_DRIVER_END
WRITE8_HANDLER( tomahawk_audio_w )
{
const device_config *sn = devtag_get_device(space->machine, SOUND, "sn");
const device_config *sn = devtag_get_device(space->machine, "sn");
/* D0 - sonar */

View File

@ -121,12 +121,12 @@ void atarijsa_init(running_machine *machine, const char *testport, int testmask)
bank_source_data = &rgn[0x10000];
/* determine which sound hardware is installed */
tms5220 = devtag_get_device(machine, SOUND, "tms");
ym2151 = devtag_get_device(machine, SOUND, "ym");
pokey = devtag_get_device(machine, SOUND, "pokey");
oki6295 = devtag_get_device(machine, SOUND, "adpcm");
oki6295_l = devtag_get_device(machine, SOUND, "adpcml");
oki6295_r = devtag_get_device(machine, SOUND, "adpcmr");
tms5220 = devtag_get_device(machine, "tms");
ym2151 = devtag_get_device(machine, "ym");
pokey = devtag_get_device(machine, "pokey");
oki6295 = devtag_get_device(machine, "adpcm");
oki6295_l = devtag_get_device(machine, "adpcml");
oki6295_r = devtag_get_device(machine, "adpcmr");
/* install POKEY memory handlers */
if (pokey != NULL)
@ -653,7 +653,7 @@ static WRITE8_HANDLER( jsa3s_io_w )
/* update the OKI bank */
oki6295_bank_base = (0x40000 * ((data >> 1) & 1)) | (oki6295_bank_base & 0x80000);
okim6295_set_bank_base(devtag_get_device(space->machine, SOUND, "adpcml"), oki6295_bank_base);
okim6295_set_bank_base(devtag_get_device(space->machine, "adpcml"), oki6295_bank_base);
/* update the bank */
memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
@ -679,8 +679,8 @@ static WRITE8_HANDLER( jsa3s_io_w )
/* update the OKI bank */
oki6295_bank_base = (0x80000 * ((data >> 4) & 1)) | (oki6295_bank_base & 0x40000);
okim6295_set_bank_base(devtag_get_device(space->machine, SOUND, "adpcml"), oki6295_bank_base);
okim6295_set_bank_base(devtag_get_device(space->machine, SOUND, "adpcmr"), 0x40000 * (data >> 6));
okim6295_set_bank_base(devtag_get_device(space->machine, "adpcml"), oki6295_bank_base);
okim6295_set_bank_base(devtag_get_device(space->machine, "adpcmr"), 0x40000 * (data >> 6));
/* update the volumes */
ym2151_volume = ((data >> 1) & 7) * 100 / 7;
@ -716,7 +716,7 @@ static void update_all_volumes(running_machine *machine )
static ADDRESS_MAP_START( atarijsa1_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x1fff) AM_RAM
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE(SOUND, "ym", ym2151_r, ym2151_w)
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ym", ym2151_r, ym2151_w)
AM_RANGE(0x2800, 0x2bff) AM_READWRITE(jsa1_io_r, jsa1_io_w)
AM_RANGE(0x3000, 0xffff) AM_ROM
ADDRESS_MAP_END
@ -724,7 +724,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( atarijsa2_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x1fff) AM_RAM
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE(SOUND, "ym", ym2151_r, ym2151_w)
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ym", ym2151_r, ym2151_w)
AM_RANGE(0x2800, 0x2bff) AM_READWRITE(jsa2_io_r, jsa2_io_w)
AM_RANGE(0x3000, 0xffff) AM_ROM
ADDRESS_MAP_END
@ -733,7 +733,7 @@ ADDRESS_MAP_END
/* full map verified from schematics and Batman GALs */
static ADDRESS_MAP_START( atarijsa3_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x1fff) AM_RAM
AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x07fe) AM_DEVREADWRITE(SOUND, "ym", ym2151_r, ym2151_w)
AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x07fe) AM_DEVREADWRITE("ym", ym2151_r, ym2151_w)
AM_RANGE(0x2800, 0x2fff) AM_READWRITE(jsa3_io_r, jsa3_io_w)
AM_RANGE(0x3000, 0xffff) AM_ROM
ADDRESS_MAP_END
@ -741,7 +741,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( atarijsa3s_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x1fff) AM_RAM
AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x07fe) AM_DEVREADWRITE(SOUND, "ym", ym2151_r, ym2151_w)
AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x07fe) AM_DEVREADWRITE("ym", ym2151_r, ym2151_w)
AM_RANGE(0x2800, 0x2fff) AM_READWRITE(jsa3s_io_r, jsa3s_io_w)
AM_RANGE(0x3000, 0xffff) AM_ROM
ADDRESS_MAP_END

View File

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

View File

@ -178,7 +178,7 @@ void cage_init(running_machine *machine, offs_t speedup)
{
char buffer[10];
sprintf(buffer, "dac%d", chan + 1);
dmadac[chan] = devtag_get_device(machine, SOUND, buffer);
dmadac[chan] = devtag_get_device(machine, buffer);
}
state_save_register_global(machine, cpu_to_cage_ready);

View File

@ -128,7 +128,7 @@ static int psgData = 0;
WRITE8_HANDLER( carnival_audio_1_w )
{
static int port1State = 0;
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
int bitsChanged;
int bitsGoneHigh;
int bitsGoneLow;
@ -207,7 +207,7 @@ WRITE8_HANDLER( carnival_audio_1_w )
WRITE8_HANDLER( carnival_audio_2_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
int bitsChanged;
int bitsGoneHigh;
int bitsGoneLow;
@ -293,7 +293,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( carnival_audio_io_map, ADDRESS_SPACE_IO, 8 )
AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(carnival_music_port_t1_r)
AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(carnival_music_port_1_w)
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_DEVWRITE(SOUND, "psg", carnival_music_port_2_w)
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_DEVWRITE("psg", carnival_music_port_2_w)
ADDRESS_MAP_END

View File

@ -95,7 +95,7 @@ static WRITE8_DEVICE_HANDLER( ctc_timer_1_w )
{
output[0] ^= 0x7f;
channel_active[0] = 1;
dac_data_w(devtag_get_device(device->machine, SOUND, "dac1"), output[0]);
dac_data_w(devtag_get_device(device->machine, "dac1"), output[0]);
}
}
@ -105,7 +105,7 @@ static WRITE8_DEVICE_HANDLER( ctc_timer_2_w )
{
output[1] ^= 0x7f;
channel_active[1] = 1;
dac_data_w(devtag_get_device(device->machine, SOUND, "dac2"), output[0]);
dac_data_w(devtag_get_device(device->machine, "dac2"), output[0]);
}
}
@ -129,7 +129,7 @@ SOUND_START( cchasm )
sound_flags = 0;
output[0] = 0; output[1] = 0;
ctc = devtag_get_device(machine, Z80CTC, "ctc");
ctc = devtag_get_device(machine, "ctc");
timer_pulse(machine, video_screen_get_frame_period(machine->primary_screen), NULL, 0, cchasm_sh_update);
}

View File

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

View File

@ -161,7 +161,7 @@ static const samples_interface spacewar_samples_interface =
static void spacewar_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
/* Explosion - rising edge */
if (SOUNDVAL_RISING_EDGE(0x01))
@ -240,7 +240,7 @@ static const samples_interface barrier_samples_interface =
static void barrier_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
/* Player die - rising edge */
if (SOUNDVAL_RISING_EDGE(0x01))
@ -293,7 +293,7 @@ static const samples_interface speedfrk_samples_interface =
static void speedfrk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
/* on the falling edge of bit 0x08, clock the inverse of bit 0x04 into the top of the shiftreg */
if (SOUNDVAL_FALLING_EDGE(0x08))
@ -358,7 +358,7 @@ static const samples_interface starhawk_samples_interface =
static void starhawk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
/* explosion - falling edge */
if (SOUNDVAL_FALLING_EDGE(0x01))
@ -434,7 +434,7 @@ static const samples_interface sundance_samples_interface =
static void sundance_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
/* bong - falling edge */
if (SOUNDVAL_FALLING_EDGE(0x01))
@ -507,7 +507,7 @@ static void tailg_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_
/* the falling edge of bit 0x10 clocks bit 0x08 into the mux selected by bits 0x07 */
if (SOUNDVAL_FALLING_EDGE(0x10))
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
/* update the shift register (actually just a simple mux) */
current_shift = (current_shift & ~(1 << (sound_val & 7))) | (((sound_val >> 3) & 1) << (sound_val & 7));
@ -592,7 +592,7 @@ static const samples_interface warrior_samples_interface =
static void warrior_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
/* normal level - 0=on, 1=off */
if (SOUNDVAL_FALLING_EDGE(0x01))
@ -663,7 +663,7 @@ static const samples_interface armora_samples_interface =
static void armora_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x10))
@ -764,7 +764,7 @@ static const samples_interface ripoff_samples_interface =
static void ripoff_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
/* on the rising edge of bit 0x02, clock bit 0x01 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x02))
@ -851,7 +851,7 @@ static const samples_interface starcas_samples_interface =
static void starcas_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@ -964,7 +964,7 @@ static const samples_interface solarq_samples_interface =
static void solarq_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
static float target_volume, current_volume;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@ -1104,7 +1104,7 @@ static const samples_interface boxingb_samples_interface =
static void boxingb_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x10))
@ -1235,7 +1235,7 @@ static const samples_interface wotw_samples_interface =
static void wotw_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@ -1348,7 +1348,7 @@ static const samples_interface wotwc_samples_interface =
static void wotwc_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@ -1542,33 +1542,33 @@ static MACHINE_RESET( demon_sound )
last_portb_write = 0xff;
/* turn off channel A on AY8910 #0 because it is used as a low-pass filter */
ay8910_set_volume(devtag_get_device(machine, SOUND, "ay1"), 0, 0);
ay8910_set_volume(devtag_get_device(machine, "ay1"), 0, 0);
}
static ADDRESS_MAP_START( demon_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x1fff) AM_ROM
AM_RANGE(0x3000, 0x33ff) AM_RAM
AM_RANGE(0x4000, 0x4001) AM_DEVREAD(SOUND, "ay1", ay8910_r)
AM_RANGE(0x4002, 0x4003) AM_DEVWRITE(SOUND, "ay1", ay8910_data_address_w)
AM_RANGE(0x5000, 0x5001) AM_DEVREAD(SOUND, "ay2", ay8910_r)
AM_RANGE(0x5002, 0x5003) AM_DEVWRITE(SOUND, "ay2", ay8910_data_address_w)
AM_RANGE(0x6000, 0x6001) AM_DEVREAD(SOUND, "ay3", ay8910_r)
AM_RANGE(0x6002, 0x6003) AM_DEVWRITE(SOUND, "ay3", ay8910_data_address_w)
AM_RANGE(0x4000, 0x4001) AM_DEVREAD("ay1", ay8910_r)
AM_RANGE(0x4002, 0x4003) AM_DEVWRITE("ay1", ay8910_data_address_w)
AM_RANGE(0x5000, 0x5001) AM_DEVREAD("ay2", ay8910_r)
AM_RANGE(0x5002, 0x5003) AM_DEVWRITE("ay2", ay8910_data_address_w)
AM_RANGE(0x6000, 0x6001) AM_DEVREAD("ay3", ay8910_r)
AM_RANGE(0x6002, 0x6003) AM_DEVWRITE("ay3", ay8910_data_address_w)
AM_RANGE(0x7000, 0x7000) AM_WRITE(SMH_NOP) /* watchdog? */
ADDRESS_MAP_END
static ADDRESS_MAP_START( demon_sound_ports, ADDRESS_SPACE_IO, 8 )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x03) AM_DEVWRITE(Z80CTC, "ctc", z80ctc_w)
AM_RANGE(0x1c, 0x1f) AM_DEVWRITE(Z80CTC, "ctc", z80ctc_w)
AM_RANGE(0x00, 0x03) AM_DEVWRITE("ctc", z80ctc_w)
AM_RANGE(0x1c, 0x1f) AM_DEVWRITE("ctc", z80ctc_w)
ADDRESS_MAP_END
static const z80_daisy_chain daisy_chain[] =
{
{ Z80CTC, "ctc" },
{ "ctc" },
{ NULL }
};

View File

@ -174,8 +174,8 @@ DISCRETE_SOUND_END
WRITE8_HANDLER( circus_clown_z_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *discrete = devtag_get_device(space->machine, SOUND, "discrete");
const device_config *samples = devtag_get_device(space->machine, "samples");
const device_config *discrete = devtag_get_device(space->machine, "discrete");
clown_z = (data & 0x0f);
*(memory_region(space->machine, "maincpu")+0x8000)=data; logerror("Z:%02x\n",data); //DEBUG

View File

@ -64,7 +64,7 @@ WRITE8_HANDLER( cyberbal_sound_bank_select_w )
coin_counter_w(1, (data >> 5) & 1);
coin_counter_w(0, (data >> 4) & 1);
cpu_set_input_line(space->machine->cpu[3], INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
if (!(data & 0x01)) devtag_reset(space->machine, SOUND, "ym");
if (!(data & 0x01)) devtag_reset(space->machine, "ym");
}
@ -146,7 +146,7 @@ WRITE16_HANDLER( cyberbal_sound_68k_w )
WRITE16_HANDLER( cyberbal_sound_68k_dac_w )
{
const device_config *dac = devtag_get_device(space->machine, SOUND, (offset & 8) ? "dac2" : "dac1");
const device_config *dac = devtag_get_device(space->machine, (offset & 8) ? "dac2" : "dac1");
dac_data_16_w(dac, (((data >> 3) & 0x800) | ((data >> 2) & 0x7ff)) << 4);
if (fast_68k_int)

View File

@ -934,7 +934,7 @@ void dcs_init(running_machine *machine)
dcs.data = cpu_get_address_space(dcs.cpu, ADDRESS_SPACE_DATA);
dcs.rev = 1;
dcs.channels = 1;
dcs.dmadac[0] = devtag_get_device(machine, SOUND, "dac");
dcs.dmadac[0] = devtag_get_device(machine, "dac");
/* configure boot and sound ROMs */
dcs.bootrom = (UINT16 *)memory_region(machine, "dcs");
@ -984,8 +984,8 @@ void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset)
dcs.program = cpu_get_address_space(dcs.cpu, ADDRESS_SPACE_PROGRAM);
dcs.data = cpu_get_address_space(dcs.cpu, ADDRESS_SPACE_DATA);
dcs.channels = 2;
dcs.dmadac[0] = devtag_get_device(machine, SOUND, "dac1");
dcs.dmadac[1] = devtag_get_device(machine, SOUND, "dac2");
dcs.dmadac[0] = devtag_get_device(machine, "dac1");
dcs.dmadac[1] = devtag_get_device(machine, "dac2");
/* always boot from the base of "dcs" */
dcs.bootrom = (UINT16 *)memory_region(machine, "dcs");
@ -1398,7 +1398,7 @@ static WRITE16_HANDLER( denver_w )
{
char buffer[10];
sprintf(buffer, "dac%d", chan + 1);
dcs.dmadac[chan] = devtag_get_device(space->machine, SOUND, buffer);
dcs.dmadac[chan] = devtag_get_device(space->machine, buffer);
}
dmadac_enable(&dcs.dmadac[0], dcs.channels, enable);
if (dcs.channels < 6)

View File

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

View File

@ -978,7 +978,7 @@ static SOUND_START( dkong)
dkong_state *state = machine->driver_data;
state->snd_rom = memory_region(machine, "soundcpu");
state->dev_vp2 = devtag_get_device(machine, LATCH8, "virtual_p2");
state->dev_vp2 = devtag_get_device(machine, "virtual_p2");
}
@ -1152,11 +1152,11 @@ static ADDRESS_MAP_START( dkong_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
ADDRESS_MAP_END
static ADDRESS_MAP_START( dkong_sound_io_map, ADDRESS_SPACE_IO, 8 )
AM_RANGE(0x00, 0xFF) AM_DEVREAD(LATCH8, "ls175.3d", dkong_tune_r)
AM_RANGE(0x00, 0xFF) AM_DEVREAD("ls175.3d", dkong_tune_r)
AM_WRITE(dkong_voice_w)
AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_DEVREAD(LATCH8, "ls175.3d", dkong_tune_r)
AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_DEVREAD("ls175.3d", dkong_tune_r)
AM_WRITE(dkong_voice_w)
AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE(SOUND, "discrete", dkong_p1_w) /* only write to dac */
AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("discrete", dkong_p1_w) /* only write to dac */
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_LATCH8_READWRITE("virtual_p2")
AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_LATCH8_READBIT("ls259.6h", 5)
AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_LATCH8_READBIT("ls259.6h", 4)
@ -1164,17 +1164,17 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( dkongjr_sound_io_map, ADDRESS_SPACE_IO, 8 )
AM_RANGE(0x00, 0x00) AM_MIRROR(0xff) AM_LATCH8_READ("ls174.3d")
AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE(SOUND, "discrete", dkong_p1_w) /* only write to dac */
AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("discrete", dkong_p1_w) /* only write to dac */
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_LATCH8_READWRITE("virtual_p2")
AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_LATCH8_READBIT("ls259.6h", 5)
AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_LATCH8_READBIT("ls259.6h", 4)
ADDRESS_MAP_END
static ADDRESS_MAP_START( radarsc1_sound_io_map, ADDRESS_SPACE_IO, 8 )
AM_RANGE(0x00, 0x00) AM_MIRROR(0xff) AM_DEVREAD(LATCH8, "ls175.3d", latch8_r)
AM_RANGE(0x00, 0xff) AM_DEVWRITE(SOUND, "discrete", dkong_p1_w) /* DAC here */
AM_RANGE(0x00, 0x00) AM_MIRROR(0xff) AM_DEVREAD("ls175.3d", latch8_r)
AM_RANGE(0x00, 0xff) AM_DEVWRITE("discrete", dkong_p1_w) /* DAC here */
AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_LATCH8_READ("virtual_p1")
AM_DEVWRITE(SOUND, "tms", M58817_command_w)
AM_DEVWRITE("tms", M58817_command_w)
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_LATCH8_WRITE("virtual_p2")
AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_LATCH8_READBIT("ls259.6h", 5)
AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_LATCH8_READBIT("ls259.6h", 4)
@ -1184,16 +1184,16 @@ static ADDRESS_MAP_START( dkong3_sound1_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x01ff) AM_RAM
AM_RANGE(0x4016, 0x4016) AM_LATCH8_READ("latch1") /* overwrite default */
AM_RANGE(0x4017, 0x4017) AM_LATCH8_READ("latch2")
AM_RANGE(0x4000, 0x4017) AM_DEVREAD(SOUND, "nes1", nes_psg_r)
AM_RANGE(0x4000, 0x4017) AM_DEVWRITE(SOUND, "nes1", nes_psg_w)
AM_RANGE(0x4000, 0x4017) AM_DEVREAD("nes1", nes_psg_r)
AM_RANGE(0x4000, 0x4017) AM_DEVWRITE("nes1", nes_psg_w)
AM_RANGE(0xe000, 0xffff) AM_ROM
ADDRESS_MAP_END
static ADDRESS_MAP_START( dkong3_sound2_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x01ff) AM_RAM
AM_RANGE(0x4016, 0x4016) AM_LATCH8_READ("latch3") /* overwrite default */
AM_RANGE(0x4000, 0x4017) AM_DEVREAD(SOUND, "nes2", nes_psg_r)
AM_RANGE(0x4000, 0x4017) AM_DEVWRITE(SOUND, "nes2", nes_psg_w)
AM_RANGE(0x4000, 0x4017) AM_DEVREAD("nes2", nes_psg_r)
AM_RANGE(0x4000, 0x4017) AM_DEVWRITE("nes2", nes_psg_w)
AM_RANGE(0xe000, 0xffff) AM_ROM
ADDRESS_MAP_END
@ -1239,7 +1239,7 @@ MACHINE_DRIVER_START( dkong2b_audio )
MDRV_LATCH8_ADD( "virtual_p2" ) /* virtual latch for port B */
MDRV_LATCH8_INVERT( 0x20 ) /* signal is inverted */
MDRV_LATCH8_DEVREAD(5, LATCH8, "ls259.6h", latch8_r, 3)
MDRV_LATCH8_DEVREAD(5, "ls259.6h", latch8_r, 3)
MDRV_LATCH8_DISCRETE_NODE("discrete", 7, DS_DISCHARGE_INV)
MDRV_CPU_ADD("soundcpu", MB8884, I8035_CLOCK)
@ -1272,8 +1272,8 @@ MACHINE_DRIVER_START( radarsc1_audio )
/* virtual_p2 is not read -see memory map-, all bits are output bits */
MDRV_LATCH8_ADD( "virtual_p1" ) /* virtual latch for port A */
MDRV_LATCH8_INVERT( 0x80 ) /* signal is inverted */
MDRV_LATCH8_DEVREAD(7, LATCH8, "ls259.6h", latch8_r, 3)
MDRV_LATCH8_DEVREAD(6, SOUND, "tms", tms5110_status_r, 0)
MDRV_LATCH8_DEVREAD(7, "ls259.6h", latch8_r, 3)
MDRV_LATCH8_DEVREAD(6, "tms", tms5110_status_r, 0)
MDRV_SOUND_ADD("tms", M58817, XTAL_640kHz)
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
@ -1300,9 +1300,9 @@ MACHINE_DRIVER_START( dkongjr_audio )
MDRV_LATCH8_ADD( "virtual_p2" ) /* virtual latch for port B */
MDRV_LATCH8_INVERT( 0x70 ) /* all signals are inverted */
MDRV_LATCH8_DEVREAD(6, LATCH8, "ls259.4h", latch8_r, 1)
MDRV_LATCH8_DEVREAD(5, LATCH8, "ls259.6h", latch8_r, 3)
MDRV_LATCH8_DEVREAD(4, LATCH8, "ls259.6h", latch8_r, 6)
MDRV_LATCH8_DEVREAD(6, "ls259.4h", latch8_r, 1)
MDRV_LATCH8_DEVREAD(5, "ls259.6h", latch8_r, 3)
MDRV_LATCH8_DEVREAD(4, "ls259.6h", latch8_r, 6)
MDRV_LATCH8_DISCRETE_NODE("discrete", 7, DS_DISCHARGE_INV)
MDRV_CPU_ADD("soundcpu", MB8884, I8035_CLOCK)

View File

@ -467,7 +467,7 @@ static void r6532_porta_w(const device_config *device, UINT8 newdata, UINT8 oldd
static void r6532_portb_w(const device_config *device, UINT8 newdata, UINT8 olddata)
{
const device_config *tms = devtag_get_device(device->machine, SOUND, "tms");
const device_config *tms = devtag_get_device(device->machine, "tms");
if (device != NULL)
{
if ((olddata & 0x01) && !(newdata & 0x01))
@ -489,7 +489,7 @@ static UINT8 r6532_portb_r(const device_config *device, UINT8 olddata)
UINT8 newdata = olddata;
if (has_tms5220)
{
const device_config *tms = devtag_get_device(device->machine, SOUND, "tms");
const device_config *tms = devtag_get_device(device->machine, "tms");
newdata &= ~0x0c;
if (!tms5220_ready_r(tms)) newdata |= 0x04;
if (!tms5220_int_r(tms)) newdata |= 0x08;
@ -720,13 +720,13 @@ static DEVICE_START( venture_common_sh_start )
DEVICE_START_CALL(common_sh_start);
riot = device_list_find_by_tag(machine->config->devicelist, RIOT6532, "riot");
riot = devtag_get_device(machine, "riot");
has_sh8253 = TRUE;
has_tms5220 = FALSE;
/* determine which sound hardware is installed */
has_mc3417 = (devtag_get_device(device->machine, SOUND, "cvsd") != NULL);
has_mc3417 = (devtag_get_device(device->machine, "cvsd") != NULL);
/* 8253 */
freq_to_step = (double)(1 << 24) / (double)SH8253_CLOCK;
@ -782,7 +782,7 @@ static DEVICE_GET_INFO( venture_sound )
static ADDRESS_MAP_START( venture_audio_map, ADDRESS_SPACE_PROGRAM, 8 )
ADDRESS_MAP_GLOBAL_MASK(0x7fff)
AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x0780) AM_RAM
AM_RANGE(0x0800, 0x087f) AM_MIRROR(0x0780) AM_DEVREADWRITE(RIOT6532, "riot", riot6532_r, riot6532_w)
AM_RANGE(0x0800, 0x087f) AM_MIRROR(0x0780) AM_DEVREADWRITE("riot", riot6532_r, riot6532_w)
AM_RANGE(0x1000, 0x1003) AM_MIRROR(0x07fc) AM_READWRITE(pia_1_r, pia_1_w)
AM_RANGE(0x1800, 0x1803) AM_MIRROR(0x07fc) AM_READWRITE(exidy_sh8253_r, exidy_sh8253_w)
AM_RANGE(0x2000, 0x27ff) AM_WRITE(exidy_sound_filter_w)
@ -816,7 +816,7 @@ MACHINE_DRIVER_END
static WRITE8_HANDLER( mtrap_voiceio_w )
{
if (!(offset & 0x10))
hc55516_digit_w(devtag_get_device(space->machine, SOUND, "cvsd"), data & 1);
hc55516_digit_w(devtag_get_device(space->machine, "cvsd"), data & 1);
if (!(offset & 0x20))
riot6532_portb_in_set(riot, data & 1, 0xff);
@ -835,7 +835,7 @@ static READ8_HANDLER( mtrap_voiceio_r )
}
if (!(offset & 0x40))
return hc55516_clock_state_r(devtag_get_device(space->machine, SOUND, "cvsd")) << 7;
return hc55516_clock_state_r(devtag_get_device(space->machine, "cvsd")) << 7;
return 0;
}
@ -992,7 +992,7 @@ static DEVICE_GET_INFO( victory_sound )
static ADDRESS_MAP_START( victory_audio_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0x0f00) AM_RAM
AM_RANGE(0x1000, 0x107f) AM_MIRROR(0x0f80) AM_DEVREADWRITE(RIOT6532, "riot", riot6532_r, riot6532_w)
AM_RANGE(0x1000, 0x107f) AM_MIRROR(0x0f80) AM_DEVREADWRITE("riot", riot6532_r, riot6532_w)
AM_RANGE(0x2000, 0x2003) AM_MIRROR(0x0ffc) AM_READWRITE(pia_1_r, pia_1_w)
AM_RANGE(0x3000, 0x3003) AM_MIRROR(0x0ffc) AM_READWRITE(exidy_sh8253_r, exidy_sh8253_w)
AM_RANGE(0x4000, 0x4fff) AM_NOP

View File

@ -13,7 +13,7 @@ WRITE8_HANDLER( fghtbskt_samples_w )
{
if( data & 1 )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
sample_start_raw(samples, 0, samplebuf + ((data & 0xf0) << 8), 0x2000, 8000, 0);
}
}

View File

@ -154,7 +154,7 @@ static TIMER_CALLBACK( noise_timer_cb )
{
if( !noise_enable && noisevolume > 0 )
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
noisevolume -= (noisevolume / 10) + 1;
sample_set_volume(samples, CHANNEL_NOISE,noisevolume / 100.0);
}
@ -166,7 +166,7 @@ WRITE8_HANDLER( galaxian_noise_enable_w )
if( noise_enable )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
noisevolume = 100;
sample_set_volume(samples, CHANNEL_NOISE,noisevolume / 100.0);
}
@ -176,7 +176,7 @@ WRITE8_HANDLER( galaxian_shoot_enable_w )
{
if( data & 1 && !(last_port2 & 1) )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
sample_start_raw(samples, CHANNEL_SHOOT, shootwave, shoot_length, shoot_rate, 0);
sample_set_volume(samples, CHANNEL_SHOOT,SHOOT_VOLUME);
}
@ -417,7 +417,7 @@ static SAMPLES_START( galaxian_sh_start )
WRITE8_HANDLER( galaxian_background_enable_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
sample_set_volume(samples, CHANNEL_LFO+offset,(data & 1) ? LFO_VOLUME : 0);
}
@ -542,7 +542,7 @@ WRITE8_HANDLER( galaxian_lfo_freq_w )
static TIMER_CALLBACK( galaxian_sh_update )
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
/*
* NE555 8R, 8S and 8T are used as pulse position modulators

View File

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

View File

@ -55,7 +55,7 @@ static void trigger_sample(const device_config *samples, UINT8 data);
WRITE8_HANDLER( gottlieb_sh_w )
{
const device_config *riot = device_list_find_by_tag(space->machine->config->devicelist, RIOT6532, "riot");
const device_config *riot = devtag_get_device(space->machine, "riot");
/* identify rev1 boards by the presence of a 6532 RIOT device */
if (riot != NULL)
@ -74,7 +74,7 @@ WRITE8_HANDLER( gottlieb_sh_w )
static void gottlieb1_sh_w(const device_config *riot, UINT8 data)
{
const device_config *samples = devtag_get_device(riot->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(riot->machine, "samples");
int pa7 = (data & 0x0f) != 0xf;
int pa0_5 = ~data & 0x3f;
@ -202,7 +202,7 @@ static void trigger_sample(const device_config *samples, UINT8 data)
#ifdef UNUSED_FUNCTION
void gottlieb_knocker(running_machine *machine)
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
if (!strcmp(machine->gamedrv->name,"reactor")) /* reactor */
{
}
@ -250,7 +250,7 @@ logerror("Votrax: intonation %d, phoneme %02x %s\n",data >> 6,data & 0x3f,Phonem
{
if (votrax_queuepos > 1)
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
int last = -1;
int i;
char phonemes[200];
@ -317,8 +317,8 @@ static ADDRESS_MAP_START( gottlieb_sound1_map, ADDRESS_SPACE_PROGRAM, 8 )
/* A15 not decoded except in expansion socket */
ADDRESS_MAP_GLOBAL_MASK(0x7fff)
AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x0d80) AM_RAM
AM_RANGE(0x0200, 0x021f) AM_MIRROR(0x0de0) AM_DEVREADWRITE(RIOT6532, "riot", riot6532_r, riot6532_w)
AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x0fff) AM_DEVWRITE(SOUND, "dac", dac_w)
AM_RANGE(0x0200, 0x021f) AM_MIRROR(0x0de0) AM_DEVREADWRITE("riot", riot6532_r, riot6532_w)
AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x0fff) AM_DEVWRITE("dac", dac_w)
AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x0fff) AM_WRITE(vortrax_data_w)
AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x0fff) AM_WRITE(speech_clock_dac_w)
AM_RANGE(0x6000, 0x7fff) AM_ROM
@ -475,7 +475,7 @@ static WRITE8_HANDLER( nmi_rate_w )
static CUSTOM_INPUT( speech_drq_custom_r )
{
return sp0250_drq_r(devtag_get_device(field->port->machine, SOUND, "sp"));
return sp0250_drq_r(devtag_get_device(field->port->machine, "sp"));
}
@ -503,7 +503,7 @@ static WRITE8_HANDLER( speech_control_w )
{
/* bit 3 selects which of the two 8913 to enable */
/* bit 4 goes to the 8913 BC1 pin */
const device_config *ay = devtag_get_device(space->machine, SOUND, (data & 0x08) ? "ay1" : "ay2");
const device_config *ay = devtag_get_device(space->machine, (data & 0x08) ? "ay1" : "ay2");
ay8910_data_address_w(ay, data >> 4, *psg_latch);
}
@ -512,14 +512,14 @@ static WRITE8_HANDLER( speech_control_w )
/* bit 6 = speech chip DATA PRESENT pin; high then low to make the chip read data */
if ((previous & 0x40) == 0 && (data & 0x40) != 0)
{
const device_config *sp = devtag_get_device(space->machine, SOUND, "sp");
const device_config *sp = devtag_get_device(space->machine, "sp");
sp0250_w(sp, 0, *sp0250_latch);
}
/* bit 7 goes to the speech chip RESET pin */
if ((previous ^ data) & 0x80)
{
const device_config *sp = devtag_get_device(space->machine, SOUND, "sp");
const device_config *sp = devtag_get_device(space->machine, "sp");
device_reset(sp);
}
}
@ -569,7 +569,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( gottlieb_audio2_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x3c00) AM_RAM
AM_RANGE(0x4000, 0x4001) AM_MIRROR(0x3ffe) AM_DEVWRITE(SOUND, "dac1", gottlieb_dac_w) AM_BASE(&dac_data)
AM_RANGE(0x4000, 0x4001) AM_MIRROR(0x3ffe) AM_DEVWRITE("dac1", gottlieb_dac_w) AM_BASE(&dac_data)
AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x3fff) AM_READ(audio_data_r)
AM_RANGE(0xe000, 0xffff) AM_MIRROR(0x2000) AM_ROM
ADDRESS_MAP_END

View File

@ -41,7 +41,7 @@ static const struct gotya_sample gotya_samples[] =
WRITE8_HANDLER( gotya_soundlatch_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
static int theme_playing;
int sample_number;

View File

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

View File

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

View File

@ -62,8 +62,8 @@ static WRITE8_HANDLER( m6803_port2_w )
/* write latch */
if ((port2 & 0x01) && !(data & 0x01))
{
const device_config *ay1 = devtag_get_device(space->machine, SOUND, "ay1");
const device_config *ay2 = devtag_get_device(space->machine, SOUND, "ay2");
const device_config *ay1 = devtag_get_device(space->machine, "ay1");
const device_config *ay2 = devtag_get_device(space->machine, "ay2");
/* control or data port? */
if (port2 & 0x04)
@ -98,9 +98,9 @@ static READ8_HANDLER( m6803_port1_r )
{
/* PSG 0 or 1? */
if (port2 & 0x08)
return ay8910_r(devtag_get_device(space->machine, SOUND, "ay1"), 0);
return ay8910_r(devtag_get_device(space->machine, "ay1"), 0);
if (port2 & 0x10)
return ay8910_r(devtag_get_device(space->machine, SOUND, "ay2"), 0);
return ay8910_r(devtag_get_device(space->machine, "ay2"), 0);
return 0xff;
}
@ -120,8 +120,8 @@ static READ8_HANDLER( m6803_port2_r )
static WRITE8_DEVICE_HANDLER( ay8910_0_portb_w )
{
const device_config *adpcm0 = devtag_get_device(device->machine, SOUND, "msm1");
const device_config *adpcm1 = devtag_get_device(device->machine, SOUND, "msm2");
const device_config *adpcm0 = devtag_get_device(device->machine, "msm1");
const device_config *adpcm1 = devtag_get_device(device->machine, "msm2");
/* bits 2-4 select MSM5205 clock & 3b/4b playback mode */
msm5205_playmode_w(adpcm0, (data >> 2) & 7);
@ -160,12 +160,12 @@ static WRITE8_HANDLER( m52_adpcm_w )
{
if (offset & 1)
{
const device_config *adpcm = devtag_get_device(space->machine, SOUND, "msm1");
const device_config *adpcm = devtag_get_device(space->machine, "msm1");
msm5205_data_w(adpcm, data);
}
if (offset & 2)
{
const device_config *adpcm = devtag_get_device(space->machine, SOUND, "msm2");
const device_config *adpcm = devtag_get_device(space->machine, "msm2");
if (adpcm != NULL)
msm5205_data_w(adpcm, data);
}
@ -174,7 +174,7 @@ static WRITE8_HANDLER( m52_adpcm_w )
static WRITE8_HANDLER( m62_adpcm_w )
{
const device_config *adpcm = devtag_get_device(space->machine, SOUND, (offset & 1) ? "msm2" : "msm1");
const device_config *adpcm = devtag_get_device(space->machine, (offset & 1) ? "msm2" : "msm1");
if (adpcm != NULL)
msm5205_data_w(adpcm, data);
}
@ -189,7 +189,7 @@ static WRITE8_HANDLER( m62_adpcm_w )
static void adpcm_int(const device_config *device)
{
const device_config *msm2 = devtag_get_device(device->machine, SOUND, "msm2");
const device_config *msm2 = devtag_get_device(device->machine, "msm2");
cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE);

View File

@ -439,12 +439,12 @@ WRITE32_HANDLER( jaguar_serial_w )
{
/* right DAC */
case 2:
dac_signed_data_16_w(devtag_get_device(space->machine, SOUND, "dac2"), (data & 0xffff) ^ 0x8000);
dac_signed_data_16_w(devtag_get_device(space->machine, "dac2"), (data & 0xffff) ^ 0x8000);
break;
/* left DAC */
case 3:
dac_signed_data_16_w(devtag_get_device(space->machine, SOUND, "dac1"), (data & 0xffff) ^ 0x8000);
dac_signed_data_16_w(devtag_get_device(space->machine, "dac1"), (data & 0xffff) ^ 0x8000);
break;
/* frequency register */

View File

@ -147,7 +147,7 @@ static WRITE8_HANDLER( speech_strobe_w )
if ((new_speech_strobe_state != state->speech_strobe_state) && new_speech_strobe_state)
{
const device_config *tms = devtag_get_device(space->machine, SOUND, "tms");
const device_config *tms = devtag_get_device(space->machine, "tms");
tms5220_data_w(tms, 0, *state->speech_data);
}
state->speech_strobe_state = new_speech_strobe_state;
@ -156,7 +156,7 @@ static WRITE8_HANDLER( speech_strobe_w )
static READ8_HANDLER( speech_ready_r )
{
return (!tms5220_ready_r(devtag_get_device(space->machine, SOUND, "tms"))) << 7;
return (!tms5220_ready_r(devtag_get_device(space->machine, "tms"))) << 7;
}
@ -175,10 +175,10 @@ static WRITE8_HANDLER( speech_reset_w )
static ADDRESS_MAP_START( audio_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x07ff) AM_RAM
AM_RANGE(0x0800, 0x080f) AM_MIRROR(0x07c0) AM_DEVREADWRITE(SOUND, "pokey1", pokey_r, pokey_w)
AM_RANGE(0x0810, 0x081f) AM_MIRROR(0x07c0) AM_DEVREADWRITE(SOUND, "pokey2", pokey_r, pokey_w)
AM_RANGE(0x0820, 0x082f) AM_MIRROR(0x07c0) AM_DEVREADWRITE(SOUND, "pokey3", pokey_r, pokey_w)
AM_RANGE(0x0830, 0x083f) AM_MIRROR(0x07c0) AM_DEVREADWRITE(SOUND, "pokey4", pokey_r, pokey_w)
AM_RANGE(0x0800, 0x080f) AM_MIRROR(0x07c0) AM_DEVREADWRITE("pokey1", pokey_r, pokey_w)
AM_RANGE(0x0810, 0x081f) AM_MIRROR(0x07c0) AM_DEVREADWRITE("pokey2", pokey_r, pokey_w)
AM_RANGE(0x0820, 0x082f) AM_MIRROR(0x07c0) AM_DEVREADWRITE("pokey3", pokey_r, pokey_w)
AM_RANGE(0x0830, 0x083f) AM_MIRROR(0x07c0) AM_DEVREADWRITE("pokey4", pokey_r, pokey_w)
AM_RANGE(0x1000, 0x1000) AM_MIRROR(0x00ff) AM_READWRITE(SMH_NOP, irq_ack_w)
AM_RANGE(0x1100, 0x1100) AM_MIRROR(0x00ff) AM_READWRITE(SMH_NOP, SMH_RAM) AM_BASE_MEMBER(jedi_state, speech_data)
AM_RANGE(0x1200, 0x13ff) AM_READWRITE(SMH_NOP, speech_strobe_w)

View File

@ -13,7 +13,7 @@ WRITE8_HANDLER( laserbat_csound1_w )
WRITE8_HANDLER( laserbat_csound2_w )
{
const device_config *sn = devtag_get_device(space->machine, SOUND, "sn");
const device_config *sn = devtag_get_device(space->machine, "sn");
int ksound = 0;
if (data & 0x01)
@ -99,8 +99,8 @@ WRITE8_HANDLER( laserbat_csound2_w )
ksound = ((data & 0x02) << 23) + (ksound3 << 16) + (ksound2 << 8) + ksound1;
tms3615_enable_w(devtag_get_device(space->machine, SOUND, "tms1"), ksound & 0x1fff);
tms3615_enable_w(devtag_get_device(space->machine, SOUND, "tms2"), (ksound >> 13) << 1);
tms3615_enable_w(devtag_get_device(space->machine, "tms1"), ksound & 0x1fff);
tms3615_enable_w(devtag_get_device(space->machine, "tms2"), (ksound >> 13) << 1);
bit14 = (data & 0x20) ? 1 : 0;

View File

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

View File

@ -542,7 +542,7 @@ WRITE8_HANDLER( mario_sh3_w )
I8035_P1_W_AH(space,3,data & 1);
break;
case 7: /* skid */
discrete_sound_w(devtag_get_device(space->machine, SOUND, "discrete"),DS_SOUND7_INP,data & 1);
discrete_sound_w(devtag_get_device(space->machine, "discrete"),DS_SOUND7_INP,data & 1);
break;
}
}
@ -559,7 +559,7 @@ static ADDRESS_MAP_START( mario_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
ADDRESS_MAP_END
static ADDRESS_MAP_START( mario_sound_io_map, ADDRESS_SPACE_IO, 8 )
AM_RANGE(0x00, 0xff) AM_READ(mario_sh_tune_r) AM_DEVWRITE(SOUND, "discrete", mario_sh_sound_w)
AM_RANGE(0x00, 0xff) AM_READ(mario_sh_tune_r) AM_DEVWRITE("discrete", mario_sh_sound_w)
AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(mario_sh_p1_r, mario_sh_p1_w)
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(mario_sh_p2_r, mario_sh_p2_w)
AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(mario_sh_t0_r)
@ -569,8 +569,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( masao_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x0fff) AM_ROM
AM_RANGE(0x2000, 0x23ff) AM_RAM
AM_RANGE(0x4000, 0x4000) AM_DEVREADWRITE(SOUND, "ay", ay8910_r, ay8910_data_w)
AM_RANGE(0x6000, 0x6000) AM_DEVWRITE(SOUND, "ay", ay8910_address_w)
AM_RANGE(0x4000, 0x4000) AM_DEVREADWRITE("ay", ay8910_r, ay8910_data_w)
AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("ay", ay8910_address_w)
ADDRESS_MAP_END
/*************************************

View File

@ -326,8 +326,8 @@ static TIMER_CALLBACK( ssio_delayed_data_w )
static void ssio_update_volumes(running_machine *machine)
{
const device_config *ay0 = devtag_get_device(machine, SOUND, "ssio.1");
const device_config *ay1 = devtag_get_device(machine, SOUND, "ssio.2");
const device_config *ay0 = devtag_get_device(machine, "ssio.1");
const device_config *ay1 = devtag_get_device(machine, "ssio.2");
ay8910_set_volume(ay0, 0, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][0]]);
ay8910_set_volume(ay0, 1, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][1]]);
ay8910_set_volume(ay0, 2, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][2]]);
@ -458,12 +458,12 @@ static ADDRESS_MAP_START( ssio_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x0c00) AM_RAM
AM_RANGE(0x9000, 0x9003) AM_MIRROR(0x0ffc) AM_READ(ssio_data_r)
AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x0ffc) AM_DEVWRITE(SOUND, "ssio.1", ay8910_address_w)
AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x0ffc) AM_DEVREAD(SOUND, "ssio.1", ay8910_r)
AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x0ffc) AM_DEVWRITE(SOUND, "ssio.1", ay8910_data_w)
AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x0ffc) AM_DEVWRITE(SOUND, "ssio.2", ay8910_address_w)
AM_RANGE(0xb001, 0xb001) AM_MIRROR(0x0ffc) AM_DEVREAD(SOUND, "ssio.2", ay8910_r)
AM_RANGE(0xb002, 0xb002) AM_MIRROR(0x0ffc) AM_DEVWRITE(SOUND, "ssio.2", ay8910_data_w)
AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x0ffc) AM_DEVWRITE("ssio.1", ay8910_address_w)
AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x0ffc) AM_DEVREAD("ssio.1", ay8910_r)
AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x0ffc) AM_DEVWRITE("ssio.1", ay8910_data_w)
AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x0ffc) AM_DEVWRITE("ssio.2", ay8910_address_w)
AM_RANGE(0xb001, 0xb001) AM_MIRROR(0x0ffc) AM_DEVREAD("ssio.2", ay8910_r)
AM_RANGE(0xb002, 0xb002) AM_MIRROR(0x0ffc) AM_DEVWRITE("ssio.2", ay8910_data_w)
AM_RANGE(0xc000, 0xcfff) AM_READWRITE(SMH_NOP, ssio_status_w)
AM_RANGE(0xd000, 0xdfff) AM_WRITENOP /* low bit controls yellow LED */
AM_RANGE(0xe000, 0xefff) AM_READ(ssio_irq_clear)
@ -501,7 +501,7 @@ MACHINE_DRIVER_END
static WRITE8_DEVICE_HANDLER( csdeluxe_porta_w )
{
dacval = (dacval & ~0x3fc) | (data << 2);
dac_signed_data_16_w(devtag_get_device(device->machine, SOUND, "csddac"), dacval << 6);
dac_signed_data_16_w(devtag_get_device(device->machine, "csddac"), dacval << 6);
}
static WRITE8_DEVICE_HANDLER( csdeluxe_portb_w )
@ -509,7 +509,7 @@ static WRITE8_DEVICE_HANDLER( csdeluxe_portb_w )
UINT8 z_mask = pianew_get_port_b_z_mask(device);
dacval = (dacval & ~0x003) | (data >> 6);
dac_signed_data_16_w(devtag_get_device(device->machine, SOUND, "csddac"), dacval << 6);
dac_signed_data_16_w(devtag_get_device(device->machine, "csddac"), dacval << 6);
if (~z_mask & 0x10) csdeluxe_status = (csdeluxe_status & ~1) | ((data >> 4) & 1);
if (~z_mask & 0x20) csdeluxe_status = (csdeluxe_status & ~2) | ((data >> 4) & 2);
@ -524,7 +524,7 @@ static WRITE_LINE_DEVICE_HANDLER( csdeluxe_irq )
static TIMER_CALLBACK( csdeluxe_delayed_data_w )
{
const device_config *pia = devtag_get_device(machine, PIA6821, "csdpia");
const device_config *pia = devtag_get_device(machine, "csdpia");
pia_portb_w(pia, 0, param & 0x0f);
pia_ca1_w(pia, 0, ~param & 0x10);
@ -579,7 +579,7 @@ static ADDRESS_MAP_START( csdeluxe_map, ADDRESS_SPACE_PROGRAM, 16 )
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0x1ffff)
AM_RANGE(0x000000, 0x007fff) AM_ROM
AM_RANGE(0x018000, 0x018007) AM_DEVREADWRITE(PIA6821, "csdpia", csdeluxe_pia_r, csdeluxe_pia_w)
AM_RANGE(0x018000, 0x018007) AM_DEVREADWRITE("csdpia", csdeluxe_pia_r, csdeluxe_pia_w)
AM_RANGE(0x01c000, 0x01cfff) AM_RAM
ADDRESS_MAP_END
@ -639,7 +639,7 @@ MACHINE_DRIVER_END
static WRITE8_DEVICE_HANDLER( soundsgood_porta_w )
{
dacval = (dacval & ~0x3fc) | (data << 2);
dac_signed_data_16_w(devtag_get_device(device->machine, SOUND, "sgdac"), dacval << 6);
dac_signed_data_16_w(devtag_get_device(device->machine, "sgdac"), dacval << 6);
}
static WRITE8_DEVICE_HANDLER( soundsgood_portb_w )
@ -647,7 +647,7 @@ static WRITE8_DEVICE_HANDLER( soundsgood_portb_w )
UINT8 z_mask = pianew_get_port_b_z_mask(device);
dacval = (dacval & ~0x003) | (data >> 6);
dac_signed_data_16_w(devtag_get_device(device->machine, SOUND, "sgdac"), dacval << 6);
dac_signed_data_16_w(devtag_get_device(device->machine, "sgdac"), dacval << 6);
if (~z_mask & 0x10) soundsgood_status = (soundsgood_status & ~1) | ((data >> 4) & 1);
if (~z_mask & 0x20) soundsgood_status = (soundsgood_status & ~2) | ((data >> 4) & 2);
@ -662,7 +662,7 @@ static WRITE_LINE_DEVICE_HANDLER( soundsgood_irq )
static TIMER_CALLBACK( soundsgood_delayed_data_w )
{
const device_config *pia = devtag_get_device(machine, PIA6821, "sgpia");
const device_config *pia = devtag_get_device(machine, "sgpia");
pia_portb_w(pia, 0, (param >> 1) & 0x0f);
pia_ca1_w(pia, 0, ~param & 0x01);
@ -698,7 +698,7 @@ static ADDRESS_MAP_START( soundsgood_map, ADDRESS_SPACE_PROGRAM, 16 )
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0x7ffff)
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x060000, 0x060007) AM_DEVREADWRITE8(PIA6821, "sgpia", pia_alt_r, pia_alt_w, 0xff00)
AM_RANGE(0x060000, 0x060007) AM_DEVREADWRITE8("sgpia", pia_alt_r, pia_alt_w, 0xff00)
AM_RANGE(0x070000, 0x070fff) AM_RAM
ADDRESS_MAP_END
@ -747,13 +747,13 @@ MACHINE_DRIVER_END
static WRITE8_DEVICE_HANDLER( turbocs_porta_w )
{
dacval = (dacval & ~0x3fc) | (data << 2);
dac_signed_data_16_w(devtag_get_device(device->machine, SOUND, "tcsdac"), dacval << 6);
dac_signed_data_16_w(devtag_get_device(device->machine, "tcsdac"), dacval << 6);
}
static WRITE8_DEVICE_HANDLER( turbocs_portb_w )
{
dacval = (dacval & ~0x003) | (data >> 6);
dac_signed_data_16_w(devtag_get_device(device->machine, SOUND, "tcsdac"), dacval << 6);
dac_signed_data_16_w(devtag_get_device(device->machine, "tcsdac"), dacval << 6);
turbocs_status = (data >> 4) & 3;
}
@ -766,7 +766,7 @@ static WRITE_LINE_DEVICE_HANDLER( turbocs_irq )
static TIMER_CALLBACK( turbocs_delayed_data_w )
{
const device_config *pia = devtag_get_device(machine, PIA6821, "tcspia");
const device_config *pia = devtag_get_device(machine, "tcspia");
pia_portb_w(pia, 0, (param >> 1) & 0x0f);
pia_ca1_w(pia, 0, ~param & 0x01);
@ -800,7 +800,7 @@ void turbocs_reset_w(running_machine *machine, int state)
static ADDRESS_MAP_START( turbocs_map, ADDRESS_SPACE_PROGRAM, 8 )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x3800) AM_RAM
AM_RANGE(0x4000, 0x4003) AM_MIRROR(0x3ffc) AM_DEVREADWRITE(PIA6821, "tcspia", pia_alt_r, pia_alt_w)
AM_RANGE(0x4000, 0x4003) AM_MIRROR(0x3ffc) AM_DEVREADWRITE("tcspia", pia_alt_r, pia_alt_w)
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
@ -863,7 +863,7 @@ static WRITE8_DEVICE_HANDLER( squawkntalk_porta2_w )
static WRITE8_DEVICE_HANDLER( squawkntalk_portb2_w )
{
const device_config *tms = devtag_get_device(device->machine, SOUND, "sntspeech");
const device_config *tms = devtag_get_device(device->machine, "sntspeech");
/* bits 0-1 select read/write strobes on the TMS5200 */
data &= 0x03;
@ -894,8 +894,8 @@ static WRITE8_DEVICE_HANDLER( squawkntalk_portb2_w )
static WRITE_LINE_DEVICE_HANDLER( squawkntalk_irq )
{
const device_config *pia0 = devtag_get_device(device->machine, PIA6821, "sntpia0");
const device_config *pia1 = devtag_get_device(device->machine, PIA6821, "sntpia1");
const device_config *pia0 = devtag_get_device(device->machine, "sntpia0");
const device_config *pia1 = devtag_get_device(device->machine, "sntpia1");
int combined_state = pianew_get_irq_a(pia0) | pianew_get_irq_b(pia0) | pianew_get_irq_a(pia1) | pianew_get_irq_b(pia1);
cpu_set_input_line(squawkntalk_sound_cpu, M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
@ -903,7 +903,7 @@ static WRITE_LINE_DEVICE_HANDLER( squawkntalk_irq )
static TIMER_CALLBACK( squawkntalk_delayed_data_w )
{
const device_config *pia0 = devtag_get_device(machine, PIA6821, "sntpia0");
const device_config *pia0 = devtag_get_device(machine, "sntpia0");
pia_porta_w(pia0, 0, ~param & 0x0f);
pia_cb1_w(pia0, 0, ~param & 0x10);
@ -930,8 +930,8 @@ void squawkntalk_reset_w(running_machine *machine, int state)
static ADDRESS_MAP_START( squawkntalk_map, ADDRESS_SPACE_PROGRAM, 8 )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0x007f) AM_RAM /* internal RAM */
AM_RANGE(0x0080, 0x0083) AM_MIRROR(0x4f6c) AM_DEVREADWRITE(PIA6821, "sntpia0", pia_r, pia_w)
AM_RANGE(0x0090, 0x0093) AM_MIRROR(0x4f6c) AM_DEVREADWRITE(PIA6821, "sntpia1", pia_r, pia_w)
AM_RANGE(0x0080, 0x0083) AM_MIRROR(0x4f6c) AM_DEVREADWRITE("sntpia0", pia_r, pia_w)
AM_RANGE(0x0090, 0x0093) AM_MIRROR(0x4f6c) AM_DEVREADWRITE("sntpia1", pia_r, pia_w)
AM_RANGE(0x1000, 0x1fff) AM_MIRROR(0x4000) AM_WRITE(squawkntalk_dac_w)
AM_RANGE(0x8000, 0xbfff) AM_MIRROR(0x4000) AM_ROM
ADDRESS_MAP_END
@ -942,8 +942,8 @@ ADDRESS_MAP_END
ADDRESS_MAP_START( squawkntalk_alt_map, ADDRESS_SPACE_PROGRAM, 8 )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0x007f) AM_RAM /* internal RAM */
AM_RANGE(0x0080, 0x0083) AM_MIRROR(0x676c) AM_DEVREADWRITE(PIA6821, "sntpia0", pia_r, pia_w)
AM_RANGE(0x0090, 0x0093) AM_MIRROR(0x676c) AM_DEVREADWRITE(PIA6821, "sntpia1", pia_r, pia_w)
AM_RANGE(0x0080, 0x0083) AM_MIRROR(0x676c) AM_DEVREADWRITE("sntpia0", pia_r, pia_w)
AM_RANGE(0x0090, 0x0093) AM_MIRROR(0x676c) AM_DEVREADWRITE("sntpia1", pia_r, pia_w)
AM_RANGE(0x0800, 0x0fff) AM_MIRROR(0x6000) AM_WRITE(squawkntalk_dac_w)
AM_RANGE(0x8000, 0x9fff) AM_MIRROR(0x6000) AM_ROM
ADDRESS_MAP_END

View File

@ -60,7 +60,7 @@ SAMPLES_START( meadows_sh_start )
/************************************/
void meadows_sh_update(running_machine *machine)
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
int preset, amp;
if (latched_0c01 != meadows_0c01 || latched_0c03 != meadows_0c03)
@ -104,9 +104,9 @@ void meadows_sh_update(running_machine *machine)
dac_enable = meadows_0c03 & ENABLE_DAC;
if (dac_enable)
dac_data_w(devtag_get_device(machine, SOUND, "dac"), meadows_dac);
dac_data_w(devtag_get_device(machine, "dac"), meadows_dac);
else
dac_data_w(devtag_get_device(machine, SOUND, "dac"), 0);
dac_data_w(devtag_get_device(machine, "dac"), 0);
}
latched_0c01 = meadows_0c01;
@ -121,9 +121,9 @@ void meadows_sh_dac_w(running_machine *machine, int data)
{
meadows_dac = data;
if (dac_enable)
dac_data_w(devtag_get_device(machine, SOUND, "dac"), meadows_dac);
dac_data_w(devtag_get_device(machine, "dac"), meadows_dac);
else
dac_data_w(devtag_get_device(machine, SOUND, "dac"), 0);
dac_data_w(devtag_get_device(machine, "dac"), 0);
}

View File

@ -146,7 +146,7 @@ MACHINE_DRIVER_END
WRITE8_HANDLER( seawolf_audio_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
UINT8 rising_bits = data & ~port_1_last;
/* if (data & 0x01) enable SHIP HIT sound */
@ -212,8 +212,8 @@ MACHINE_DRIVER_END
WRITE8_HANDLER( gunfight_audio_w )
{
const device_config *samples0 = devtag_get_device(space->machine, SOUND, "samples1");
const device_config *samples1 = devtag_get_device(space->machine, SOUND, "samples2");
const device_config *samples0 = devtag_get_device(space->machine, "samples1");
const device_config *samples1 = devtag_get_device(space->machine, "samples2");
/* D0 and D1 are just tied to 1k resistors */
@ -1645,8 +1645,8 @@ WRITE8_HANDLER( gmissile_audio_1_w )
reversed (D5=R, D7=L), but the software confirms that
ours is right */
const device_config *samples0 = devtag_get_device(space->machine, SOUND, "samples1");
const device_config *samples1 = devtag_get_device(space->machine, SOUND, "samples2");
const device_config *samples0 = devtag_get_device(space->machine, "samples1");
const device_config *samples1 = devtag_get_device(space->machine, "samples2");
UINT8 rising_bits = data & ~port_1_last;
/* D0 and D1 are not connected */
@ -1741,8 +1741,8 @@ MACHINE_DRIVER_END
WRITE8_HANDLER( m4_audio_1_w )
{
const device_config *samples0 = devtag_get_device(space->machine, SOUND, "samples1");
const device_config *samples1 = devtag_get_device(space->machine, SOUND, "samples2");
const device_config *samples0 = devtag_get_device(space->machine, "samples1");
const device_config *samples1 = devtag_get_device(space->machine, "samples2");
UINT8 rising_bits = data & ~port_1_last;
/* D0 and D1 are not connected */
@ -1769,8 +1769,8 @@ WRITE8_HANDLER( m4_audio_1_w )
WRITE8_HANDLER( m4_audio_2_w )
{
const device_config *samples0 = devtag_get_device(space->machine, SOUND, "samples1");
const device_config *samples1 = devtag_get_device(space->machine, SOUND, "samples2");
const device_config *samples0 = devtag_get_device(space->machine, "samples1");
const device_config *samples1 = devtag_get_device(space->machine, "samples2");
UINT8 rising_bits = data & ~port_2_last;
/* if (data & 0x01) enable LEFT PLAYER EXPLOSION sound via 510K res (goes to left speaker) */
@ -2043,7 +2043,7 @@ WRITE8_HANDLER( clowns_audio_1_w )
WRITE8_DEVICE_HANDLER( clowns_audio_2_w )
{
const device_config *samples = devtag_get_device(device->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(device->machine, "samples");
UINT8 rising_bits = data & ~port_2_last;
discrete_sound_w(device, CLOWNS_POP_BOTTOM_EN, (data >> 0) & 0x01);
@ -2745,7 +2745,7 @@ WRITE8_DEVICE_HANDLER( spcenctr_audio_2_w )
WRITE8_DEVICE_HANDLER( spcenctr_audio_3_w )
{
const device_config *sn = devtag_get_device(device->machine, SOUND, "sn");
const device_config *sn = devtag_get_device(device->machine, "sn");
/* if (data & 0x01) enable SCREECH (hit the sides) sound */
@ -2798,7 +2798,7 @@ MACHINE_DRIVER_END
WRITE8_HANDLER( phantom2_audio_1_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
UINT8 rising_bits = data & ~port_1_last;
/* if (data & 0x01) enable PLAYER SHOT sound */
@ -2820,7 +2820,7 @@ WRITE8_HANDLER( phantom2_audio_1_w )
WRITE8_HANDLER( phantom2_audio_2_w )
{
const device_config *samples = devtag_get_device(space->machine, SOUND, "samples");
const device_config *samples = devtag_get_device(space->machine, "samples");
UINT8 rising_bits = data & ~port_2_last;
/* D0-D2 are not connected */
@ -3660,7 +3660,7 @@ MACHINE_DRIVER_END
WRITE8_DEVICE_HANDLER( invaders_audio_1_w )
{
const device_config *sn = devtag_get_device(device->machine, SOUND, "sn");
const device_config *sn = devtag_get_device(device->machine, "sn");
sn76477_enable_w(sn, (~data >> 0) & 0x01); /* saucer sound */
@ -4042,7 +4042,7 @@ MACHINE_DRIVER_END
WRITE8_DEVICE_HANDLER( invad2ct_audio_1_w )
{
const device_config *sn = devtag_get_device(device->machine, SOUND, "sn1");
const device_config *sn = devtag_get_device(device->machine, "sn1");
sn76477_enable_w(sn, (~data >> 0) & 0x01); /* saucer sound */
@ -4068,7 +4068,7 @@ WRITE8_DEVICE_HANDLER( invad2ct_audio_2_w )
WRITE8_DEVICE_HANDLER( invad2ct_audio_3_w )
{
const device_config *sn = devtag_get_device(device->machine, SOUND, "sn2");
const device_config *sn = devtag_get_device(device->machine, "sn2");
sn76477_enable_w(sn, (~data >> 0) & 0x01); /* saucer sound */

View File

@ -170,13 +170,13 @@ static void stop_mono_flop(const device_config *sn, int n)
static TIMER_CALLBACK( stop_mono_flop_callback )
{
stop_mono_flop(devtag_get_device(machine, SOUND, "sn"), param);
stop_mono_flop(devtag_get_device(machine, "sn"), param);
}
static void spacefev_sound_pins_changed(running_machine *machine)
{
const device_config *sn = devtag_get_device(machine, SOUND, "sn");
const device_config *sn = devtag_get_device(machine, "sn");
UINT16 changes = ~curr_sound_pins & prev_sound_pins;
if (changes & (1 << 0x3))
@ -208,7 +208,7 @@ static void spacefev_sound_pins_changed(running_machine *machine)
static void sheriff_sound_pins_changed(running_machine *machine)
{
const device_config *sn = devtag_get_device(machine, SOUND, "sn");
const device_config *sn = devtag_get_device(machine, "sn");
UINT16 changes = ~curr_sound_pins & prev_sound_pins;
if (changes & (1 << 0x6))
@ -410,13 +410,13 @@ static READ8_HANDLER( helifire_8035_p2_r )
static WRITE8_HANDLER( n8080_dac_w )
{
dac_data_w(devtag_get_device(space->machine, SOUND, "dac"), data & 0x80);
dac_data_w(devtag_get_device(space->machine, "dac"), data & 0x80);
}
static WRITE8_HANDLER( helifire_dac_w )
{
dac_data_w(devtag_get_device(space->machine, SOUND, "dac"), data * helifire_dac_volume);
dac_data_w(devtag_get_device(space->machine, "dac"), data * helifire_dac_volume);
}
@ -442,7 +442,7 @@ static WRITE8_HANDLER( helifire_sound_ctrl_w )
static TIMER_CALLBACK( spacefev_vco_voltage_timer )
{
const device_config *sn = devtag_get_device(machine, SOUND, "sn");
const device_config *sn = devtag_get_device(machine, "sn");
double voltage = 0;
if (mono_flop[2])

View File

@ -99,9 +99,9 @@ ADDRESS_MAP_END
ADDRESS_MAP_START( namco_54xx_map_io, ADDRESS_SPACE_IO, 8 )
AM_RANGE(MB88_PORTK, MB88_PORTK) AM_READ(namco_54xx_K_r)
AM_RANGE(MB88_PORTO, MB88_PORTO) AM_DEVWRITE(SOUND, "discrete", namco_54xx_O_w)
AM_RANGE(MB88_PORTO, MB88_PORTO) AM_DEVWRITE("discrete", namco_54xx_O_w)
AM_RANGE(MB88_PORTR0, MB88_PORTR0) AM_READ(namco_54xx_R0_r)
AM_RANGE(MB88_PORTR1, MB88_PORTR1) AM_DEVWRITE(SOUND, "discrete", namco_54xx_R1_w)
AM_RANGE(MB88_PORTR1, MB88_PORTR1) AM_DEVWRITE("discrete", namco_54xx_R1_w)
AM_RANGE(MB88_PORTR2, MB88_PORTR2) AM_NOP
ADDRESS_MAP_END

View File

@ -126,7 +126,7 @@ static WRITE16_HANDLER( c7x_shared_w )
}
ADDRESS_MAP_START( namcoc7x_mcu_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x002000, 0x002fff) AM_DEVREADWRITE(SOUND, "c352", c352_r, c352_w)
AM_RANGE(0x002000, 0x002fff) AM_DEVREADWRITE("c352", c352_r, c352_w)
AM_RANGE(0x004000, 0x00bfff) AM_RAM AM_BASE(&namcoc7x_mcuram)
AM_RANGE(0x00c000, 0x00ffff) AM_ROM AM_REGION("c7x", 0x8c000)
AM_RANGE(0x080000, 0x0fffff) AM_ROM AM_REGION("c7x", 0)
@ -137,7 +137,7 @@ ADDRESS_MAP_START( namcoc7x_mcu_map, ADDRESS_SPACE_PROGRAM, 16 )
ADDRESS_MAP_END
ADDRESS_MAP_START( namcoc7x_mcu_share_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x002000, 0x002fff) AM_DEVREADWRITE(SOUND, "c352", c352_r, c352_w )
AM_RANGE(0x002000, 0x002fff) AM_DEVREADWRITE("c352", c352_r, c352_w )
AM_RANGE(0x004000, 0x00bfff) AM_READWRITE( c7x_shared_r, c7x_shared_w ) AM_BASE(&namcoc7x_mcuram)
AM_RANGE(0x00c000, 0x00ffff) AM_ROM AM_REGION("c7x", 0x8c000)
AM_RANGE(0x080000, 0x0fffff) AM_ROM AM_REGION("c7x", 0)

View File

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

View File

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

View File

@ -49,7 +49,7 @@ void polyplay_set_channel2(int active)
void polyplay_play_channel1(running_machine *machine, int data)
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
if (data) {
freq1 = 2457600 / 16 / data / 8;
sample_set_volume(samples, 0, channel_playing1 * 1.0);
@ -63,7 +63,7 @@ void polyplay_play_channel1(running_machine *machine, int data)
void polyplay_play_channel2(running_machine *machine, int data)
{
const device_config *samples = devtag_get_device(machine, SOUND, "samples");
const device_config *samples = devtag_get_device(machine, "samples");
if (data) {
freq2 = 2457600 / 16 / data / 8;
sample_set_volume(samples, 1, channel_playing2 * 1.0);

View File

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

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