Closed DoctorMikeReddy closed 8 months ago
I would guess it's a newer version of CC65 which defines the NULL macro differently, maybe (void*)0 instead of just 0. That's my best guess, you'd have to check the CC65 include files. But if your fix works, then it works! :)
What's weird is it's not needed for two of the examples. Fortunately, they both work with line 300 commented out. Yes, using the latest cc65. I'll investigate.
P.S. Love the book, and the web site of course, and recommended our library get paper and digital copies
Ok, have found a NULL define here in cc65:
https://github.com/cc65/cc65/blob/master/include/stddef.h
/ NULL pointer /
So, I'm guessing this must be happening first in the cases where the code doesn't compile, before the NULL definition in your version of neslib.h tries
I have been experimenting with your code examples using VSCode, as I am teaching with your book with some second year games students. I have forked from the repo at: https://github.com/WillSams/Making-Games-For-The-NES-book-examples which I know is not an official repo, but uses the examples from the book without requiring 8bitworkshop; I have modified the makefiles to include compile.bat files for Windows. However, apart from 01_hello_world and 12_title_screen_rle all of the other projects have the following error when compiling with cl65:
Error: ./../neslib/neslib.h:300: Error: Macro redefinition is not identical 1 errors and 0 warnings generated. make: *** Error 1
I can get round the error by commenting out line 300 in neslib.h: 300 // #define NULL 0
Any idea where else NULL is being defined, assuming that is the error?