diff --git a/src/frontend/mame/ui/audio_effect_compressor.cpp b/src/frontend/mame/ui/audio_effect_compressor.cpp index fb1161dc870ae..0fb8a58fa89bc 100644 --- a/src/frontend/mame/ui/audio_effect_compressor.cpp +++ b/src/frontend/mame/ui/audio_effect_compressor.cpp @@ -438,7 +438,7 @@ u32 menu_audio_effect_compressor::flag_mode() const { u32 flag = 0; if(!m_effect->isset_mode()) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; if(m_effect->mode()) flag |= FLAG_LEFT_ARROW; else @@ -450,7 +450,7 @@ u32 menu_audio_effect_compressor::flag_lim(float value, float min, float max, bo { u32 flag = 0; if(!isset) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; if(value > min) flag |= FLAG_LEFT_ARROW; if(value < max) @@ -462,7 +462,7 @@ u32 menu_audio_effect_compressor::flag_lim_special(float value, float min, bool { u32 flag = 0; if(!isset) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; if(value != min) flag |= FLAG_LEFT_ARROW; if(value >= min) diff --git a/src/frontend/mame/ui/audio_effect_eq.cpp b/src/frontend/mame/ui/audio_effect_eq.cpp index 514019cae3387..2d3a18d06bd07 100644 --- a/src/frontend/mame/ui/audio_effect_eq.cpp +++ b/src/frontend/mame/ui/audio_effect_eq.cpp @@ -367,7 +367,7 @@ u32 menu_audio_effect_eq::flag_mode() const { u32 flag = 0; if(!m_effect->isset_mode()) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; if(m_effect->mode() == 1) flag |= FLAG_LEFT_ARROW; if(m_effect->mode() == 0) @@ -379,7 +379,7 @@ u32 menu_audio_effect_eq::flag_low_shelf() const { u32 flag = 0; if(!m_effect->isset_low_shelf()) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; if(m_effect->low_shelf()) flag |= FLAG_RIGHT_ARROW; else @@ -391,7 +391,7 @@ u32 menu_audio_effect_eq::flag_high_shelf() const { u32 flag = 0; if(!m_effect->isset_high_shelf()) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; if(m_effect->high_shelf()) flag |= FLAG_RIGHT_ARROW; else @@ -403,7 +403,7 @@ u32 menu_audio_effect_eq::flag_f(u32 band) const { u32 flag = 0; if(!m_effect->isset_f(band)) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; u32 f = m_effect->f(band); if(f > FREQ_LIMITS[band][0]) flag |= FLAG_LEFT_ARROW; @@ -416,7 +416,7 @@ u32 menu_audio_effect_eq::flag_q(u32 band) const { u32 flag = 0; if(!m_effect->isset_q(band)) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; u32 q = roundf(m_effect->q(band) * 100.0f); if(q > 10) flag |= FLAG_LEFT_ARROW; @@ -429,7 +429,7 @@ u32 menu_audio_effect_eq::flag_db(u32 band) const { u32 flag = 0; if(!m_effect->isset_db(band)) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; s32 db = roundf(m_effect->db(band) * 10.0f); if(db > -120) flag |= FLAG_LEFT_ARROW; diff --git a/src/frontend/mame/ui/audio_effect_filter.cpp b/src/frontend/mame/ui/audio_effect_filter.cpp index 8d7029d8041e4..9a43e242dd20c 100644 --- a/src/frontend/mame/ui/audio_effect_filter.cpp +++ b/src/frontend/mame/ui/audio_effect_filter.cpp @@ -372,7 +372,7 @@ u32 menu_audio_effect_filter::flag_highpass_active() const { u32 flag = 0; if(!m_effect->isset_highpass_active()) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; if(m_effect->highpass_active()) flag |= FLAG_LEFT_ARROW; else @@ -384,7 +384,7 @@ u32 menu_audio_effect_filter::flag_fh() const { u32 flag = 0; if(!m_effect->isset_fh()) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; u32 f = m_effect->fh(); if(f > FH_MIN) flag |= FLAG_LEFT_ARROW; @@ -397,7 +397,7 @@ u32 menu_audio_effect_filter::flag_qh() const { u32 flag = 0; if(!m_effect->isset_qh()) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; u32 q = roundf(m_effect->qh() * 100.0f); if(q > 10) flag |= FLAG_LEFT_ARROW; @@ -410,7 +410,7 @@ u32 menu_audio_effect_filter::flag_lowpass_active() const { u32 flag = 0; if(!m_effect->isset_lowpass_active()) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; if(m_effect->lowpass_active()) flag |= FLAG_LEFT_ARROW; else @@ -422,7 +422,7 @@ u32 menu_audio_effect_filter::flag_fl() const { u32 flag = 0; if(!m_effect->isset_fl()) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; u32 f = m_effect->fl(); if(f > FL_MIN) flag |= FLAG_LEFT_ARROW; @@ -435,7 +435,7 @@ u32 menu_audio_effect_filter::flag_ql() const { u32 flag = 0; if(!m_effect->isset_ql()) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; u32 q = roundf(m_effect->ql() * 100.0f); if(q > 10) flag |= FLAG_LEFT_ARROW; diff --git a/src/frontend/mame/ui/audio_effect_reverb.cpp b/src/frontend/mame/ui/audio_effect_reverb.cpp index 344897756e179..1027d78b2e604 100644 --- a/src/frontend/mame/ui/audio_effect_reverb.cpp +++ b/src/frontend/mame/ui/audio_effect_reverb.cpp @@ -537,7 +537,7 @@ u32 menu_audio_effect_reverb::flag_mode() const { u32 flag = 0; if(!m_effect->isset_mode()) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; if(m_effect->mode()) flag |= FLAG_LEFT_ARROW; else @@ -549,7 +549,7 @@ u32 menu_audio_effect_reverb::flag_tap_setup() const { u32 flag = 0; if(!m_effect->isset_early_tap_setup()) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; if(m_effect->early_tap_setup() != 0) flag |= FLAG_LEFT_ARROW; if(m_effect->early_tap_setup() != audio_effect_reverb::early_tap_setup_count() - 1) @@ -571,7 +571,7 @@ u32 menu_audio_effect_reverb::flag_percent(double val, bool isset) { u32 flag = 0; if(!isset) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; if(val > 0.0) flag |= FLAG_LEFT_ARROW; if(val < 100.0) @@ -583,7 +583,7 @@ u32 menu_audio_effect_reverb::flag_freq(double val, bool isset) { u32 flag = 0; if(!isset) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; if(val > 100.0) flag |= FLAG_LEFT_ARROW; if(val < 16000.0) @@ -595,7 +595,7 @@ u32 menu_audio_effect_reverb::flag_ms(float val, bool isset) { u32 flag = 0; if(!isset) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; if(val > 0.0f) flag |= FLAG_LEFT_ARROW; if(val < 200.0f) @@ -607,7 +607,7 @@ u32 menu_audio_effect_reverb::flag_decay(float val, bool isset) { u32 flag = 0; if(!isset) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; if(val > 0.1f) flag |= FLAG_LEFT_ARROW; if(val < 30.0f) @@ -619,7 +619,7 @@ u32 menu_audio_effect_reverb::flag_spin(double val, bool isset) { u32 flag = 0; if(!isset) - flag |= FLAG_INVERT; + flag |= FLAG_DE_EMPHASIZE; if(val > 0.0) flag |= FLAG_LEFT_ARROW; if(val < 5.0) diff --git a/src/frontend/mame/ui/audioeffects.cpp b/src/frontend/mame/ui/audioeffects.cpp index d015aca87f629..df83dd95cee71 100644 --- a/src/frontend/mame/ui/audioeffects.cpp +++ b/src/frontend/mame/ui/audioeffects.cpp @@ -211,7 +211,7 @@ u32 menu_audio_effects::flag_latency() const if(latency < 0.05f) flag |= FLAG_RIGHT_ARROW; if(machine().sound().resampler_type() != sound_manager::RESAMPLER_HQ) - flag |= FLAG_INVERT | FLAG_DISABLE; + flag |= FLAG_DISABLE; return flag; } @@ -224,7 +224,7 @@ u32 menu_audio_effects::flag_length() const if(length < 500) flag |= FLAG_RIGHT_ARROW; if(machine().sound().resampler_type() != sound_manager::RESAMPLER_HQ) - flag |= FLAG_INVERT | FLAG_DISABLE; + flag |= FLAG_DISABLE; return flag; } @@ -237,7 +237,7 @@ u32 menu_audio_effects::flag_phases() const if(phases < 1000) flag |= FLAG_RIGHT_ARROW; if(machine().sound().resampler_type() != sound_manager::RESAMPLER_HQ) - flag |= FLAG_INVERT | FLAG_DISABLE; + flag |= FLAG_DISABLE; return flag; } diff --git a/src/frontend/mame/ui/confswitch.cpp b/src/frontend/mame/ui/confswitch.cpp index be02a35b109c9..3fe3d530e5f46 100644 --- a/src/frontend/mame/ui/confswitch.cpp +++ b/src/frontend/mame/ui/confswitch.cpp @@ -129,6 +129,9 @@ void menu_confswitch::populate() if (field.has_next_setting()) flags |= FLAG_RIGHT_ARROW; + if (field.live().value == field.defvalue()) + flags |= FLAG_DE_EMPHASIZE; + // add the menu item item_append(field.name(), field.setting_name(), flags, &field); } diff --git a/src/frontend/mame/ui/inputmap.cpp b/src/frontend/mame/ui/inputmap.cpp index 4f6c41bd237e2..e67247a665e89 100644 --- a/src/frontend/mame/ui/inputmap.cpp +++ b/src/frontend/mame/ui/inputmap.cpp @@ -609,9 +609,9 @@ void menu_input::populate_sorted() } else { - // otherwise, generate the sequence name and invert it if different from the default + // otherwise, generate the sequence name and invert it if same as the default subtext = machine().input().seq_name(item.seq); - flags |= (item.seq != *item.defseq) ? FLAG_INVERT : 0; + flags |= (item.seq == *item.defseq) ? FLAG_DE_EMPHASIZE : 0; } // add the item diff --git a/src/frontend/mame/ui/menu.cpp b/src/frontend/mame/ui/menu.cpp index 6ae5ef6a3d0f8..76e54a6c779b7 100644 --- a/src/frontend/mame/ui/menu.cpp +++ b/src/frontend/mame/ui/menu.cpp @@ -838,9 +838,13 @@ void menu::draw(uint32_t flags) else { // otherwise, draw the item on the left and the subitem text on the right - bool const subitem_invert(pitem.flags() & FLAG_INVERT); + bool const item_disabled(pitem.flags() & FLAG_DISABLE); // item disabled: both item and subitem at 70% brightness + bool const subitem_de_emphasized((pitem.flags() & FLAG_DE_EMPHASIZE) && !is_selected(itemnum)); // subitem default: subitem at 70% brightness float item_width, subitem_width; + if (item_disabled) + fgcolor = fgcolor.scale8(0.7f * 256); // 70% + // draw the left-side text ui().draw_text_full( container(), @@ -889,13 +893,16 @@ void menu::draw(uint32_t flags) if (!core_stricmp(pitem.subtext(), _("Auto"))) fgcolor2 = rgb_t(0xff,0xff,0x00); + if (item_disabled || subitem_de_emphasized) + fgcolor2 = fgcolor2.scale8(0.7F * 256); // 70% + // draw the subitem right-justified ui().draw_text_full( container(), subitem_text, effective_left + item_width, line_y0, effective_width - item_width, text_layout::text_justify::RIGHT, text_layout::word_wrapping::TRUNCATE, - mame_ui_manager::NORMAL, subitem_invert ? fgcolor3 : fgcolor2, bgcolor, + mame_ui_manager::NORMAL, fgcolor2, bgcolor, &subitem_width, nullptr, line_height()); } @@ -926,7 +933,7 @@ void menu::draw(uint32_t flags) if (selected_subitem_too_big) { menu_item const &pitem = selected_item(); - bool const subitem_invert(pitem.flags() & FLAG_INVERT); + bool const subitem_invert(pitem.flags() & FLAG_DE_EMPHASIZE); auto const linenum = m_selected - top_line; float const line_y = m_items_top + float(linenum) * line_height(); diff --git a/src/frontend/mame/ui/menu.h b/src/frontend/mame/ui/menu.h index b59913df1a7a3..d4d6228686c55 100644 --- a/src/frontend/mame/ui/menu.h +++ b/src/frontend/mame/ui/menu.h @@ -56,7 +56,7 @@ class menu { FLAG_LEFT_ARROW = 1U << 0, FLAG_RIGHT_ARROW = 1U << 1, - FLAG_INVERT = 1U << 2, + FLAG_DE_EMPHASIZE = 1U << 2, FLAG_DISABLE = 1U << 4, FLAG_UI_HEADING = 1U << 5, FLAG_COLOR_BOX = 1U << 6 diff --git a/src/frontend/mame/ui/pluginopt.cpp b/src/frontend/mame/ui/pluginopt.cpp index 732b49dfa2d55..bde09aca99a68 100644 --- a/src/frontend/mame/ui/pluginopt.cpp +++ b/src/frontend/mame/ui/pluginopt.cpp @@ -172,8 +172,8 @@ void menu_plugin_opt::populate() item_flags_or |= FLAG_RIGHT_ARROW; else if (flag == "lr") item_flags_or |= FLAG_RIGHT_ARROW | FLAG_LEFT_ARROW; - else if (flag == "invert") - item_flags_or |= FLAG_INVERT; + else if (flag == "invert") // FIXME: do we need to change this? + item_flags_or |= FLAG_DE_EMPHASIZE; else if (flag == "heading") item_flags_or |= FLAG_DISABLE | FLAG_UI_HEADING; else diff --git a/src/frontend/mame/ui/selgame.cpp b/src/frontend/mame/ui/selgame.cpp index dda281f684a93..bc9ea2df48dac 100644 --- a/src/frontend/mame/ui/selgame.cpp +++ b/src/frontend/mame/ui/selgame.cpp @@ -356,7 +356,7 @@ void menu_select_game::populate() 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); + item_append(elem.description, elem.is_clone ? FLAG_DE_EMPHASIZE : 0, (void *)&elem); curitem++; } } @@ -385,13 +385,13 @@ void menu_select_game::populate() } ui_system_info const &sysinfo = m_persistent_data.systems()[driver_list::find(info.driver->name)]; - item_append(sysinfo.description, cloneof ? FLAG_INVERT : 0, (void *)&info); + item_append(sysinfo.description, cloneof ? FLAG_DE_EMPHASIZE : 0, (void *)&info); } else { if (old_item_selected == -1 && info.shortname == reselect_last::driver()) old_item_selected = curitem; - item_append(info.longname, info.devicetype, info.parentname.empty() ? 0 : FLAG_INVERT, (void *)&info); + item_append(info.longname, info.devicetype, info.parentname.empty() ? 0 : FLAG_DE_EMPHASIZE, (void *)&info); } curitem++; }); diff --git a/src/frontend/mame/ui/selmenu.cpp b/src/frontend/mame/ui/selmenu.cpp index 5af866846c13e..99a2a023561d1 100644 --- a/src/frontend/mame/ui/selmenu.cpp +++ b/src/frontend/mame/ui/selmenu.cpp @@ -3324,7 +3324,7 @@ void menu_select_launch::draw(u32 flags) } else { - bool const item_invert(pitem.flags() & FLAG_INVERT); + bool const item_invert(pitem.flags() & FLAG_DE_EMPHASIZE); if (m_has_icons) draw_icon(linenum, pitem.ref(), item_text_left, linetop); if (pitem.subtext().empty()) diff --git a/src/frontend/mame/ui/selsoft.cpp b/src/frontend/mame/ui/selsoft.cpp index 4e9a16bb196b7..4923f5638f56f 100644 --- a/src/frontend/mame/ui/selsoft.cpp +++ b/src/frontend/mame/ui/selsoft.cpp @@ -573,7 +573,7 @@ void menu_select_software::populate() item_append( m_displaylist[curitem].get().longname, m_displaylist[curitem].get().devicetype, - m_displaylist[curitem].get().parentname.empty() ? 0 : FLAG_INVERT, (void *)&m_displaylist[curitem].get()); + m_displaylist[curitem].get().parentname.empty() ? 0 : FLAG_DE_EMPHASIZE, (void *)&m_displaylist[curitem].get()); } m_skip_main_items = 0; diff --git a/src/frontend/mame/ui/simpleselgame.cpp b/src/frontend/mame/ui/simpleselgame.cpp index 1034a368f1b4b..76ff08f69cc86 100644 --- a/src/frontend/mame/ui/simpleselgame.cpp +++ b/src/frontend/mame/ui/simpleselgame.cpp @@ -263,7 +263,7 @@ void simple_menu_select_game::populate() item_append( m_drivlist->driver(curmatch).type.fullname(), m_drivlist->driver(curmatch).name, - (cloneof == -1) ? 0 : FLAG_INVERT, + (cloneof == -1) ? 0 : FLAG_DE_EMPHASIZE, (void *)&m_drivlist->driver(curmatch)); } } diff --git a/src/frontend/mame/ui/sliders.cpp b/src/frontend/mame/ui/sliders.cpp index d59757914ef4b..548be0db1cee7 100644 --- a/src/frontend/mame/ui/sliders.cpp +++ b/src/frontend/mame/ui/sliders.cpp @@ -200,6 +200,8 @@ void menu_sliders::populate() flags |= FLAG_LEFT_ARROW; if (curval < slider->maxval) flags |= FLAG_RIGHT_ARROW; + if (curval == slider->defval) + flags |= FLAG_DE_EMPHASIZE; item_append(slider->description, tempstring, flags, (void *)slider, menu_item_type::SLIDER); } } @@ -225,6 +227,8 @@ void menu_sliders::populate() flags |= FLAG_LEFT_ARROW; if (curval < slider->maxval) flags |= FLAG_RIGHT_ARROW; + if (curval == slider->defval) + flags |= FLAG_DE_EMPHASIZE; item_append(slider->description, tempstring, flags, (void *)slider, menu_item_type::SLIDER); } else diff --git a/src/frontend/mame/ui/videoopt.cpp b/src/frontend/mame/ui/videoopt.cpp index 1396be35b3fc7..5958facc8d365 100644 --- a/src/frontend/mame/ui/videoopt.cpp +++ b/src/frontend/mame/ui/videoopt.cpp @@ -143,7 +143,7 @@ void menu_video_options::populate() bool eclipsed(false); for (auto it = toggles.begin(); !eclipsed && (toggle != it); ++it) eclipsed = ((current_mask & it->mask()) != it->mask()) && ((toggle_mask & it->mask()) == it->mask()); - item_append_on_off(toggle->name(), enabled, eclipsed ? (FLAG_INVERT | FLAG_DISABLE) : 0U, reinterpret_cast(ITEM_TOGGLE_FIRST + ref)); + item_append_on_off(toggle->name(), enabled, eclipsed ? (FLAG_DE_EMPHASIZE | FLAG_DISABLE) : 0U, reinterpret_cast(ITEM_TOGGLE_FIRST + ref)); } item_append(menu_item_type::SEPARATOR); } @@ -163,7 +163,7 @@ void menu_video_options::populate() // cropping bool const canzoom(curview.has_art() && !curview.visible_screens().empty()); - item_append_on_off(_("Zoom to Screen Area"), m_target.zoom_to_screen(), canzoom ? 0U : (FLAG_INVERT | FLAG_DISABLE), reinterpret_cast(ITEM_ZOOM)); + item_append_on_off(_("Zoom to Screen Area"), m_target.zoom_to_screen(), canzoom ? 0U : (FLAG_DE_EMPHASIZE | FLAG_DISABLE), reinterpret_cast(ITEM_ZOOM)); if (!m_snapshot) {