ams: use default bct0 by default

This commit is contained in:
Michael Scire 2020-12-18 13:27:52 -08:00
parent 35a6705d55
commit 0bf2ade76f
2 changed files with 15 additions and 14 deletions

View file

@ -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_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_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 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/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/system_settings.ini atmosphere-$(AMSVER)/atmosphere/config_templates/system_settings.ini
cp config_templates/exosphere.ini atmosphere-$(AMSVER)/atmosphere/config_templates/exosphere.ini cp config_templates/exosphere.ini atmosphere-$(AMSVER)/atmosphere/config_templates/exosphere.ini

View file

@ -37,24 +37,25 @@ static char g_bct0_buffer[BCTO_MAX_SIZE];
#define CONFIG_LOG_LEVEL_KEY "log_level" #define CONFIG_LOG_LEVEL_KEY "log_level"
#define DEFAULT_BCT0 \ static const char *get_default_bct0(void) {
"BCT0\n"\ return "BCT0\n"
"[stage1]\n"\ "[stage1]\n"
"stage2_path = atmosphere/fusee-secondary.bin\n"\ "stage2_path = atmosphere/fusee-secondary.bin\n"
"stage2_mtc_path = atmosphere/fusee-mtc.bin\n"\ "stage2_mtc_path = atmosphere/fusee-mtc.bin\n"
"stage2_addr = 0xF0000000\n"\ "stage2_addr = 0xF0000000\n"
"stage2_entrypoint = 0xF0000000\n"\ "stage2_entrypoint = 0xF0000000\n"
"[exosphere]\n"\ "\n"
"debugmode = 1\n"\
"debugmode_user = 0\n"\
"disable_user_exception_handlers = 0\n"\
"[stratosphere]\n" "[stratosphere]\n"
"\n";
}
static const char *load_config(void) { static const char *load_config(void) {
if (!read_from_file(g_bct0_buffer, BCTO_MAX_SIZE, "atmosphere/config/BCT.ini")) { 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, "Failed to read BCT0 from SD!\n");
print(SCREEN_LOG_LEVEL_DEBUG, "Using default BCT0!\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) { if (memcmp(g_bct0_buffer, "BCT0", 4) != 0) {