Mercurial > repos > blastem
comparison config.c @ 2243:0d1d5dccdd28
Initial implementation of oscilloscope debug view
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 22 Nov 2022 17:57:02 -0800 |
parents | 0a107b2d5837 |
children | 62f316b76e9a |
comparison
equal
deleted
inserted
replaced
2240:8e8db9141209 | 2243:0d1d5dccdd28 |
---|---|
283 return; | 283 return; |
284 } | 284 } |
285 *pads = tern_insert_node(*pads, key, dupe_tree(val.ptrval)); | 285 *pads = tern_insert_node(*pads, key, dupe_tree(val.ptrval)); |
286 } | 286 } |
287 | 287 |
288 #define CONFIG_VERSION 5 | 288 #define CONFIG_VERSION 6 |
289 static tern_node *migrate_config(tern_node *config, int from_version) | 289 static tern_node *migrate_config(tern_node *config, int from_version) |
290 { | 290 { |
291 tern_node *def_config = parse_bundled_config("default.cfg"); | 291 tern_node *def_config = parse_bundled_config("default.cfg"); |
292 switch(from_version) | 292 switch(from_version) |
293 { | 293 { |
359 config = tern_insert_path(config, "io\0ea_multitap\0""1\0", (tern_val){.ptrval = strdup(tap11)}, TVAL_PTR); | 359 config = tern_insert_path(config, "io\0ea_multitap\0""1\0", (tern_val){.ptrval = strdup(tap11)}, TVAL_PTR); |
360 config = tern_insert_path(config, "io\0ea_multitap\0""2\0", (tern_val){.ptrval = strdup(tap12)}, TVAL_PTR); | 360 config = tern_insert_path(config, "io\0ea_multitap\0""2\0", (tern_val){.ptrval = strdup(tap12)}, TVAL_PTR); |
361 config = tern_insert_path(config, "io\0ea_multitap\0""3\0", (tern_val){.ptrval = strdup(tap13)}, TVAL_PTR); | 361 config = tern_insert_path(config, "io\0ea_multitap\0""3\0", (tern_val){.ptrval = strdup(tap13)}, TVAL_PTR); |
362 config = tern_insert_path(config, "io\0ea_multitap\0""4\0", (tern_val){.ptrval = strdup(tap14)}, TVAL_PTR); | 362 config = tern_insert_path(config, "io\0ea_multitap\0""4\0", (tern_val){.ptrval = strdup(tap14)}, TVAL_PTR); |
363 } | 363 } |
364 case 5: { | |
365 char *binding_o = tern_find_path_default(config, "bindings\0keys\0o\0", (tern_val){.ptrval = "ui.oscilloscope"}, TVAL_PTR).ptrval; | |
366 config = tern_insert_path(config, "bindings\0keys\0o\0", (tern_val){.ptrval = strdup(binding_o)}, TVAL_PTR); | |
367 } | |
364 } | 368 } |
365 char buffer[16]; | 369 char buffer[16]; |
366 sprintf(buffer, "%d", CONFIG_VERSION); | 370 sprintf(buffer, "%d", CONFIG_VERSION); |
367 return tern_insert_ptr(config, "version", strdup(buffer)); | 371 return tern_insert_ptr(config, "version", strdup(buffer)); |
368 } | 372 } |