From bae754cec2680286ea03a381313fe91754effceb Mon Sep 17 00:00:00 2001 From: Martin White Date: Tue, 4 Jun 2019 15:03:51 +0100 Subject: [PATCH] Adds quiet boot option to hide menu duing countdown --- MiSTer.ini | 3 ++- cfg.cpp | 3 ++- cfg.h | 1 + menu.cpp | 23 ++++++++++++++++++++++- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/MiSTer.ini b/MiSTer.ini index 118b8de..d058741 100644 --- a/MiSTer.ini +++ b/MiSTer.ini @@ -25,7 +25,8 @@ fb_terminal=1 ; 1 - enabled (default), 0 - disabled ; corename - Autoboot first corename_*.rbf found on the SD/USB ; corename_yyyymmdd.rbf - Autoboot first corename_yyyymmdd.rbf found on the SD/USB ;bootcore=lastcore ; uncomment to autoboot a core, as the last loaded core. -bootcore_timeout=10 ; 10-30 timeout before autoboot, comment for autoboot without timeout. +bootcore_timeout=10 ; 5-30 timeout before autoboot, comment for autoboot without timeout. +;bootcore_quiet=1 ; uncomment to initially hide the menu. This will only have any effect if bootcore_timeout is non-zero and bootcore is a named core ; Option to load the custom font. Format is plain bitmap 8x8. ; Supported sizes of font: diff --git a/cfg.cpp b/cfg.cpp index 2a011df..2cd1b4d 100644 --- a/cfg.cpp +++ b/cfg.cpp @@ -49,7 +49,8 @@ const ini_var_t ini_vars[] = { { "RBF_HIDE_DATECODE", (void*)(&(cfg.rbf_hide_datecode)), UINT8, 0, 1, 1 }, { "MENU_PAL", (void*)(&(cfg.menu_pal)), UINT8, 0, 1, 1 }, { "BOOTCORE", (void*)(&(cfg.bootcore)), STRING, 0, sizeof(cfg.bootcore) - 1, 1 }, - { "BOOTCORE_TIMEOUT", (void*)(&(cfg.bootcore_timeout)), INT16, 10, 30, 1 }, + { "BOOTCORE_TIMEOUT", (void*)(&(cfg.bootcore_timeout)), INT16, 5, 30, 1 }, + { "BOOTCORE_QUIET", (void*)(&(cfg.bootcore_quiet)), UINT8, 0, 1, 1 }, { "FONT", (void*)(&(cfg.font)), STRING, 0, sizeof(cfg.font) - 1, 1 }, { "FB_SIZE", (void*)(&(cfg.fb_size)), UINT8, 1, 4, 1 }, { "FB_TERMINAL", (void*)(&(cfg.fb_terminal)), UINT8, 0, 1, 1 }, diff --git a/cfg.h b/cfg.h index 9a09325..dfce14d 100644 --- a/cfg.h +++ b/cfg.h @@ -34,6 +34,7 @@ typedef struct { uint8_t rbf_hide_datecode; uint8_t menu_pal; int16_t bootcore_timeout; + uint8_t bootcore_quiet; uint8_t fb_size; uint8_t fb_terminal; char bootcore[256]; diff --git a/menu.cpp b/menu.cpp index c257304..4adf8be 100644 --- a/menu.cpp +++ b/menu.cpp @@ -469,7 +469,16 @@ static uint32_t menu_key_get(void) c2 = c1; // inject a fake "MENU_KEY" if no menu is visible and the menu key is loaded - if (!user_io_osd_is_visible() && !video_fb_state() && is_menu_core()) c = KEY_F12; + if (!cfg.bootcore_quiet) + { + if (!user_io_osd_is_visible() && !video_fb_state() && is_menu_core()) c = KEY_F12; + } + else + { + // Enable key events in OSD + user_io_osd_key_enable(1); + } + // generate repeat "key-pressed" events if ((c1 & UPSTROKE) || (!c1)) @@ -805,6 +814,11 @@ void HandleUI(void) { cfg.bootcore[0] = '\0'; } + else if (c && cfg.bootcore_quiet) + { + cfg.bootcore_quiet = 0; + menu = true; + } if (is_menu_core()) { @@ -4248,6 +4262,13 @@ void HandleUI(void) OsdWrite(16, "", 1, 0); OsdWrite(17, str, 1, 0); OsdWrite(18, "", 1, 0); + + // Override and hide OSD but countdown still happens + if (cfg.bootcore_quiet) + { + menustate = MENU_NONE1; + OsdClear(); + } } } }