Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
Hi,
I am developping on game boy with GBDK 2.95.3, but I can't find any way to use malloc. Malloc.h has no definition for malloc function, but the function is declared in Malloc.c.
I don't understant what I am supposed to do to use malloc with gbdk.
Anyone has any idea ?
Thanks a lot.
Offline
Given the GB has very little memory, I would discourage the use of malloc altogether.
I never used GBDK, anyways, so I can't help you with that.
Last edited by ISSOtm (2017-12-13 14:33:57)
Offline
I underdstand it, in fact I wish to use malloc to avoid declaring an array of a specific size when I can have a smaller array in some cases. But I think I will change my design and keep some constraints, it will be better for memory space.
Offline
Hell_666 wrote:
I underdstand it, in fact I wish to use malloc to avoid declaring an array of a specific size when I can have a smaller array in some cases. But I think I will change my design and keep some constraints, it will be better for memory space.
I used GBDK a lot, and I ended up using fixed size arrays, anyway it is a GB, and it's better to simplify things a lot, you probably can do without malloc just fine.
Offline
Yes, I have given up and just used a fixed size array. It was for sprite animation, so I decided to force animations to have 2 frames only, it will be enough on Gameboy. Thanks at all for your advices.
Offline