Newbie to NES programming.

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
PiXL
Posts: 3
Joined: Thu Feb 11, 2016 1:23 pm

Newbie to NES programming.

Post by PiXL »

Greetings,

I've started learning ASM yesterday, using this tutorials: https://skilldrick.github.io/easy650/

It's a really nice tutorial that explains the basic pretty well. However, it feels really short. It doesn't explain how to make an ASM file work with a ROM or how to actually draw a sprite/background made with YY-CHR onto the screen.

I have YY-CHR, Notepad++, cc65 (which comes with ca65) and FCEUX.

If there are any good tutorials, tools that can push me in the right direction, please do share.

Nice to meet everyone!
lazerbeat
Posts: 64
Joined: Tue Jul 09, 2013 7:13 am

Re: Newbie to NES programming.

Post by lazerbeat »

I really like the nerdy nights tutorials here

http://nintendoage.com/auth/forum/messa ... eadid=7155
User avatar
Sogona
Posts: 186
Joined: Thu Jul 23, 2015 7:54 pm
Location: USA
Contact:

Re: Newbie to NES programming.

Post by Sogona »

Easy6502 isn't specifically geared towards NES development, which is why it doesn't talk about graphics for it, using CHR files, how to set up ROMs, etc.

So yeah, I'd say Nerdy Nights is the best tutorial to start out with (It's definitely the most popular.) If you're using CC65, there are a couple tutorials on here for that too. Here's a recent one.
PiXL
Posts: 3
Joined: Thu Feb 11, 2016 1:23 pm

Re: Newbie to NES programming.

Post by PiXL »

@Sogona
It's a nice tutorial, although he's using C instead of ASM. However, I'll keep it bookmarked just in case I want to switch.

@lazerbeat
Woah! Talk about going into the details! I like it! Although I wonder, since he uses NESASM and I use ca65, will there be any differences?
User avatar
dougeff
Posts: 2876
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: Newbie to NES programming.

Post by dougeff »

Yes, lot's of differences between NESASM and CA65...

Look at these "Hello World" files for some basic differences in SYNTAX and such...
viewtopic.php?f=22&t=12847
nesdoug.com -- blog/tutorial on programming for the NES
PiXL
Posts: 3
Joined: Thu Feb 11, 2016 1:23 pm

Re: Newbie to NES programming.

Post by PiXL »

@dougeff
Thank you so much! Also, I really like your blog!
User avatar
dougeff
Posts: 2876
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: Newbie to NES programming.

Post by dougeff »

Thanks. If you give me a few months, I will probably add an ASM section.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
darryl.revok
Posts: 520
Joined: Sat Jul 25, 2015 1:22 pm

Re: Newbie to NES programming.

Post by darryl.revok »

I just wanted to offer a couple tips, and of course it's totally up to you whether you want to follow them or not. These are based on my experience but I believe they would apply to most.
PiXL wrote:Woah! Talk about going into the details! I like it!
In the future you will most likely want even more details, and I'd recommend the NESdev wiki as an invaluable source for all sorts of tech sheets on the console, updated and verified, with very thorough descriptions.

That being said, I'll be the first to admit that I was highly intimidated by the data sheets at first. Even some of the more specific details in Nerdy Nights were confusing to me in the beginning. You're unlikely to understand why every write to the hardware happens, what can be changed and what must be left the same, right off from the beginning. And I don't think you necessarily need to. I think a focus on learning the fundamentals, how the language works, and how to approach the logic for the platform is more important in the beginning. Then, when you start to get a grasp on those things, that knowledge will begin to elucidate the more esoteric pieces of information.

I'm not saying not to read every portion of the tutorials. Definitely do, and take what you can. I'm saying, if your focus is software development, don't get caught up if you can't figure out, for example, why every step of the startup sequence has to happen as it does. I'd focus more on the operators, getting really used to what they do and how they work together, and you'll get to the point that you can look at the startup code and see what's going on.

Sounds like you're on the right track. I'd highly recommend bookmarking this page: http://www.obelisk.me.uk/ specifically the 6502 instructions. Any time you're stuck on figuring out how to do something, look at the operators you have available, consider what sort of indexing options they have, and think about the best way to solve it. You'll eventually memorize this stuff over time. You'll eventually memorize the parts of the hardware stuff you need because you'll have to look them up to do things.

Somewhere after getting a good fundamental grasp of the operators is getting a good fundamental grasp of the flags. These can be a little tricky but just as important. Primarily, carry, zero, and negative. The rest, I feel, aren't worth racking your brain over until they can come more easily.

Choosing ca65 as a starting point is a good call, as you'll have the highest range of options available to you, without a hurdle of restructuring your program later. As far as I know, no other assembler will let you do things like linking with C code, linking with 6502 simulators, or source level debugging.

Most importantly, have fun. If you have a reason to want to do it, you'll have a reason to learn. Welcome to NESdev!
Post Reply