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.

ASM > Maximum non-efs file size

#170808 - Flash - Wed Oct 21, 2009 1:58 pm

Just curious what the maximum filesize is for an .nds to be able to execute?

I have been coding Manic Miner the Lost Levels and the file reached 2.81 megs and now fails to run on a DSTT. The game runs fine on R4's AK2i, etc. And the game ran fine on DSTT prior to breaking 2.8m. On a DSTT it now opens and presents 2 black screens.

Is there something I may be missing here?

With Warhawk DS, I felt sure it was when we reached 3.8m that we needed to use EFS to enable execution?

#170809 - elhobbs - Wed Oct 21, 2009 2:52 pm

You cannot go by the nds size alone. The bss section(non initialized or zero initialized data) does not take space in the nds file. You need to use arm-eabi-size on the arm9 elf file. It will show how much memory is used by the nds file. The nds has 4mb of memory. Some of the libnds libraries use malloc plus you may want to use it yourself so you need toleave a little room after the nds file is loaded.

#170812 - headspin - Wed Oct 21, 2009 3:34 pm

This particular project is written in 100% assembler so libnds is not used and the only lib's linked in are xm7 and zlib. No dynamic memory is allocated by the game itself.

Here is the output for the arm-eabi-size on the arm9 elf

Code:
   text    data     bss     dec     hex filename
2754044  172920      92 2927056  2ca9d0 ManicMinerLL.arm9.elf


It doesn't seem right that going over 2.8 MB fails on the DSTT card. Could the loader possibly be taking that much memory? When people say "4 MB" of memory it doesn't take into account card loaders and things like Moonshell. So I guess the question is what is the maximum amount of RAM you should aim for when developing a game that will have the widest compatibility with all flash cards and loaders?

The next step is to look at EFS/libfat but surely you can get a ROM around 3.5 MB before it starts causing problems.
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game


Last edited by headspin on Wed Oct 21, 2009 4:15 pm; edited 1 time in total

#170813 - kusma - Wed Oct 21, 2009 3:37 pm

headspin wrote:
It doesn't seem right that going over 2.8 MB fails on the DSTT card. Could the loader possibly be taking that much memory? When people say "4 MB" of memory it doesn't take into account card loaders and things like Moonshell

I thought the loaders were put in VRAM to be able to load the entire memory without getting in the way...

#170841 - sverx - Thu Oct 22, 2009 8:51 am

Flash wrote:
the file reached 2.81 megs and now fails to run on a DSTT. The game runs fine on R4's AK2i, etc. And the game ran fine on DSTT prior to breaking 2.8m. On a DSTT it now opens and presents 2 black screens.


Try to remove some XMs from the build, until the .NDS it goes under 2.8MB, and check again. If it works I guess it means that DSTT has a limitation (maybe there's a firmware upgrade... did you check that?) and if it doesn't work it means there's something else in your code that DSTT doesn't like...

#170845 - spacefractal - Thu Oct 22, 2009 9:01 pm

This game does not use libnds.....

I donno if The Detective Game have same problem which is now over 2.81mb?

I gonna think EFS is needed to move the XM modules away from memory again, just like you did for Warkhawk?

There is 1MB XM total from the 35 songs I created, so it should been pretty save to create a EPS version?

PS. Im are the musican of this game, and not a coder.

#170858 - headspin - Fri Oct 23, 2009 10:03 pm

sverx wrote:
Try to remove some XMs from the build, until the .NDS it goes under 2.8MB, and check again. If it works I guess it means that DSTT has a limitation (maybe there's a firmware upgrade... did you check that?) and if it doesn't work it means there's something else in your code that DSTT doesn't like...


According to the Stu who is testing MMLL on DSTT he has the latest firmware version (1.17).

So what I've proposed to Flash is to add some fake space to the game to take it up to ~3.5MB and test it on R4 and Acekard. If it works on those then I would suggest not to worry about trying to keep the binary below 2.7MB for the DSTT. It could actually be a bug exposed by this particular card too.
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game