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.

Beginners > WRAM and loading Background/Collision Data.

#34809 - Celeryface - Wed Jan 26, 2005 5:13 pm

I want to load my background and collision layer data into WRAM. Each file is 67kb (there are 2), and I want to copy the data into WRAM so that I can alter the data after a collision with the player.

Is there a way to see how much WRAM I've used from mallocs and from what the linker script has put in it, and how much is available?

For reference: I use the Visual HAM installation with my own headers (not HAMlib).

:)

#34822 - tepples - Wed Jan 26, 2005 6:57 pm

When you link your app, you get a .elf file. List the symbols in the .elf file with
Code:
nm -n balloon.elf > map.txt

Open map.txt and look at the area around 0x02040000 to get an idea of how much EWRAM the linkscript has assigned.

Following a malloc() arena is a bit tougher; because I typically roll my own allocation systems, I haven't looked into it.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#34827 - Celeryface - Wed Jan 26, 2005 8:41 pm

tepples wrote:
When you link your app, you get a .elf file. List the symbols in the .elf file with
Code:
nm -n balloon.elf > map.txt



Which does nm do, I've never used it before? :)

#34836 - tepples - Thu Jan 27, 2005 12:03 am

nm manpage:

http://m68hc11.serveftp.org/doc/binutils_2.html
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.