Skip to content
Screenshot published by the dendy project
Screenshot published in the dendy project's official README. Image source: dendy project on GitHub.

dendy

EMULATOR DATABASE

dendy

Dendy is an open-source NES / Famicom emulator written in Go. It focuses on playability and includes a built-in peer-to-peer netplay feature and a WebAssembly build that runs in modern browsers.

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 dendy

Dendy is notable for being implemented in Go with a simple, command-line-driven interface, native netplay support (peer-to-peer and relay-assisted room joining), and a WASM build that runs in browsers. It is intended as a hobby project emphasizing features rather than aiming for cycle-perfect accuracy.

Users who want a lightweight, Go-based NES emulator with easy netplay and a browser (WASM) demo; developers who want an example of an emulator implemented in Go or a starting point to experiment with netplay or WASM.

The people behind dendy / history

Dendy is actively maintained in its repository and contains source, documentation, and pre-built binaries. The project README describes the emulator as a hobby project that runs many games the author tested and highlights features added over time (netplay, WASM). The repository includes source for CPU/APU/PPU components, netplay/relay code, and build scripts. There are pre-built release assets for Windows, macOS, and Linux on the project's releases page, and a WASM-hosted demo is available from the project's documentation site. The author cautions it is not as accurate as long-established emulators.

Screenshots

Screenshot published by the dendy project
Screenshot published in the dendy project's official README. Image source: dendy project on GitHub.
The Legend of Zelda gameplay on NES
Gameplay from The Legend of Zelda on NES.

Tutorials & guides

dendy setup guide (click to expand)

Setup note: This guide covers practical setup: choosing between pre-built binaries, installing via Go, or building from source, plus runtime usage (ROMs, controls, and netplay). It focuses on verified, project-provided commands and requirements.

  1. Get the official release or WASM demo: Download pre-built binaries for Windows/macOS/Linux from the project's GitHub releases page. For a quick browser test, open the project's WASM demo on its GitHub Pages documentation site. The releases page and docs are the official distribution points; do not expect firmware, BIOS, or commercial game ROMs to be included.
  2. Install via Go (quick for Go users): If you have a recent Go toolchain installed, you can install the CLI directly (per the project's README) using: go install "github.com/maxpoletaev/dendy/cmd/dendy@latest". This retrieves the module and installs the dendy executable into your Go bin directory.
  3. Build from source (recommended for reproducible builds): Clone the repository: git clone https://github.com/maxpoletaev/dendy.git && cd dendy. Use the provided Makefile: make build. Building may require a C compiler (gcc/clang) and native dependencies for raylib when building the desktop front-end; consult the raylib-go requirements for your platform before building.
  4. Runtime: running a ROM: The emulator is command-line driven. Launch it with a path to a .nes file: dendy romfile.nes. Use dendy -help to list available flags. Common flags: -scale=<n> to scale the window, -nospritelimit to disable sprite-per-scanline limit, -nosave to prevent loading/saving state, -nocrt to disable CRT shader effect, and -gg to apply Game Genie codes (comma-separated).
  5. Controls and input: Player 1 is mapped to keyboard by default (README documents a typical layout). Gamepads are supported and are usually detected automatically. The mouse emulates the Zapper light gun for compatible games. Hotkeys include CTRL+R / ⌘+R to reset, CTRL+Q / ⌘+Q to quit, CTRL+X / ⌘+X to resync netplay, CTRL+Z / ⌘+Z to rewind ~5 seconds, F12 to screenshot, and M to mute.
  6. Netplay (peer-to-peer and relay-assisted rooms): Netplay requires both players to run the same ROM and the same emulator version. Host a session with: dendy -listen=0.0.0.0:1234 roms/game.nes. Connect from the client: dendy -connect=<host-ip>:1234 roms/game.nes. For NAT traversal without manual port-forwarding, use the built-in relay method: host with -createroom to obtain a room ID, and clients join with -joinroom=<id>. The README warns the relay/hole-punching approach can fail in cases like symmetric NAT.
  7. WASM usage: A WASM-compiled build is hosted on the project's GitHub Pages site. The WASM build runs in modern browsers but (per project notes) currently does not support netplay in its deployed form. Use the site for quick testing; for custom WASM builds, build from source with the project instructions and WASM target.
  8. Troubleshooting and building dependencies: If building from source fails, ensure you have a supported Go version, a C compiler (gcc/clang) for native dependencies, and the libraries required by raylib-go. The README references the raylib-go requirements for platform-specific setup. If a pre-built binary does not run on your platform, consider building locally or checking the releases page for the correct asset.

Software reminder: Dendy does not include commercial ROMs, console firmware, or BIOS files. You must supply your own legally obtained .nes ROM files. Ensure you use matching ROM versions for netplay and the same emulator version on all machines.

Additional information

What dendy supports

  • Windows (pre-built binaries available)
  • macOS (pre-built binaries available)
  • Linux (pre-built binaries available)
  • Web browsers (WASM build hosted)
  • Gamepad input (platform-dependent)
  • Mouse (Zapper emulation)

READMEs & documentation

dendy official project README
<div align="center">
   <img src="logo.png" width="300" alt="Kivi Logo">
   <p>NES/Famicom emulator with network multiplayer written in Go</p>
   <img src="https://img.shields.io/badge/status-Stable-green?style=flat-square" alt="">
   <img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="">
</div>

<hr>

Dendy is a NES/Famicom emulator written in Go and named after the post-soviet Famicom
clone, that I used to have back in my childhood. It’s nothing serious, so do not 
expect it to beat any of the existing emulators in terms of accuracy and compatibility. 
Yet, it is capable of running most of the games I tried, and it comes with a nice 
network multiplayer feature, so it’s not completely useless.

<img src="screenshots.png" alt="Screenshots">

## WebAssembly

The WASM-compiled version for modern browsers is available at 
https://maxpoletaev.github.io/dendy/. It runs surprisingly smooth, though it does 
not support netplay in its current form (there was an [experimental][wasm-netplay] 
implementation of it over WebRTC, but it was too slow and unreliable to be 
usable).

[wasm-netplay]: https://drive.google.com/file/d/1r3ZY20L168u3djRMWA_KLMrY0eIr1ify/view?usp=sharing

## Download

You can download the latest pre-built binaries for Windows, macOS, and Linux
from the releases page: https://github.com/maxpoletaev/dendy/releases (not
guaranteed to work as I don’t have a Windows machine to check it).

