aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorneonloop2021-08-12 15:34:52 +0000
committerneonloop2021-08-12 15:34:52 +0000
commit490f17e9bf7940f0e09eac66ff3c5a8d536f3624 (patch)
treeb1ecfd38c9ff6f91b163377b5b8e5298555ee450 /main.c
parent1aff43f93d09b207d97cdf18ccf8d28aedc49158 (diff)
downloadpicoarch-490f17e9bf7940f0e09eac66ff3c5a8d536f3624.tar.gz
picoarch-490f17e9bf7940f0e09eac66ff3c5a8d536f3624.tar.bz2
picoarch-490f17e9bf7940f0e09eac66ff3c5a8d536f3624.zip
Allows deleting game-specific config from menu
Diffstat (limited to 'main.c')
-rw-r--r--main.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/main.c b/main.c
index 9cd0696..b3998db 100644
--- a/main.c
+++ b/main.c
@@ -22,6 +22,7 @@ bool should_quit = false;
unsigned current_audio_buffer_size;
char core_name[MAX_PATH];
char* content_path;
+int config_override = 0;
static uint32_t vsyncs;
static uint32_t renders;
@@ -126,6 +127,10 @@ int save_config(int is_game)
config_write_keys(config_file);
fclose(config_file);
+
+ if (is_game)
+ config_override = 1;
+
return 0;
}
@@ -136,7 +141,9 @@ static void alloc_config_buffer(char **config_ptr) {
config_file_name(config_filename, MAX_PATH, 1);
config_file = fopen(config_filename, "rb");
- if (!config_file) {
+ if (config_file) {
+ config_override = 1;
+ } else {
config_file_name(config_filename, MAX_PATH, 0);
config_file = fopen(config_filename, "rb");
}
@@ -191,6 +198,18 @@ static void load_config_keys(void)
}
}
+int remove_config(int is_game) {
+ char config_filename[MAX_PATH];
+ int ret;
+
+ config_file_name(config_filename, MAX_PATH, is_game);
+ ret = remove(config_filename);
+ if (ret == 0)
+ config_override = 0;
+
+ return ret;
+}
+
void handle_emu_action(emu_action action)
{
static emu_action prev_action = EACTION_NONE;