NES Programming

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
Slacker
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 31
Joined: Tue Nov 11, 2008 11:41 am
Location: MountLake Terrace, WA
Contact:

NES Programming

Post 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.
~Slacker
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: NES Programming

Post 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.
User avatar
sparda
Chaos Rift Junior
Chaos Rift Junior
Posts: 291
Joined: Tue Sep 23, 2008 3:54 pm

Re: NES Programming

Post 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.
User avatar
Slacker
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 31
Joined: Tue Nov 11, 2008 11:41 am
Location: MountLake Terrace, WA
Contact:

Re: NES Programming

Post 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
~Slacker
User avatar
Slacker
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 31
Joined: Tue Nov 11, 2008 11:41 am
Location: MountLake Terrace, WA
Contact:

Re: NES Programming

Post 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)
~Slacker
User avatar
Trask
ES Beta Backer
ES Beta Backer
Posts: 738
Joined: Wed Oct 29, 2008 8:17 pm
Current Project: Building a 2D Engine
Favorite Gaming Platforms: Sega Genesis and Xbox 360
Programming Language of Choice: C/C++
Location: Pittsburgh, PA
Contact:

Re: NES Programming

Post 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
MarauderIIC wrote:You know those people that are like "CHECK IT OUT I just made Linux run on this piece of celery [or other random object]!!"? Yeah, that's Falco, but with ES.
Dear god, they actually ported ES to a piece of celery!
Martin Golding wrote: "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
User avatar
mllarson
Chaos Rift Regular
Chaos Rift Regular
Posts: 183
Joined: Fri Nov 14, 2008 5:20 pm
Location: Minnesota, where "Cold as Hell" has real meaning...

Re: NES Programming

Post 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.
"Mmmm... these paint chips are scrumptious!"
User avatar
Slacker
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 31
Joined: Tue Nov 11, 2008 11:41 am
Location: MountLake Terrace, WA
Contact:

Re: NES Programming

Post 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
~Slacker
Post Reply