This commit is contained in:
RocketRobz 2018-10-07 12:28:55 -06:00
parent 2edfa7faab
commit 93cfb60710
2 changed files with 14 additions and 10 deletions

View File

@ -32,7 +32,7 @@ bool flashcardFound(void) {
} }
bool bothSDandFlashcard(void) { bool bothSDandFlashcard(void) {
if ((access("sd:/", F_OK) == 0) && (access("fat:/", F_OK) == 0)) { if (sdMounted && flashcardMounted) {
return true; return true;
} else { } else {
return false; return false;

View File

@ -152,15 +152,13 @@ void showDirectoryContents (const vector<DirEntry>& dirContents, int startRow) {
} }
} }
int fileBrowse_A(DirEntry* entry) { int fileBrowse_A(DirEntry* entry, char path[PATH_MAX]) {
int pressed = 0; int pressed = 0;
int assignedOp[3] = {0}; int assignedOp[3] = {0};
int optionOffset = 0; int optionOffset = 0;
int cursorScreenPos = 0; int cursorScreenPos = 0;
int maxCursors = -1; int maxCursors = -1;
char path[PATH_MAX];
getcwd(path, PATH_MAX);
printf ("\x1b[0;27H"); printf ("\x1b[0;27H");
printf (" "); // Clear time printf (" "); // Clear time
consoleInit(NULL, 1, BgType_Text4bpp, BgSize_T_256x256, 15, 0, false, true); consoleInit(NULL, 1, BgType_Text4bpp, BgSize_T_256x256, 15, 0, false, true);
@ -426,12 +424,18 @@ string browseForFile (void) {
screenOffset = 0; screenOffset = 0;
fileOffset = 0; fileOffset = 0;
} else { } else {
int getOp = fileBrowse_A(entry); char path[PATH_MAX];
if (getOp == 0) { getcwd(path, PATH_MAX);
// Return the chosen file if (bothSDandFlashcard() || entry->isApp
return entry->name; || strcmp (path, (secondaryDrive ? "fat:/gm9i/out/" : "sd:/gm9i/out/")) != 0)
} else if (getOp == 1 || getOp == 2) { {
getDirectoryContents (dirContents); // Refresh directory listing int getOp = fileBrowse_A(entry, path);
if (getOp == 0) {
// Return the chosen file
return entry->name;
} else if (getOp == 1 || getOp == 2) {
getDirectoryContents (dirContents); // Refresh directory listing
}
} }
} }
} }