src/mess/climess.c
| r2281 | r2282 | |
| 46 | 46 | int i; |
| 47 | 47 | machine_config *config; |
| 48 | 48 | const device_config *dev; |
| 49 | | const struct IODevice *iodev; |
| 49 | image_device_info info; |
| 50 | 50 | const char *src; |
| 51 | 51 | const char *driver_name; |
| 52 | 52 | const char *name; |
| r2281 | r2282 | |
| 72 | 72 | |
| 73 | 73 | for (dev = image_device_first(config); dev != NULL; dev = image_device_next(dev)) |
| 74 | 74 | { |
| 75 | | iodev = mess_device_from_core_device(dev); |
| 75 | info = image_device_getinfo(dev); |
| 76 | 76 | |
| 77 | | src = iodev->file_extensions; |
| 77 | src = info.file_extensions; |
| 78 | name = info.instance_name; |
| 79 | shortname = info.brief_instance_name; |
| 78 | 80 | |
| 79 | | name = device_instancename(&iodev->devclass, iodev->index_in_device); |
| 80 | | shortname = device_briefinstancename(&iodev->devclass, iodev->index_in_device); |
| 81 | | |
| 82 | 81 | sprintf(paren_shortname, "(%s)", shortname); |
| 83 | 82 | |
| 84 | 83 | mame_printf_info("%-13s%-12s%-8s ", driver_name, name, paren_shortname); |
src/mess/configms.c
| r2281 | r2282 | |
| 6 | 6 | |
| 7 | 7 | #include "mame.h" |
| 8 | 8 | #include "deprecat.h" |
| 9 | | #include "device.h" |
| 10 | 9 | #include "configms.h" |
| 11 | 10 | #include "config.h" |
| 12 | 11 | #include "xmlfile.h" |
| r2281 | r2282 | |
| 25 | 24 | { |
| 26 | 25 | xml_data_node *node; |
| 27 | 26 | const device_config *dev; |
| 28 | | const struct IODevice *iodev; |
| 27 | image_device_info info; |
| 29 | 28 | const device_config *image; |
| 30 | 29 | const char *dev_instance; |
| 31 | 30 | const char *working_directory; |
| r2281 | r2282 | |
| 37 | 36 | image = NULL; |
| 38 | 37 | dev_instance = xml_get_attribute_string(node, "instance", NULL); |
| 39 | 38 | |
| 40 | | if (dev_instance != NULL) |
| 39 | if ((dev_instance != NULL) && (dev_instance[0] != '\0')) |
| 41 | 40 | { |
| 42 | 41 | for (dev = image_device_first(Machine->config); (image == NULL) && (dev != NULL); dev = image_device_next(dev)) |
| 43 | 42 | { |
| 44 | | iodev = mess_device_from_core_device(dev); |
| 45 | | if (iodev != NULL) |
| 46 | | { |
| 47 | | if (!strcmp(dev_instance, device_instancename(&iodev->devclass, iodev->index_in_device))) |
| 48 | | image = dev; |
| 49 | | } |
| 43 | info = image_device_getinfo(dev); |
| 44 | if (!strcmp(dev_instance, info.instance_name)) |
| 45 | image = dev; |
| 50 | 46 | } |
| 51 | 47 | |
| 52 | 48 | if (image != NULL) |
| r2281 | r2282 | |
| 70 | 66 | static void device_dirs_save(int config_type, xml_data_node *parentnode) |
| 71 | 67 | { |
| 72 | 68 | xml_data_node *node; |
| 73 | | const struct IODevice *dev; |
| 69 | image_device_info info; |
| 74 | 70 | const device_config *image; |
| 75 | 71 | const char *dev_instance; |
| 76 | 72 | |
| r2281 | r2282 | |
| 79 | 75 | { |
| 80 | 76 | for (image = image_device_first(Machine->config); image != NULL; image = image_device_next(image)) |
| 81 | 77 | { |
| 82 | | dev = mess_device_from_core_device(image); |
| 83 | | dev_instance = device_instancename(&dev->devclass, dev->index_in_device); |
| 78 | info = image_device_getinfo(image); |
| 79 | dev_instance = info.instance_name; |
| 84 | 80 | |
| 85 | 81 | node = xml_add_child(parentnode, "device", NULL); |
| 86 | 82 | if (node != NULL) |
src/mess/infomess.c
| r2281 | r2282 | |
| 29 | 29 | void print_game_device(FILE *out, const game_driver *game, const machine_config *config) |
| 30 | 30 | { |
| 31 | 31 | const device_config *dev; |
| 32 | | const struct IODevice *iodev; |
| 32 | image_device_info info; |
| 33 | 33 | const char *name; |
| 34 | 34 | const char *shortname; |
| 35 | const char *ext; |
| 35 | 36 | |
| 36 | 37 | for (dev = image_device_first(config); dev != NULL; dev = image_device_next(dev)) |
| 37 | 38 | { |
| 38 | | iodev = mess_device_from_core_device(dev); |
| 39 | info = image_device_getinfo(dev); |
| 39 | 40 | |
| 40 | 41 | /* print out device type */ |
| 41 | | fprintf(out, "\t\t<device type=\"%s\"", xml_normalize_string(device_typename(iodev->type))); |
| 42 | fprintf(out, "\t\t<device type=\"%s\"", xml_normalize_string(device_typename(info.type))); |
| 42 | 43 | |
| 43 | 44 | /* does this device have a tag? */ |
| 44 | | if (iodev->tag) |
| 45 | | fprintf(out, " tag=\"%s\"", xml_normalize_string(iodev->tag)); |
| 45 | if (dev->tag) |
| 46 | fprintf(out, " tag=\"%s\"", xml_normalize_string(dev->tag)); |
| 46 | 47 | |
| 47 | 48 | /* is this device mandatory? */ |
| 48 | | if (iodev->must_be_loaded) |
| 49 | if (info.must_be_loaded) |
| 49 | 50 | fprintf(out, " mandatory=\"1\""); |
| 50 | 51 | |
| 51 | 52 | /* close the XML tag */ |
| 52 | 53 | fprintf(out, ">\n"); |
| 53 | 54 | |
| 54 | | name = device_instancename(&iodev->devclass, iodev->index_in_device); |
| 55 | | shortname = device_briefinstancename(&iodev->devclass, iodev->index_in_device); |
| 55 | name = info.instance_name; |
| 56 | shortname = info.brief_instance_name; |
| 56 | 57 | |
| 57 | 58 | fprintf(out, "\t\t\t<instance"); |
| 58 | 59 | fprintf(out, " name=\"%s\"", xml_normalize_string(name)); |
| 59 | 60 | fprintf(out, " briefname=\"%s\"", xml_normalize_string(shortname)); |
| 60 | 61 | fprintf(out, "/>\n"); |
| 61 | 62 | |
| 62 | | if (iodev->file_extensions) |
| 63 | ext = info.file_extensions; |
| 64 | while (*ext) |
| 63 | 65 | { |
| 64 | | const char* ext = iodev->file_extensions; |
| 65 | | while (*ext) |
| 66 | | { |
| 67 | | fprintf(out, "\t\t\t<extension"); |
| 68 | | fprintf(out, " name=\"%s\"", xml_normalize_string(ext)); |
| 69 | | fprintf(out, "/>\n"); |
| 70 | | ext += strlen(ext) + 1; |
| 71 | | } |
| 66 | fprintf(out, "\t\t\t<extension"); |
| 67 | fprintf(out, " name=\"%s\"", xml_normalize_string(ext)); |
| 68 | fprintf(out, "/>\n"); |
| 69 | ext += strlen(ext) + 1; |
| 72 | 70 | } |
| 73 | 71 | |
| 74 | 72 | fprintf(out, "\t\t</device>\n"); |