From 3ed545b9f47a998458f2c17ef5c940ba42ccf8c9 Mon Sep 17 00:00:00 2001 From: sorgelig Date: Sat, 24 Jul 2021 22:35:24 +0800 Subject: [PATCH] Remove redundant OsdNameSet calls. --- menu.cpp | 18 +----------------- user_io.cpp | 6 ++---- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/menu.cpp b/menu.cpp index 0bc8b7f..535c8e2 100644 --- a/menu.cpp +++ b/menu.cpp @@ -1330,7 +1330,6 @@ void HandleUI(void) else { if (is_menu()) { - OsdCoreNameSet(""); SelectFile("", 0, SCANO_CORES, MENU_CORE_FILE_SELECTED1, MENU_SYSTEM1); } else if (is_minimig()) @@ -1562,12 +1561,8 @@ void HandleUI(void) entry = 0; uint32_t selentry = 0; menumask = 0; - p = user_io_get_core_name(); - if (!p[0]) OsdCoreNameSet("8BIT"); - else OsdCoreNameSet(p); - if(!page) OsdSetTitle(OsdCoreNameGet()); - else OsdSetTitle(title); + OsdSetTitle(page ? title : user_io_get_core_name()); dip_submenu = -1; dip2_submenu = -1; @@ -1821,16 +1816,6 @@ void HandleUI(void) entry++; } } - - // check for 'V'ersion strings - if (p[0] == 'V') - { - // get version string - strcpy(s, OsdCoreNameGet()); - strcat(s, " "); - substrcpy(s + strlen(s), p, 1); - OsdCoreNameSet(s); - } } } while (p); @@ -5766,7 +5751,6 @@ void HandleUI(void) case MENU_SYSTEM2: if (menu) { - OsdCoreNameSet(""); SelectFile("", 0, SCANO_CORES, MENU_CORE_FILE_SELECTED1, MENU_SYSTEM1); break; } diff --git a/user_io.cpp b/user_io.cpp index 56d5a82..f3173c2 100644 --- a/user_io.cpp +++ b/user_io.cpp @@ -419,9 +419,9 @@ static void parse_config() do { p = user_io_get_confstr(i); printf("get cfgstring %d = %s\n", i, p); - if (!i && p && p[0]) + if (!i) { - OsdCoreNameSet(p); + OsdCoreNameSet((p && p[0]) ? p : "CORE"); } if (i == 1 && p) @@ -1095,8 +1095,6 @@ void user_io_init(const char *path, const char *xml) name = user_io_create_config_name(); if(strlen(name) > 0) { - OsdCoreNameSet(user_io_get_core_name()); - uint32_t status[2] = { 0, 0 }; if (!is_st() && !is_minimig()) {