From cd52867c53fcd6e1f89e6359f863803262bce308 Mon Sep 17 00:00:00 2001 From: Shiz Date: Mon, 1 May 2023 10:46:20 +0200 Subject: [PATCH 1/3] imports: add property_node_clone() and property_node_traversal() --- src/imports/import_32_1101_avs.def | 2 ++ src/imports/import_32_1304_avs.def | 2 ++ src/imports/import_32_1403_avs.def | 2 ++ src/imports/import_32_1508_avs.def | 2 ++ src/imports/import_32_1601_avs.def | 2 ++ src/imports/import_32_1603_avs.def | 2 ++ src/imports/import_32_1700_avs.def | 2 ++ src/imports/import_64_1508_avs.def | 2 ++ src/imports/import_64_1509_avs.def | 2 ++ src/imports/import_64_1601_avs.def | 2 ++ src/imports/import_64_1603_avs.def | 2 ++ src/imports/import_64_1700_avs.def | 2 ++ 12 files changed, 24 insertions(+) diff --git a/src/imports/import_32_1101_avs.def b/src/imports/import_32_1101_avs.def index cfc6f9b5..b892c78e 100644 --- a/src/imports/import_32_1101_avs.def +++ b/src/imports/import_32_1101_avs.def @@ -21,6 +21,8 @@ EXPORTS property_node_datasize @267 NONAME property_node_refer @278 NONAME property_node_remove @279 NONAME + property_node_clone @280 NONAME + property_node_traversal @282 NONAME property_psmap_import @288 NONAME property_psmap_export @287 NONAME property_read_query_memsize @291 NONAME diff --git a/src/imports/import_32_1304_avs.def b/src/imports/import_32_1304_avs.def index 489944a7..8f149ae4 100644 --- a/src/imports/import_32_1304_avs.def +++ b/src/imports/import_32_1304_avs.def @@ -21,6 +21,8 @@ EXPORTS property_node_datasize @249 NONAME property_node_refer @268 NONAME property_node_remove @129 NONAME + property_node_clone @130 NONAME + property_node_traversal @132 NONAME property_psmap_import @102 NONAME property_psmap_export @110 NONAME property_read_query_memsize @100 NONAME diff --git a/src/imports/import_32_1403_avs.def b/src/imports/import_32_1403_avs.def index 32d68b11..9a3b7c92 100644 --- a/src/imports/import_32_1403_avs.def +++ b/src/imports/import_32_1403_avs.def @@ -16,6 +16,8 @@ EXPORTS property_destroy @130 NONAME property_insert_read @133 NONAME property_node_remove @148 NONAME + property_node_clone @149 NONAME + property_node_traversal @151 NONAME property_psmap_import @163 NONAME property_psmap_export @164 NONAME property_read_query_memsize @161 NONAME diff --git a/src/imports/import_32_1508_avs.def b/src/imports/import_32_1508_avs.def index 05419ed7..d937da48 100644 --- a/src/imports/import_32_1508_avs.def +++ b/src/imports/import_32_1508_avs.def @@ -24,6 +24,8 @@ EXPORTS property_node_create @145 NONAME property_node_refer @158 NONAME property_node_remove @146 NONAME + property_node_clone @147 NONAME + property_node_traversal @149 NONAME property_psmap_export @162 NONAME property_psmap_import @161 NONAME property_read_query_memsize @159 NONAME diff --git a/src/imports/import_32_1601_avs.def b/src/imports/import_32_1601_avs.def index e260a8c6..f815797a 100644 --- a/src/imports/import_32_1601_avs.def +++ b/src/imports/import_32_1601_avs.def @@ -13,6 +13,8 @@ EXPORTS property_search @141 NONAME property_node_create @142 NONAME property_node_remove @143 NONAME + property_node_clone @144 NONAME + property_node_traversal @146 NONAME property_node_refer @155 NONAME property_read_query_memsize @156 NONAME property_psmap_export @159 NONAME diff --git a/src/imports/import_32_1603_avs.def b/src/imports/import_32_1603_avs.def index 98f5fe7a..dfbc4263 100644 --- a/src/imports/import_32_1603_avs.def +++ b/src/imports/import_32_1603_avs.def @@ -13,6 +13,8 @@ EXPORTS property_search @162 NONAME property_node_create @163 NONAME property_node_remove @164 NONAME + property_node_clone @165 NONAME + property_node_traversal @167 NONAME property_node_refer @176 NONAME property_read_query_memsize @177 NONAME property_psmap_import @179 NONAME diff --git a/src/imports/import_32_1700_avs.def b/src/imports/import_32_1700_avs.def index d8944d9b..0922175a 100644 --- a/src/imports/import_32_1700_avs.def +++ b/src/imports/import_32_1700_avs.def @@ -15,6 +15,8 @@ EXPORTS property_search @162 NONAME property_node_create @163 NONAME property_node_remove @164 NONAME + property_node_clone @165 NONAME + property_node_traversal @167 NONAME property_node_refer @176 NONAME property_read_query_memsize @177 NONAME property_psmap_import @179 NONAME diff --git a/src/imports/import_64_1508_avs.def b/src/imports/import_64_1508_avs.def index bc9fbf06..5e5e2e66 100644 --- a/src/imports/import_64_1508_avs.def +++ b/src/imports/import_64_1508_avs.def @@ -24,6 +24,8 @@ EXPORTS property_node_create @145 NONAME property_node_refer @158 NONAME property_node_remove @146 NONAME + property_node_clone @147 NONAME + property_node_traversal @149 NONAME property_psmap_export @162 NONAME property_psmap_import @161 NONAME property_read_query_memsize @159 NONAME diff --git a/src/imports/import_64_1509_avs.def b/src/imports/import_64_1509_avs.def index ae6110a2..a24c1669 100644 --- a/src/imports/import_64_1509_avs.def +++ b/src/imports/import_64_1509_avs.def @@ -24,6 +24,8 @@ EXPORTS property_node_create @145 NONAME property_node_refer @158 NONAME property_node_remove @146 NONAME + property_node_clone @147 NONAME + property_node_traversal @149 NONAME property_psmap_export @162 NONAME property_psmap_import @161 NONAME property_read_query_memsize @159 NONAME diff --git a/src/imports/import_64_1601_avs.def b/src/imports/import_64_1601_avs.def index 5bbe4528..e337bcc9 100644 --- a/src/imports/import_64_1601_avs.def +++ b/src/imports/import_64_1601_avs.def @@ -13,6 +13,8 @@ EXPORTS property_search @141 NONAME property_node_create @142 NONAME property_node_remove @143 NONAME + property_node_clone @144 NONAME + property_node_traversal @146 NONAME property_node_refer @155 NONAME property_read_query_memsize @156 NONAME property_psmap_export @159 NONAME diff --git a/src/imports/import_64_1603_avs.def b/src/imports/import_64_1603_avs.def index 0355922f..59275628 100644 --- a/src/imports/import_64_1603_avs.def +++ b/src/imports/import_64_1603_avs.def @@ -13,6 +13,8 @@ EXPORTS property_search @162 NONAME property_node_create @163 NONAME property_node_remove @164 NONAME + property_node_clone @165 NONAME + property_node_traversal @167 NONAME property_node_refer @176 NONAME property_read_query_memsize @177 NONAME property_psmap_import @179 NONAME diff --git a/src/imports/import_64_1700_avs.def b/src/imports/import_64_1700_avs.def index fe8cc6e6..68c74e0f 100644 --- a/src/imports/import_64_1700_avs.def +++ b/src/imports/import_64_1700_avs.def @@ -15,6 +15,8 @@ EXPORTS property_search @162 NONAME property_node_create @163 NONAME property_node_remove @164 NONAME + property_node_clone @165 NONAME + property_node_traversal @167 NONAME property_node_refer @176 NONAME property_read_query_memsize @177 NONAME property_psmap_import @179 NONAME From cc73131d53b739809f59166783d1c5669721c473 Mon Sep 17 00:00:00 2001 From: Shiz Date: Mon, 1 May 2023 10:47:23 +0200 Subject: [PATCH 2/3] imports: clarify property_node_clone() prototype --- src/imports/avs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/imports/avs.h b/src/imports/avs.h index ff48a33e..84ecb4cd 100644 --- a/src/imports/avs.h +++ b/src/imports/avs.h @@ -203,8 +203,8 @@ int property_psmap_export( const struct property_psmap *psmap); struct property_node *property_node_clone( - struct property *new_parent, - int unk0, + struct property *parent_prop, + struct property_node *parent_node, struct property_node *src, bool deep); struct property_node *property_node_create( From df882f4cc44a996ffc35f6b1ba0a3f5eb3be9c21 Mon Sep 17 00:00:00 2001 From: Shiz Date: Mon, 1 May 2023 10:47:57 +0200 Subject: [PATCH 3/3] launcher: override ea3 config using ea3-ident.xml --- src/main/launcher/main.c | 17 +++++++++++++++++ src/main/launcher/options.c | 1 + src/main/launcher/options.h | 1 + 3 files changed, 19 insertions(+) diff --git a/src/main/launcher/main.c b/src/main/launcher/main.c index 4d935d78..ef8340e7 100644 --- a/src/main/launcher/main.c +++ b/src/main/launcher/main.c @@ -238,6 +238,23 @@ int main(int argc, const char **argv) log_fatal("%s: /ea3 missing", options.ea3_config_path); } + if (path_exists(options.ea3_ident_path)) { + log_info("%s: loading override", options.ea3_ident_path); + struct property *ea3_ident = boot_property_load(options.ea3_ident_path); + struct property_node *node = + property_search(ea3_ident, NULL, "/ea3_conf"); + if (node == NULL) { + log_fatal("%s: /ea3_conf missing", options.ea3_ident_path); + } + + for (node = property_node_traversal(node, TRAVERSE_FIRST_CHILD); node; + node = property_node_traversal(node, TRAVERSE_NEXT_SIBLING)) { + property_node_clone(NULL, ea3_config_root, node, TRUE); + } + + boot_property_free(ea3_ident); + } + ea3_ident_init(&ea3); if (!ea3_ident_from_property(&ea3, ea3_config)) { diff --git a/src/main/launcher/options.c b/src/main/launcher/options.c index 757555ec..d2467a39 100644 --- a/src/main/launcher/options.c +++ b/src/main/launcher/options.c @@ -19,6 +19,7 @@ void options_init(struct options *options) options->app_config_path = "prop/app-config.xml"; options->avs_config_path = "prop/avs-config.xml"; options->ea3_config_path = "prop/ea3-config.xml"; + options->ea3_ident_path = "prop/ea3-ident.xml"; options->softid = NULL; options->pcbid = NULL; options->module = NULL; diff --git a/src/main/launcher/options.h b/src/main/launcher/options.h index 13f1c0fb..99dd0229 100644 --- a/src/main/launcher/options.h +++ b/src/main/launcher/options.h @@ -12,6 +12,7 @@ struct options { const char *app_config_path; const char *avs_config_path; const char *ea3_config_path; + const char *ea3_ident_path; const char *softid; const char *pcbid; const char *module;