From e2b1743064d8ca9fd48496efa174489475625afc Mon Sep 17 00:00:00 2001 From: RocketRobz Date: Thu, 11 Oct 2018 19:24:47 -0600 Subject: [PATCH] Only run fatInitDefault if arm7 SCFG is locked --- arm9/source/driveOperations.cpp | 3 ++- arm9/source/main.cpp | 4 +++- arm9/source/main.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arm9/source/driveOperations.cpp b/arm9/source/driveOperations.cpp index bb3d40b..596b4d6 100644 --- a/arm9/source/driveOperations.cpp +++ b/arm9/source/driveOperations.cpp @@ -4,6 +4,7 @@ #include #include +#include "main.h" #include "dldi-include.h" static sNDSHeader nds; @@ -200,7 +201,7 @@ bool flashcardMount(void) { fatGetVolumeLabel("fat", fatLabel); fixLabel(true); return true; - } else if (!sdMountedDone) { + } else if ((!isDSiMode()) || (arm7SCFGLocked && !sdMountedDone)) { fatInitDefault(); if (flashcardFound()) { fatGetVolumeLabel("fat", fatLabel); diff --git a/arm9/source/main.cpp b/arm9/source/main.cpp index 28e35aa..042aaa4 100644 --- a/arm9/source/main.cpp +++ b/arm9/source/main.cpp @@ -40,6 +40,7 @@ char titleName[32] = {" "}; int screenMode = 0; +bool arm7SCFGLocked = false; bool isRegularDS = true; bool is3DS = true; @@ -114,6 +115,7 @@ int main(int argc, char **argv) { } fifoWaitValue32(FIFO_USER_06); + if (fifoGetValue32(FIFO_USER_03) == 0) arm7SCFGLocked = true; u16 arm7_SNDEXCNT = fifoGetValue32(FIFO_USER_07); if (arm7_SNDEXCNT != 0) isRegularDS = false; // If sound frequency setting is found, then the console is not a DS Phat/Lite fifoSendValue32(FIFO_USER_07, 0); @@ -134,7 +136,7 @@ int main(int argc, char **argv) { } sdMounted = sdMount(); } - if (!sdMounted || (access("sd:/Nintendo 3DS", F_OK) != 0)) { + if (!isDSiMode() || !sdMounted || (access("sd:/Nintendo 3DS", F_OK) != 0)) { is3DS = false; } if (!isDSiMode() || !yHeld) { diff --git a/arm9/source/main.h b/arm9/source/main.h index a7b1334..2a4a8b4 100644 --- a/arm9/source/main.h +++ b/arm9/source/main.h @@ -8,6 +8,7 @@ extern char titleName[32]; extern int screenMode; +extern bool arm7SCFGLocked; extern bool isRegularDS; extern bool is3DS;