Alternatively, if you have Go installed, you either install it using:

```sh
go install "github.com/maxpoletaev/dendy/cmd/dendy@latest"
```

Or clone the repo and build it from source (preferable):

```sh
git clone https://github.com/maxpoletaev/dendy.git
cd dendy
make build
```

For this to work, you may need to install a C compiler (gcc or clang) and additional
dependencies required by raylib. See https://github.com/gen2brain/raylib-go#requirements
for more details.

## Play

There is no GUI, so you will have to run the emulator from the command line.
Just point it to a`.nes` ROM file you want to play:

```sh
dendy romfile.nes
```

There’s a bunch of command line flags that you can learn about by running
`dendy -help`. Here are some of the most useful ones:

 * `-scale=<n>` - Scale the window by `n` times (default: 2)
 * `-nospritelimit` - Disable original sprite per scanline limit (eliminates flickering)
 * `-listen` and `-connect` - For network multiplayer (see below)
 * `-nosave` - Do not load and save the game state on exit
 * `-nocrt` - Disables the CRT effect, in case you don’t like it
 * `-gg` - Apply Game Genie codes (comma-separated)

## Controls

### Controller

Player 1 controller is emulated using the keyboard. The default mapping follows the natural
layout of the controller (dpad on the left, buttons on the right). Second player's controls
are not supported on a single machine.

```
                   ┆┆
┌───────────────────────────────────────┐
│                                       │
│    [W]                      [U]  [I]  │   <- turbo buttons
│ [A]   [D]                             │
│    [S]                      [J]  [K]  │
│           [Enter] [RShift]            │
│                                       │
└───────────────────────────────────────┘
```

If a gamepad is connected, it will likely be detected automatically and can be used
instead of the keyboard. I tested it with a PS4 controller connected via Bluetooth.

### Zapper (Light Gun)

