Bootable .dsi files (#7)

* Update file_browse.cpp

Added ".dsi" extensions to the entry list.

* Update main.cpp

Booting ".dsi" files are possible.
This commit is contained in:
ChampionLeake 2018-10-16 20:02:07 -04:00 committed by RocketRobz
parent 4028963b72
commit a643526781
2 changed files with 13 additions and 1 deletions

View File

@ -109,6 +109,8 @@ void getDirectoryContents (vector<DirEntry>& 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"))
{

View File

@ -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);