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 > Detecting which flashcard is used

#141559 - Jesse - Wed Sep 26, 2007 10:39 pm

Is there a way to get information about what flashcard is being used from within a program?
_________________
http://www.collectingsmiles.com/colors & http://www.collectingsmiles.com/hyena

#141561 - Lick - Wed Sep 26, 2007 11:23 pm

Use libfat. Rebootlib contains an example piece of code that detects the device.
_________________
http://licklick.wordpress.com

#141562 - Jesse - Wed Sep 26, 2007 11:54 pm

Works like a charm, thanks! Here's the snippet I needed.

Code:
fatInitDefault();
struct stat st;
stat("/.", &st);
iprintf("DeviceID: %.8x\n", int(st.st_dev));

_________________
http://www.collectingsmiles.com/colors & http://www.collectingsmiles.com/hyena