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 > how to use LibFat ?

#137906 - jonnyhilly - Fri Aug 17, 2007 9:03 am

ok, so Ive been using gbfs, but by data is too big so I need to switch to LibFAT.
Seemed easy enough at first...
add the lib file to the makefile,
LIBS := -lfat -lnds9
include the .h file
#include <fat.h>
and call fatInitDefault()

except that fatInitDefault() always returns false.

I cant find any decent instructions on what might cause the error, or how to setup your files if you are using an emulator or ROM.

I still have some files pachaged with gbfs

I am currently running on no$ emulator.
but also plan to put my code onto a rom.

1) so why does fatInitDefault fail ?

2) for emulator use... Do I just put my files into a folder on the PC which is a sub folder of where the .NDS file is ?

3) for using from a rom, do I have to batch the files together or something, or can I just duplicate the pc folder structure.

4) or is there a doc somewhere that describes all this and more ?

any help greatly appreciated, thanks

#137908 - Diddl - Fri Aug 17, 2007 10:15 am

libfat isn't made for use in an emulator. for such the emulator must offer an libfat interface accessable with a dldi or any similar way.


libfat access mass storage of a flashcard. most slot 2 flashcards are supported. for slot 1 flashcards you need to patch the nds file fith an dldi for this card.

#137910 - PypeBros - Fri Aug 17, 2007 10:36 am

Diddl wrote:
libfat isn't made for use in an emulator. for such the emulator must offer an libfat interface accessable with a dldi or any similar way.


libfat access mass storage of a flashcard. most slot 2 flashcards are supported. for slot 1 flashcards you need to patch the nds file fith an dldi for this card.


Alternatively, i'd say an emulator that e.g. simulates the SuperCard or the GBAMP hardware will do the trick (maybe you'll have to dldi-patch the .nds file for that hardware first). Afaik, the latest builds of desmume for windows might have such flashcart device support, but since i'm a linux-guy, i can't tell for sure.
_________________
SEDS: Sprite Edition on DS :: modplayer

#137924 - ThousandKnives - Fri Aug 17, 2007 4:01 pm

Diddl wrote:
libfat access mass storage of a flashcard. most slot 2 flashcards are supported. for slot 1 flashcards you need to patch the nds file fith an dldi for this card.

Dldi patching isn't necessarily required anymore. I didn't have to do any when I started using libfat.

#137933 - M3d10n - Fri Aug 17, 2007 6:00 pm

Download dldirc and use it to patch your rom with the FCSR dldi driver. It'll build a new rom with an appended filesystem for you, which is compatible with No$GBA.

#137935 - Lino - Fri Aug 17, 2007 6:38 pm

you can use iDeaS it has the support for the DLDI R4DS.