Look for MiSTer.ini in the root folder first.

This commit is contained in:
sorgelig
2018-01-23 05:57:08 +08:00
parent 64c218cff6
commit 579652a364
4 changed files with 11 additions and 5 deletions

1
cfg.c
View File

@@ -39,6 +39,7 @@ const ini_var_t ini_vars[] = {
// mist ini config
const ini_cfg_t ini_cfg = {
"MiSTer.ini",
CONFIG_DIR"/MiSTer.ini",
ini_sections,
ini_vars,

View File

@@ -196,11 +196,13 @@ void ini_parse(const ini_cfg_t* cfg)
memset(&ini_file, 0, sizeof(ini_file));
if (!FileOpen(&ini_file, cfg->filename))
{
ini_parser_debugf("Can't open file %s !", cfg->filename);
return;
if (!FileOpen(&ini_file, cfg->filename_alt))
{
return;
}
else ini_parser_debugf("Opened file %s with size %d bytes.", cfg->filename_alt, ini_file.size);
}
ini_parser_debugf("Opened file %s with size %d bytes.", cfg->filename, ini_file.size);
else ini_parser_debugf("Opened file %s with size %d bytes.", cfg->filename, ini_file.size);
ini_pt = 0;

View File

@@ -32,6 +32,7 @@ typedef struct {
typedef struct {
const char* filename;
const char* filename_alt;
const ini_section_t* sections;
const ini_var_t* vars;
int nsections;

4
main.c
View File

@@ -57,7 +57,9 @@ int main(int argc, char *argv[])
DISKLED_OFF;
printf("\nMinimig by Dennis van Weeren");
printf("\nARM Controller by Jakub Bednarski\n\n");
printf("\nARM Controller by Jakub Bednarski");
printf("\nMiSTer code by Sorgelig\n\n");
printf("Version %s\n\n", version + 5);
if (!is_fpga_ready(1))