From 06f46aed760a80d8103afd990a46fc6f5c70f69f Mon Sep 17 00:00:00 2001 From: Robz8 Date: Thu, 4 Oct 2018 21:59:30 -0600 Subject: [PATCH] bug fixes --- arm9/source/driveMenu.cpp | 13 ++++++++++--- arm9/source/driveOperations.cpp | 4 +++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/arm9/source/driveMenu.cpp b/arm9/source/driveMenu.cpp index a178bfb..c6f340e 100644 --- a/arm9/source/driveMenu.cpp +++ b/arm9/source/driveMenu.cpp @@ -42,8 +42,14 @@ void driveMenu (void) { int held = 0; while (true) { - if (isDSiMode() && !pressed) { - flashcardMounted = flashcardMount(); // Try to mount flashcard + if (isDSiMode() && !pressed) { + if (REG_SCFG_MC == 0x11) { + if (flashcardMounted) { + flashcardUnmount(); + } + } else { + flashcardMounted = flashcardMount(); // Try to mount flashcard + } } if (!dmTextPrinted) { @@ -88,7 +94,7 @@ void driveMenu (void) { printf ("\x1b[3;1H"); } printf ("[fat:] GAMECART"); - if (!flashcardFound()) { + if (!flashcardMounted) { iprintf ("\x1b[%i;29H", 2+isDSiMode()); printf ("[x]"); } @@ -111,6 +117,7 @@ void driveMenu (void) { swiWaitForVBlank(); if (REG_SCFG_MC != dm_SCFG_MC) { + dmTextPrinted = false; break; } } while (!(pressed & KEY_UP) && !(pressed & KEY_DOWN) && !(pressed & KEY_A) && !(held & KEY_R)); diff --git a/arm9/source/driveOperations.cpp b/arm9/source/driveOperations.cpp index 0d5ea30..bf2241e 100644 --- a/arm9/source/driveOperations.cpp +++ b/arm9/source/driveOperations.cpp @@ -107,6 +107,8 @@ void ShowGameInfo(const char gameid[], const char gamename[]) { bool flashcardMount(void) { if (flashcardFound()) { return true; + } else if (!isDSiMode()) { + return fatMountSimple("fat", &io_dldi_data->ioInterface); } else if (REG_SCFG_MC != 0x11) { // Reset Slot-1 to allow reading title name and ID sysSetCardOwner (BUS_OWNER_ARM9); @@ -147,8 +149,8 @@ bool flashcardMount(void) { io_dldi_data = dldiLoadFromBin(ak2_sd_bin); return fatMountSimple("fat", &io_dldi_data->ioInterface); } - return false; } + return false; } void flashcardUnmount(void) {