Zapper is emulated using the mouse and can be used in games like Duck Hunt. Just 
point the mouse cursor at the right position on the screen and click to shoot.

### Hotkeys

 * `CTRL+R` or `⌘+R` - Reset the game
 * `CTRL+Q` or `⌘+Q` - Quit the emulator
 * `CTRL+X` or `⌘+X` - Resync the emulators (netplay)
 * `CTRL+Z` or `⌘+Z` - Undo/Rewind 5 seconds back in time
 * `F12` - Take a screenshot
 * `M` - Mute/unmute

## Game Genie Codes

Game Genie was a cartridge pass-through device that allowed players to modify
the game program ROM data with special codes, creating new effects and cheats.
The code was basically a memory address:value pair that was patched in the
game's memory when that value was read from the cartridge.

You can use various Game Genie codes available on the internet with the emulator 
by passing them as a comma-separated list to the `-gg` flag.

## Network Multiplayer

To utilize the multiplayer feature, you need to start the emulator with the 
`-listen=<host>:<port>` argument on the host machine and the `-connect=<host>:<port>` 
argument on the client machine. Once the connection is established, the game 
will start for both sides. The host machine will be the first player. The players 
must ensure they are running the same ROM file and the same version of the emulator.

```bash
dendy -listen=0.0.0.0:1234 roms/game.nes       # Player 1
dendy -connect=192.168.1.4:1234 roms/game.nes  # Player 2
```

### When players are behind NATs

There is also a way to connect two players behind NATs without having to set up
port forwarding, with a little help from an external relay server. You can use
the `-createroom` flag to create a room on the public server, and the
`-joinroom=<id>` to join it.

Two clients will exchange their public IP addresses and port numbers through the
relay server and establish a peer-to-peer UDP connection using a technique called
"hole punching". The relay server will not be involved in the actual gameplay,
so it should not affect the latency. This method won’t work if both players are
behind symmetric NATs (luckily, most home residential NATs are not symmetric).

```bash
dendy -createroom roms/game.nes            # Player 1 - get a room ID
dendy -joinroom=XXX-XXX-XXX roms/game.nes  # Player 2 - use the room ID
```

I currently host a public relay server, which IP is hardcoded within the emulator.
In case it goes down at some point, you can run your own using the `dendy-relay`
binary (available when building from source), and then set the `-relay` flag in
the emulator to use it.

### Behind the scenes

The multiplayer part works by using something called rollback networking. This 
is a fancy way of making sure that when you play a game with someone else over the 
internet, it feels smooth and quick, just like playing side by side.

Here’s how it works: the game runs full speed for both players, and every move 
you make is sent over the internet to the other player. The cool part is, the 
local player should not notice any delay when they press buttons because the game 
guesses what the other player is going to do before their moves actually get to you.
If the guess is wrong, the game quickly fixes it by going back a tiny bit to when 
both players agreed on what was happening, then moves forward again using the 
correct moves.

In addition to predicting and correcting player actions, it has a mechanism to 
ensure frame rate synchronization between players, especially when there are 
drifts in clock speed causing one player’s game running slower than the other’s. 
The emulator can detect that one of the players is falling behind too much and
adjust the frame rate accordingly or even pause the game for one player for a 
few frames to let the other player catch up.

Within a reasonable latency, all of this should happen in a fraction of a second,
without the players noticing anything weird. When tested, ping of up to 150ms 
felt pretty playable.

## Tested Games

