This guide will get you from zero to running your first SNES ROM in about 10 minutes.
| I want to make SNES games | I want to contribute to the SDK | |
|---|---|---|
| What | Download the pre-built SDK, write C code, build ROMs | Clone the repo, modify compiler/library/tools |
| Prerequisites | make + text editor | clang, cmake, git, python3 |
| Time to start | ~5 minutes | ~15 minutes |
| Go to | Path A: Game Developer | Path B: SDK Developer |
You want to write SNES games in C. The SDK is already compiled — you just need to download it, write code, and run make.
You only need make (the build tool) and an emulator. No compiler installation required — the SDK ships with its own cross-compiler.
macOS:
Linux (Ubuntu/Debian):
Linux (Fedora):
Windows:
luna (the SDK test/debug backend, installed by scripts/install-luna.sh) covers headless debugging — see tutorials/debugging.md. For playing your ROM in a window, pick any GUI emulator:
| Emulator | Best For | Download |
|---|---|---|
| Mesen | Debugging, accuracy | mesen.ca |
| bsnes | Cycle accuracy | GitHub releases |
| Snes9x | Performance | snes9x.com |
Download the latest release for your platform from the GitHub Releases page:
| Platform | File |
|---|---|
| Linux x86_64 | opensnes_<version>_linux_x86_64.zip |
| Linux aarch64 | opensnes_<version>_linux_arm64.zip |
| macOS arm64 | opensnes_<version>_darwin_arm64.zip |
| Windows x86_64 | opensnes_<version>_windows_x86_64.zip |
Extract the archive somewhere permanent (e.g., ~/opensnes or C:\opensnes).
The SDK comes with pre-built example ROMs:
Note: mesen must be on your PATH for the Linux command above. Install Mesen from mesen.ca and either add its directory to PATH or alias it (alias mesen=~/Mesen/Mesen). No emulator installed? The SDK's own luna backend also plays ROMs: luna print_string.sfc (install it once with scripts/install-luna.sh).
You should see "Hello World!" on screen.
The SDK ships an opensnes CLI (in the extracted bin/ directory) that scaffolds, builds, and runs a project for you. Put it on your PATH once — from the extracted SDK directory:
Then create, build, and run your first project in three commands:
opensnes init gives you a project that builds and runs from the start. Pick a template:
Other commands: opensnes build, opensnes clean, and opensnes doctor (checks your toolchain, library, and emulator and tells you what is missing). Run opensnes help for the full list.
Prefer to wire it by hand, or curious what init generates? Create a new directory anywhere on your machine:
Create two files:
Makefile:
main.c:
Build and run:
That's it — you're making SNES games.
Projects can declare automated tests that run in luna, the same cycle-accurate emulator the SDK's own test suite uses. Opt-in is simply the presence of test/manifest.toml (the game template ships one):
Workflow:
(Or opensnes test / opensnes test --update from the project directory.)
Three oracles run per test:
Commit test/ to your repo; rerun make test-update when you intentionally change what the game shows or does.
You want to modify the compiler, library, tools, or build system itself. This requires building the entire SDK from source.
You need a full C/C++ development environment.
macOS:
Linux (Ubuntu/Debian):
Linux (Fedora):
Windows:
This takes a few minutes. Expected output:
See CLAUDE.md for architecture details and coding conventions.
Explore by complexity:
| Level | Examples | What You'll Learn |
|---|---|---|
| Beginner | text/print_string, text/scroll_message | Console output, text formatting |
| Intermediate | sprites/simple_sprite, input/two_players | Sprites, controller input |
| Advanced | mode7/rotate_scale, audio/snesmod_music | Mode 7, tracker music |
| Expert | games/breakout, games/likemario | Complete game structure |
| SA-1 Coprocessor | chips/sa1_hello, chips/sa1_starfield | 10.74 MHz second CPU (tutorial) |
| SuperFX (GSU) | chips/superfx_hello, chips/superfx_3d | RISC coprocessor, 3D rendering (tutorial) |
Browse all examples:
The full set (all 19 tutorials, always current) is on the docs home page — see the tutorial navigation in mainpage. The most common starting points:
| Topic | Guide |
|---|---|
| Graphics & Backgrounds | tutorials/graphics.md |
| Sprites & Animation | tutorials/sprites.md, tutorials/animation.md |
| Scrolling & Parallax | tutorials/scrolling.md |
| Collision Detection | tutorials/collision.md |
| Input Handling | tutorials/input.md |
| Audio & Music | tutorials/audio.md |
| Math & Fixed-Point | tutorials/math.md |
| DMA | tutorials/dma.md |
| HDMA Effects | tutorials/hdma.md |
| Color Math | tutorials/colormath.md |
| Hardware Windows | tutorials/window.md |
| Mosaic | tutorials/mosaic.md |
| Mode 7 | tutorials/mode7.md |
| Game States | tutorials/game_states.md |
| SRAM Saves | tutorials/sram.md |
| SA-1 Coprocessor | tutorials/sa1.md |
| SuperFX (GSU) | tutorials/superfx.md |
| Debugging | tutorials/debugging.md |
Install build tools (see prerequisites for your path above).
You forgot --recursive when cloning. Fix it:
Run make from the SDK root first — the library must be compiled before examples:
Your ROM built but doesn't display anything. Common causes:
See TROUBLESHOOTING.md for more solutions.
This is usually a compiler limitation. Check:
See API_INDEX.md — the SDK indexed by what you are trying to do, with the example that does it. Worth a scan before you write a helper: several already exist.