From 6f4cb98033cc3e726383b1c28e4a14f017366b47 Mon Sep 17 00:00:00 2001 From: Pablo Curiel Date: Wed, 14 Oct 2020 19:08:01 -0400 Subject: [PATCH] Cleanup startup logfile messages. --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- code_templates/system_title_dumper.c | 3 --- code_templates/usb_gc_dumper.c | 3 --- code_templates/usb_romfs_dumper.c | 3 --- code_templates/xml_generator.c | 3 --- source/utils.c | 12 ++++++++++-- 6 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 26b155e..ca8eed8 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -22,7 +22,7 @@ Steps to reproduce the behavior: - CFW: [e.g. Atmosphère, SX OS, etc.] - CFW version: [e.g. 0.11.1, 2.9.4, etc.] - Atmosphère launch method (if applicable): [e.g. Hekate, fusee-primary] -- NXDumpTool version: [e.g. 1.2.0] +- nxdumptool version: [e.g. 2.0.0] - Homebrew launch method: [e.g. title override, applet] - Source storage used with the application (if applicable): [e.g. gamecard, SD/eMMC] - SD card specs: [e.g. Samsung EVO 256 GB, FAT32 partition] diff --git a/code_templates/system_title_dumper.c b/code_templates/system_title_dumper.c index 085821e..84053a6 100644 --- a/code_templates/system_title_dumper.c +++ b/code_templates/system_title_dumper.c @@ -225,9 +225,6 @@ int main(int argc, char *argv[]) int ret = 0; - utilsWriteLogBufferToLogFile("________________________________________________________________\r\n"); - LOGFILE(APP_TITLE " starting."); - consoleInit(NULL); consolePrint("initializing...\n"); diff --git a/code_templates/usb_gc_dumper.c b/code_templates/usb_gc_dumper.c index f77b9f4..0a15f80 100644 --- a/code_templates/usb_gc_dumper.c +++ b/code_templates/usb_gc_dumper.c @@ -188,9 +188,6 @@ int main(int argc, char *argv[]) Menu *cur_menu = &g_rootMenu; u32 element_count = menuGetElementCount(cur_menu), page_size = 30; - utilsWriteLogBufferToLogFile("________________________________________________________________\r\n"); - LOGFILE(APP_TITLE " starting."); - consoleInit(NULL); consolePrint("initializing...\n"); diff --git a/code_templates/usb_romfs_dumper.c b/code_templates/usb_romfs_dumper.c index 453b275..d08c1c0 100644 --- a/code_templates/usb_romfs_dumper.c +++ b/code_templates/usb_romfs_dumper.c @@ -306,9 +306,6 @@ int main(int argc, char *argv[]) int ret = 0; - utilsWriteLogBufferToLogFile("________________________________________________________________\r\n"); - LOGFILE(APP_TITLE " starting."); - consoleInit(NULL); consolePrint("initializing...\n"); diff --git a/code_templates/xml_generator.c b/code_templates/xml_generator.c index b835f00..11415e9 100644 --- a/code_templates/xml_generator.c +++ b/code_templates/xml_generator.c @@ -53,9 +53,6 @@ int main(int argc, char *argv[]) int ret = 0; - utilsWriteLogBufferToLogFile("________________________________________________________________\r\n"); - LOGFILE(APP_TITLE " starting."); - consoleInit(NULL); consolePrint("initializing...\n"); diff --git a/source/utils.c b/source/utils.c index 71e7acf..3dbbc0c 100644 --- a/source/utils.c +++ b/source/utils.c @@ -78,8 +78,16 @@ bool utilsInitializeResources(void) bool ret = g_resourcesInitialized; if (ret) goto end; + utilsWriteLogBufferToLogFile("________________________________________________________________\r\n"); + LOGFILE(APP_TITLE " v%u.%u.%u starting.", VERSION_MAJOR, VERSION_MINOR, VERSION_MICRO); + + /* Log Horizon OS version. */ + u32 hos_version = hosversionGet(); + LOGFILE("Horizon OS version: %u.%u.%u.", HOSVER_MAJOR(hos_version), HOSVER_MINOR(hos_version), HOSVER_MICRO(hos_version)); + /* Retrieve custom firmware type. */ if (!_utilsGetCustomFirmwareType()) goto end; + LOGFILE("Detected %s CFW.", (g_customFirmwareType == UtilsCustomFirmwareType_Atmosphere ? "Atmosphere" : (g_customFirmwareType == UtilsCustomFirmwareType_SXOS ? "SX OS" : "ReiNX"))); /* Initialize needed services. */ if (!servicesInitialize()) @@ -90,6 +98,7 @@ bool utilsInitializeResources(void) /* Check if we're not running under a development unit. */ if (!_utilsIsDevelopmentUnit()) goto end; + LOGFILE("Running under %s unit.", g_isDevUnit ? "development" : "retail"); /* Initialize USB interface. */ if (!usbInitialize()) @@ -145,6 +154,7 @@ bool utilsInitializeResources(void) /* Get applet type. */ g_programAppletType = appletGetAppletType(); + LOGFILE("Running under %s mode.", utilsAppletModeCheck() ? "applet" : "title override"); /* Disable screen dimming and auto sleep. */ appletSetMediaPlaybackState(true); @@ -741,7 +751,6 @@ static bool _utilsGetCustomFirmwareType(void) /* Finally, determine the CFW type. */ g_customFirmwareType = (rnx_srv ? UtilsCustomFirmwareType_ReiNX : (tx_srv ? UtilsCustomFirmwareType_SXOS : UtilsCustomFirmwareType_Atmosphere)); - LOGFILE("Detected %s CFW.", (g_customFirmwareType == UtilsCustomFirmwareType_Atmosphere ? "Atmosphere" : (g_customFirmwareType == UtilsCustomFirmwareType_SXOS ? "SX OS" : "ReiNX"))); return true; } @@ -755,7 +764,6 @@ static bool _utilsIsDevelopmentUnit(void) if (R_SUCCEEDED(rc)) { g_isDevUnit = tmp; - LOGFILE("Running under %s unit.", g_isDevUnit ? "development" : "retail"); } else { LOGFILE("splIsDevelopment failed! (0x%08X).", rc); }