[solved] 4mb limit

Post Reply
spectre1989
Posts: 24
Joined: Tue Jun 23, 2009 7:19 pm

[solved] 4mb limit

Post by spectre1989 » Wed Jun 24, 2009 3:29 am

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
Last edited by spectre1989 on Sat Jun 27, 2009 11:07 pm, edited 1 time in total.

eKid
Posts: 65
Joined: Sat Dec 06, 2008 6:07 pm
Contact:

Re: 4mb limit

Post by eKid » Wed Jun 24, 2009 5:33 am

I think the NitroFS stuff can put things into the .nds file, but I haven't ever used this kind of stuff.

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

Re: 4mb limit

Post by vuurrobin » Wed Jun 24, 2009 10:30 am

there are already some libraries out there that does this. EFS is the most used one (I think), but libfilesystem comes with devkitPro.

spectre1989
Posts: 24
Joined: Tue Jun 23, 2009 7:19 pm

Re: 4mb limit

Post by spectre1989 » Wed Jun 24, 2009 4:09 pm

Thanks for the replies guys, rather relieved that it's already been done! EFS looks like the best bet from what I can see.

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

Re: 4mb limit

Post by WinterMute » Wed Jun 24, 2009 4:12 pm

libfilesystem is the best, EFS is an unsupported 3rd party library.
Help keep devkitPro toolchains free, Donate today

Personal Blog

spectre1989
Posts: 24
Joined: Tue Jun 23, 2009 7:19 pm

Re: 4mb limit

Post by spectre1989 » Wed Jun 24, 2009 7:10 pm

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!

spectre1989
Posts: 24
Joined: Tue Jun 23, 2009 7:19 pm

Re: 4mb limit

Post by spectre1989 » Thu Jun 25, 2009 11:05 pm

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

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

Re: 4mb limit

Post by WinterMute » Fri Jun 26, 2009 12:34 pm

just like fatInitDefault(), everything after nitroFSInit() is just standard file IO.
Help keep devkitPro toolchains free, Donate today

Personal Blog

Sylus101
Posts: 179
Joined: Wed Dec 24, 2008 5:08 am

Re: 4mb limit

Post by Sylus101 » Sat Jun 27, 2009 7:27 am

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.
-Sylus "Not Stylus..." McFrederickson

Come visit my web site.

spectre1989
Posts: 24
Joined: Tue Jun 23, 2009 7:19 pm

Re: 4mb limit

Post by spectre1989 » Sat Jun 27, 2009 11:06 pm

Yeah I got it working, now on my way to my first homebrew, woo!

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests