diff options
Diffstat (limited to 'backends/platform/ds/arm9/source/fat/disc_io.c')
-rw-r--r-- | backends/platform/ds/arm9/source/fat/disc_io.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/backends/platform/ds/arm9/source/fat/disc_io.c b/backends/platform/ds/arm9/source/fat/disc_io.c index 69befa09b7..988810073d 100644 --- a/backends/platform/ds/arm9/source/fat/disc_io.c +++ b/backends/platform/ds/arm9/source/fat/disc_io.c @@ -77,6 +77,8 @@ #include "io_mmcf.h" #endif +#include "io_dldi.h" + // Keep a pointer to the active interface LPIO_INTERFACE active_interface = 0; @@ -104,6 +106,8 @@ static struct { u32 count; } cache[ DISC_CACHE_COUNT ]; +FATDevice currentDevice; + static u32 disc_CacheFind(u32 sector) { u32 i; @@ -245,6 +249,7 @@ bool disc_setGbaSlotInterface (void) if (active_interface->fn_StartUp()) { // set M3 SD as default IO + currentDevice = DEVICE_M3SD; return true ; } ; } @@ -259,6 +264,7 @@ bool disc_setGbaSlotInterface (void) if (active_interface->fn_StartUp()) { // set MMCF as default IO + currentDevice = DEVICE_MMCF; return true ; } ; #endif @@ -271,6 +277,7 @@ bool disc_setGbaSlotInterface (void) if (active_interface->fn_StartUp()) { // set M3 CF as default IO + currentDevice = DEVICE_M3CF; return true ; } ; #endif @@ -282,6 +289,7 @@ bool disc_setGbaSlotInterface (void) if (active_interface->fn_StartUp()) { // set GBAMP as default IO + currentDevice = DEVICE_MPCF; return true ; } ; #endif @@ -293,6 +301,7 @@ bool disc_setGbaSlotInterface (void) if (active_interface->fn_StartUp()) { // set SC CF as default IO + currentDevice = DEVICE_SCCF; return true ; } ; #endif @@ -325,6 +334,11 @@ bool disc_setGbaSlotInterface (void) return false; } + +FATDevice disc_getDeviceId() { + return currentDevice; +} + #ifdef NDS // Check the DS card slot for a valid memory card interface // If an interface is found, it is set as the default interace @@ -339,6 +353,16 @@ bool disc_setDsSlotInterface (void) WAIT_CR |= (1<<11); #endif + active_interface = DLDI_GetInterface(); + + if (active_interface->fn_StartUp()) { + consolePrintf("DLDI Driver Initialised OK!\n"); + currentDevice = DEVICE_DLDI; + return true; + } else { + consolePrintf("DLDI Initialise failed.\n"); + } + #ifdef SUPPORT_SCSD // check if we have a SuperCard SD plugged in if (discDetect == 2) { @@ -347,6 +371,7 @@ bool disc_setDsSlotInterface (void) if (active_interface->fn_StartUp()) { // set SC SD as default IO + currentDevice = DEVICE_SCSD; return true ; } ; } @@ -358,6 +383,7 @@ bool disc_setDsSlotInterface (void) if (active_interface->fn_StartUp()) { // set NJSD as default IO + currentDevice = DEVICE_NJSD; return true ; } ; #endif @@ -368,6 +394,7 @@ bool disc_setDsSlotInterface (void) if (active_interface->fn_StartUp()) { // set Neoflash MK2 / MK3 as default IO + currentDevice = DEVICE_NMMC; return true ; } ; #endif |