This is what you will need to program an NES game…
1. An assembler (or compiler)
2. A tile editor
3. A text editor, like Notepad++
4. A tile arranging program
5. A good NES emulator
6. a music tracker
7. a test cartridge
For my examples I will exclusively work with cc65. It is part of a suite of software, and is one of the best compiler/assembler programs available for 6502 (i.e. NES) programming. Although, the learning curve is a bit steep, I will help get you started.
(Click on Windows snapshot)
NOTE: the version that I use is V2.15 (in command line type…
to see your version). Files from different versions of cc65 can sometimes give error messages (especially much older versions of cc65 may not compile). I believe the newer versions 2.16-2.19 work also.
You need a tile editor to create the graphics. I personally prefer YY-CHR. You can get it here…(this is the updated and improved version).
I prefer to work first in GIMP/Photoshop, convert to indexed (4 color), then copy/paste over to YY-CHR later. You should be working in the 2bpp NES format (the default).
Here is a link where you can download GIMP.
Notepad++ is a tool for writing programming code. You could use any text editor, if you like. Notepad++ is available here…
The great thing about Notepad++ is you can set it to highlight your code, which makes it easier to read. And it has the line # on the left. If you get error messages while compiling, it will tell you the line of the error. If you double-click on a word, it will highlight every instance of that word. It has a find-and-replace feature which I use a lot, also find-in-file to search an entire folder’s files for a word.
Or, I’ve heard of people using VSCode to write their C code. It is a bit more advanced, and can do syntax error checking and code completion, which notepad++ can’t do.
To make background maps, we need a tile arranger app. I highly recommend, NES Screen Tool. It shows the NES color limitations very well, and is good for making single screen games. It also gives you nametable addresses and attribute table addresses, which comes in handy. I use 2.3, and if you have an older version, it won’t open the .nss files in my source code. Get it here…
And, if you are making a scrolling game, I would also pick up Tiled map editor. I will go into more detail later, but you can make a data array out of the exported .csv files from Tiled.
Now that that’s done…how do these things work?
Photoshop – choose an image, and resize to a reasonable NES size. Here I’m using 128 x 128 pixels. Then reduce to 4 colors, by Image/Mode/Indexed…Palette:Custom, reduce to 4 colors. (I made a custom 4 color swatch set, that can be loaded here.) Cut and paste into YY-CHR.
YY-CHR – make sure it’s set on 2bpp (NES). You may have to use the color replacement tool, in YY-CHR, if it got the color indexing wrong…
It doesn’t matter what palette settings you give it here. YY-CHR can show you various color options, but doesn’t save the palette. You will have to program the palette into your game. Save your graphics as a .chr file.
You can load the .chr file into NES Screen Tool, and create backgrounds, palettes, and sprites using just this tool. Save the nametable (can be compressed as RLE, and also can be formatted as a C array). Save the palette (or copy to clipboard as a C array). You can also make sprite arrangements (more on this later).
The newest version of NES Screen Tool can also import graphics (BMP indexed 16 color) as a tileset, or import it as a nametable (auto generates tiles). Kasumi has explained this process better than I could, here…
And, next is an NES emulator. I use FCEUX 90% of the time because it has excellent debugging tools, PPU viewer, Nametable viewer, Hex Editor, etc. However, it is not the most accurate emulator. You may wish to test your game on multiple emulators, to assure that other people will be able to play your game without issues. (I’ve used Nintendulator, Nestopia, and Mesen). Actually, Mesen is probably better than FCEUX now (it definitely has more debugging tools). Get that too.
FCEUX is here…
Mesen is here…
You may have to change the video display to display every pixel. I’ve seen people say “the NES is 256×224 pixels”, but that is not true. Older TVs tended to cut off a few pixels from the top/bottom of the picture, but the NES generates a full 240 pixels high. One of my TVs displays nearly the entire 240 pixels. You should assume that some users will see the entire picture, so in FCEUX go to Config/Video/Drawing Area, and set the output to the full 0 to 239.
I don’t want to go into too much detail yet, but you will also need to get Famitracker for making music and/or sound effects for your game.
Playing the game in an emulator is nice, but the real test is playing on a real NES with a flash cartridge.
I have a PowerPak, but if I were buying one today, I would probably get a N8 Everdrive from krikzz (directly or from their Amazon page or from StoneAgeGamer). The PowerPak uses a compact flash card, and the N8 uses an SD card. I needed to buy a special attachment to connect a compact flash drive to my computer, but most computers have SD card slots.
OPTIONAL… I have been writing simple python 3 scripts to process some of the data into C arrays. You don’t need to, but it might be helpful if you installed python 3, to use my tutorial files. I just use simple scripts for “automating the boring stuff”.
cc65 – in more detail.