Mercurial > repos > blastem
diff config.c @ 2018:193b804c9845
Add a UI button to reset config to defaults
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 09 Nov 2020 00:29:47 -0800 |
parents | 5433252329fb |
children | bdd83b47d78a |
line wrap: on
line diff
--- a/config.c Sat Nov 07 18:27:34 2020 -0800 +++ b/config.c Mon Nov 09 00:29:47 2020 -0800 @@ -298,6 +298,21 @@ persist_config_at(config, config, "blastem.cfg"); } +void delete_custom_config_at(char *fname) +{ + char *confpath = path_append(get_exe_dir(), fname); + delete_file(confpath); + free(confpath); + confpath = path_append(get_config_dir(), fname); + delete_file(confpath); + free(confpath); +} + +void delete_custom_config(void) +{ + delete_custom_config_at("blastem.cfg"); +} + char **get_extension_list(tern_node *config, uint32_t *num_exts_out) { char *ext_filter = strdup(tern_find_path_default(config, "ui\0extensions\0", (tern_val){.ptrval = "bin gen md smd sms gg"}, TVAL_PTR).ptrval);