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) {