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 with an emulator

#129423 - snowsquirrel - Tue May 22, 2007 7:21 pm

I have a game which I use libfat and fcsr image. Is no$gba the only emulator that will run it? Dualis, Desmume, etc, all seem to crash. They did not crash before I started using libfat.
~S

#129435 - Abcd1234 - Tue May 22, 2007 8:50 pm

Odds are the application has a bug in it. In contrast, I've used FCSR with desmume for my own projects, and it works just fine, and should work on any emulator.

#129438 - snowsquirrel - Tue May 22, 2007 9:26 pm

I have also tried with a main.cpp, and nothing else. It fails if I run the initFatDefault().

As long as I know it should work, I'll try a newer version of libfat...

#129470 - dantheman - Wed May 23, 2007 2:22 am

DS emulators are far from perfect. The only ones I know of that have support for FAT code at all are Dualis with its GBAMP emulation and Desmume with its recently added support for libfat, probably through GBAMP emulation (search through the posts here, as it was announced on GBAdev somewhere).

FCSR would probably be your best bet for testing libfat on an emulator, but like you discovered in the other thread, for usage on a real homebrew device you want to just patch the regular application with DLDI and launch it, putting the other necessary files on your media card, as FCSR won't work on your slot-1 device.

#129476 - snowsquirrel - Wed May 23, 2007 3:37 am

I am an idiot. I was trying to run the .gba.ds. Using the .nds got things working with libfat.

#129480 - tepples - Wed May 23, 2007 5:17 am

dantheman wrote:
DS emulators are far from perfect. The only ones I know of that have support for FAT code at all are Dualis with its GBAMP emulation

Which version of Dualis handles fatInitDefault() of the version of libfat distributed with devkitARM R20 without crashing?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#129483 - dantheman - Wed May 23, 2007 6:03 am

I'm honestly not sure. It was my understanding that they just kinda hacked GBAMP code in there, and for all I know it was before libfat even became that popular. I really don't use the emulator that much at all, and all I know is that the last few versions (last updated May 2006) had some form of code for GBAMP emulation. I got it to work with PocketSPC at least, but that's all I tried.

#129520 - snowsquirrel - Wed May 23, 2007 1:26 pm

yeah, I can't seem to get it to work with any slot 1 emulator. I just use the slot 2 rom with no$gba, and the slot 1 rom with the ds hardware. I have a nice little Rakefile which handles all this, so I am happy.

~S

#129526 - silent_code - Wed May 23, 2007 3:20 pm

how do you create the fat12 image? i can't get it working. it'll always create a 10kb file, refusing to add any files from the specified folder.

thanks for helping.

#129528 - snowsquirrel - Wed May 23, 2007 3:31 pm

What platform are you on? I am on window, and found the build.bat to be somewhat flaky, so I rewrote it using a ruby script. I'll post the ruby script if you want.

The min size is 1000bytes, as if it is any smaller, it does not seem to work. The script just checks the size, of all your files, and if the total size is smaller than 10000, it pads it to 10000.

What do you mean, it refuses your files? Post the output of the command.

#129535 - silent_code - Wed May 23, 2007 4:21 pm

yeah, i'm on win(xp), too.
unfortunately i can't post anything today. i'll try tomorrow.
the point is, that it says it can't find or add whatever file. that may be because of the build.bat, i really can't tell. what would i need to run a ruby script? i guess some interpreter... but i'd better like to not install any additional software, just to build that file. :^\

#129536 - snowsquirrel - Wed May 23, 2007 4:27 pm

yeah, you would need the ruby interpreter. but if you post your output of the build.bat, I may be able to help you, as I ran into some trouble with the package too before I got it to work.

~S

#129644 - silent_code - Thu May 24, 2007 5:12 pm

check out http://forum.gbadev.org/viewtopic.php?p=129645#129645
problem is probably solved.

#129720 - hedgehog - Fri May 25, 2007 4:43 pm

That should solve the problem:

Quote from:
http://forum.gbadev.org/viewtopic.php?t=12292&postdays=0&postorder=asc&start=45

I'm german and tried fcsrimage before but couldn't create an image due to an imagesize problem (just manually had to change the imagesize with corrections on:

if /I %size% LSS 10000 ( set /A size="10000" )

You are using the same build.bat. Looking into the output of dir /w /s /-c I've found a general solution. Its a simple language problem.
For german users it must be changed:
replace:
for /f "tokens=3,4*" %%a in ( 'dir /w /s /-C %2 ^| findstr "File(s)"') do @set info=%%a
with:
for /f "tokens=3,4*" %%a in ( 'dir /w /s /-C %2 ^| findstr "Datei(en)"') do @set info=%%a
That's the line checking for the filesize of the image.



You're right, I didn't notice that the batch file was based on the english output :/
I edited it right now, now doesn't depend on language anymore:

for /f "tokens=3,4*" %%a in ( 'dir /w /s /-C %2 ^| tail -n 2 ^| head -n 1') do @set info=%%a

#129729 - silent_code - Fri May 25, 2007 5:51 pm

ah, that's a good one. :^) vielen dank! ;^D