DSi/3DS: Properly unmount SD card

This commit is contained in:
RocketRobz 2020-02-17 01:12:44 -07:00
parent 50b41435f4
commit 2011b83be9

View File

@ -371,25 +371,18 @@ void driveMenu (void) {
dmTextPrinted = false; dmTextPrinted = false;
if (isDSiMode() && sdMountedDone) { if (isDSiMode() && sdMountedDone) {
if (sdMounted) { if (sdMounted) {
if (currentDrive == 0) { currentDrive = 0;
sdUnmount(); chdir("sd:/");
} else { sdUnmount();
consoleSelect(&bottomConsole);
consoleClear();
printf ("\x1B[47m"); // Print foreground white color
printf ("Please open and exit SDCARD\n");
printf ("before unmounting.\n");
for (int i = 0; i < 60*2; i++) {
swiWaitForVBlank();
}
}
} else if (isRegularDS) { } else if (isRegularDS) {
sdMounted = sdMount(); sdMounted = sdMount();
} }
} else { } else {
if (flashcardMounted && currentDrive == 1) { if (flashcardMounted) {
currentDrive = 1;
chdir("fat:/");
flashcardUnmount(); flashcardUnmount();
} else if (!flashcardMounted) { } else {
flashcardMounted = flashcardMount(); flashcardMounted = flashcardMount();
} }
} }