From c305f4347dfa5fe5026afbbe6cf29896b07bb6d0 Mon Sep 17 00:00:00 2001 From: Themaister Date: Thu, 12 Jan 2012 22:53:14 +0100 Subject: [PATCH] Add g_console struct. --- general.h | 12 ++++++++++++ settings.c | 14 +++++++++++--- ssnes.c | 1 - 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/general.h b/general.h index 2d9eee2cce..b325f2e6b9 100644 --- a/general.h +++ b/general.h @@ -166,6 +166,14 @@ struct settings bool savestate_auto_index; }; +// Settings and/or global state that is specific to a console-style implementation. +#if defined(__CELLOS_LV2__) || defined(_XBOX) || defined(XENON) || defined(GEKKO) +struct console_settings +{ + bool block_config_read; +}; +#endif + enum ssnes_game_type { SSNES_CART_NORMAL = 0, @@ -348,9 +356,13 @@ struct global }; void parse_config(void); +void config_set_defaults(void); extern struct settings g_settings; extern struct global g_extern; +#if defined(__CELLOS_LV2__) || defined(_XBOX) || defined(XENON) || defined(GEKKO) +extern struct console_settings g_console; +#endif #define SSNES_LOG(...) do { \ if (g_extern.verbose) \ diff --git a/settings.c b/settings.c index d1988b3259..749da3d51d 100644 --- a/settings.c +++ b/settings.c @@ -31,12 +31,15 @@ struct settings g_settings; struct global g_extern; +#if defined(__CELLOS_LV2__) || defined(_XBOX) || defined(XENON) || defined(GEKKO) +struct console_settings g_console; +#endif #ifdef HAVE_CONFIGFILE static void read_keybinds(config_file_t *conf); #endif -static void set_defaults(void) +void config_set_defaults(void) { const char *def_video = NULL; const char *def_audio = NULL; @@ -224,11 +227,16 @@ static void parse_config_file(void); void parse_config(void) { - set_defaults(); +#if defined(__CELLOS_LV2__) || defined(_XBOX) || defined(XENON) || defined(GEKKO) + if (!g_console.block_config_read) +#endif + { + config_set_defaults(); #ifdef HAVE_CONFIGFILE - parse_config_file(); + parse_config_file(); #endif + } } #ifdef HAVE_CONFIGFILE diff --git a/ssnes.c b/ssnes.c index b0bc0f55dc..2f2293e840 100644 --- a/ssnes.c +++ b/ssnes.c @@ -2210,4 +2210,3 @@ error: return 1; } -