diff --git a/src/frontend/mame/ui/moptions.cpp b/src/frontend/mame/ui/moptions.cpp index a030fa219ef..9b070962932 100644 --- a/src/frontend/mame/ui/moptions.cpp +++ b/src/frontend/mame/ui/moptions.cpp @@ -51,6 +51,7 @@ const options_entry ui_options::s_option_entries[] = { OPTION_SKIP_BIOS_MENU, "0", OPTION_BOOLEAN, "skip bios submenu, start with configured or default" }, { OPTION_SKIP_PARTS_MENU, "0", OPTION_BOOLEAN, "skip parts submenu, start with first part" }, { OPTION_LAST_USED_FILTER, "", OPTION_STRING, "latest used filter" }, + { OPTION_LAST_RIGHT_PANEL "(0-1)", "0", OPTION_INTEGER, "latest right panel focus" }, { OPTION_LAST_USED_MACHINE, "", OPTION_STRING, "latest used machine" }, { OPTION_INFO_AUTO_AUDIT, "0", OPTION_BOOLEAN, "enable auto audit in the general info panel" }, { OPTION_HIDE_ROMLESS, "1", OPTION_BOOLEAN, "hide romless machine from available list" }, diff --git a/src/frontend/mame/ui/moptions.h b/src/frontend/mame/ui/moptions.h index 9b750583307..5630cdf40e7 100644 --- a/src/frontend/mame/ui/moptions.h +++ b/src/frontend/mame/ui/moptions.h @@ -8,10 +8,10 @@ ***************************************************************************/ -#pragma once +#ifndef MAME_FRONTEND_UI_MOPTIONS_H +#define MAME_FRONTEND_UI_MOPTIONS_H -#ifndef __UI_OPTS_H__ -#define __UI_OPTS_H__ +#pragma once #include "options.h" @@ -45,6 +45,7 @@ #define OPTION_SKIP_BIOS_MENU "skip_biosmenu" #define OPTION_SKIP_PARTS_MENU "skip_partsmenu" #define OPTION_LAST_USED_FILTER "last_used_filter" +#define OPTION_LAST_RIGHT_PANEL "last_right_panel" #define OPTION_LAST_USED_MACHINE "last_used_machine" #define OPTION_INFO_AUTO_AUDIT "info_audit_enabled" #define OPTION_HIDE_ROMLESS "hide_romless" @@ -109,6 +110,7 @@ public: bool skip_parts_menu() const { return bool_value(OPTION_SKIP_PARTS_MENU); } const char *last_used_machine() const { return value(OPTION_LAST_USED_MACHINE); } const char *last_used_filter() const { return value(OPTION_LAST_USED_FILTER); } + int last_right_panel() const { return int_value(OPTION_LAST_RIGHT_PANEL); } bool info_audit() const { return bool_value(OPTION_INFO_AUTO_AUDIT); } bool hide_romless() const { return bool_value(OPTION_HIDE_ROMLESS); } @@ -137,4 +139,4 @@ private: static const options_entry s_option_entries[]; }; -#endif /* __UI_OPTS_H__ */ +#endif // MAME_FRONTEND_UI_MOPTIONS_H diff --git a/src/frontend/mame/ui/selgame.cpp b/src/frontend/mame/ui/selgame.cpp index 1aae1bd7291..a2f4c8a177f 100644 --- a/src/frontend/mame/ui/selgame.cpp +++ b/src/frontend/mame/ui/selgame.cpp @@ -74,6 +74,7 @@ menu_select_game::menu_select_game(mame_ui_manager &mui, render_container &conta if (first_start) { reselect_last::set_driver(moptions.last_used_machine()); + ui_globals::rpanel = std::min(std::max(moptions.last_right_panel(), RP_FIRST), RP_LAST); std::string tmp(moptions.last_used_filter()); std::size_t const found = tmp.find_first_of(","); @@ -153,6 +154,7 @@ menu_select_game::~menu_select_game() } ui_options &mopt = ui().options(); + mopt.set_value(OPTION_LAST_RIGHT_PANEL, ui_globals::rpanel, OPTION_PRIORITY_CMDLINE); mopt.set_value(OPTION_LAST_USED_FILTER, filter.c_str(), OPTION_PRIORITY_CMDLINE); mopt.set_value(OPTION_LAST_USED_MACHINE, last_driver.c_str(), OPTION_PRIORITY_CMDLINE); mopt.set_value(OPTION_HIDE_PANELS, ui_globals::panels_status, OPTION_PRIORITY_CMDLINE); diff --git a/src/lib/util/png.cpp b/src/lib/util/png.cpp index 32ede1be9c1..7a0783cc47f 100644 --- a/src/lib/util/png.cpp +++ b/src/lib/util/png.cpp @@ -250,6 +250,8 @@ public: return PNGERR_UNSUPPORTED_FORMAT; // unknown colour sample format if ((0 != pnginfo.interlace_method) && (1 != pnginfo.interlace_method)) return PNGERR_UNSUPPORTED_FORMAT; // unknown interlace method + if (!pnginfo.bit_depth || (8 % pnginfo.bit_depth)) + return PNGERR_UNSUPPORTED_FORMAT; // bit depth must be a factor of eight // calculate the offset for each pass of the interlace on the input and output unsigned const pass_count(get_pass_count());