(GX) save input binds (per core)

This commit is contained in:
Toad King 2012-08-21 00:51:00 -04:00
parent 14af5ca589
commit dc0b44d2f3
3 changed files with 11 additions and 1 deletions

View File

@ -23,7 +23,7 @@
#ifndef IS_SALAMANDER
static void rarch_console_name_from_id(char *name, size_t size)
void rarch_console_name_from_id(char *name, size_t size)
{
if (size == 0)
return;

View File

@ -27,6 +27,8 @@ enum
#endif
};
void rarch_console_name_from_id(char *name, size_t size);
//We need to set libretro to the first entry in the cores
//directory so that it will be saved to the config file
void rarch_manage_libretro_set_first_file(char *first_file, size_t size_of_first_file, const char *libretro_path, const char * exe_ext);

View File

@ -382,6 +382,13 @@ int main(void)
rarch_settings_set_default(&input_gx);
rarch_config_load(default_paths.config_file, path_prefix, extension, find_libretro_file);
char core_name[64];
rarch_console_name_from_id(core_name, sizeof(core_name));
char input_path[1024];
snprintf(input_path, sizeof(input_path), "%s/%s.cfg", default_paths.input_presets_dir, core_name);
config_read_keybinds(input_path);
init_libretro_sym();
input_gx.post_init();
@ -436,6 +443,7 @@ begin_shutdown:
if(g_console.return_to_launcher)
rarch_console_exec(g_console.launch_app_on_exit);
config_save_keybinds(input_path);
return 1;
}