From f5f7616f5730c58f8edc995a185f219cfab5e5eb Mon Sep 17 00:00:00 2001 From: Sorgelig Date: Mon, 18 Jul 2022 01:08:52 +0800 Subject: [PATCH] x86: respect setname in config name. --- support/x86/x86.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/support/x86/x86.cpp b/support/x86/x86.cpp index c76af68..d6e5625 100644 --- a/support/x86/x86.cpp +++ b/support/x86/x86.cpp @@ -527,17 +527,25 @@ void x86_set_image(int num, char *filename) else if (ide_is_placeholder(num - 2)) hdd_set(num - 2, filename); } +static char* get_config_name() +{ + static char str[256]; + snprintf(str, sizeof(str), "%ssys.cfg", user_io_get_core_name()); + return str; +} + + void x86_config_save() { config.ver = CFG_VER; - FileSaveConfig("ao486sys.cfg", &config, sizeof(config)); + FileSaveConfig(get_config_name(), &config, sizeof(config)); } void x86_config_load() { static x86_config tmp; memset(&config, 0, sizeof(config)); - if (FileLoadConfig("ao486sys.cfg", &tmp, sizeof(tmp)) && (tmp.ver == CFG_VER)) + if (FileLoadConfig(get_config_name(), &tmp, sizeof(tmp)) && (tmp.ver == CFG_VER)) { memcpy(&config, &tmp, sizeof(config)); }