| Game | Status | Issues |
|------|--------|--------|
| [Bad Apple][badapple] | Playable ||
| Balloon Fight | Playable ||
| Batman| Playable ||
| Battle City | Playable ||
| Battletoads | Playable ||
| Battletoads & Double Dragon | Not Playable | Freezes |
| Bomberman | Playable ||
| Bomberman 2 | Playable ||
| Captain America | Playable ||
| Castlevania | Playable ||
| Chip 'n Dale | Playable ||
| Chip 'n Dale 2 | Playable ||
| Contra Force | Playable ||
| Contra | Playable ||
| Darkwing Duck | Playable ||
| Dr. Mario | Playable ||
| Donkey Kong | Playable ||
| Double Dragon 2 | Playable ||
| Double Dragon 3 | Playable ||
| Duck Hunt | Playable ||
| Duck Tales | Playable ||
| Ice Climber | Playable ||
| Jackal | Playable ||
| Kirby's Adventure | Playable ||
| Legend of Zelda | Playable ||
| Mario Bros. | Playable ||
| Megaman | Playable ||
| Megaman 4 | Playable ||
| Metal Gear | Playable ||
| Mighty Final Fight | Playable ||
| Ninja Cat | Playable ||
| Prince of Persia | Playable | Incorrect sprite/background priority |
| Super Contra | Playable ||
| Super Mario Bros. 3 | Crash ||
| Super Mario Bros. | Playable ||
| Teenage Mutant Ninja Turtles | Playable ||
| Teenage Mutant Ninja Turtles 2 | Playable ||
| Teenage Mutant Ninja Turtles 3 | Playable ||
| Teenage Mutant Ninja Turtles: Tournament Fighters | Not Playable | Graphical artifacts |
| Tiny Toon Adventures | Playable ||

[badapple]: https://www.nesdev.org/wiki/Bad_Apple

## Status

### CPU

* [x] Official opcodes
* [x] Unofficial opcodes
* [x] Runtime disassembly
* [x] Cycle-accurate emulation
* [x] Accurate clock speed
* [x] Interrupts

### Graphics

* [x] Background rendering
* [x] Sprite rendering
* [x] 8×16 sprites
* [x] Palettes
* [x] Scrolling

### Input/Output

* [x] Graphics output
* [x] Controllers
* [x] Zapper

### Sound

The sound chip emulation is still work in progress and is not very reliable yet.
It may occasionally produce some pops and crackles, but it should be good enough
for most games.

* [x] Square channels
* [x] Triangle channel
* [x] Noise channel
* [x] Length counter
* [x] Envelope
* [x] Sweep
* [x] DMC

### Mappers

The goal is to support top 7 mappers covering the majority of games. The
percentage indicates the number of games that use the mapper according to
nescartdb.com.

* [x] MMC1 (Mapper 1) - 28%
* [x] MMC3 (Mapper 4) - 24%
* [x] UxROM (Mapper 2) - 11%
* [x] NROM (Mapper 0) - 10%
* [x] CNROM (Mapper 3) - 6%
* [x] AxROM (Mapper 7) - 3%
* [ ] MMC5 (Mapper 5) - 1%

## Dependencies

 * https://github.com/gen2brain/raylib-go/raylib - Go bindings for Raylib (graphics/audio)
 * https://github.com/xtaci/kcp-go - TCP-over-UDP for netplay

## Resources

* [NESDev Wiki](https://www.nesdev.org/wiki/Nesdev_Wiki)
* [MOS 6502 CPU Reference](https://web.archive.org/web/20210429110213/http://obelisk.me.uk/6502/) by Andrew Jabobs
* [Extra Instructions of the 65xx Series CPU](http://www.ffd2.com/fridge/docs/6502-NMOS.extra.opcodes) by Adam Vardy
* [NES Rendering Overview](https://austinmorlan.com/posts/nes_rendering_overview/) by Austin Morlan
* [Making NES Games in Assembly](https://famicom.party/book/) by Kevin Zurawel
* [NES Emulator from Scratch](https://www.youtube.com/playlist?list=PLrOv9FMX8xJHqMvSGB_9G9nZZ_4IgteYf) series by javidx9
* [Audio pseudo-code](https://forums.nesdev.org/viewtopic.php?t=13767) by oRBIT2002
* [Retroarch Netplay README](https://github.com/libretro/RetroArch/blob/master/network/netplay/README)
* [GameGenie Technical Notes](https://tuxnes.sourceforge.net/gamegenie.html)

## Referenced Projects

* [github.com/OneLoneCoder/olcNES](https://github.com/OneLoneCoder/olcNES)
* [github.com/ad-sho-loko/goones](https://github.com/ad-sho-loko/goones)
* [github.com/fogleman/nes](https://github.com/fogleman/nes)
* [github.com/marethyu/nesty](https://github.com/marethyu/nesty)
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 dendy

    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