I've been using CC65 + Shiru's Neslib for quite a long time now, and never updated. The CC65 version I'm using is cc65-2.13.3-1, which works straight away with Shiru's Neslib.
The problem is that I've found that old versions of CC65 have a bug (or feature) which makes multidimensional arrays get pushed to the DATA segment (that is, they take space in ROM and are copied to RAM) which takes valuable resources, even if they are defined as const:
I've read that recent versions of CC65 fix this problem. I try and download the latest version of CC65, but it seems it is uncompatible with Neslib's runtime.lib, and replacing it with the nes.lib included with CC65 makes my games stop working (they compile, but they won't work).
Does anybody know about what was the latest CC65 version to work alongside Shiru's Neslib? I'm hoping it solves the const data being copied to RAM when it shouldn't problem.
Thanks in advance.
The problem is that I've found that old versions of CC65 have a bug (or feature) which makes multidimensional arrays get pushed to the DATA segment (that is, they take space in ROM and are copied to RAM) which takes valuable resources, even if they are defined as const:
Code:
const unsigned char arr1 [] = { 1, 2, 3 };
const unsigned char arr2 [] = { 4, 5, 6 };
const unsigned char *arr_list { arr1, arr2 }; // This should be in ROM, but it's copied to RAM
const unsigned char arr2 [] = { 4, 5, 6 };
const unsigned char *arr_list { arr1, arr2 }; // This should be in ROM, but it's copied to RAM
I've read that recent versions of CC65 fix this problem. I try and download the latest version of CC65, but it seems it is uncompatible with Neslib's runtime.lib, and replacing it with the nes.lib included with CC65 makes my games stop working (they compile, but they won't work).
Does anybody know about what was the latest CC65 version to work alongside Shiru's Neslib? I'm hoping it solves the const data being copied to RAM when it shouldn't problem.
Thanks in advance.