gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > libfat stalling 5 secs trying to mount empty Slot2

#159200 - fluff - Thu Jun 26, 2008 9:20 pm

EDIT: Oh yeah, the issue I'm having is that fatInitDefault() takes about 5 seconds to complete.

Well, I mucked about a bit more and located the stalling lines in libfat.

This is from the libfat 20080530 source.

Code:

disc.c:
const IO_INTERFACE* _FAT_disc_gbaSlotFindInterface (void) {
   [...]
      fluff_debug_libfat2 = 10 + i;   //fluff: stalls for 5 secs with i == 7, i.e. with _io_m3sd
      if ((ioInterfaces[i]->features & FEATURE_SLOT_GBA) && (ioInterfaces[i]->fn_startup())) {


Or, broken down further still:

Code:

io_m3sd.c:
static bool _M3SD_initCard (void) {
   [...]
   if (!_M3SD_sendCommand (GO_IDLE_STATE, 0)) {   //fluff: stalls for ~1.5 seconds
   [...]
   return _SD_InitCard (_M3SD_cmd_6byte_response,
            _M3SD_cmd_17byte_response,
            true,
            &_M3SD_relativeCardAddress);   //fluff: stalls for ~4 seconds
}


My Slot2 is empty for the record. So does this delay happen to everyone or is it somehow a feature of my CycloDS?

I'm also wondering, is there any good reason to keep supporting non-DLDI adapters?

I would very much like to just rip out the M3SD (what's that anyway, all M3 adapters with SD cards?) support in the libfat I'm using... Would that mean trouble for a good portion of the hordes of fans my apps will no doubt receive, or can I do it in good conscience? :)

Commenting out all the Slot2 elements in ioInterfaces gives me a wonderful virtually instantaneous fatInitDefault experience... Plus I shave a chunk off the executable.

#159202 - tepples - Thu Jun 26, 2008 9:27 pm

If you rip out M3SD support, all that means is that users of SLOT-2 M3 cards might need to use DLDI. Big whoop. There are DLDI files for all the cards with built-in drivers. As I understand it, you need to leave in the built-in drivers primarily for programs that can browse files from cards in both slots.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#159203 - fluff - Thu Jun 26, 2008 9:38 pm

Superb. I see on that page there are DLDI drivers for the 2 built-in Slot1 cards as well. I'll happily kill everything non-DLDI then... Thanks!