Mercurial > repos > blastem
comparison config.c @ 2238:0a107b2d5837
Add support for EA 4-way Play
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 17 Sep 2022 18:29:24 -0700 |
parents | 93918a6a8ab7 |
children | 0d1d5dccdd28 |
comparison
equal
deleted
inserted
replaced
2237:f82c090c1e89 | 2238:0a107b2d5837 |
---|---|
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 4 | 288 #define CONFIG_VERSION 5 |
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 { |
349 config = tern_insert_path(config, "io\0sega_multitap.1\0""1\0", (tern_val){.ptrval = strdup(tap11)}, TVAL_PTR); | 349 config = tern_insert_path(config, "io\0sega_multitap.1\0""1\0", (tern_val){.ptrval = strdup(tap11)}, TVAL_PTR); |
350 config = tern_insert_path(config, "io\0sega_multitap.1\0""2\0", (tern_val){.ptrval = strdup(tap12)}, TVAL_PTR); | 350 config = tern_insert_path(config, "io\0sega_multitap.1\0""2\0", (tern_val){.ptrval = strdup(tap12)}, TVAL_PTR); |
351 config = tern_insert_path(config, "io\0sega_multitap.1\0""3\0", (tern_val){.ptrval = strdup(tap13)}, TVAL_PTR); | 351 config = tern_insert_path(config, "io\0sega_multitap.1\0""3\0", (tern_val){.ptrval = strdup(tap13)}, TVAL_PTR); |
352 config = tern_insert_path(config, "io\0sega_multitap.1\0""4\0", (tern_val){.ptrval = strdup(tap14)}, TVAL_PTR); | 352 config = tern_insert_path(config, "io\0sega_multitap.1\0""4\0", (tern_val){.ptrval = strdup(tap14)}, TVAL_PTR); |
353 } | 353 } |
354 case 4: { | |
355 char *tap11 = tern_find_path_default(config, "io\0ea_multitap\0""1\0", (tern_val){.ptrval = "gamepad6.1"}, TVAL_PTR).ptrval; | |
356 char *tap12 = tern_find_path_default(config, "io\0ea_multitap\0""2\0", (tern_val){.ptrval = "gamepad6.2"}, TVAL_PTR).ptrval; | |
357 char *tap13 = tern_find_path_default(config, "io\0ea_multitap\0""3\0", (tern_val){.ptrval = "gamepad6.3"}, TVAL_PTR).ptrval; | |
358 char *tap14 = tern_find_path_default(config, "io\0ea_multitap\0""4\0", (tern_val){.ptrval = "gamepad6.4"}, TVAL_PTR).ptrval; | |
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); | |
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); | |
363 } | |
354 } | 364 } |
355 char buffer[16]; | 365 char buffer[16]; |
356 sprintf(buffer, "%d", CONFIG_VERSION); | 366 sprintf(buffer, "%d", CONFIG_VERSION); |
357 return tern_insert_ptr(config, "version", strdup(buffer)); | 367 return tern_insert_ptr(config, "version", strdup(buffer)); |
358 } | 368 } |