src/mess/device.c
| r3046 | r3047 | |
| 108 | 108 | |
| 109 | 109 | |
| 110 | 110 | /*************************************************************************** |
| 111 | FUNCTION PROTOTYPES |
| 112 | ***************************************************************************/ |
| 113 | |
| 114 | static const struct IODevice *mess_device_from_core_device(const device_config *device); |
| 115 | |
| 116 | |
| 117 | |
| 118 | /*************************************************************************** |
| 111 | 119 | CORE IMPLEMENTATION |
| 112 | 120 | ***************************************************************************/ |
| 113 | 121 | |
| r3046 | r3047 | |
| 495 | 503 | * |
| 496 | 504 | *************************************/ |
| 497 | 505 | |
| 498 | | const struct IODevice *mess_device_from_core_device(const device_config *device) |
| 506 | static const struct IODevice *mess_device_from_core_device(const device_config *device) |
| 499 | 507 | { |
| 500 | 508 | const mess_device_config *mess_device = (device != NULL) ? (const mess_device_config *) device->inline_config : NULL; |
| 501 | 509 | return (mess_device != NULL) ? &mess_device->io_device : NULL; |
| r3046 | r3047 | |
| 614 | 622 | |
| 615 | 623 | |
| 616 | 624 | |
| 617 | | const device_config *image_from_device(const struct IODevice *device) |
| 618 | | { |
| 619 | | return device->devconfig; |
| 620 | | } |
| 621 | | |
| 622 | | |
| 623 | | |
| 624 | 625 | const device_config *image_from_devtag_and_index(running_machine *machine, const char *devtag, int id) |
| 625 | 626 | { |
| 626 | 627 | const device_config *image = NULL; |
src/mess/device.h
| r3046 | r3047 | |
| 83 | 83 | }; |
| 84 | 84 | |
| 85 | 85 | |
| 86 | | struct IODevice; |
| 87 | | |
| 88 | 86 | typedef void (*device_getdispositions_func)(int id, unsigned int *readable, unsigned int *writeable, unsigned int *creatable); |
| 89 | | typedef const char *(*device_getname_func)(const struct IODevice *dev, int id, char *buf, size_t bufsize); |
| 90 | 87 | |
| 91 | 88 | struct _mess_device_class; |
| 92 | 89 | struct _machine_config; |
| r3046 | r3047 | |
| 110 | 107 | device_getdispositions_func getdispositions; |
| 111 | 108 | |
| 112 | 109 | device_display_func display; |
| 113 | | device_getname_func name; |
| 114 | 110 | |
| 115 | 111 | int (*validity_check)(const struct _mess_device_class *devclass); |
| 116 | 112 | }; |
| r3046 | r3047 | |
| 191 | 187 | /* interoperability with MAME devices */ |
| 192 | 188 | DEVICE_GET_INFO(mess_device); |
| 193 | 189 | struct _machine_config *machine_config_alloc_with_mess_devices(const game_driver *gamedrv); |
| 194 | | const struct IODevice *mess_device_from_core_device(const device_config *device); |
| 195 | 190 | const mess_device_class *mess_devclass_from_core_device(const device_config *device); |
| 196 | 191 | |
| 197 | 192 | /* device naming */ |
| r3046 | r3047 | |
| 216 | 211 | |
| 217 | 212 | /* deprecated device access functions */ |
| 218 | 213 | int image_index_in_device(const device_config *device); |
| 219 | | const device_config *image_from_device(const struct IODevice *iodev); |
| 220 | 214 | const device_config *image_from_devtag_and_index(running_machine *machine, const char *devtag, int id); |
| 221 | 215 | |
| 222 | 216 | /* deprecated device access functions that assume one device of any given type */ |