From a643526781a7a85fd240d709c1879350123405b2 Mon Sep 17 00:00:00 2001 From: ChampionLeake Date: Tue, 16 Oct 2018 20:02:07 -0400 Subject: [PATCH] Bootable .dsi files (#7) * Update file_browse.cpp Added ".dsi" extensions to the entry list. * Update main.cpp Booting ".dsi" files are possible. --- arm9/source/file_browse.cpp | 2 ++ arm9/source/main.cpp | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/arm9/source/file_browse.cpp b/arm9/source/file_browse.cpp index 11117eb..c5243ee 100644 --- a/arm9/source/file_browse.cpp +++ b/arm9/source/file_browse.cpp @@ -109,6 +109,8 @@ void getDirectoryContents (vector& dirContents) { || (dirEntry.name.substr(dirEntry.name.find_last_of(".") + 1) == "NDS") || (dirEntry.name.substr(dirEntry.name.find_last_of(".") + 1) == "argv") || (dirEntry.name.substr(dirEntry.name.find_last_of(".") + 1) == "ARGV") + || (dirEntry.name.substr(dirEntry.name.find_last_of(".") + 1) == "dsi") + || (dirEntry.name.substr(dirEntry.name.find_last_of(".") + 1) == "DSI") || (isDSiMode() && is3DS && sdMounted && dirEntry.name.substr(dirEntry.name.find_last_of(".") + 1) == "firm") || (isDSiMode() && is3DS && sdMounted && dirEntry.name.substr(dirEntry.name.find_last_of(".") + 1) == "FIRM")) { diff --git a/arm9/source/main.cpp b/arm9/source/main.cpp index ed196b6..109fc92 100644 --- a/arm9/source/main.cpp +++ b/arm9/source/main.cpp @@ -193,7 +193,17 @@ int main(int argc, char **argv) { } else { argarray.push_back(strdup(filename.c_str())); } - + if ((strcasecmp (filename.c_str() + filename.size() - 4, ".dsi") == 0) + || (strcasecmp (filename.c_str() + filename.size() - 4, ".DSI") == 0)) { + char *name = argarray.at(0); + strcpy (filePath + pathLen, name); + free(argarray.at(0)); + argarray.at(0) = filePath; + consoleClear(); + iprintf ("Running %s with %d parameters\n", argarray[0], argarray.size()); + int err = runNdsFile (argarray[0], argarray.size(), (const char **)&argarray[0]); + iprintf ("\x1b[31mStart failed. Error %i\n", err); + } if ((strcasecmp (filename.c_str() + filename.size() - 4, ".nds") == 0) || (strcasecmp (filename.c_str() + filename.size() - 4, ".NDS") == 0)) { char *name = argarray.at(0);