NDS fatInitDefault() fails 100%

Post Reply
iBite
Posts: 3
Joined: Sat Oct 10, 2009 6:35 am

NDS fatInitDefault() fails 100%

Post by iBite » Sat Oct 10, 2009 6:46 am

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(); }
	}

User avatar
vuurrobin
Posts: 219
Joined: Fri Jul 11, 2008 8:49 pm
Location: The Netherlands
Contact:

Re: NDS fatInitDefault() fails 100%

Post by vuurrobin » Sat Oct 10, 2009 10:29 am

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.

StevenH
Posts: 133
Joined: Sun Feb 22, 2009 7:59 pm

Re: NDS fatInitDefault() fails 100%

Post by StevenH » Sat Oct 10, 2009 12:07 pm

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.

iBite
Posts: 3
Joined: Sat Oct 10, 2009 6:35 am

Re: NDS fatInitDefault() fails 100%

Post by iBite » Tue Oct 13, 2009 4:46 am

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.

StevenH
Posts: 133
Joined: Sun Feb 22, 2009 7:59 pm

Re: NDS fatInitDefault() fails 100%

Post by StevenH » Tue Oct 13, 2009 8:50 am

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.

User avatar
vuurrobin
Posts: 219
Joined: Fri Jul 11, 2008 8:49 pm
Location: The Netherlands
Contact:

Re: NDS fatInitDefault() fails 100%

Post by vuurrobin » Tue Oct 13, 2009 8:51 am

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.

iBite
Posts: 3
Joined: Sat Oct 10, 2009 6:35 am

Re: NDS fatInitDefault() fails 100%

Post by iBite » Wed Oct 14, 2009 4:02 am

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... :roll:

StevenH
Posts: 133
Joined: Sun Feb 22, 2009 7:59 pm

Re: NDS fatInitDefault() fails 100%

Post by StevenH » Wed Oct 14, 2009 10:10 am

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.

WinterMute
Site Admin
Posts: 1856
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: NDS fatInitDefault() fails 100%

Post by WinterMute » Wed Oct 14, 2009 12:56 pm

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.
Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests