Previous 15994 Revisions Next

r13239 Sunday 13th November, 2011 at 15:30:50 UTC by Miodrag Milanović
Fixed reading default card and throw exception now on wrong slot item name (no whatsnew)
[src/emu]dislot.c mconfig.c

src/emu/dislot.c
r13238r13239
3030
3131device_t* device_slot_interface::get_card_device()
3232{
33   const char *subtag = device().mconfig().options().value(device().tag());
33   const char *subtag;
3434   device_t *dev = NULL;
35   if (!device().mconfig().options().exists(device().tag())) {
36      subtag = m_default_card;
37   } else {
38      subtag = device().mconfig().options().value(device().tag());
39   }
3540   if (subtag) {
3641      device_slot_card_interface *intf = NULL;
3742      dev = device().subdevice(subtag);
src/emu/mconfig.c
r13238r13239
7979         if (!options.exists(owner.tag()))
8080            selval = slot->get_default_card(devicelist(), options);
8181
82         if (selval != NULL)
83            for (int i = 0; intf[i].name != NULL; i++)
82         if (selval != NULL && strlen(selval)!=0) {
83            bool found = false;
84            for (int i = 0; intf[i].name != NULL; i++) {
8485               if (strcmp(selval, intf[i].name) == 0) {
8586                  device_t *new_dev = device_add(&owner, intf[i].name, intf[i].devtype, 0);
87                  found = true;
8688                  if (!options.exists(owner.tag()))
8789                     device_t::static_set_input_default(*new_dev, slot->input_ports_defaults());
8890               }
91            }
92            if (!found)
93               throw emu_fatalerror("Unknown slot option '%s' in slot '%s'", selval, owner.tag());
94         }
8995      }
9096   }
9197

Previous 15994 Revisions Next


© 1998-2018 The MESS Team