From 8077a9e633f73b31bba0aad1c36575c46b4ab47d Mon Sep 17 00:00:00 2001 From: Barry Rodewald Date: Tue, 23 Nov 2021 01:25:34 +1300 Subject: [PATCH 1/4] fmtowns: disable FMR backwards compatibility text rendering, fixes display regression --- src/mame/video/fmtowns.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mame/video/fmtowns.cpp b/src/mame/video/fmtowns.cpp index 54f22f7af31..b45cd75d6d2 100644 --- a/src/mame/video/fmtowns.cpp +++ b/src/mame/video/fmtowns.cpp @@ -1358,6 +1358,7 @@ void towns_state::towns_crtc_draw_layer(bitmap_rgb32 &bitmap,const rectangle* re void towns_state::render_text_char(uint8_t x, uint8_t y, uint8_t ascii, uint16_t jis, uint8_t attr) { +#if 0 uint32_t rom_addr; uint32_t vram_addr; uint16_t linesize = m_video.towns_crtc_reg[24] * 4; @@ -1428,6 +1429,7 @@ void towns_state::render_text_char(uint8_t x, uint8_t y, uint8_t ascii, uint16_t vram_addr += linesize; vram_addr &= 0x3ffff; } +#endif } void towns_state::draw_text_layer() From 5668590fcb00bd3ef01d9e061dc196c3949b0043 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Tue, 23 Nov 2021 11:19:29 +1100 Subject: [PATCH 2/4] -frontend: Fixed crashes switching between favourites and other filters. * Also made the system and software selection menus a bit less eager to reselect the first item. -docs: Bumped documentation version to 0.238. --- docs/source/conf.py | 6 +++--- src/frontend/mame/ui/selgame.cpp | 12 ++++++++---- src/frontend/mame/ui/selmenu.cpp | 25 +++++++++++++++++-------- src/frontend/mame/ui/selsoft.cpp | 2 +- 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 8d0a7db6060..b0216243210 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -56,16 +56,16 @@ master_doc = 'index' # General information about the project. project = u'MAME Documentation' -copyright = u'2021, MAMEdev Team' +copyright = u'1997-2021, MAMEdev and contributors' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '0.237' +version = '0.238' # The full version, including alpha/beta/rc tags. -release = '0.237' +release = '0.238' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/src/frontend/mame/ui/selgame.cpp b/src/frontend/mame/ui/selgame.cpp index e555bdfc15b..f6b5f6cb2a7 100644 --- a/src/frontend/mame/ui/selgame.cpp +++ b/src/frontend/mame/ui/selgame.cpp @@ -341,6 +341,8 @@ void menu_select_game::populate(float &customtop, float &custombottom) if (!isfavorite()) { + if (m_populated_favorites) + m_prev_selected = nullptr; m_populated_favorites = false; m_displaylist.clear(); machine_filter const *const flt(m_persistent_data.filter_data().get_current_filter()); @@ -399,6 +401,8 @@ void menu_select_game::populate(float &customtop, float &custombottom) else { // populate favorites list + if (!m_populated_favorites) + m_prev_selected = nullptr; m_populated_favorites = true; m_search.clear(); mame_machine_manager::instance()->favorite().apply_sorted( @@ -412,8 +416,8 @@ void menu_select_game::populate(float &customtop, float &custombottom) bool cloneof = strcmp(info.driver->parent, "0"); if (cloneof) { - int cx = driver_list::find(info.driver->parent); - if (cx != -1 && ((driver_list::driver(cx).flags & machine_flags::IS_BIOS_ROOT) != 0)) + int const cx = driver_list::find(info.driver->parent); + if ((0 <= cx) && ((driver_list::driver(cx).flags & machine_flags::IS_BIOS_ROOT) != 0)) cloneof = false; } @@ -1036,7 +1040,7 @@ void menu_select_game::get_selection(ui_software_info const *&software, ui_syste if (m_populated_favorites) { software = reinterpret_cast(get_selection_ptr()); - system = &m_persistent_data.systems()[driver_list::find(software->driver->name)]; + system = software ? &m_persistent_data.systems()[driver_list::find(software->driver->name)] : nullptr; } else { @@ -1100,7 +1104,7 @@ void menu_select_game::filter_selected() } } m_persistent_data.filter_data().set_current_filter_type(new_type); - reset(reset_options::SELECT_FIRST); + reset(reset_options::REMEMBER_REF); }); } } diff --git a/src/frontend/mame/ui/selmenu.cpp b/src/frontend/mame/ui/selmenu.cpp index fc20bc0c9ee..1b393edc91a 100644 --- a/src/frontend/mame/ui/selmenu.cpp +++ b/src/frontend/mame/ui/selmenu.cpp @@ -1419,7 +1419,6 @@ void menu_select_launch::handle_keys(uint32_t flags, int &iptkey) } else if (m_focus == focused_menu::LEFT) { - m_prev_selected = nullptr; filter_selected(); } return; @@ -1774,7 +1773,6 @@ void menu_select_launch::handle_events(uint32_t flags, event &ev) } else if (hover() >= HOVER_FILTER_FIRST && hover() <= HOVER_FILTER_LAST) { - m_prev_selected = nullptr; m_filter_highlight = hover() - HOVER_FILTER_FIRST; filter_selected(); stop = true; @@ -1953,18 +1951,29 @@ void menu_select_launch::draw(uint32_t flags) // make sure the selection if (m_available_items < m_visible_lines) m_visible_lines = m_available_items; - if (top_line < 0 || is_first_selected()) + int selection; + if (selected_index() < m_available_items) + { + selection = selected_index(); + } + else + { + selection = 0; + while ((m_available_items > selection) && (item(selection).ref() != m_prev_selected)) + ++selection; + } + if (top_line < 0 || !selection) { top_line = 0; } - else if (selected_index() < m_available_items) + else if (selection < m_available_items) { - if (selected_index() >= (top_line + m_visible_lines)) - top_line = selected_index() - (m_visible_lines / 2); + if ((selection >= (top_line + m_visible_lines)) || (selection <= top_line)) + top_line = (std::max)(selection - (m_visible_lines / 2), 0); if ((top_line + m_visible_lines) >= m_available_items) top_line = m_available_items - m_visible_lines; - else if (selected_index() >= (top_line + m_visible_lines - 2)) - top_line = selected_index() - m_visible_lines + ((selected_index() == (m_available_items - 1)) ? 1: 2); + else if (selection >= (top_line + m_visible_lines - 2)) + top_line = selection - m_visible_lines + ((selection == (m_available_items - 1)) ? 1: 2); } // determine effective positions taking into account the hilighting arrows diff --git a/src/frontend/mame/ui/selsoft.cpp b/src/frontend/mame/ui/selsoft.cpp index 25baf9fe32c..c5c32303e93 100644 --- a/src/frontend/mame/ui/selsoft.cpp +++ b/src/frontend/mame/ui/selsoft.cpp @@ -741,7 +741,7 @@ void menu_select_software::filter_selected() } } m_data->set_filter_type(new_type); - reset(reset_options::SELECT_FIRST); + reset(reset_options::REMEMBER_REF); }); } } From 2cc297a47c713dd379e585193413a5aadfe59746 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 24 Nov 2021 04:59:33 +1100 Subject: [PATCH 3/4] frontend: Fixed another case where the system selection menu could get confused when changing filters. --- src/frontend/mame/ui/selgame.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/frontend/mame/ui/selgame.cpp b/src/frontend/mame/ui/selgame.cpp index f6b5f6cb2a7..d52274a6cb9 100644 --- a/src/frontend/mame/ui/selgame.cpp +++ b/src/frontend/mame/ui/selgame.cpp @@ -337,8 +337,9 @@ void menu_select_game::populate(float &customtop, float &custombottom) icon.second.texture.reset(); set_switch_image(); - int old_item_selected = -1; + bool have_prev_selected = false; + int old_item_selected = -1; if (!isfavorite()) { if (m_populated_favorites) @@ -391,7 +392,8 @@ void menu_select_game::populate(float &customtop, float &custombottom) int curitem = 0; for (ui_system_info const &elem : m_displaylist) { - if (old_item_selected == -1 && elem.driver->name == reselect_last::driver()) + have_prev_selected = have_prev_selected || (&elem == m_prev_selected); + if ((old_item_selected == -1) && (elem.driver->name == reselect_last::driver())) old_item_selected = curitem; item_append(elem.description, elem.is_clone ? FLAG_INVERT : 0, (void *)&elem); @@ -406,8 +408,9 @@ void menu_select_game::populate(float &customtop, float &custombottom) m_populated_favorites = true; m_search.clear(); mame_machine_manager::instance()->favorite().apply_sorted( - [this, &old_item_selected, curitem = 0] (ui_software_info const &info) mutable + [this, &have_prev_selected, &old_item_selected, curitem = 0] (ui_software_info const &info) mutable { + have_prev_selected = have_prev_selected || (&info == m_prev_selected); if (info.startempty) { if (old_item_selected == -1 && info.shortname == reselect_last::driver()) @@ -440,6 +443,9 @@ void menu_select_game::populate(float &customtop, float &custombottom) item_append(_("Configure Options"), 0, (void *)(uintptr_t)CONF_OPTS); item_append(_("Configure Machine"), 0, (void *)(uintptr_t)CONF_MACHINE); skip_main_items = 3; + + if (m_prev_selected && !have_prev_selected) + m_prev_selected = item(0).ref(); } else { From fb21b789040ae91eef30a625b3b642ccf51d457b Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 24 Nov 2021 05:07:01 +1100 Subject: [PATCH 4/4] Bump version to 0.238 --- android-project/app/src/main/AndroidManifest.xml | 4 ++-- makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/android-project/app/src/main/AndroidManifest.xml b/android-project/app/src/main/AndroidManifest.xml index 13b404156cc..40de2085e72 100644 --- a/android-project/app/src/main/AndroidManifest.xml +++ b/android-project/app/src/main/AndroidManifest.xml @@ -4,8 +4,8 @@ --> diff --git a/makefile b/makefile index 7024a9222c1..e87704e7e3a 100644 --- a/makefile +++ b/makefile @@ -1546,7 +1546,7 @@ endif ifeq (posix,$(SHELLTYPE)) $(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS) - @echo '#define BARE_BUILD_VERSION "0.237"' > $@ + @echo '#define BARE_BUILD_VERSION "0.238"' > $@ @echo '#define BARE_VCS_REVISION "$(NEW_GIT_VERSION)"' >> $@ @echo 'extern const char bare_build_version[];' >> $@ @echo 'extern const char bare_vcs_revision[];' >> $@ @@ -1556,7 +1556,7 @@ $(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS) @echo 'const char build_version[] = BARE_BUILD_VERSION " (" BARE_VCS_REVISION ")";' >> $@ else $(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS) - @echo #define BARE_BUILD_VERSION "0.237" > $@ + @echo #define BARE_BUILD_VERSION "0.238" > $@ @echo #define BARE_VCS_REVISION "$(NEW_GIT_VERSION)" >> $@ @echo extern const char bare_build_version[]; >> $@ @echo extern const char bare_vcs_revision[]; >> $@