What's the correct method to switch to 8mb heap

support for the ARM toolchain
Post Reply
Peter
Posts: 6
Joined: Fri Apr 10, 2009 9:03 am
Contact:

What's the correct method to switch to 8mb heap

Post by Peter » Wed Sep 02, 2009 11:00 am

What is the official devkitARM method to switch heap memory to 8mb when creating applications for the nintendo ds? So far, I just modified the ewram constant in devkitPro\devkitARM\arm-eabi\lib\ds_arm9.ld, but I wonder if there is a makefile switch that I'm missing and if this has any unexpected side-effects when I just change this value (haven't noticed anything yet though)?

I guess it would even more useful when the 4mb debug memory would reside in a seperate section, so you can specify __attribute__'s to explictly move debug-only buffers in to this section.

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

Re: What's the correct method to switch to 8mb heap

Post by vuurrobin » Wed Sep 02, 2009 10:15 pm

a normal nintendo ds only has 4 mb (and the dsi has 16mb, but its currently not easy to run code in dsi mode).

although I do vaguely remember that debug versions of the ds hardware has an extra 4mb for debug purposes, but that is only for officiel developers.

could you tell some more about what you're doing and what kind of hardware you're using (asuming its hardware you want to use).

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

Re: What's the correct method to switch to 8mb heap

Post by WinterMute » Thu Sep 03, 2009 1:56 am

I'd need a bit more information on what you're doing. Since you specify 8MiB I'd assume you're working with a debug system? Is this for official code or did you just manage to get one to play with?

There are quite a few changes in the crt0 and libnds that would be required to support 8MiB, I'm currently in the process of making similar changes for DSi support. Essentially we need the crt0 to detect the presence of extra RAM and adjust the mpu setup plus the end of heap address.
Help keep devkitPro toolchains free, Donate today

Personal Blog

Peter
Posts: 6
Joined: Fri Apr 10, 2009 9:03 am
Contact:

Re: What's the correct method to switch to 8mb heap

Post by Peter » Thu Sep 03, 2009 8:05 am

WinterMute wrote:I'd need a bit more information on what you're doing.
I want to have extra space for title specific data, debug data and code. With title specific resources I refer to e.g. memory tracking stats, debug font resources, additional debug information in game assets and code that is available in development builds only.

It also allows me to see how many bytes the title is above the 4mb limit, rather than just getting out-of-mem and halt. Being able to see that game world 5 allocates 10kb more than it should, but still runs, makes development more comfortable. The programmer is not necessarily the one who tweaks assets, when another person tweaks assets and the game crashes afterwards, because it's a few kb too large, makes this process more time consuming than necessary, not to mention additional support requests to the programming team.
WinterMute wrote: Since you specify 8MiB I'd assume you're working with a debug system?
Just no$gba.
WinterMute wrote: I'm currently in the process of making similar changes for DSi support. Essentially we need the crt0 to detect the presence of extra RAM and adjust the mpu setup plus the end of heap address.
If this detection code could also handle whether IsDebugger returns 1 would be great. no$gba emulates this SWI instruction.

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

Re: What's the correct method to switch to 8mb heap

Post by WinterMute » Sat Dec 05, 2009 10:01 pm

Sorry for taking so long over the release. devkitARM r27 + libnds 1.4.0 now handles 8meg quite happily :)

http://forums.devkitpro.org/viewtopic.php?p=3658#p3658
Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest