frontend: Don't let the non-menus get as far as trying to draw.
This commit is contained in:
parent
dc33e01896
commit
6e355f86c8
@ -44,7 +44,7 @@ function autofire.startplugin()
|
|||||||
|
|
||||||
for i, button in ipairs(buttons) do
|
for i, button in ipairs(buttons) do
|
||||||
local key = button.port .. '\0' .. button.mask .. '.' .. button.type
|
local key = button.port .. '\0' .. button.mask .. '.' .. button.type
|
||||||
local state = button_states[key] or { 0, button.button }
|
local state = button_states[key] or {0, button.button}
|
||||||
state[1] = process_button(button) | state[1]
|
state[1] = process_button(button) | state[1]
|
||||||
button_states[key] = state
|
button_states[key] = state
|
||||||
end
|
end
|
||||||
|
@ -74,23 +74,24 @@ void menu_control_floppy_image::hook_load(const std::string &filename)
|
|||||||
{
|
{
|
||||||
machine().popmessage("Error: %s\n", m_image.error());
|
machine().popmessage("Error: %s\n", m_image.error());
|
||||||
stack_pop();
|
stack_pop();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
bool can_in_place = input_format->supports_save();
|
{
|
||||||
if(can_in_place) {
|
bool can_in_place = input_format->supports_save();
|
||||||
std::string tmp_path;
|
if(can_in_place) {
|
||||||
util::core_file::ptr tmp_file;
|
std::string tmp_path;
|
||||||
// attempt to open the file for writing but *without* create
|
util::core_file::ptr tmp_file;
|
||||||
std::error_condition const filerr = util::zippath_fopen(filename, OPEN_FLAG_READ | OPEN_FLAG_WRITE, tmp_file, tmp_path);
|
// attempt to open the file for writing but *without* create
|
||||||
if(!filerr)
|
std::error_condition const filerr = util::zippath_fopen(filename, OPEN_FLAG_READ | OPEN_FLAG_WRITE, tmp_file, tmp_path);
|
||||||
tmp_file.reset();
|
if(!filerr)
|
||||||
else
|
tmp_file.reset();
|
||||||
can_in_place = false;
|
else
|
||||||
|
can_in_place = false;
|
||||||
|
}
|
||||||
|
m_submenu_result.rw = menu_select_rw::result::INVALID;
|
||||||
|
menu::stack_push<menu_select_rw>(ui(), container(), can_in_place, m_submenu_result.rw);
|
||||||
|
m_state = SELECT_RW;
|
||||||
}
|
}
|
||||||
m_submenu_result.rw = menu_select_rw::result::INVALID;
|
|
||||||
menu::stack_push<menu_select_rw>(ui(), container(), can_in_place, m_submenu_result.rw);
|
|
||||||
m_state = SELECT_RW;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_control_floppy_image::menu_activated()
|
void menu_control_floppy_image::menu_activated()
|
||||||
@ -174,6 +175,7 @@ void menu_control_floppy_image::menu_activated()
|
|||||||
|
|
||||||
case menu_select_rw::result::INVALID:
|
case menu_select_rw::result::INVALID:
|
||||||
m_state = START_FILE;
|
m_state = START_FILE;
|
||||||
|
menu_activated();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -164,6 +164,7 @@ void menu_control_device_image::load_software_part()
|
|||||||
{
|
{
|
||||||
machine().popmessage(_("The software selected is missing one or more required ROM or CHD images.\nPlease acquire the correct files or select a different one."));
|
machine().popmessage(_("The software selected is missing one or more required ROM or CHD images.\nPlease acquire the correct files or select a different one."));
|
||||||
m_state = SELECT_SOFTLIST;
|
m_state = SELECT_SOFTLIST;
|
||||||
|
menu_activated();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,17 +230,22 @@ void menu_control_device_image::menu_activated()
|
|||||||
if (!m_sld)
|
if (!m_sld)
|
||||||
{
|
{
|
||||||
stack_pop();
|
stack_pop();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
m_software_info_name.clear();
|
else
|
||||||
menu::stack_push_special_main<menu_software_list>(ui(), container(), m_sld, m_image.image_interface(), m_software_info_name);
|
{
|
||||||
m_state = SELECT_PARTLIST;
|
m_software_info_name.clear();
|
||||||
|
menu::stack_push_special_main<menu_software_list>(ui(), container(), m_sld, m_image.image_interface(), m_software_info_name);
|
||||||
|
m_state = SELECT_PARTLIST;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SELECT_PARTLIST:
|
case SELECT_PARTLIST:
|
||||||
m_swi = m_sld->find(m_software_info_name);
|
m_swi = m_sld->find(m_software_info_name);
|
||||||
if (!m_swi)
|
if (!m_swi)
|
||||||
|
{
|
||||||
m_state = START_SOFTLIST;
|
m_state = START_SOFTLIST;
|
||||||
|
menu_activated();
|
||||||
|
}
|
||||||
else if (m_swi->has_multiple_parts(m_image.image_interface()))
|
else if (m_swi->has_multiple_parts(m_image.image_interface()))
|
||||||
{
|
{
|
||||||
m_submenu_result.swparts = menu_software_parts::result::INVALID;
|
m_submenu_result.swparts = menu_software_parts::result::INVALID;
|
||||||
@ -263,6 +269,7 @@ void menu_control_device_image::menu_activated()
|
|||||||
|
|
||||||
default: // return to list
|
default: // return to list
|
||||||
m_state = SELECT_SOFTLIST;
|
m_state = SELECT_SOFTLIST;
|
||||||
|
menu_activated();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user