From 0bf2ade76f263f79fe7c497296c26de4022e5935 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Fri, 18 Dec 2020 13:27:52 -0800 Subject: [PATCH] ams: use default bct0 by default --- Makefile | 2 +- fusee/fusee-primary/src/main.c | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index bf8a9d9c3..ff76ab2d2 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ dist-no-debug: all cp sept/sept-secondary/sept-secondary_01.enc atmosphere-$(AMSVER)/sept/sept-secondary_01.enc cp sept/sept-secondary/sept-secondary_dev_00.enc atmosphere-$(AMSVER)/sept/sept-secondary_dev_00.enc cp sept/sept-secondary/sept-secondary_dev_01.enc atmosphere-$(AMSVER)/sept/sept-secondary_dev_01.enc - cp config_templates/BCT.ini atmosphere-$(AMSVER)/atmosphere/config/BCT.ini + cp config_templates/BCT.ini atmosphere-$(AMSVER)/atmosphere/config_templates/BCT.ini cp config_templates/override_config.ini atmosphere-$(AMSVER)/atmosphere/config_templates/override_config.ini cp config_templates/system_settings.ini atmosphere-$(AMSVER)/atmosphere/config_templates/system_settings.ini cp config_templates/exosphere.ini atmosphere-$(AMSVER)/atmosphere/config_templates/exosphere.ini diff --git a/fusee/fusee-primary/src/main.c b/fusee/fusee-primary/src/main.c index 3e3808209..427f4a042 100644 --- a/fusee/fusee-primary/src/main.c +++ b/fusee/fusee-primary/src/main.c @@ -37,24 +37,25 @@ static char g_bct0_buffer[BCTO_MAX_SIZE]; #define CONFIG_LOG_LEVEL_KEY "log_level" -#define DEFAULT_BCT0 \ -"BCT0\n"\ -"[stage1]\n"\ -"stage2_path = atmosphere/fusee-secondary.bin\n"\ -"stage2_mtc_path = atmosphere/fusee-mtc.bin\n"\ -"stage2_addr = 0xF0000000\n"\ -"stage2_entrypoint = 0xF0000000\n"\ -"[exosphere]\n"\ -"debugmode = 1\n"\ -"debugmode_user = 0\n"\ -"disable_user_exception_handlers = 0\n"\ -"[stratosphere]\n" +static const char *get_default_bct0(void) { + return "BCT0\n" + "[stage1]\n" + "stage2_path = atmosphere/fusee-secondary.bin\n" + "stage2_mtc_path = atmosphere/fusee-mtc.bin\n" + "stage2_addr = 0xF0000000\n" + "stage2_entrypoint = 0xF0000000\n" + "\n" + "[stratosphere]\n" + "\n"; +} static const char *load_config(void) { if (!read_from_file(g_bct0_buffer, BCTO_MAX_SIZE, "atmosphere/config/BCT.ini")) { print(SCREEN_LOG_LEVEL_DEBUG, "Failed to read BCT0 from SD!\n"); print(SCREEN_LOG_LEVEL_DEBUG, "Using default BCT0!\n"); - memcpy(g_bct0_buffer, DEFAULT_BCT0, sizeof(DEFAULT_BCT0)); + + const char * const default_bct0 = get_default_bct0(); + memcpy(g_bct0_buffer, default_bct0, strlen(default_bct0)); } if (memcmp(g_bct0_buffer, "BCT0", 4) != 0) {