Closed R-Gerard closed 7 years ago
The oam_off variable must be placed in ZP, you placed it as a normal variable. This is the same as in the original neslib, it hasn't changed. I haven't looked at the examples, perhaps Shiru included the variable in his prebuilt library, but this is not how it relates to standalone projects - standalone ones have always needed to put the oam_off variable to ZP themselves.
An example on how to do that can be found under my nes repo, cnrom/, but that won't work on your old compiler, since the pragma syntax is different.
I'd advice against using a compiler that old. That's from 2012, five years old, and there have been quite some changes since.
D'oh! Thanks. Just a simple case of RTFM.
Actually, I'm having a similar issue with your example cnrom project using the latest cc65 from master (head commit of cc65/master is 0bbe4f56).
make clean all
rm -f cnrom.nes *.o
cl65 -c -C nes.cfg -t nes -Oisr main.c -o main.o
cl65 -c -C nes.cfg -t nes -Oisr crt0.s -o crt0.o
cl65 -o cnrom.nes -C nes.cfg -t nes -Oisr main.o crt0.o
ld65: Warning: Address size mismatch for `_oam_off': Exported from main.o, main.s(36) as `absolute', import in crt0.o, display.sinc(1) as `zeropage'
ld65: Error: Range error in module `display.sinc', line 40
make: *** [cnrom.nes] Error 1
Do you mind telling me what particular commit you compiled cc65 from?
24c2da9, but master should work just fine, unless there's some recent bug.
Hrm... I get a different error with the cnrom project using that build of cc65:
cc65 --version
cc65 V2.15 - Git 24c2da98
make clean all
rm -f cnrom.nes *.o
cl65 -c -C nes.cfg -t nes -Oisr main.c -o main.o
main.c(77): Error: Undefined symbol: `KEY_START'
make: *** [main.o] Error 1
I confirm cc65 master is buggy. Also, although that git sha was what my cc65 --version says, the build system is also buggy - it doesn't update the version string when the git revision changes. My cc65 timestamp is Jan 21 2016, so one of that day's commits is known to work.
I bisected and reported the bug.
Okay, I confirmed this fork works with Shiru's old examples using https://github.com/cc65/cc65/commit/f7cdfbf (last commit on Jan 21, 2016).
I'm trying to compile Shiru's examples using this fork of
neslib
as a git-submodule in my project.I've made the following changes to Shiru's example code:
uint8_t oam_off;
to Shiru'sexample1.c
nes.cfg
(NROM128)When I run the following command:
...I get this error:
I'm using the latest BrewFormula to install cc65 V2.13.3 rather than compile cc65 from the master branch.
Any idea what I'm doing wrong?