Hi folks.
I'm wondering if anyone knowledgable with SDCC can help me with a strange problem.
While writing my game for cpcretrodev2017, I ran into a problem I've never seen before.
I've got a lot of arrays set up at the top of my main.c file.
They are followed by the function main().
This is how I've always done SDCC dev.
Now, the weird thing is that I seem to have hit a wall, despite my program only compiling to around 4K.
When I add one more variable, and try to reference that new variable in code, I get weird crashes.
I've tried a lot of different things, and the only thing that fixed it was to either remove one of the arrays, or move an array to my asm.s file, and define it in z80. The compiler then seemed to put the array definition into a different part of memory, thereby fixing the crash I was getting.
It seems that too many variables/arrays defined in C confuses the compiler. It looks very much like the compiler placed data into the code area at compile time, overwriting some code.
Has anyone ever seen anything like this before?