summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/emu/ui/menu.cpp2
-rw-r--r--src/emu/ui/ui.cpp2
-rw-r--r--src/emu/ui/ui.h2
3 files changed, 4 insertions, 2 deletions
diff --git a/src/emu/ui/menu.cpp b/src/emu/ui/menu.cpp
index 547030298bb..3803790c359 100644
--- a/src/emu/ui/menu.cpp
+++ b/src/emu/ui/menu.cpp
@@ -537,6 +537,8 @@ void ui_menu::draw(bool customonly, bool noimage, bool noinput)
machine().ui().draw_outlined_box(container, x1, y1, x2, y2, UI_BACKGROUND_COLOR);
// determine the first visible line based on the current selection
+ if (selected > top_line + visible_lines)
+ top_line = selected - (visible_lines / 2);
if (top_line < 0 || selected == 0)
top_line = 0;
if (top_line + visible_lines >= item.size())
diff --git a/src/emu/ui/ui.cpp b/src/emu/ui/ui.cpp
index b7babbc641e..6652bf0b8e8 100644
--- a/src/emu/ui/ui.cpp
+++ b/src/emu/ui/ui.cpp
@@ -2773,7 +2773,7 @@ rgb_t decode_ui_color(int id, running_machine *machine)
if (machine != nullptr) {
ui_options option;
- for (int x = 0; x < ARRAY_LENGTH(s_color_list); x++) {
+ for (int x = 0; x < ARRAY_LENGTH(s_color_list); ++x) {
const char *o_default = option.value(s_color_list[x]);
const char *s_option = machine->ui().options().value(s_color_list[x]);
int len = strlen(s_option);
diff --git a/src/emu/ui/ui.h b/src/emu/ui/ui.h
index 43f54c0b243..ffd2fddc371 100644
--- a/src/emu/ui/ui.h
+++ b/src/emu/ui/ui.h
@@ -226,5 +226,5 @@ private:
FUNCTION PROTOTYPES
***************************************************************************/
rgb_t decode_ui_color(int id, running_machine *machine = nullptr);
-int get_font_rows(running_machine *machine = NULL);
+int get_font_rows(running_machine *machine = nullptr);
#endif /* __USRINTRF_H__ */