News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Arnaud

Specify address for function and sdcc link question

Started by Arnaud, 18:53, 09 October 15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Arnaud

Hello,

i'm using cpctelera to code my game and i've got a problem of memory use, when my code reach the address 0x4000 my game crashed (i guess it's because there are game data at this address).
I have got plenty of memory free above 0x8000 but i don't know how use it to store my functions.

I also see a strange behaviour with SDCC, i have note that not used function are always linked in the program and waste memory.
Is there an option to remove useless function while link operation ?

Thanks,
Arnaud.

arnoldemu

Quote from: Arnaud on 18:53, 09 October 15
Hello,

i'm using cpctelera to code my game and i've got a problem of memory use, when my code reach the address 0x4000 my game crashed (i guess it's because there are game data at this address).
I have got plenty of memory free above 0x8000 but i don't know how use it to store my functions.

I also see a strange behaviour with SDCC, i have note that not used function are always linked in the program and waste memory.
There is an "at" modifier that can be used with functions and data, but it will be hard work to maintain that because it's difficult to know the size of each function.

I think you can also use the "banked" feature. I have some test code that demonstrates that. I'll find it.


Quote from: Arnaud on 18:53, 09 October 15
Is there an option to remove useless function while link operation ?

Thanks,
Arnaud.
no.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

Two bits of code I was trying.

Banked sdcc functionality and named sections functionality.

You may be able to use either.

One of them allows you to define which section the code lives in and to set a location for that section.
They both appear to use a function to transfer between which maybe could be empty.

I think I have one more banked example.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Arnaud


Powered by SMFPacks Menu Editor Mod