Page 1 of 1

Using overlays in my program

Posted: Fri Jan 22, 2010 2:27 pm
by Tomdev
Hey everyone,

First I tried to keep my binary small with a plugin loader, but unfortunately it wasn't working really well. I saw somewhere in a post that using overlays is better on the nds, but if I look in the examples folder I don't see an example with overlays. So how can I use overlays in my program? What modifications are needed in the makefile and how do I need to structure my code?

Tomdev

Re: Using overlays in my program

Posted: Fri Jan 22, 2010 6:03 pm
by elhobbs
your questions are non-trivial. if you are using that much code there is not going to be much room for data... why do you think you need to use overlays in the first place?

Re: Using overlays in my program

Posted: Fri Jan 22, 2010 6:47 pm
by Tomdev
I need overlays because I have much code, but not every piece of code is needed at the same time. From what I understood is that you've to load the overlays when you need them.

Tomdev

and sorry for the english...
edit:
I found this post about overlays on gbadev.org:http://forum.gbadev.org/viewtopic.php?t=14707
but the explanation of how to use them was not working for me, when I did what there was said I got the message:

Code: Select all

D:\devkitPro\examples\nds\templates\arm9>make
linking arm9.elf
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.4.2/../../../../arm-eabi/lib/ds
_arm9.ld:204: nonconstant expression for load base
collect2: ld returned 1 exit status
make[1]: *** [/d/devkitPro/examples/nds/templates/arm9/arm9.elf] Error 1
make: *** [build] Error 2
does someone know why, I don't know much about linker script files...