summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/info.c
diff options
context:
space:
mode:
author smf- <smf-@users.noreply.github.com>2013-12-16 19:31:52 +0000
committer smf- <smf-@users.noreply.github.com>2013-12-16 19:31:52 +0000
commitcc9b510f9c76edebb38e83e40439a5a75adeb2db (patch)
tree5a073dabf4d7e33e8860b4700169f767968f60c4 /src/emu/info.c
parent496c6d67229d0991594f5e4ff9a56d129eee18db (diff)
Slot options can now be configured inline without creating an array. Legacy support for old configuration uses MCFG_FRAGMENT_ADD, which required changing so the current device could be updated by the fragment. [smf]
Diffstat (limited to 'src/emu/info.c')
-rw-r--r--src/emu/info.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/emu/info.c b/src/emu/info.c
index 73cddd4a41b..d3a9e231168 100644
--- a/src/emu/info.c
+++ b/src/emu/info.c
@@ -398,12 +398,11 @@ void info_xml_creator::output_devices()
slot_interface_iterator iter(m_drivlist.config().root_device());
for (const device_slot_interface *slot = iter.first(); slot != NULL; slot = iter.next())
{
- const slot_interface* intf = slot->get_slot_interfaces();
- for (int i = 0; intf && intf[i].name != NULL; i++)
+ for (const device_slot_option *option = slot->first_option(); option != NULL; option = option->next())
{
astring temptag("_");
- temptag.cat(intf[i].name);
- device_t *dev = const_cast<machine_config &>(m_drivlist.config()).device_add(&m_drivlist.config().root_device(), temptag.cstr(), intf[i].devtype, 0);
+ temptag.cat(option->name());
+ device_t *dev = const_cast<machine_config &>(m_drivlist.config()).device_add(&m_drivlist.config().root_device(), temptag.cstr(), option->devtype(), 0);
// notify this device and all its subdevices that they are now configured
device_iterator subiter(*dev);
@@ -1281,19 +1280,18 @@ void info_xml_creator::output_slots(device_t &device, const char *root_tag)
fprintf(m_output, " interface=\"%s\"", xml_normalize_string(slot->slot_interface()));
*/
- const slot_interface* intf = slot->get_slot_interfaces();
- for (int i = 0; intf && intf[i].name != NULL && !intf[i].internal; i++)
+ for (const device_slot_option *option = slot->first_option(); option != NULL; option = option->next())
{
- device_t *dev = const_cast<machine_config &>(m_drivlist.config()).device_add(&m_drivlist.config().root_device(), "dummy", intf[i].devtype, 0);
+ device_t *dev = const_cast<machine_config &>(m_drivlist.config()).device_add(&m_drivlist.config().root_device(), "dummy", option->devtype(), 0);
if (!dev->configured())
dev->config_complete();
fprintf(m_output, "\t\t\t<slotoption");
- fprintf(m_output, " name=\"%s\"", xml_normalize_string(intf[i].name));
+ fprintf(m_output, " name=\"%s\"", xml_normalize_string(option->name()));
fprintf(m_output, " devname=\"%s\"", xml_normalize_string(dev->shortname()));
- if (slot->get_default_card())
+ if (slot->default_option())
{
- if (strcmp(slot->get_default_card(),intf[i].name)==0)
+ if (strcmp(slot->default_option(),option->name())==0)
fprintf(m_output, " default=\"yes\"");
}
fprintf(m_output, "/>\n");