A hands-on 65816 / SNES programming course

Building a Game for the SNES

From an empty folder to a small, playable Super Nintendo game — one concept at a time. Every lesson assembles into a real .sfc ROM you run in an emulator, so you're never just reading. You're building.

ca65 / cc65 Mesen emulator macOS No prior 65816 experience needed

Who this is for

You're comfortable programming and have asar, ca65 (part of the cc65 suite), and the Mesen emulator installed. You don't need prior 6502/65816 or SNES experience — Lesson 2 covers the CPU from scratch.

How each lesson works

A short concept explanation, one fully-commented assembly file, the exact build commands, and what you should see in Mesen. Lessons build on each other — by the end you'll have a running codebase, not disconnected demos.

Course index

This tutorial standardizes on ca65 over asar — mainly because Mesen's debugger has first-class ca65 support, and the reference material this course leans on (nesdoug's series, the Super Famicom Development Wiki) is written for it too.

Part 0

Foundations

1
Toolchain setup & your first ROM
Install/verify ca65 and Mesen, understand the ROM header and reset vector, display a solid color.
2
The 65816 CPU crash course
Registers, 8/16-bit mode switching, addressing modes, the .smart directive, and 6502-vs-65816 gotchas.
3
SNES memory map & hardware registers
WRAM, VRAM, CGRAM, OAM, the PPU/CPU register windows, and how to read the reference wiki.
Part 1

Graphics fundamentals

4
Palettes & CGRAM
SNES color format (15-bit BGR), writing a palette from ROM in a loop.
5
Tiles & VRAM
Tile bitplane formats (2bpp/4bpp/8bpp), loading graphics data into VRAM.
6
Backgrounds & tilemaps
BG modes, the tilemap entry format, turning on a background layer.
7
Debugging with Mesen
Breakpoints, PPU viewers, memory tools, the event viewer, and trace logger.
8
DMA & HDMA deep dive
General-purpose DMA channels, the DMA fill trick, HDMA for scanline effects.
9
Background scrolling
BGxHOFS/BGxVOFS, a real per-frame game loop, seamless wrapping.
Part 2

Sprites & interaction

10
Sprites (OAM) basics
Sprite graphics, the OAM table, size/priority attributes.
11
Controller input & sprite animation
NMI setup, joypad reading, moving and animating a sprite.
12
Collision detection
Sprite-vs-sprite (AABB boxes) and sprite-vs-world (a lookup table).
Part 3

Audio

13
The SPC700 & audio basics
The second CPU, the boot handshake, making a sound with no SPC700 code.
14
Music & sound effects
Triggering sound effects from gameplay, and a realistic path to real music.
Part 4

Wrapping up

15
Code organization & optimization
Multi-file projects, macros, the V-Blank time budget, ROM banking.
16
Capstone project
A small playable game combining a scrolling background, an animated/collidable player sprite, a collectible, and sound.
Appendix

Reference

A
SNES address & register map
Every hardware address the course touches, one page, organized by topic — WRAM/VRAM/CGRAM/OAM, PPU and DMA registers, the ROM header byte map, and the DSP.

Reference resources

65816 Reference
Full instruction set.
SPC700 Reference
Sound CPU instruction set.
Registers
Every PPU/CPU hardware register, bit by bit.
Memory Mapping
LoROM/HiROM layout details.
nesdoug's SNES tutorial series
A second explanation style, ca65-based.
nesdoug's SNES example code
Companion repos per lesson.