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 difference between No$Gba and actual DS [solved]

#159295 - doudou - Sat Jun 28, 2008 9:15 pm

My rom crashes on my DS when I use libfat for resources packaging but it's fine in No$Gba.

Is libfat meant to be used in the same way on device and emulator?

(I use DS one card in case it would have something to do with it).


Last edited by doudou on Sat Jul 05, 2008 7:13 pm; edited 1 time in total

#159296 - elhobbs - Sat Jun 28, 2008 9:33 pm

the emulators tend to be more forgiving when it come to access violations. you may have to resort to print statements and infite loops to halt the program at various stages to locate the error. you might want to give desmume a try as you can attach a debugger to it. I have used insight (comes with devkitarm) and it works quite nicely. if you can setup your project to cross build for the DS and Windows then that is even better as you have much better debugging tools like visual studio express.

oh yeah, to answer your actual question - it depends on how you are trying to access data. are you trying to read the fat file system on the flash card or are you using something like FCSR (which I think the data is attached to the binary)? if you are trying to access the files through the fat file system then you need to make sure you are using the correct dldi driver.


Last edited by elhobbs on Sat Jun 28, 2008 9:36 pm; edited 1 time in total

#159297 - silent_code - Sat Jun 28, 2008 9:33 pm

What type of card is the DS one?

libfat should work with any DLDI-able card, but shouldn't work with no$gba (which version are you using?) - emulators and older GBA NOR cartridges are mostly supported via FCSR.

An alternative to the "pure" libfat are EFS2.0 by Noda and NitroFS by eris. Those should work with any device, as well as with emulators. Another bonus is that they append the files to the .nds, so you only have one file (just like with FCSR, but with different reasons.)

I don't know how both libraries handle external files, which is important for development, as you don't want to write a big ROM file to your card every time you need to test a new version. This is even more true when sending the .nds over WiFi.

But I'm sure that both libraries have some sort of support for those cases.

Have a nice day! :^)
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#159620 - doudou - Thu Jul 03, 2008 1:48 am

The DS one : http://eng.supercard.cn/manual/dsone/

Libfat does work with no$gba 2.5c, but I have to DLDI patch my rom.

Quote:
Another bonus is that they append the files to the .nds


Maybe that's what I misunderstood: I thought I would only have the .nds file with libfat, as for commercial roms.

#159621 - doudou - Thu Jul 03, 2008 2:03 am

I now isolated my problem to the following that fails (returns false):

Code:
fatInitDefault()


Does anyone knows what I have to look for?

#159657 - doudou - Thu Jul 03, 2008 7:02 pm

Do we need a specific DLDI version depending on the hardware (flash card) we use? And do we have something else than the .nds to upload on the cart?

#159663 - silent_code - Thu Jul 03, 2008 9:22 pm

Yes, each card provides its own DLDI "driver".
Most modern cards auto patch ROMs (I'm talking about homebrew, which are also ROM images... ;^) ), but some older ones need manual patching via one of the available console or GUI tools.
Visit chishm's official DLDI page for more information.
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#159738 - doudou - Sat Jul 05, 2008 7:12 pm

Ok, with scds2.dldi it's now fine, thanks!