Page 1 of 1
NDS fatInitDefault() fails 100%
Posted: Sat Oct 10, 2009 6:46 am
by iBite
I've also compiled and tested the examples which also failed. I'm using the latest devkitProUpdater-1.5.0 and PAlib 090801. This was the only combination of libraries I could get to play nice with each other. My R4 card also locks up while inside of fatInitDefault() and iDeaS just returns false. please, someone have an answer for me; this is frustrating when the example code doesn't even work... (running Windows Vista x64 if that makes a difference).
Code: Select all
PA_Init();
PA_InitVBL();
PA_SetLedBlink(0, 0); // Stop led blinking on DS-X
PA_SetAutoCheckLid(false);
// Waits some VBL to fix some compatibility issues with some flashcards
PA_WaitForVBL();
PA_WaitForVBL();
PA_WaitForVBL();
// init libfat EFS
PA_Init8bitBg(0, 0);
PA_SetBgPalCol(0, 1, PA_RGB(31, 31, 31)); // white
centerAlignSmartText(0, 0, 92, 255, 0, "Initializing FAT/EFS, please wait...", 1, 1, 1);
if(!fatInitDefault())
{
PA_Clear8bitBg(0);
centerAlignSmartText(0, 0, 84, 255, 0, "FAT init failed!\n\nMake sure the binary is DLDI-patched.", 1, 1, 1);
while(1) { PA_WaitForVBL(); }
}
Re: NDS fatInitDefault() fails 100%
Posted: Sat Oct 10, 2009 10:29 am
by vuurrobin
have you tried dldi patching your *.nds file? some card firmwares don't do it automaticly.
you could also try a newer/different firmware if that is available.
Re: NDS fatInitDefault() fails 100%
Posted: Sat Oct 10, 2009 12:07 pm
by StevenH
One thing I could sugest - uninstall both the devkit and PALib software, re-install devkit and try the examples again. If your still getting failures at this point I'm not sure what it would be, as I don't use PAlib at all. Also have you asked on the PALib forums as someone on there might have seen this issue in the past.
Re: NDS fatInitDefault() fails 100%
Posted: Tue Oct 13, 2009 4:46 am
by iBite
I have dldi patched it for R4 (which i also changed my emulator settings to load as R4). This only served to now lock up the emulator =).
Fresh install of devkitPro on my Windows x64, using iDeas Emulator, testing all file system examples, failure to initialize... I am running this on my PC from an external USB harddrive; could that be related? The only filesystem example that worked was the one that didn't require the nitrofs; it uses compiled textures. My harddrive is also formatted with NTFS; not a problem i hope.
Re: NDS fatInitDefault() fails 100%
Posted: Tue Oct 13, 2009 8:50 am
by StevenH
iBite wrote:I have dldi patched it for R4 (which i also changed my emulator settings to load as R4). This only served to now lock up the emulator =).
Fresh install of devkitPro on my Windows x64, using iDeas Emulator, testing all file system examples, failure to initialize... I am running this on my PC from an external USB harddrive; could that be related? The only filesystem example that worked was the one that didn't require the nitrofs; it uses compiled textures. My harddrive is also formatted with NTFS; not a problem i hope.
And do the examples work on real hardware? or are you just using an emulator?
If your only using an emulator then you may never get any fat code to work as none of the emulators I've tried has worked when I used fat, the only emulator that sort of works for me is No$ and then only with the nitroFS libfilesystem.
Re: NDS fatInitDefault() fails 100%
Posted: Tue Oct 13, 2009 8:51 am
by vuurrobin
emulators may not handle fat correctly, so always test on hardware.
iBite wrote:The only filesystem example that worked was the one that didn't require the nitrofs;
nitrofs needs the argv and argc variables. your loader may not support those variables (most loaders dont). try using the homebrewmenu in the devkitPro svn, which do support the argv and argc variables.
Re: NDS fatInitDefault() fails 100%
Posted: Wed Oct 14, 2009 4:02 am
by iBite
okay so..
[on hardware]
* libfat fatInitDefault() - Okay
* nitrofs - Failure (even after patching)
[emulator]
* libfat - Failure
* nitrofs - Failure (only worked on no$gba)
Sooo.. Basically the only way to get it to work is; NOT us PAlib, use only libfat, no emulators unless I want to compile all my resources into .c files. Meaning to test every little change I'll have to compile, patch, use my microSD to SD converter to copy the file, put my micro SD into my R4, THEN test it... with no printf or any kind of debugging...
...awesome...
Re: NDS fatInitDefault() fails 100%
Posted: Wed Oct 14, 2009 10:10 am
by StevenH
iBite wrote:okay so..
[on hardware]
* libfat fatInitDefault() - Okay
* nitrofs - Failure (even after patching)
And which method did you use to launch your nitroFS nds file? If you did not use the homebrew launcher then nitrofs will always fail, and I already said that the only emulator that works with nitroFS enabled nds files is no$.
link to the homebrew menu -
http://devkitpro.svn.sourceforge.net/vi ... z?view=tar
One thing about the homebrew menu, this will not work on emulators since it needs a working fat implementation. The reason you need to use this file instead of the launcher that comes with your cart is that the nitro filesystem requires a correctly setup command line, most cart launchers do not have this feature yet, and in the case of the R4 it's doubtfull that it ever will.
Oh and as for the comment about no printf or any kind of debugging, libnds includes a console, that has iprintf (iprintf is an integer only implementation of printf which is perfect for the DS since there is no FPU on the DS) and it's very useful, there is also a guru meditation / crash error report function that I've not played with but it helps alot with finding errors.
And to paraphase WinterMute - There's only one way to test your nds files, and that's on real hardware since emulators do not behave like the real thing.
Re: NDS fatInitDefault() fails 100%
Posted: Wed Oct 14, 2009 12:56 pm
by WinterMute
Just to clarify, iprintf is an integer only version of printf provided by newlib which has no float support, printf will work just fine. iprintf is normally used to avoid linking in floating point libraries that aren't generally needed.