Skip to content
The Legend of Zelda gameplay on NES
Gameplay from The Legend of Zelda on NES. Image from the Retro Replay media library.

binjnes

EMULATOR DATABASE

binjnes

binjnes is an open-source, cycle-aware NES (Nintendo Entertainment System) emulator written in C that can be built as a native binary or compiled to WebAssembly for running in a browser.

6.0 / 10

NES

Download Tutorials & guides

Sign in to download. Files are hosted by the emulator project.

NES
SYSTEM SPOTLIGHTNESArtwork from the Retro Replay system database

About binjnes

Small, focused NES implementation with cycle-accurate timing goals, wide mapper support, save/load state and battery backup support, and the ability to build as a native program or a WebAssembly module for browser play. The project includes test harnesses and published test results to demonstrate correctness on many timing/APU tests.

Developers, researchers, or hobbyists who want a compact, test-oriented NES core they can build locally or run in a browser; also useful for running headless tests against ROMs because of its Python test harness and hash-based validation.

The people behind binjnes / history

binjnes is maintained on GitHub (binji/binjnes). The repository contains many commits and active project files (source, docs, tests, submodules) and describes the emulator as a "simple NES emulator" implemented in C with WebAssembly build support. The project documents its features, a long list of supported mappers and a Python-based test harness. The repository shows ongoing activity (commits and tests) at the time of inspection, but no single explicit founding year is stated in the repository README.

Screenshots

The Legend of Zelda gameplay on NES
Gameplay from The Legend of Zelda on NES. Image from the Retro Replay media library.
The Legend of Zelda gameplay on NES
Gameplay from The Legend of Zelda on NES.

Tutorials & guides

binjnes setup guide (click to expand)

Setup note: This guide describes how to obtain binjnes, build it natively and as WebAssembly, and run it. It follows the project's documented steps and relies on tools listed in the repository (CMake, sokol, optional Emscripten for wasm). The guide assumes you will supply your own NES ROM files and any legally required firmware; commercial games and firmware are not included with the project.

  1. Clone the repository (including submodules): Use a recursive clone so submodules (third-party libraries used by the project) are included: git clone --recursive https://github.com/binji/binjnes If you already cloned without submodules, run: git submodule update --init
  2. Prerequisites: Install CMake and a C toolchain for your platform. The README also references the sokol headers/libraries as a dependency (the project uses sokol). For building WebAssembly, install an Emscripten toolchain (the project expects an emscripten directory or a symlink pointing to your Emscripten installation).
  3. Build natively (Linux / macOS / Windows via CMake): From the repository root you can run make which will invoke CMake and place outputs in bin/. Alternatively: mkdir build && cd build && cmake .. && make The produced native executable is typically bin/binjnes. Run it from the command line as: bin/binjnes <path-to-rom.nes>
  4. Build WebAssembly (browser) with Emscripten: Provide a symlink or path named emscripten pointing to your Emscripten installation, then run: ln -s ${PATH_TO_EMSCRIPTEN} emscripten make wasm Or set EMSCRIPTEN_CMAKE on the make command line: make wasm EMSCRIPTEN_CMAKE="/path/to/Emscripten.cmake" The repository contains a docs/ and an example web UI used when running the wasm build.
  5. Run and control the emulator: Native: bin/binjnes <filename> The README documents keyboard controls for players, save/load state keys, rewind, pause, stepping one frame, and reset. When running in a browser, the included web UI supports file upload, input configuration, save download/upload, scaling and pause controls as documented on the project's site.
  6. Testing and validation: The repo includes a Python test harness (scripts/tester.py) and a test_results.md file. Use the provided scripts to run selected test categories (for example: scripts/tester.py apu). The project uses hash-based checks to validate test outputs.
  7. Changing build configuration or updating submodules: If you change submodules or build options, remove generated output directories before rebuilding to force CMake to reconfigure (the README suggests removing out/ or rerunning CMake).

Software reminder: binjnes does not include commercial game ROMs, BIOS/firmware, or license keys. You must provide legally obtained ROM images and any required files yourself. Follow local law when acquiring game files.

Additional information

What binjnes supports

  • Native Linux (build from source)
  • Native macOS (build from source)
  • Native Windows (build from source via CMake/Make or equivalent)
  • Web (WebAssembly build via Emscripten)

READMEs & documentation

