Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Setting up a build environment for the NES with cc65

Setting up a NES Build environment

This setup will allow you to assemble the NES projects I've got up on GitHub.


Setting up dependencies

Make a folder somewhere for all this stuff to go. Something like C:\nes (or ~/nes if on Linux). All of the following commands should be run from the command line in the folder you create.

All dependencies will be put into a subfolder:

$ mkdir tools


If you're on Windows you can grab the release snapshot from their SourceForge instead of compiling from source:

For linux, or if you want to compile from source on Windows:

$ cd tools && git clone
$ cd cc65 && make && cd ..

Compiling cc65 may take a little while.


A few utilities are written in Go and are incorperated into the build process. These utilities are usually built when needed and include things like bmp2chr and generate-credits.

Download and install Go from here:

If you run linux, your distribution may have Go in it's package repository. The most recent version of Go is usually required (v1.12 as of this writing).

Ready to build

At this point you should be able to assemble my various NES projects by typing make in the correct source directory.

For instance, to assemble nes-pong run these commands, starting in the top-level nes folder:

$ git clone
$ cd nes-pong
$ make

After make finishes you should have a bin/ folder inside the nes-pong folder which will contain the rom file pong.nes. The directory structure should look like this:

├── pong
│   ├── bin
│   │   ├── pong.labels
│   │   ├── pong.lst
│   │   ├──
│   │   ├── pong.nes
│   │   ├──
│   │   ├── pong.nes.db
│   │   ├──
│   │   ├──
│   │   └── pong.o
│   ├── LICENSE.txt
│   ├── Makefile
│   ├── pong.asm
│   ├── pong.chr
│   ├──
│   └── [...]
└── tools
    └── cc65
        ├── bin
        │   ├── ca65
        │   ├── ld65
        │   └── [...]
        └── [...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment