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.

Coding > Troubleshooting GBA malloc in devkitARM R19

#93589 - wintermute - Thu Jul 20, 2006 12:22 am

tepples wrote:
entilzha wrote:
Hmm, I read somewhere else on the forum that malloc is broken in the latest release (r19) of devkitARM.

Did you read this in the GBA section? The GBA startup code and the Nintendo DS startup code, which set up the heap, have separate bugs.


Would you mind telling me what these bugs are exactly?
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#93637 - delfare - Thu Jul 20, 2006 9:06 am

Quote:

Why are you allocating memory to use as a screen?

I use the 16bit mode of PAlib and I use a buffer to make a double buffering

Quote:

What does PA_RGB do?

PA_RGB create a 16bit color(like RGB15)

Quote:

What does "it bug" mean?

the game stop

Quote:

What are you doing with map1 and map2 later?

I use it to make a bouble buffering and I desalloc with free when I have finished
_________________
If I speak badly, it's because I speak french and I am 15

PA 3d tutorial : http://delfare.pizz.biz

#93709 - tepples - Thu Jul 20, 2006 9:13 pm

wintermute wrote:
tepples wrote:
entilzha wrote:
Hmm, I read somewhere else on the forum that malloc is broken in the latest release (r19) of devkitARM.

Did you read this in the GBA section? The GBA startup code and the Nintendo DS startup code, which set up the heap, have separate bugs.

Would you mind telling me what these bugs are exactly?

The malloc() bug. I was backing you up.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#93722 - wintermute - Thu Jul 20, 2006 9:58 pm

tepples wrote:
The malloc() bug. I was backing you up.


Hmm, you appear to be implying that the GBA startup code and the DS startup code both have their own bugs. FWIW the GBA malloc bug actually has nothing to do with the startup code, I think it may actually be a binutils bug causing the problem.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#93731 - tepples - Thu Jul 20, 2006 10:43 pm

If it is a binutils bug, then why does it affect 256 KiB EWRAM and not 4096 KiB EWRAM?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#93738 - wintermute - Thu Jul 20, 2006 11:00 pm

tepples wrote:
If it is a binutils bug, then why does it affect 256 KiB EWRAM and not 4096 KiB EWRAM?


The DS linker scripts have been adjusted to work around the issue. There are a couple of problematic areas I missed on the GBA, mainly because I rarely, if ever use malloc on GBA.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog