This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Latest CC65 which works with Shiru's Neslib

Latest CC65 which works with Shiru's Neslib
by on (#159746)
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:

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


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.
Re: Latest CC65 which works with Shiru's Neslib
by on (#159752)
Yeah, that was a bug in and older version of cc65.

I can't remember what exactly is included in runtime.lib, but it should be possible to regenerate it for a new version of cc65.
Re: Latest CC65 which works with Shiru's Neslib
by on (#159763)
Shiru's neslib is just a subset of the normal CC65 NES runtime. You "should" be able to get away with using it instead.

Alternatively, I've repackaged the runtime here.
Re: Latest CC65 which works with Shiru's Neslib
by on (#159764)
Thanks, I'll try. I must have done something wrong, as recompiling any of my games gives me a garbled screen and a crash.