Mercurial > repos > blastem
diff config.c @ 1900:93960907807a
Added UI for selecting configured model
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 16 Feb 2020 10:33:20 -0800 |
parents | a4cae960fd08 |
children | 5433252329fb |
line wrap: on
line diff
--- a/config.c Sun Feb 02 22:38:49 2020 -0800 +++ b/config.c Sun Feb 16 10:33:20 2020 -0800 @@ -322,3 +322,18 @@ char * lowpass_cutoff_str = tern_find_path(config, "audio\0lowpass_cutoff\0", TVAL_PTR).ptrval; return lowpass_cutoff_str ? atoi(lowpass_cutoff_str) : DEFAULT_LOWPASS_CUTOFF; } + +tern_node *get_systems_config(void) +{ + static tern_node *systems; + if (!systems) { + systems = parse_bundled_config("systems.cfg"); + } + return systems; +} + +tern_node *get_model(tern_node *config, system_type stype) +{ + char *model = tern_find_path_default(config, "system\0model\0", (tern_val){.ptrval = "md1va3"}, TVAL_PTR); + return tern_find_node(get_systems_config(), model); +}