Mercurial > repos > blastem
comparison 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 |
comparison
equal
deleted
inserted
replaced
2017:8e7b06ade815 | 2018:193b804c9845 |
---|---|
296 void persist_config(tern_node *config) | 296 void persist_config(tern_node *config) |
297 { | 297 { |
298 persist_config_at(config, config, "blastem.cfg"); | 298 persist_config_at(config, config, "blastem.cfg"); |
299 } | 299 } |
300 | 300 |
301 void delete_custom_config_at(char *fname) | |
302 { | |
303 char *confpath = path_append(get_exe_dir(), fname); | |
304 delete_file(confpath); | |
305 free(confpath); | |
306 confpath = path_append(get_config_dir(), fname); | |
307 delete_file(confpath); | |
308 free(confpath); | |
309 } | |
310 | |
311 void delete_custom_config(void) | |
312 { | |
313 delete_custom_config_at("blastem.cfg"); | |
314 } | |
315 | |
301 char **get_extension_list(tern_node *config, uint32_t *num_exts_out) | 316 char **get_extension_list(tern_node *config, uint32_t *num_exts_out) |
302 { | 317 { |
303 char *ext_filter = strdup(tern_find_path_default(config, "ui\0extensions\0", (tern_val){.ptrval = "bin gen md smd sms gg"}, TVAL_PTR).ptrval); | 318 char *ext_filter = strdup(tern_find_path_default(config, "ui\0extensions\0", (tern_val){.ptrval = "bin gen md smd sms gg"}, TVAL_PTR).ptrval); |
304 uint32_t num_exts = 0, ext_storage = 5; | 319 uint32_t num_exts = 0, ext_storage = 5; |
305 char **ext_list = malloc(sizeof(char *) * ext_storage); | 320 char **ext_list = malloc(sizeof(char *) * ext_storage); |