diff options
Diffstat (limited to 'src/frontend/mame/info.cpp')
-rw-r--r-- | src/frontend/mame/info.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/frontend/mame/info.cpp b/src/frontend/mame/info.cpp index 38135aa2c05..d3e7e36cfb1 100644 --- a/src/frontend/mame/info.cpp +++ b/src/frontend/mame/info.cpp @@ -563,15 +563,8 @@ void info_xml_creator::output_one_device(machine_config &config, device_t &devic //------------------------------------------------- -// 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) +// output_devices - print the XML info for +// registered device types //------------------------------------------------- void info_xml_creator::output_devices(device_type_set const *filter) @@ -582,7 +575,11 @@ void info_xml_creator::output_devices(device_type_set const *filter) auto const action = [this, &config] (device_type type) { // add it at the root of the machine config - device_t *const dev = config.device_add(&config.root_device(), "_tmp", type, 0); + device_t *dev; + { + machine_config::token const tok(config.begin_configuration(config.root_device())); + dev = config.device_add("_tmp", type, 0); + } // notify this device and all its subdevices that they are now configured for (device_t &device : device_iterator(*dev)) @@ -591,7 +588,8 @@ void info_xml_creator::output_devices(device_type_set const *filter) // print details and remove it output_one_device(config, *dev, dev->tag()); - config.device_remove(&config.root_device(), "_tmp"); + machine_config::token const tok(config.begin_configuration(config.root_device())); + config.device_remove("_tmp"); }; // run through devices @@ -1756,6 +1754,7 @@ void info_xml_creator::output_slots(machine_config &config, device_t &device, co if (devtypes || listed) { + machine_config::token const tok(config.begin_configuration(slot.device())); std::string newtag(slot.device().tag()), oldtag(":"); newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length()); @@ -1767,7 +1766,7 @@ void info_xml_creator::output_slots(machine_config &config, device_t &device, co { if (devtypes || (listed && option.second->selectable())) { - device_t *const dev = config.device_add(&slot.device(), "_dummy", option.second->devtype(), option.second->clock()); + device_t *const dev = config.device_add("_dummy", option.second->devtype(), option.second->clock()); if (!dev->configured()) dev->config_complete(); @@ -1783,7 +1782,7 @@ void info_xml_creator::output_slots(machine_config &config, device_t &device, co fprintf(m_output, "/>\n"); } - config.device_remove(&slot.device(), "_dummy"); + config.device_remove("_dummy"); } } |