summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2011-11-13 15:28:56 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2011-11-13 15:28:56 +0000
commit1d9a61aa0933137b59f254309a965172e252ff6c (patch)
tree515f7ece9d593088a01023d65c27e9cc1b20519b
parent35762c31865cf36c34ee1cd81927a23ebee96608 (diff)
Fixed reading default card and throw exception now on wrong slot item name (no whatsnew)
-rw-r--r--src/emu/dislot.c7
-rw-r--r--src/emu/mconfig.c10
2 files changed, 14 insertions, 3 deletions
diff --git a/src/emu/dislot.c b/src/emu/dislot.c
index 5295b260cb9..a794589aa13 100644
--- a/src/emu/dislot.c
+++ b/src/emu/dislot.c
@@ -30,8 +30,13 @@ void device_slot_interface::static_set_slot_info(device_t &device, const slot_in
device_t* device_slot_interface::get_card_device()
{
- const char *subtag = device().mconfig().options().value(device().tag());
+ const char *subtag;
device_t *dev = NULL;
+ if (!device().mconfig().options().exists(device().tag())) {
+ subtag = m_default_card;
+ } else {
+ subtag = device().mconfig().options().value(device().tag());
+ }
if (subtag) {
device_slot_card_interface *intf = NULL;
dev = device().subdevice(subtag);
diff --git a/src/emu/mconfig.c b/src/emu/mconfig.c
index 70df85c5436..1916a2a0fbe 100644
--- a/src/emu/mconfig.c
+++ b/src/emu/mconfig.c
@@ -79,13 +79,19 @@ machine_config::machine_config(const game_driver &gamedrv, emu_options &options)
if (!options.exists(owner.tag()))
selval = slot->get_default_card(devicelist(), options);
- if (selval != NULL)
- for (int i = 0; intf[i].name != NULL; i++)
+ if (selval != NULL && strlen(selval)!=0) {
+ bool found = false;
+ for (int i = 0; intf[i].name != NULL; i++) {
if (strcmp(selval, intf[i].name) == 0) {
device_t *new_dev = device_add(&owner, intf[i].name, intf[i].devtype, 0);
+ found = true;
if (!options.exists(owner.tag()))
device_t::static_set_input_default(*new_dev, slot->input_ports_defaults());
}
+ }
+ if (!found)
+ throw emu_fatalerror("Unknown slot option '%s' in slot '%s'", selval, owner.tag());
+ }
}
}