Skip to content
This repository was archived by the owner on Nov 11, 2024. It is now read-only.

Commit b745052

Browse files
fincsWinterMute
authored andcommitted
Avoid using DSi SD interface in NDS mode
1 parent 78ca2bd commit b745052

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

source/disc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@ const INTERFACE_ID _FAT_disc_interfaces[] = {
8686

8787
/* ====================== NDS ====================== */
8888
#elif defined (NDS)
89+
#include <nds/system.h>
8990
#include <nds/arm9/dldi.h>
9091

9192
static const DISC_INTERFACE* get_io_dsisd (void) {
92-
return &__io_dsisd;
93+
return isDSiMode() ? &__io_dsisd : NULL;
9394
}
9495

9596
const INTERFACE_ID _FAT_disc_interfaces[] = {

source/libfat.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ bool fatInit (uint32_t cacheSize, bool setAsDefaultDevice) {
154154
i++)
155155
{
156156
disc = _FAT_disc_interfaces[i].getInterface();
157+
if (!disc) {
158+
continue;
159+
}
157160
if (fatMount (_FAT_disc_interfaces[i].name, disc, 0, cacheSize, DEFAULT_SECTORS_PAGE)) {
158161
// The first device to successfully mount is set as the default
159162
if (defaultDevice < 0) {

0 commit comments

Comments
 (0)