Option in ini file to enable the recents.

This commit is contained in:
sorgelig
2019-12-29 06:54:42 +08:00
parent 7f4159a21e
commit e4d36a5548
4 changed files with 13 additions and 3 deletions

View File

@@ -22,7 +22,12 @@ direct_video=0 ; 1 - enable core video timing over HDMI, use only with V
fb_size=0 ; 0 - automatic, 1 - full size, 2 - 1/2 of resolution, 4 - 1/4 of resolution.
fb_terminal=1 ; 1 - enabled (default), 0 - disabled
osd_timeout=30 ; 5-3600 timeout (in seconds) for OSD to disappear in Menu core. 30 seconds if not set.
; Background picture will get darker after double timout
; Background picture will get darker after double timeout
; 1 - enables the recent file loaded/mounted.
; WARNING: This option will enable write to SD card on every load/mount which may wear the SD card after many writes to the same place
; There is also higher chance to corrupt the File System if MiSTer will be reset or powered off while writing.
recents=0
; lastcore - Autoboot the last loaded core (corename autosaved in CONFIG/lastcore.dat) first found on the SD/USB
; lastexactcore - Autoboot the last loaded exact core (corename_yyyymmdd.rbf autosaved in CONFIG/lastcore.dat) first found on the SD/USB

View File

@@ -58,6 +58,7 @@ const ini_var_t ini_vars[] = {
{ "DIRECT_VIDEO", (void*)(&(cfg.direct_video)), UINT8, 0, 1 },
{ "OSD_ROTATE", (void*)(&(cfg.osd_rotate)), UINT8, 0, 2 },
{ "GAMEPAD_DEFAULTS", (void*)(&(cfg.gamepad_defaults)), UINT8, 0, 1 },
{ "RECENTS", (void*)(&(cfg.recents)), UINT8, 0, 1 },
};
// mist ini config

1
cfg.h
View File

@@ -41,6 +41,7 @@ typedef struct {
uint8_t osd_rotate;
uint16_t osd_timeout;
uint8_t gamepad_defaults;
uint8_t recents;
char bootcore[256];
char video_conf[1024];
char video_conf_pal[1024];

View File

@@ -9,8 +9,9 @@
#include "file_io.h"
#include "user_io.h"
#include "osd.h"
#include "recent.h"
#include "cfg.h"
#include "support.h"
#include "recent.h"
#define RECENT_MAX 16
@@ -70,6 +71,8 @@ static void recent_load(int idx)
int recent_init(int idx)
{
if (!cfg.recents) return 0;
recent_load(idx);
recent_scan(SCANF_INIT);
return recent_available();
@@ -242,7 +245,7 @@ int recent_select(char *dir, char *path)
void recent_update(char* dir, char* path, int idx)
{
if (!strlen(path)) return;
if (!cfg.recents || !strlen(path)) return;
if (is_neogeo_core())
{