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.

Coding > libfat for use on the GBA

#130543 - norfair - Tue Jun 05, 2007 2:34 am

Hello!

I'm trying to build software for an oldschool system called the GBA :)

I want to use libfat in my project. My problem lies here:

I only have an M3 perfect lite (micro SD) and an NDS lite to test.

Is it possible to use libfat on the M3 lite within GBA mode? Or will it only work from NDS mode?

I tried a basic program but the console seems to hang on fatInitDefault();

If it doesn't work, what would be a good compatible gba flash cart to use libfat with? There is alot of NDS information around, but very little GBA info that I could find.

Thanks in advance (no pun intended)

-Norfair

#130545 - tepples - Tue Jun 05, 2007 3:20 am

Libfat works in GBA mode if your DLDI works. Some SLOT-2 DLDIs should work from GBA mode, even though Chishm's official DLDI tester does not support GBA mode.

Have you tried compiling your GBA program as multiboot? I don't know whether libfat works when executing from ROM in SLOT-2 while accessing a card in SLOT-2, and I don't know whether the available DLDIs handle this situation. All I have is a GBAMP, which requires multiboot programs.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#130546 - norfair - Tue Jun 05, 2007 3:29 am

Thank you for the quick reply Tepples.

I just rebuilt my basic program as a multiboot, patched it, and it worked first try!

Now I pretty much only need to work with multiboot restrictions in size >_>

I'm guessing the alternative solution that would work in all cases is using GBFS huh? :)

#130547 - Dwedit - Tue Jun 05, 2007 3:58 am

It's possible to make the filesystem code run from iwram/ewram, then have wrapper functions for the filesystem code to switch the M3 from 32MB RAM mode to filesystem mode, and back again, but that stuff is cartridge specific.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#130605 - tepples - Tue Jun 05, 2007 8:01 pm

Dwedit wrote:
that stuff is cartridge specific.

Then why doesn't the DLDI already handle it while it's handling everything else that's cartridge specific? Is it because there is no DLDI tester that runs in GBA mode?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.