diff config.c @ 2162:1270fe86eb89

Add Quick Load binding
author Michael Pavone <pavone@retrodev.com>
date Thu, 09 Jun 2022 09:35:38 -0700
parents bdd83b47d78a
children ee6d30c56eeb
line wrap: on
line diff
--- a/config.c	Tue May 24 18:49:38 2022 -0700
+++ b/config.c	Thu Jun 09 09:35:38 2022 -0700
@@ -285,7 +285,7 @@
 	*pads = tern_insert_node(*pads, key, dupe_tree(val.ptrval));
 }
 
-#define CONFIG_VERSION 1
+#define CONFIG_VERSION 2
 static tern_node *migrate_config(tern_node *config, int from_version)
 {
 	tern_node *def_config = parse_bundled_config("default.cfg");
@@ -326,6 +326,13 @@
 		config = tern_insert_path(config, "bindings\0pads\0", (tern_val){.ptrval = pads}, TVAL_NODE);
 		break;
 	}
+	case 1: {
+		char *l_bind = tern_find_path(config, "bindings\0keys\0l\0", TVAL_PTR).ptrval;
+		if (!l_bind) {
+			config = tern_insert_path(config, "bindings\0keys\0l\0", (tern_val){.ptrval = strdup("ui.load_state")}, TVAL_PTR);
+		}
+		break;
+	}
 	}
 	char buffer[16];
 	sprintf(buffer, "%d", CONFIG_VERSION);