From b7450524b18118df693870f64242cabf5d62234b Mon Sep 17 00:00:00 2001 From: fincs Date: Sun, 15 Jan 2017 13:33:28 +0100 Subject: [PATCH] Avoid using DSi SD interface in NDS mode --- source/disc.c | 3 ++- source/libfat.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/disc.c b/source/disc.c index 5f626b6..d27da2a 100755 --- a/source/disc.c +++ b/source/disc.c @@ -86,10 +86,11 @@ const INTERFACE_ID _FAT_disc_interfaces[] = { /* ====================== NDS ====================== */ #elif defined (NDS) +#include #include static const DISC_INTERFACE* get_io_dsisd (void) { - return &__io_dsisd; + return isDSiMode() ? &__io_dsisd : NULL; } const INTERFACE_ID _FAT_disc_interfaces[] = { diff --git a/source/libfat.c b/source/libfat.c index 4c9a3b9..4d323ca 100644 --- a/source/libfat.c +++ b/source/libfat.c @@ -154,6 +154,9 @@ bool fatInit (uint32_t cacheSize, bool setAsDefaultDevice) { i++) { disc = _FAT_disc_interfaces[i].getInterface(); + if (!disc) { + continue; + } if (fatMount (_FAT_disc_interfaces[i].name, disc, 0, cacheSize, DEFAULT_SECTORS_PAGE)) { // The first device to successfully mount is set as the default if (defaultDevice < 0) {