binjnes official project README
[![Github CI Status](https://github.com/binji/binjnes/workflows/CI/badge.svg)](https://github.com/binji/binjnes)

# binjnes

A simple NES emulator.

## Features

* Cycle accurate, passes many timing tests (see below)
* Supports quite a few mappers
  * 0, 1, 2, 3, 4, 5, 7, 9, 10, 11, 13, 16, 18, 19, 21, 22, 23, 24, 25, 26, 28, 29, 30, 32, 33, 34, 38, 65, 66, 67, 69, 71, 75, 76, 78, 79, 80, 85, 87, 89, 93, 111, 118, 146, 163, 180, 206, 210, 232
  * Has built-in cart database
  * Supports additional audio channels for mapper 19, 24, 26
* Save/load battery backup
* Save/load emulator state to file
* Pause and step one frame
* **Rewind** and seek to specific cycle
* Convenient Python test harness using hashes to validate

## Cloning

Use a recursive clone, to include the submodules:

```
$ git clone --recursive https://github.com/binji/binjnes
```

If you've already cloned without initializing submodules, you can run this:

```
$ git submodule update --init
```

## Building

Requires [CMake](https://cmake.org) and
[sokol](https://github.com/floooh/sokol).

### Building (Linux/Mac)

If you run `make`, it will run CMake for you and put the output in the `bin/`
directory.

```
$ make
$ bin/binjnes foo.nes
```

You can also just use cmake directly:

```
$ mkdir build
$ cd build
$ cmake ..
$ make
```

### Building WebAssembly

You can build binjnes as a WebAssembly module. You'll need an incoming build of
emscripten. See https://github.com/kripken/emscripten/wiki/WebAssembly and
http://kripken.github.io/emscripten-site/docs/building_from_source/index.html#installing-from-source.

Put a symlink to Emscripten in the `emscripten` directory, then run make.

```
$ ln -s ${PATH_TO_EMSCRIPTEN} emscripten
$ make wasm
```
Or set Makefile variables via command line:
```
$ make wasm EMSCRIPTEN_CMAKE="/path/to/Emscripten.cmake"
```

### Changing the Build Configuration

If you change the build config (e.g. update the submodules), you may need to run CMake again.
The simplest way to do this is to remove the `out/` directory.

```
$ rm -rf out/
$ make
```

## Running

```
$ bin/binjnes <filename>
```

Keys:

| Action | Key |
| --- | --- |
| P0 DPAD-UP | <kbd>↑</kbd> |
| P0 DPAD-DOWN | <kbd>↓</kbd> |
| P0 DPAD-LEFT | <kbd>←</kbd> |
| P0 DPAD-RIGHT | <kbd>→</kbd> |
| P0 B | <kbd>Z</kbd> |
| P0 A | <kbd>X</kbd> |
| P0 START | <kbd>Enter</kbd> |
| P0 SELECT | <kbd>Tab</kbd> |
| P1 DPAD-UP | <kbd>Y</kbd> |
| P1 DPAD-DOWN | <kbd>H</kbd> |
| P1 DPAD-LEFT | <kbd>G</kbd> |
| P1 DPAD-RIGHT | <kbd>J</kbd> |
| P1 B | <kbd>K</kbd> |
| P1 A | <kbd>L</kbd> |
| P1 START | <kbd>O</kbd> |
| P1 SELECT | <kbd>I</kbd> |
| Reset | <kbd>Delete</kbd> |
| Save state | <kbd>F6</kbd> |
| Load state | <kbd>F9</kbd> |
| Rewind | <kbd>Backspace</kbd> |
| Pause | <kbd>Space</kbd> |
| Step one frame | <kbd>N</kbd> |

## Running tests

`scripts/tester.py` will only run the tests that match a filter passed on the
command line. Some examples:

```
# Run all tests
$ scripts/tester.py

# Run all apu tests
$ scripts/tester.py apu
```

## Test status

[See test results](test_results.md)
Download original README

Original project README source

Release log

Selected releases and changes, with coverage from our weekly emulation roundup.

    Sources & further reading

    FROM THE COMMUNITY

    Player reviews

    0 reviews
    6.0/ 10

    Overall rating

    Provisional site rating and approved member scores, each counted once.

    Starting site scores are provisional editorial scores. Established mainstream projects receive a higher starting score; other imported entries begin at a neutral 6/10 pending individual review. Member scores change the average after approval.

    Your take on binjnes

    Spam has been overwhelming. To help us approve your review, sign up and introduce yourself in the Introductions forum so we know you’re not a bot.

    Sign in with your Retro Replay account to rate this project and share your experience.

    Sign in to review