From 1fb6d8a3c51464714793a34ca1092208bd2e2287 Mon Sep 17 00:00:00 2001 From: npwoods Date: Tue, 18 Apr 2017 06:26:21 -0400 Subject: Fixed a regression in the mandatory image check (#2243) As a consequence of recent changes, we were not properly blocking the emulation from starting when a must_be_loaded() image had an unspecified image. --- src/frontend/mame/ui/info.cpp | 15 +++++++++++++-- src/frontend/mame/ui/ui.cpp | 3 +-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/frontend/mame/ui/info.cpp b/src/frontend/mame/ui/info.cpp index 670042de0f5..8101faad3c6 100644 --- a/src/frontend/mame/ui/info.cpp +++ b/src/frontend/mame/ui/info.cpp @@ -319,12 +319,23 @@ std::string machine_info::game_info_string() std::string machine_info::mandatory_images() { std::ostringstream buf; + bool is_first = true; // make sure that any required image has a mounted file for (device_image_interface &image : image_interface_iterator(m_machine.root_device())) { - if (image.must_be_loaded() && m_machine.options().image_options().count(image.instance_name()) == 0) - buf << "\"" << image.instance_name() << "\", "; + if (image.must_be_loaded()) + { + auto iter = m_machine.options().image_options().find(image.instance_name()); + if (iter == m_machine.options().image_options().end() || iter->second.empty()) + { + if (is_first) + is_first = false; + else + buf << ", "; + buf << "\"" << image.instance_name() << "\""; + } + } } return buf.str(); } diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp index 3212ab8c116..cf4ea2c9cc5 100644 --- a/src/frontend/mame/ui/ui.cpp +++ b/src/frontend/mame/ui/ui.cpp @@ -341,8 +341,7 @@ void mame_ui_manager::display_startup_screens(bool first_time) messagebox_text = machine_info().mandatory_images(); if (!messagebox_text.empty()) { - std::string warning; - warning.assign(_("This driver requires images to be loaded in the following device(s): ")).append(messagebox_text.substr(0, messagebox_text.length() - 2)); + std::string warning = std::string(_("This driver requires images to be loaded in the following device(s): ")) + messagebox_text; ui::menu_file_manager::force_file_manager(*this, machine().render().ui_container(), warning.c_str()); } break; -- cgit v1.2.3