pinkpuff wrote:Anyway I changed the line endings to windows-style ones (I'm using Geany, it has a built in feature for doing that),
In that case you could've as well converted it to *nix style line endings.
and now I'm getting this error instead:
Code: Select all
Warning: Segment `CODE' is not aligned properly. Resulting executable may not be functional.
The code was probably written for an older version of cc65 that didn't have this warning (or the author ignored it). It is shown when .align is used, but the corresponding segment doesn't have "align=xxx" specification in the linker configuration with xxx greater or equal to the alignment requested in the code.
For example, if .align 256 is used in the code, ca65 (when assembling) assumes that the current segment starts at an address multiple of 256. If align=256 is specified in the linker configuration, this is always true. If align is left out of the linker config, it may or may not be true. In your case, it worked regardless because there were no other segments with data before the CODE segment.
And don't worry if you didn't understand the above, it's really not that important.
To fix the warning, you'd have to dump the default NES configuration from ld65 (ld65 --dump-config nes), add align=256 to the segment definition of the CODE segment, then use the new configuration file instead of "-t nes" when linking.