NES Programming Blog
Moderator: Moderators
NES Programming Blog
If you search for tutorials on how to program the NES in C, the examples either aren't very clear, or contain poor examples of programming the NES.
Well, you can include my tutorial / blog to that list.
https://nesdoug.wordpress.com/
This was the super top-secret other project that I've been working on for a month. It has lots of example code for programming the NES in cc65.
And, a tiny example game (vertical space shooter).
If anyone sees any factual errors, or broken links, unclear code, or just plain bad advice...please let me know. I'm hoping that someone out there can use this to get started on NES game development.
Thanks.
Well, you can include my tutorial / blog to that list.
https://nesdoug.wordpress.com/
This was the super top-secret other project that I've been working on for a month. It has lots of example code for programming the NES in cc65.
And, a tiny example game (vertical space shooter).
If anyone sees any factual errors, or broken links, unclear code, or just plain bad advice...please let me know. I'm hoping that someone out there can use this to get started on NES game development.
Thanks.
nesdoug.com -- blog/tutorial on programming for the NES
Re: NES Programming Blog
One thing that I found really nice in thefox's KNES is this macro:
Proofreading, there's several apostrophe mistakes.
Code: Select all
#define PPU_ADDR(a) \
do { \
PPU.addr = HIBYTE( a ); \
PPU.addr = LOBYTE( a ); \
} while ( 0 )
Re: NES Programming Blog
.apostrophe mistakes
Huh?
nesdoug.com -- blog/tutorial on programming for the NES
Re: NES Programming Blog
Apostrophes:
Post 0, paragraph 11, "mirroring) it’s map" → its (is possessive, not a contraction)
Post 10, paragraph 8, "referenced it's address" → its
Post 10, paragraph 17, "for it’s collision" → its
Post 13, paragraph 3, "the other one’s." → ones (is plural, not possessive nor a contraction)
Post 13, paragraph 13, "with it’s logic" → its
Post 0, paragraph 11, "mirroring) it’s map" → its (is possessive, not a contraction)
Post 10, paragraph 8, "referenced it's address" → its
Post 10, paragraph 17, "for it’s collision" → its
Post 13, paragraph 3, "the other one’s." → ones (is plural, not possessive nor a contraction)
Post 13, paragraph 13, "with it’s logic" → its
Re: NES Programming Blog
( http://blog.writeathome.com/index.php/2 ... -teachers/ )
Anyway, of what I read so far, it looks like you explain the NES architecture in a very clear, simple way.
Re: NES Programming Blog
Thanks for the tutorial! I will check it out.
Re: NES Programming Blog
I'd recommend mentioning in "Getting Started" that this is geared towards Windows development. It becomes evident pretty quickly, but this could be a stumbling block for beginners.
Have only skimmed over this so far, but it looks pretty neat! Looking forward to reading the whole thing in depth.
Have only skimmed over this so far, but it looks pretty neat! Looking forward to reading the whole thing in depth.
Re: NES Programming Blog
That's so weird...
I have a little Stats menu on my blog, and I got like 9000 views yesterday, most from a referral on Reddit by zeroone. Those are almost monetizable numbers... (according to some website, if that traffic was sustainable, I could make $20 a day, or $7-8000 a year off ad revenue.)
My most popular YouTube video only got like 100 views all year.
Actually, that's almost enough to get my dropbox account suspended. Google tells me there's a 10gb bandwidth per day limit on public downloads from a free dropbox account. Hmm.
I have a little Stats menu on my blog, and I got like 9000 views yesterday, most from a referral on Reddit by zeroone. Those are almost monetizable numbers... (according to some website, if that traffic was sustainable, I could make $20 a day, or $7-8000 a year off ad revenue.)
My most popular YouTube video only got like 100 views all year.
Actually, that's almost enough to get my dropbox account suspended. Google tells me there's a 10gb bandwidth per day limit on public downloads from a free dropbox account. Hmm.
nesdoug.com -- blog/tutorial on programming for the NES
Re: NES Programming Blog
@dougeff Awesome stuff. Blogs like this tend to be the catalyst for future projects.
Re: NES Programming Blog
Wow, they really tore me a new one over at Reddit (ie, didn't like the way I write code.)
https://www.reddit.com/r/programming/co ... game_in_c/
Should I edit the hell out of my example code (to make it look pretty) and add a hundred comments? I don't even know what all these things mean...
"no grouping of globals), no arrays for groups of bullets (he instead has Bullet1x,Bullet1y, Bullet2x, Bullet2y, etc.), no structs, CamelCase, magic number galore, repeated code due to the Something1...SomethingN convention, commented-out code"
What the heck is a CamelCase?
Magic numbers...I get that, I should replace with constants that describe what they are.
Commented-out code...because it was redundant, or a removed debugging element.
And, I don't know why, but some other website on cc65 (??) said 'don't use structs'...so I didn't.
Grouping of globals...they look ok to me. Am I missing something?
https://www.reddit.com/r/programming/co ... game_in_c/
Should I edit the hell out of my example code (to make it look pretty) and add a hundred comments? I don't even know what all these things mean...
"no grouping of globals), no arrays for groups of bullets (he instead has Bullet1x,Bullet1y, Bullet2x, Bullet2y, etc.), no structs, CamelCase, magic number galore, repeated code due to the Something1...SomethingN convention, commented-out code"
What the heck is a CamelCase?
Magic numbers...I get that, I should replace with constants that describe what they are.
Commented-out code...because it was redundant, or a removed debugging element.
And, I don't know why, but some other website on cc65 (??) said 'don't use structs'...so I didn't.
Grouping of globals...they look ok to me. Am I missing something?
nesdoug.com -- blog/tutorial on programming for the NES
Re: NES Programming Blog
You appear to be referring to the comment by _georgesim_.
CamelCase is "HelloWorld" as opposed to something like "hello_world". Different people prefer different styles. CamelCase has the connotation that you're trying to be object-oriented.
"Arrays for groups of bullets" would have been something like this:
That at least allows efficient indexing. I explained why structs are dispreferred on 6502.
CamelCase is "HelloWorld" as opposed to something like "hello_world". Different people prefer different styles. CamelCase has the connotation that you're trying to be object-oriented.
"Arrays for groups of bullets" would have been something like this:
Code: Select all
BulletX: .res MAX_BULLETS
BulletY: .res MAX_BULLETS
BulletDX: .res MAX_BULLETS
BulletDY: .res MAX_BULLETS
-
- Posts: 2158
- Joined: Sun Jun 05, 2005 2:04 pm
- Location: Minneapolis, Minnesota, United States
- Contact:
Re: NES Programming Blog
Most programming stuff I've seen has used the convention of camelCase instead of CamelCase.
- rainwarrior
- Posts: 8734
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: NES Programming Blog
If someone wants to pick an argument about an arbitrary naming convention like CamelCase, camelCase, underscores, or however you've chosen to do it, I would highly recommend that you ignore them. There is very little productive argument to be had about this. It's generally just a foolish waste of time.dougeff wrote:What the heck is a CamelCase?
As long as you're consistent with your conventions, it's probably fine.
-
- Posts: 2158
- Joined: Sun Jun 05, 2005 2:04 pm
- Location: Minneapolis, Minnesota, United States
- Contact:
Re: NES Programming Blog
I would agree with this. Putting multiple conventions together causes confusion and often causes one to doubt whether or not they understand what they're looking at. Camel case isn't really any better or worse than other naming conventions (I personally use a lot of dot notation for things); just as long as it's clear what it means, and is consistent with how other things are named.As long as you're consistent with your conventions, it's probably fine.
- mikejmoffitt
- Posts: 1353
- Joined: Sun May 27, 2012 8:43 pm
Re: NES Programming Blog
Your blog made front-page on Hacker News!
Do you have any plans on discussing PRG bankswitching techniques from a C context?
Do you have any plans on discussing PRG bankswitching techniques from a C context?