mirror of
https://github.com/holub/mame
synced 2025-06-01 10:31:48 +03:00
devintrf.c: add devtag_get_device(machine, type, tag) to retrieve the device_config for (type, tag)
* This is needed, if you need to read a device or device status outside a AM_DEVREAD context.
This commit is contained in:
parent
6f9eaf0908
commit
772082e0b8
@ -590,6 +590,26 @@ void *devtag_get_token(running_machine *machine, device_type type, const char *t
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*-------------------------------------------------
|
||||||
|
devtag_get_device - return the device associated
|
||||||
|
with a tag
|
||||||
|
-------------------------------------------------*/
|
||||||
|
|
||||||
|
const device_config *devtag_get_device(running_machine *machine, device_type type, const char *tag)
|
||||||
|
{
|
||||||
|
const device_config *device;
|
||||||
|
|
||||||
|
assert(machine != NULL);
|
||||||
|
assert(type != NULL);
|
||||||
|
assert(tag != NULL);
|
||||||
|
|
||||||
|
device = device_list_find_by_tag(machine->config->devicelist, type, tag);
|
||||||
|
if (device == NULL)
|
||||||
|
fatalerror("devtag_get_device failed to find device: type=%s tag=%s\n", devtype_name(type), tag);
|
||||||
|
return device;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------
|
/*-------------------------------------------------
|
||||||
devtag_get_static_config - return a pointer to
|
devtag_get_static_config - return a pointer to
|
||||||
the static configuration for a device based on
|
the static configuration for a device based on
|
||||||
|
@ -254,6 +254,9 @@ void devtag_reset(running_machine *machine, device_type type, const char *tag);
|
|||||||
|
|
||||||
/* ----- device information getters ----- */
|
/* ----- device information getters ----- */
|
||||||
|
|
||||||
|
/* return the device associated with a tag */
|
||||||
|
const device_config *devtag_get_device(running_machine *machine, device_type type, const char *tag);
|
||||||
|
|
||||||
/* return the token associated with an allocated device */
|
/* return the token associated with an allocated device */
|
||||||
void *devtag_get_token(running_machine *machine, device_type type, const char *tag);
|
void *devtag_get_token(running_machine *machine, device_type type, const char *tag);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user