Page 1 of 1

NES Programming

Posted: Thu Nov 13, 2008 4:20 pm
by Slacker
I've been contemplating this for a while, and recently have been looking at a bunch of info about programming a game on the NES. One thing that intrigues and scares me is the 6502 assembly. The lowest level of programming experience I have is C, and what little I have looked at the assembly code, it seems pretty hardcore, though I'm most likely just psyching myself out.

I looked through the 'Assembly Homework Thread', and was just wondering if you guys had any (more) 'if I knew this before I started learning assembly...' or just plain tips on making the learning curve a little less... curvy. Just an FYI, I'm aware that programming in assembly is different with every different setup, I'm more looking for some tips to help me wrap my head around the lower level programming in general.

Re: NES Programming

Posted: Thu Nov 13, 2008 4:31 pm
by Falco Girgis
In my opinion, from a C background, assembly wasn't that bad. I think that it's harder going from C to C++. With that transition, you are literally changing the way that your mind thinks: from procedural to object oriented. With C to assembly, you are still thinking procedurally, you just have new things to worry about now.

Assembly comes with an initial shock, then gets much easier. With C or C++, there are plenty of advanced topics for the two languages. With assembly, you learn the opcodes. They are what they are. There is no advanced polymorphism, inheritance, or encapsulation theory to go with it. Once you know how to use the opcodes, you can start making something.

Granted it is muuuuch harder to make something with assembly, but the actual "learning curve" isn't that bad. It's the "get good at it" and "make something cool with it" curve that's more of a bitch than higher level languages.

edit: Make sure that you understand C-style pointers perfectly, by the way.

Re: NES Programming

Posted: Thu Nov 13, 2008 4:50 pm
by sparda
Aaaahhh, a potential NES programmer eh? Good, good :mrgreen:

Well, you're right that assembly has a bit of a learning curve, but it has to do more with the density of the material you're learning more than the difficulty of the assembly language itself, I think. You see, I don't mean to scare you, but if you decide to go and take the plunge, keep in mind that you have to learn not only the assembly language, but also the architecture of the system you're programming for. So, you'll be up for days (if you're like me), reading up on NES PPUs, memory banks, paged memory, sound chip, and so on. Not to mention you'd have to learn the assembler you'll be working with (Nesasm in my case) thoroughly as well, (directives, format, etc).

Man, its been ages since I've done this stuff, but it was pretty interesting and I learned a lot when I did, so I definitely advice you to go into it!
Here is an essential website:

nesdev.parodius.com

P.S. You should be comfortable with at least one high level language, and have moderate understanding of computer sound and graphics, because to tell you the truth, you probably will want to write your own tools. Unless you want to use antiquated, buggy, tools that is :(

So, if after reading some PPU documentation you can't write a basic BMP to NES converter, for instance, then I suggest you look into that kinda stuff as well.

Re: NES Programming

Posted: Thu Nov 13, 2008 4:53 pm
by Slacker
GyroVorbis wrote:Assembly comes with an initial shock, then gets much easier.
Yeah, I figured it was easier than my mind makes it out to be.
GyroVorbis wrote:I think that it's harder going from C to C++. With that transition, you are literally changing the way that your mind thinks: from procedural to object oriented.
I definitely hear what you're saying there! Granted I have only been learning C++ for about a year or so, but I'm still getting my brain wrapped around all the OOP stuff. Maybe one of these days I'll be struck with a fit of enlightenment! :P

Re: NES Programming

Posted: Thu Nov 13, 2008 5:01 pm
by Slacker
sparda wrote:Man, its been ages since I've done this stuff, but it was pretty interesting and I learned a lot when I did, so I definitely advice you to go into it!
That's exactly why I want to make an NES game, I'm really looking forward to it, I think it'll be a blast.

On a side note the community college I go to dropped its assembly class, and actually the only school around here that DOES offer it is the UW... so looks like I'm on my own with learning assembly. I figure once I get the concepts down I can port my assembly knowledge to other platforms. (don't know how often I'll use assembly though)

Re: NES Programming

Posted: Thu Nov 13, 2008 9:47 pm
by Trask
Awesome, I love retro game/retro programming. I've always wanted to get into Genesis programming myself as that was a childhood favorite in terms of consoles. The deep low level programming scares me a bit and I imagine help is not as readily available today as you would find for GBA/DS/PS2/etc... development. So it's possible to get stuck and not find your way out I suppose, but hey I'm not as hardcore as half the people here. But best of luck, I hope you post some of your work if you're successful :D

Re: NES Programming

Posted: Sat Nov 22, 2008 10:51 am
by mllarson
http://mdb.classicgaming.gamespy.com/m1/m1source.txt
Metroid 1 disassembled and commented on what is going on in the game. So if you have a copy of the game you could put two and two together.

Re: NES Programming

Posted: Sat Nov 22, 2008 6:22 pm
by Slacker
mllarson wrote:http://mdb.classicgaming.gamespy.com/m1/m1source.txt
Metroid 1 disassembled and commented on what is going on in the game. So if you have a copy of the game you could put two and two together.
Yeah, I found that and was flipping through it, it's pretty hardcore imo seeing how the game was laid out, the comments were awesome and I recommend anyone who's interested in NES programming to take a look at it some rainy Sunday. As I was reading through it I was actually able to pick up a lot on how the language and structure is laid out. Only a matter of time. (Hopefully)

I went through a hello world tutorial the other day, but the tutorial assumed you already new the 6502 assembly language, so it wasn't as informative as I would have liked. I'm mainly just sifting through everything on http://nesdev.parodius.com right now, and taking notes. The language is still pretty cryptic, slowly but surely though I'll pick it up! :P