mirror of
https://github.com/Oibaf66/uae-wii.git
synced 2024-11-25 12:06:55 +01:00
Store changed prefs in uaerc.saved and make uaerc.user an optional
configuration file which overrides the other configuration if it exists.
This commit is contained in:
parent
280b27728f
commit
c0b348e944
@ -757,7 +757,7 @@ void gui_display(int shortcut)
|
||||
}
|
||||
#endif
|
||||
strcat(user_options, OPTIONSFILENAME);
|
||||
strcat(user_options, ".user");
|
||||
strcat(user_options, ".saved");
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
setup_joystick_defaults(i);
|
||||
|
44
src/main.c
44
src/main.c
@ -391,6 +391,28 @@ static void parse_cmdline (int argc, char **argv)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void parse_user_conf_file(const char *extension)
|
||||
{
|
||||
/* FIXME! ska: This is temporary, and will be removed when you can
|
||||
* pass command line options in meta.xml for the homebrew channel */
|
||||
char user_options[255] = "";
|
||||
char *user_argv[] = {"program", "-f", user_options};
|
||||
#ifdef OPTIONS_IN_HOME
|
||||
char *home = getenv ("HOME");
|
||||
if (home != NULL && strlen (home) < 240)
|
||||
{
|
||||
strcpy (user_options, home);
|
||||
strcat (user_options, "/");
|
||||
}
|
||||
#endif
|
||||
strcat(user_options, OPTIONSFILENAME);
|
||||
strcat(user_options, extension);
|
||||
|
||||
/* Allow the user uaerc to override the default one */
|
||||
parse_cmdline (3, user_argv);
|
||||
/* Until here */
|
||||
}
|
||||
|
||||
static void parse_cmdline_and_init_file (int argc, char **argv)
|
||||
{
|
||||
char *home;
|
||||
@ -433,26 +455,8 @@ static void parse_cmdline_and_init_file (int argc, char **argv)
|
||||
fix_options ();
|
||||
|
||||
parse_cmdline (argc, argv);
|
||||
/* FIXME! ska: This is temporary, and will be removed when you can
|
||||
* pass command line options in meta.xml for the homebrew channel */
|
||||
{
|
||||
char user_options[255] = "";
|
||||
char *user_argv[] = {"program", "-f", user_options};
|
||||
#ifdef OPTIONS_IN_HOME
|
||||
char *home = getenv ("HOME");
|
||||
if (home != NULL && strlen (home) < 240)
|
||||
{
|
||||
strcpy (user_options, home);
|
||||
strcat (user_options, "/");
|
||||
}
|
||||
#endif
|
||||
strcat(user_options, OPTIONSFILENAME);
|
||||
strcat(user_options, ".user");
|
||||
|
||||
/* Allow the user uaerc to override the default one */
|
||||
parse_cmdline (3, user_argv);
|
||||
}
|
||||
/* Until here */
|
||||
parse_user_conf_file(".saved");
|
||||
parse_user_conf_file(".user");
|
||||
|
||||
fix_options ();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user