From 08081a30313cb8d37d533731ce9dec868273d2f2 Mon Sep 17 00:00:00 2001 From: etabeta78 Date: Sun, 14 Jun 2015 16:53:32 +0200 Subject: [PATCH] info.c: worked around missing sub-devices in -lx output [Fabio Priuli] out of whatsnew: I fear no proper and clean solution is possible as long as the driver has such a privileged role in the MAME core structure, because stuff that is not attached to a root_device (=driver) is hard to parse. Anyway, there should be no more missing roms from -lx output (until people starts adding them as sub-sub-subdevices... ;) ) --- src/emu/info.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/emu/info.c b/src/emu/info.c index 4b5adfab3b1..adb0f3468d4 100644 --- a/src/emu/info.c +++ b/src/emu/info.c @@ -374,6 +374,12 @@ void info_xml_creator::output_one_device(device_t &device, const char *devtag) // output_devices - print the XML info for devices // with roms and for devices that can be mounted // in slots +// The current solution works to some extent, but +// it is limited by the fact that devices are only +// acknowledged when attached to a driver (so that +// for instance sub-sub-devices could never appear +// in the xml input if they are not also attached +// directly to a driver as device or sub-device) //------------------------------------------------- typedef tagmap_t slot_map; @@ -415,6 +421,17 @@ void info_xml_creator::output_devices() if (shortnames.add(dev->shortname(), 0, FALSE) != TMERR_DUPLICATE) output_one_device(*dev, temptag.c_str()); + // also, check for subdevices with ROMs (a few devices are missed otherwise, e.g. MPU401) + device_iterator deviter2(*dev); + for (device_t *device = deviter2.first(); device != NULL; device = deviter2.next()) + { + if (device->owner() == dev && device->shortname()!= NULL && strlen(device->shortname())!=0) + { + if (shortnames.add(device->shortname(), 0, FALSE) != TMERR_DUPLICATE) + output_one_device(*device, device->tag()); + } + } + const_cast(m_drivlist.config()).device_remove(&m_drivlist.config().root_device(), temptag.c_str()); } }