fix for slots, makes c64 and other loading (nw)

This commit is contained in:
Miodrag Milanovic 2016-01-17 20:27:05 +01:00
parent 214ac51495
commit e61f9bf26f

View File

@ -278,15 +278,15 @@ void emu_options::update_slot_options()
for (device_slot_interface *slot = iter.first(); slot != nullptr; slot = iter.next()) for (device_slot_interface *slot = iter.first(); slot != nullptr; slot = iter.next())
{ {
// retrieve info about the device instance // retrieve info about the device instance
const char *name = slot->device().tag().c_str() + 1; std::string name(slot->device().tag().c_str()+1);
if (exists(name) && slot->first_option() != nullptr) if (exists(name.c_str()) && slot->first_option() != nullptr)
{ {
std::string defvalue = slot->get_default_card_software(); std::string defvalue = slot->get_default_card_software();
if (defvalue.length() > 0) if (defvalue.length() > 0)
{ {
set_default_value(name, defvalue.c_str()); set_default_value(name.c_str(), defvalue.c_str());
const device_slot_option *option = slot->option(defvalue.c_str()); const device_slot_option *option = slot->option(defvalue.c_str());
set_flag(name, ~OPTION_FLAG_INTERNAL, (option != nullptr && !option->selectable()) ? OPTION_FLAG_INTERNAL : 0); set_flag(name.c_str(), ~OPTION_FLAG_INTERNAL, (option != nullptr && !option->selectable()) ? OPTION_FLAG_INTERNAL : 0);
} }
} }
} }