A simple "Hello World" style program for the Nintendo Entertainment System. It demonstrates initializing the NES, drawing a background, reading from controllers, and drawing / controlling a sprite.
NES development is new to me, so I decided to start with a simple Hello World project. I tried to keep it simple and add plenty of comments. I hope others find it useful.
Here's what you need to get started with this code.
The code uses the ca65 macro assembler and ld65 linker. Install cc65 to get both tools and include them in your path.
The graphics are contained in CHR files, and I found YY-CHR.NET useful for editing these files.
For debugging, I like Mesen. It can import the hello.nes.dbg file that is generated at build time to show the code's labels.
On Windows, just run build.cmd. The same commands in that file should work on Linux; I didn't just include a shell script. I probably should add a makefile. In any case, a successful build should produce hello.nes - run that in the NES emulator / debugger of your choice.
I didn't figure this out in a vacuum! The following resources helped me a bunch. Thanks to the community of people who made this material available.
- Nesdev Wiki
- Michael Chiaramonte's YouTube video
- This and this 6502 instruction set reference.
- Brad Smith's NES-ca65-example
- Damian Yerrick's NES project template
- pubby's feedback on this nesdev forum post
- Matthew Justice matthewjustice
This project is licensed under the MIT License - see the LICENSE file for details