Previous 15994 Revisions Next

r15409 Tuesday 5th June, 2012 at 18:23:19 UTC by Miodrag Milanović
Fixed for slot menus + some cleanup (nw)
[src/emu]dislot.h emuopts.c info.c mconfig.c uimain.c

src/emu/emuopts.c
r15408r15409
252252         entry[0].name = slot->device().tag() + 1;
253253         entry[0].description = NULL;
254254         entry[0].flags = OPTION_STRING | OPTION_FLAG_DEVICE;
255         entry[0].defvalue = (slot->get_slot_interfaces() != NULL) ? slot->get_default_card(config,*this) : NULL;
255         entry[0].defvalue = (slot->get_slot_interfaces() != NULL) ? slot->get_default_card() : NULL;
256256         add_entries(entry, true);
257257
258258         added = true;
src/emu/uimain.c
r15408r15409
180180   slot_interface_iterator slotiter(machine().root_device());
181181   if (slotiter.first() != NULL)
182182   {
183      bool display = false;
184      for (const device_slot_interface *slot = slotiter.first(); slot != NULL; slot = slotiter.next())
185      {
186         if (slot->fixed()) continue;
187         display = true;
188      }
189      /* add image info menu */
190      if (display) item_append("Slot Devices", NULL, 0, (void *)SLOT_DEVICES);
183      /* add slot info menu */
184      item_append("Slot Devices", NULL, 0, (void *)SLOT_DEVICES);
191185   }
192186
193187   network_interface_iterator netiter(machine().root_device());
r15408r15409
458452   slot_interface_iterator iter(machine().root_device());
459453   for (device_slot_interface *slot = iter.first(); slot != NULL; slot = iter.next())
460454   {
461      // do no display fixed slots
462      if (slot->fixed()) continue;
463455      /* record the menu item */
464456      const char *title = get_slot_device(slot);
465      item_append(slot->device().tag()+1, strcmp(title,"")==0 ? "------" : title, MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW, (void *)slot);
457      // do no display fixed slots
458      if (slot->fixed()) title = slot->get_default_card();
459     
460      item_append(slot->device().tag()+1, strcmp(title,"")==0 ? "------" : title, slot->fixed() ? 0 : (MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW), (void *)slot);
466461   }
467462   item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL);
468463   item_append("Reset",  NULL, 0, NULL);
src/emu/info.c
r15408r15409
12851285            fprintf(m_output, "\t\t\t<slotoption");
12861286            fprintf(m_output, " name=\"%s\"", xml_normalize_string(intf[i].name));
12871287            fprintf(m_output, " devname=\"%s\"", xml_normalize_string(dev->shortname()));
1288            if (slot->get_default_card(m_drivlist.config(), m_drivlist.options()))
1288            if (slot->get_default_card())
12891289            {
1290               if (strcmp(slot->get_default_card(m_drivlist.config(), m_drivlist.options()),intf[i].name)==0)
1290               if (strcmp(slot->get_default_card(),intf[i].name)==0)
12911291                  fprintf(m_output, " default=\"yes\"");
12921292            }
12931293            fprintf(m_output, "/>\n");
src/emu/dislot.h
r15408r15409
5656
5757   static void static_set_slot_info(device_t &device, const slot_interface *slots_info, const char *default_card,const input_device_default *default_input, const void *default_config, UINT32 default_clock, bool fixed);
5858   const slot_interface* get_slot_interfaces() const { return m_slot_interfaces; };
59   const char * get_default_card(const machine_config &config, emu_options &options) const { return m_default_card; };
59   const char * get_default_card() const { return m_default_card; };
6060   virtual const char * get_default_card_software(const machine_config &config, emu_options &options) { return NULL; };
6161   const input_device_default *input_ports_defaults() const { return m_input_defaults; }
6262   const void *default_config() const { return m_default_config; }
src/emu/mconfig.c
r15408r15409
8080         const char *selval = options.value(owner.tag()+1);
8181         bool isdefault = (options.priority(owner.tag()+1)==OPTION_PRIORITY_DEFAULT);
8282         if (!is_selected_driver || !options.exists(owner.tag()+1))
83            selval = slot->get_default_card(*this, options);
83            selval = slot->get_default_card();
8484
8585         if (selval != NULL && strlen(selval) != 0)
8686         {
r15408r15409
9191               {
9292                  if ((!intf[i].internal) || (isdefault && intf[i].internal))
9393                  {
94                     const char *def = slot->get_default_card(*this, options);
94                     const char *def = slot->get_default_card();
9595                     bool is_default = (def != NULL && strcmp(def, selval) == 0);
9696                     device_t *new_dev = device_add(&owner, intf[i].name, intf[i].devtype, is_default ? slot->default_clock() : 0);
9797                     found = true;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team