Hello,
Recently, I got into NES programming. After working through a general book about 6502 Assembly, I did the Nerdy Nights tutorial. Then, I converted my custom sample program to CC65 with the help of the website https://bitbucket.org/ddribin/nerdy-nights/src.
I did that because I'm planning to do my first game in C with the whole NES-specific low-level stuff written in Assembly and the general game logic written in C. So, I will need to write everything in CC65 syntax.
But of course, some questions came up. And I want to ask the first few in this thread. It would be great if you could help me with them.
1.
I've read that CC65 can be a hassle to set up while NESASM is quite easy to start because it doesn't require a cfg file and putting together the header.
But in the examples, the CC65 code doesn't look any more complicated than the NESASM code.
In NESASM, we have
In CC65, we have:
Doesn't look that much more complicated to me. So, in which situation does CC65 become complicated to set up?
2.
What's the deal with the "nes.cfg" file?
The guy from that CC65 example site said:
But I neither found an "nes.cfg" in "cc65-win32-2.13.3-1.zip", nor in "cc65-nes-2.13.3-1.zip". (O.k., it's version 2.13.3 instead of 2.13.0, but I didn't find 2.13.0 to check it.)
And when I compile my code with
By the way, why is there a file called "neschar.inc" in the folder "06-backgrounds2" on that site? This doesn't seem to be used either.
3.
My first game shall look like one of those first generation games. You know, like "Donkey Kong". (I don't mean that I want to re-program a specific one of those games, I just want my game to have the same technical limitations.) So, I would for example expect my nes file to be 24592 bytes long.
That's the case when I compile with NESASM. But with CC65, it's 40976 bytes.
I assume that's because the NESASM code (see above) declares
What do I have to do to tell CC65 that my game shall have the same header data as games like "Donkey Kong"?
I guess this is where the "nes.cfg" comes into play somehow, right? But I'm still a bit confused since the CC65 zip files don't include one and I'm not sure if the one from that site is identical to the one that the current version of CC65 would use by default.
(The basis for my sample code was the background2 example from week 6 from Nerdy Nights. The CC65 version can be found on the website that I linked above.)
Recently, I got into NES programming. After working through a general book about 6502 Assembly, I did the Nerdy Nights tutorial. Then, I converted my custom sample program to CC65 with the help of the website https://bitbucket.org/ddribin/nerdy-nights/src.
I did that because I'm planning to do my first game in C with the whole NES-specific low-level stuff written in Assembly and the general game logic written in C. So, I will need to write everything in CC65 syntax.
But of course, some questions came up. And I want to ask the first few in this thread. It would be great if you could help me with them.
1.
I've read that CC65 can be a hassle to set up while NESASM is quite easy to start because it doesn't require a cfg file and putting together the header.
But in the examples, the CC65 code doesn't look any more complicated than the NESASM code.
In NESASM, we have
Code:
.inesprg 1
.ineschr 1
.inesmap 0
.inesmir 1
.ineschr 1
.inesmap 0
.inesmir 1
In CC65, we have:
Code:
.segment "HEADER"
.byte "NES", $1A
.byte 2
.byte 1
.byte $01, $00
.byte "NES", $1A
.byte 2
.byte 1
.byte $01, $00
Doesn't look that much more complicated to me. So, in which situation does CC65 become complicated to set up?
2.
What's the deal with the "nes.cfg" file?
The guy from that CC65 example site said:
Quote:
Here's the nes.cfg as shipping with cc65 version 2.13.0.
and then showed a source code.But I neither found an "nes.cfg" in "cc65-win32-2.13.3-1.zip", nor in "cc65-nes-2.13.3-1.zip". (O.k., it's version 2.13.3 instead of 2.13.0, but I didn't find 2.13.0 to check it.)
And when I compile my code with
Code:
cl65 -t nes -L cc65\lib -o test test.asm
it doesn't ask for such a file. So, what do I need it for?By the way, why is there a file called "neschar.inc" in the folder "06-backgrounds2" on that site? This doesn't seem to be used either.
3.
My first game shall look like one of those first generation games. You know, like "Donkey Kong". (I don't mean that I want to re-program a specific one of those games, I just want my game to have the same technical limitations.) So, I would for example expect my nes file to be 24592 bytes long.
That's the case when I compile with NESASM. But with CC65, it's 40976 bytes.
I assume that's because the NESASM code (see above) declares
Code:
.ineschr 1
while the CC65 code declares 2 x 16KB PRG:Code:
.byte 2
However, when I replace the 2 with a 1, the NES program doesn't work anymore and only shows a gray screen.What do I have to do to tell CC65 that my game shall have the same header data as games like "Donkey Kong"?
I guess this is where the "nes.cfg" comes into play somehow, right? But I'm still a bit confused since the CC65 zip files don't include one and I'm not sure if the one from that site is identical to the one that the current version of CC65 would use by default.
(The basis for my sample code was the background2 example from week 6 from Nerdy Nights. The CC65 version can be found on the website that I linked above.)