From 2011b83be942bb4bd44b82eceefe20d2c38f65ba Mon Sep 17 00:00:00 2001 From: RocketRobz Date: Mon, 17 Feb 2020 01:12:44 -0700 Subject: [PATCH] DSi/3DS: Properly unmount SD card --- arm9/source/driveMenu.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/arm9/source/driveMenu.cpp b/arm9/source/driveMenu.cpp index cf0ac87..5a58a8f 100644 --- a/arm9/source/driveMenu.cpp +++ b/arm9/source/driveMenu.cpp @@ -371,25 +371,18 @@ void driveMenu (void) { dmTextPrinted = false; if (isDSiMode() && sdMountedDone) { if (sdMounted) { - if (currentDrive == 0) { - sdUnmount(); - } else { - 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(); - } - } + currentDrive = 0; + chdir("sd:/"); + sdUnmount(); } else if (isRegularDS) { sdMounted = sdMount(); } } else { - if (flashcardMounted && currentDrive == 1) { + if (flashcardMounted) { + currentDrive = 1; + chdir("fat:/"); flashcardUnmount(); - } else if (!flashcardMounted) { + } else { flashcardMounted = flashcardMount(); } }