Page 1 of 1

[solved] 4mb limit

Posted: Wed Jun 24, 2009 3:29 am
by spectre1989
Hi all,

I'm aware that our .nds files are limited to 4mb, so if need be we can put all our assets in a folder on the flashcart and load it at runtime, but I had a thought... If pirate roms exist, then it must be possible to package all the assets into our .nds file.

Apologies if this has already been said before, I did try searching, but I had an idea from my Operating System development days. Couldn't we create a .nds file, padd it out with 0s until it's the full 4 megabytes long, and then join on the asset data at the end of the file, then use far pointers to get to the data.

Hmm though that's just made me realise, that wouldn't be possible would it, as only the first 4megs would be stored in memory.. But anyway, you can see the idea forming, is there any way we can break the 4meg limit without loading from folders on the flashcart? Just figure if official roms can run from 1 .nds file, surely there's a way?

Cheers
Spec

Re: 4mb limit

Posted: Wed Jun 24, 2009 5:33 am
by eKid
I think the NitroFS stuff can put things into the .nds file, but I haven't ever used this kind of stuff.

Re: 4mb limit

Posted: Wed Jun 24, 2009 10:30 am
by vuurrobin
there are already some libraries out there that does this. EFS is the most used one (I think), but libfilesystem comes with devkitPro.

Re: 4mb limit

Posted: Wed Jun 24, 2009 4:09 pm
by spectre1989
Thanks for the replies guys, rather relieved that it's already been done! EFS looks like the best bet from what I can see.

Re: 4mb limit

Posted: Wed Jun 24, 2009 4:12 pm
by WinterMute
libfilesystem is the best, EFS is an unsupported 3rd party library.

Re: 4mb limit

Posted: Wed Jun 24, 2009 7:10 pm
by spectre1989
WinterMute wrote:libfilesystem is the best, EFS is an unsupported 3rd party library.
Ah ha, I didn't realise libfilesystem could also break the 4meg limit, for some reason I was under the impression it could only read from files on the flashcart, but checked out the examples and it's awesome!

Re: 4mb limit

Posted: Thu Jun 25, 2009 11:05 pm
by spectre1989
In order to use nitroFS with libfilesystem, am I right in thinking I still need to include the nitroFS header files and link with the nitroFS libs? The only nitro related function I could find in the existing header files was just to init nitroFS, so I'm somewhat at a loss as to how to open a file through nitro..

Cheers
Spec

Re: 4mb limit

Posted: Fri Jun 26, 2009 12:34 pm
by WinterMute
just like fatInitDefault(), everything after nitroFSInit() is just standard file IO.

Re: 4mb limit

Posted: Sat Jun 27, 2009 7:27 am
by Sylus101
spectre1989 wrote:In order to use nitroFS with libfilesystem, am I right in thinking I still need to include the nitroFS header files and link with the nitroFS libs? The only nitro related function I could find in the existing header files was just to init nitroFS, so I'm somewhat at a loss as to how to open a file through nitro..

Cheers
Spec
Just to expand on this a little, libfilesytem IS nitroFS... you don't use nitroFS with libfilesystem. Let me correct myself there, libfilesystem is a modified version of nitroFS. You only need to include the existing header and like WinterMute said, once you init, it's regular file io afterwards.

Re: 4mb limit

Posted: Sat Jun 27, 2009 11:06 pm
by spectre1989
Yeah I got it working, now on my way to my first homebrew, woo!