From bd99826bb24c59a5c85fe5c63e40764d744a85db Mon Sep 17 00:00:00 2001 From: Reisen Usagi Date: Thu, 9 Jun 2016 15:50:07 -0300 Subject: [PATCH 1/2] Fix SMDH Header being cleared And erasing the Magic in the process --- source/cmd.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/cmd.cpp b/source/cmd.cpp index 540ee7d..bba237a 100644 --- a/source/cmd.cpp +++ b/source/cmd.cpp @@ -441,7 +441,13 @@ int cmd_process_command(int argc, char* argv[]) { } SMDH smdh; - memset(&smdh, 0, sizeof(SMDH)); + + // Are These really needed? The values are coded in 3ds/smdh.h + // So remove them if unnecessary + memset(&smdh.titles, 0, sizeof(SMDHTitle) * 0x10); + memset(&smdh.settings, 0, sizeof(SMDHSettings)); + memset(&smdh.smallIcon, 0, 0x480); + memset(&smdh.largeIcon, 0, 0x1200); std::vector regions = cmd_parse_list(cmd_find_arg(args, "r", "regions", "regionfree")); for(std::vector::iterator it = regions.begin(); it != regions.end(); it++) { @@ -536,4 +542,4 @@ int cmd_process_command(int argc, char* argv[]) { cmd_invalid_command(command); return -1; } -} \ No newline at end of file +} From ddc126e9b9833e4687b12191747931bd45000db2 Mon Sep 17 00:00:00 2001 From: Reisen Usagi Date: Fri, 10 Jun 2016 13:21:56 -0300 Subject: [PATCH 2/2] Removed Unnecessary memsets --- source/cmd.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/source/cmd.cpp b/source/cmd.cpp index bba237a..44d1baa 100644 --- a/source/cmd.cpp +++ b/source/cmd.cpp @@ -442,13 +442,6 @@ int cmd_process_command(int argc, char* argv[]) { SMDH smdh; - // Are These really needed? The values are coded in 3ds/smdh.h - // So remove them if unnecessary - memset(&smdh.titles, 0, sizeof(SMDHTitle) * 0x10); - memset(&smdh.settings, 0, sizeof(SMDHSettings)); - memset(&smdh.smallIcon, 0, 0x480); - memset(&smdh.largeIcon, 0, 0x1200); - std::vector regions = cmd_parse_list(cmd_find_arg(args, "r", "regions", "regionfree")); for(std::vector::iterator it = regions.begin(); it != regions.end(); it++) { const std::string region = *it;