Previous 15994 Revisions Next

r14594 Thursday 23rd February, 2012 at 16:24:45 UTC by Fabio Priuli
info: additional cleanup for device info output made possible by Micko's work + renamed slot "shortname" attribute to "devname" to make clear it is the name of the device to be mounted. no whatsnew.
cbm: fixed a few duplicate descriptions in view of additional validations. no whatsnew.
[src/emu]info.c info.h
[src/mess/machine]c64_system3.c vic10std.c vic20std.c

src/emu/info.c
r14593r14594
179179"\t\t\t<!ATTLIST slot name CDATA #REQUIRED>\n"
180180"\t\t\t<!ELEMENT slotoption EMPTY>\n"
181181"\t\t\t\t<!ATTLIST slotoption name CDATA #REQUIRED>\n"
182"\t\t\t\t<!ATTLIST slotoption shortname CDATA #REQUIRED>\n"
182"\t\t\t\t<!ATTLIST slotoption devname CDATA #REQUIRED>\n"
183183"\t\t\t\t<!ATTLIST slotoption default (yes|no) \"no\">\n"
184184"\t\t<!ELEMENT softwarelist EMPTY>\n"
185185"\t\t\t<!ATTLIST softwarelist name CDATA #REQUIRED>\n"
r14593r14594
340340//  a single device
341341//-------------------------------------------------
342342
343void info_xml_creator::output_one_device(device_t &device, const char *innertag, const char *outertag)
343void info_xml_creator::output_one_device(device_t &device, const char *devtag)
344344{
345345   bool has_speaker = FALSE, has_input = FALSE;
346346   // check if the device adds speakers to the system
r14593r14594
363363         }
364364
365365   // start to output info
366   fprintf(m_output, "\t<%s", outertag);
367   // TODO: merge handling for devices with roms and other devices
368   if (outertag == emulator_info::get_xml_top())
369   {
370      // it's a device with roms necessary for this configuration
371      fprintf(m_output, " name=\"%s\"", xml_normalize_string(device.shortname()));
372      fprintf(m_output, " isdevice=\"yes\"");
373      fprintf(m_output, " runnable=\"no\"");
374   }
375   else
376   {
377      // it's a generic device
378      astring shrtnm(device.shortname());
379      if (shrtnm.cmp(""))
380         fprintf(m_output, " shortname=\"%s\"", shrtnm.cstr());
381   }
366   fprintf(m_output, "\t<%s", emulator_info::get_xml_top());
367   fprintf(m_output, " name=\"%s\"", xml_normalize_string(device.shortname()));
368   fprintf(m_output, " isdevice=\"yes\"");
369   fprintf(m_output, " runnable=\"no\"");
382370   fprintf(m_output, ">\n");
383371   fprintf(m_output, "\t\t<description>%s</description>\n", xml_normalize_string(device.name()));
384372
385373   output_rom(device);
386   output_chips(device, innertag);
374   output_chips(device, devtag);
387375   output_display(device);
388376   if (has_speaker)
389377      output_sound(device);
390378   if (has_input)
391379      output_input(portlist);
392   output_switches(portlist, innertag, IPT_DIPSWITCH, "dipswitch", "dipvalue");
393   output_switches(portlist, innertag, IPT_CONFIG, "configuration", "confsetting");
380   output_switches(portlist, devtag, IPT_DIPSWITCH, "dipswitch", "dipvalue");
381   output_switches(portlist, devtag, IPT_CONFIG, "configuration", "confsetting");
394382   output_adjusters(portlist);
395   output_images(device, innertag);
396   output_slots(device, innertag);
397   fprintf(m_output, "\t</%s>\n", outertag);
383   output_images(device, devtag);
384   output_slots(device, devtag);
385   fprintf(m_output, "\t</%s>\n", emulator_info::get_xml_top());
398386}
399387
400388
r14593r14594
409397void info_xml_creator::output_devices()
410398{
411399   m_drivlist.reset();
412   slot_map desc;
400   slot_map shortnames;
413401
414   // first, run through slot devices
415402   while (m_drivlist.next())
416403   {
404      // first, run through devices with roms which belongs to the default configuration
417405      device_iterator deviter(m_drivlist.config().root_device());
418406      deviter.first();
419      for (device_t *device = deviter.next(); device != NULL; device = deviter.next()) {
407      for (device_t *device = deviter.next(); device != NULL; device = deviter.next())
408      {
420409         if (device->rom_region() != NULL && device->shortname()!= NULL)
421410         {
422            if (desc.add(device->name(), 0, FALSE) != TMERR_DUPLICATE)
423               output_one_device(*device, device->tag(), emulator_info::get_xml_top());
411            if (shortnames.add(device->shortname(), 0, FALSE) != TMERR_DUPLICATE)
412               output_one_device(*device, device->tag());
424413         }
425414      }
415
416      // then, run through slot devices
426417      slot_interface_iterator iter(m_drivlist.config().root_device());
427418      for (const device_slot_interface *slot = iter.first(); slot != NULL; slot = iter.next())
428419      {
r14593r14594
439430               if (!device->configured())
440431                  device->config_complete();
441432
442            if (desc.add(dev->name(), 0, FALSE) != TMERR_DUPLICATE)
443               output_one_device(*dev, temptag.cstr(), emulator_info::get_xml_top());
433            if (shortnames.add(dev->shortname(), 0, FALSE) != TMERR_DUPLICATE)
434               output_one_device(*dev, temptag.cstr());
444435
445436            const_cast<machine_config &>(m_drivlist.config()).device_remove(&m_drivlist.config().root_device(), temptag.cstr());
446437            global_free(dev);
r14593r14594
12861277
12871278            fprintf(m_output, "\t\t\t<slotoption");
12881279            fprintf(m_output, " name=\"%s\"", xml_normalize_string(intf[i].name));
1289            fprintf(m_output, " shortname=\"%s\"", xml_normalize_string(dev->shortname()));
1280            fprintf(m_output, " devname=\"%s\"", xml_normalize_string(dev->shortname()));
12901281            if (slot->get_default_card(m_drivlist.config(), m_drivlist.options()))
12911282            {
12921283               if (slot->get_default_card(m_drivlist.config(), m_drivlist.options()) == intf[i].name)
src/emu/info.h
r14593r14594
7777   void output_software_list();
7878   void output_ramoptions();
7979
80   void output_one_device(device_t &device, const char *innertag, const char *outertag);
80   void output_one_device(device_t &device, const char *devtag);
8181   void output_devices();
8282
8383   const char *get_merge_name(const hash_collection &romhashes);
r14593r14594
8585   // internal state
8686   FILE *               m_output;
8787   driver_enumerator &      m_drivlist;
88   dynamic_array<UINT8>   m_device_used;
8988   emu_options          m_lookup_options;
9089
9190   static const char s_dtd_string[];
src/mess/machine/c64_system3.c
r14593r14594
2828//-------------------------------------------------
2929 
3030c64_system3_cartridge_device::c64_system3_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
31   device_t(mconfig, C64_SYSTEM3, "C64 Dinamic cartridge", tag, owner, clock),
31   device_t(mconfig, C64_SYSTEM3, "C64 System 3 cartridge", tag, owner, clock),
3232   device_c64_expansion_card_interface(mconfig, *this)
3333{
3434}
src/mess/machine/vic10std.c
r14593r14594
2828//-------------------------------------------------
2929 
3030vic10_standard_cartridge_device::vic10_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
31    : device_t(mconfig, VIC10_STD, "Standard Cartridge", tag, owner, clock),
31    : device_t(mconfig, VIC10_STD, "VIC-10 Standard Cartridge", tag, owner, clock),
3232     device_vic10_expansion_card_interface(mconfig, *this),
3333     m_exram(NULL),
3434     m_lorom(NULL),
src/mess/machine/vic20std.c
r14593r14594
2828//-------------------------------------------------
2929
3030vic20_standard_cartridge_device::vic20_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
31    : device_t(mconfig, VIC20_STD, "Standard Cartridge", tag, owner, clock),
31    : device_t(mconfig, VIC20_STD, "VIC-20 Standard Cartridge", tag, owner, clock),
3232     device_vic20_expansion_card_interface(mconfig, *this)
3333{
3434}

Previous 15994 Revisions Next


© 1998-2018 The MESS Team