View Full Version : What kind of tools/knowledge would you need to program a new NES game?
The Adventurer
09-17-2012, 06:24 AM
So. I've recently gotten interested in the notion of creating a NES game from scratch. I have a little understanding of software programming basics. While I admit I'm not particularly adept at game programming, I'm willing to learn what I need to.
Anyway, sometimes amateur developers turn out original games designed to be run on NES consoles, or as a ROM to be run via Nintendo Emulation. Stuff like Castlevania Blood Moon and Battle Kid: Fortress of Peril. Are there prexisting developer tools to design games with the NES hardware? Or does it take esoteric knowledge of the hardware to program for it?
nbasic (BASIC for NES) (http://bobrost.com/nes/) is all you need. To wit, nbasic is the friendliest way to program games for the NES and it can handle all but the most demanding of applications. I'd say to start with nbasic and if you need the all the power you can get from an NES to then and only then start learning assembly programming for the NES's CPU as it is significantly more difficult than BASIC.
Damaniel
09-17-2012, 02:03 PM
I've never tried using nbasic, but I've dabbled a little bit in programming the NES the 'native' way (6502 assembly language). It's quite a daunting task - while the hardware is well documented, assembly language programming can seem downright foreign for people whose primary programming experience comes from higher level languages (i.e. most of us, including myself).
Another consideration is the relatively limited hardware. If you're not used to working with only 2k of RAM (and who really is these days?), then you might end up feeling really constrained. There are memory mappers that can help with this somewhat (I think that MMC5 gives 2k extra RAM at the expense of being a pain in the ass to work with), but those are an entirely different can of worms, as each of the mappers works differently and offers their own set of tradeoffs.
My biggest complaint is that there isn't one good "here's how to do a basic game from start to finish" book for NES games. There's a lot of documentation out there, but the quality varies widely, some of it is very out of date, and there's no standardization on any particular tools (the assembly syntax varies greatly between assemblers, which makes using sample programs in different assemblers more of a pain than it should be). If I had all the time in the world, I'd sit down and make some VERY simple games, and use the experience to actually write a book (along the lines of 'Making Games with Python and Pygame') that provides source code to a few different simple games, and explains exactly how they work.
ccovell
09-17-2012, 09:35 PM
It might be a little old, but when I made Solar Wars (http://www.chrismcovell.com/solarwars.html), I wrote a diary of development that showed how my game progressed from a simple gravity simulation to an actual game.
http://www.chrismcovell.com/data/SolarWarsSource.zip
33 assembly files are in there from the barebones start to finish. It might not help with learning assembly instructions, but at least you can see how an NES game is structured and the necessary routines (NMI, reset...) laid out.
tomaitheous
09-19-2012, 02:20 PM
You can try these out: http://www.nintendoage.com/forum/messageview.cfm?catid=22&threadid=7155
Nesdev forum and Nintendoage have people just like you learning to code on the old NES.
I personally would stay away from any BASIC compiler for the NES. You'll run into restrictions real fast and if you decide to continue, you'll have wasted all the time with the BASIC environment and such. It's best to just jump in and learn Assembler first. The 6502 is very popular processor and there are tons of tutorials as well as emulators. A processor emulator is VERY helpful for people that never touched Assembly language. It allows you to step through your code, instruction by instruction, so see what's actually going on.
It may seem daunting to learn Assembler for 6502, but it's just a matter of sticking with it and learning the syntax. Once you've learned something about the processor, you won't forget it. I mean, you don't need to be a 'pro' at Assembler to code in Assembler. Or to get game logic running along. Anyone can learn to program for the NES in assembler and such. It just takes perseverance and patience. Figure that it'll probably take about a year to learn the processor, video hardware, audio hardware, and the mappers. There are plenty of tools as well (debuggers) and a community for asking questions/getting help.
The Adventurer
09-19-2012, 05:07 PM
You can try these out: http://www.nintendoage.com/forum/messageview.cfm?catid=22&threadid=7155
Nesdev forum and Nintendoage have people just like you learning to code on the old NES.
I personally would stay away from any BASIC compiler for the NES. You'll run into restrictions real fast and if you decide to continue, you'll have wasted all the time with the BASIC environment and such. It's best to just jump in and learn Assembler first. The 6502 is very popular processor and there are tons of tutorials as well as emulators. A processor emulator is VERY helpful for people that never touched Assembly language. It allows you to step through your code, instruction by instruction, so see what's actually going on.
It may seem daunting to learn Assembler for 6502, but it's just a matter of sticking with it and learning the syntax. Once you've learned something about the processor, you won't forget it. I mean, you don't need to be a 'pro' at Assembler to code in Assembler. Or to get game logic running along. Anyone can learn to program for the NES in assembler and such. It just takes perseverance and patience. Figure that it'll probably take about a year to learn the processor, video hardware, audio hardware, and the mappers. There are plenty of tools as well (debuggers) and a community for asking questions/getting help.
Whoa. Okay, this is interesting.
Thanks for all the help guys, I think you've got me on the right path. Gonna read up on those Assembler tutorials. We'll see if it leads to anything.
Masamune
09-20-2012, 07:41 PM
The above information is useful about programming for the NES. What would you suggest if you wanted to program Super Nintendo games from scratch?
Berserker
09-21-2012, 06:26 PM
While not NES-specific, you might find this (http://skilldrick.github.com/easy6502/) useful - it's a 6502 tutorial that uses an emulator (http://www.6502asm.com/) written in JavaScript, so you can compile and run the examples and tweak the values and instructions to see what they do right there on the page.
ccovell
09-21-2012, 09:54 PM
The above information is useful about programming for the NES. What would you suggest if you wanted to program Super Nintendo games from scratch?
I'd say start with the NES anyway. The SNES is far more complex to program than the NES, yet builds on top of knowledge needed from NES hardware: The SNES' CPU instructions are a superset of the NES'; the SNES PPU(s) have similar register locations as the NES, but about 16x the complexity (# of regs needed to write to) and the sound unit is its own "black box" CPU + RAM + DSP unit to program.