INI option to hide RBF datecode.

This commit is contained in:
sorgelig
2018-12-23 22:37:04 +08:00
parent 53ca769890
commit b6e1b127ca
5 changed files with 12 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ vscale_mode=0 ; 0 - scale to fit the screen height.
vscale_border=0 ; set vertical border for TVs cutting the upper/bottom parts of screen (1-99)
;bootscreen=0 ; uncomment to disable boot screen of some cores like Minimig.
;mouse_throttle=10 ; 1-100 mouse speed divisor. Useful for very sensitive mouses
rbf_hide_datecode=0 ; 1 - hides datecodes from rbf file names. Press F2 for quick temporary toggle
; USER button emulation by keybaord. Usually it's reset button.
; 0 - lctrl+lalt+ralt (lctrl+lgui+rgui on keyrah)

View File

@@ -42,6 +42,7 @@ const ini_var_t ini_vars[] = {
{ "VOLUMECTL", (void*)(&(cfg.volumectl)), UINT8, 0, 1, 1 },
{ "VSCALE_MODE", (void*)(&(cfg.vscale_mode)), UINT8, 0, 3, 1 },
{ "VSCALE_BORDER", (void*)(&(cfg.vscale_border)), UINT8, 0, 100, 1 },
{ "RBF_HIDE_DATECODE", (void*)(&(cfg.rbf_hide_datecode)), UINT8, 0, 1, 1 },
};
// mist ini config

1
cfg.h
View File

@@ -31,6 +31,7 @@ typedef struct {
uint8_t volumectl;
uint8_t vscale_mode;
uint8_t vscale_border;
uint8_t rbf_hide_datecode;
char video_conf[1024];
} cfg_t;

View File

@@ -3495,6 +3495,9 @@ void PrintDirectory(void)
}
}
//not full check but should be enough.
if (cfg.rbf_hide_datecode && len > 9 && !strncmp(flist_DirItem(k)->d_name + len - 9, "_20", 3)) len -= 9;
if (len > 28)
{
len = 27; // trim display length if longer than 30 characters

View File

@@ -2440,6 +2440,12 @@ void user_io_kbd(uint16_t key, int press)
if (press) setBrightness(BRIGHTNESS_UP, 0);
}
else
if (key == KEY_F2 && osd_is_visible)
{
if (press == 1) cfg.rbf_hide_datecode = !cfg.rbf_hide_datecode;
PrintDirectory();
}
else
if ((core_type == CORE_TYPE_MINIMIG2) ||
(core_type == CORE_TYPE_MIST) ||
(core_type == CORE_TYPE_ARCHIE) ||