Skip to content
vmileaPublic

About

Fast, accurate, low-latency NES emulator for RP2040 / RP2350

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

NESmite

NESmite is a fast, accurate, low-latency NES emulator for microcontrollers. It currently supports boards in the Raspberry Pi Pico (RP2040) / Pico 2 (RP2350) family.

Games running in NESmite

Features

  • Plays most NES (US), Famicom, and Famicom Disk System games flawlessly.
  • Fits your setup:
    • modern: HDMI output with USB gamepads
    • retro: composite video for CRT TV with NES controllers and a light gun
    • mixed: PCBs with HDMI and NES controllers
  • Adds virtually zero lag (around 0.5 ms) compared to a real NES. Your display and gamepad will be the limiting factors.
  • Quality-of-life: save states, slow-motion, fast-forward, NES CPU "overclock" for smoother gameplay.

Compatibility

Supported mappers: 0, 1, 2, 3, 4, 5, 7, 9, 10, 11, 13, 15, 16, 18, 19, 21, 22, 23, 24, 25, 26, 28, 30, 32, 33, 34, 35, 36, 41, 46, 47, 48, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 82, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97, 105, 111, 112, 113, 114, 115, 118, 119, 121, 132, 133, 136, 138, 139, 140, 141, 143, 144, 145, 146, 147, 148, 149, 150, 152, 153, 154, 155, 156, 157, 158, 159, 172, 173, 176, 177, 178, 180, 184, 185, 189, 190, 191, 192, 195, 196, 197, 206, 207, 209, 210, 211, 212, 215, 227, 228, 232, 241, 242, 243, 268, 552, and the Famicom Disk System (20).

PAL games are not currently supported and Dendy games run at 60 FPS.

How to use

  1. Prepare an SD card with your ROMs. Format it as exFAT or FAT32.
  2. For Famicom Disk System: place the BIOS in the same folder as the games or at /mite/bios/disksys.rom.
  3. Download the UF2 file for your board from the Releases page.
  4. Connect the board to a PC while holding the BOOTSEL button, then copy the UF2 file.
  5. Hook up the peripherals and display. On a modern TV, make sure to enable game mode for minimal latency.
  6. Power it up and load your favorite game.

In-game shortcuts:

  • START + SELECT: quick menu
  • START + LEFT: slow down
  • START + RIGHT: speed up
  • START + UP: load state
  • START + DOWN: save state

Supported boards

NESmite is designed to work well on both RP2040 and RP2350 based boards:

  • RP2040 gets all of the features and can run even the most complex games like Lagrange Point (VRC7).
  • RP2350 is faster and can use PSRAM for quicker loading. Some RP2350 boards (those with an HSTX port, or any Raspberry Pi Pico 2 with a DVI sock) can output a 720p HDMI signal which looks sharper and has lower latency on some TVs.
  • Flash usage on boards without PSRAM: each loaded ROM is cached in flash memory for faster access. Old entries are evicted to make room when the flash is full. What this means: first load can take a couple of seconds, recent games load instantly, and flash wear isn't a concern in normal use. Boards with larger flash (4 MiB+) can hold more recent games.
  • Overclock: core voltage never exceeds 1.3 V, so the CPU remains stable without a heatsink. Frequency depends on video output: 252 MHz for default HDMI, 315 MHz for composite, 372 MHz for 720p HDMI.

Instructions

All-in-one boards:

PCB kits:

Breadboard:

You can easily add your custom board. To build the firmware yourself, see Building for a board.

Peripherals

Gamepads

The following USB controllers have been tested:

  • Xbox One controller
  • Xbox 360 controller
  • DualShock 4
  • DualSense

Generic HID and XInput gamepads should also work. Use a hub to connect multiple controllers.

NESmite polls USB devices at 500 Hz, but the actual latency depends on your gamepad. Check Gamepadla's latency tiers.

Up to two classic NES controllers are supported over GPIO. Input latency is indistinguishable from a real NES when using the classic controllers.

Light gun

Light guns should "just work" on a CRT TV.

Games also play fine over HDMI on some low-latency OLED / LCD displays - no IPS patches required. Be aware:

  • NESmite enables ALLM (Auto Low Latency Mode) on compatible TVs, but some brands need special configuration. For example: LG OLEDs require Game Optimizer with Prevent Input Delay set to Boost.
  • Some TVs have increased latency at the default 640x480 resolution. Try 720p instead if your board supports it.
  • Nintendo's original Zapper is tuned for the CRT scanline frequency and won't respond to the flash on an LCD. Use a light gun from a Dendy clone or a modern reproduction instead.

Some light guns may require external pull-ups on the sensor and trigger lines for reliable operation.

FAQ

There are no instructions for my RP2040 / RP2350 board. How do I set it up?

Pico or Pico 2 clones like the Pimoroni Pico Plus 2 usually work with the Pico UF2s. You can also build your own firmware (or ask an LLM to do it).

How do I connect two USB gamepads?

Through a hub. USB-C hubs don't work when plugged in directly: try a USB-A hub with an OTG adapter instead.

How does NESmite differ from pico-infonesPlus?

NESmite has a much more accurate and faster emulation core, wider mapper support, lower latency, conveniences like fast-forward / slow-motion and NES overclocking, and can output a composite signal for CRT TVs.

On the other hand, it doesn't support PAL games or NSF playback, and the range of supported boards and gamepads is smaller.

Note that NESmite leans heavily on AI during development, which makes any comparison quite unfair. Please continue supporting the PicoPlus-devel community!

Project history

I started this emulator back in August 2025, using smolnes to bootstrap, transplanting the chips M6502 emulator onto it, and gradually rewriting based on the NESDev docs until it became its own thing. A few months in it was passing most CPU / PPU tests and playing many tricky-to-emulate games. It still had no sound, just a dummy APU.

Most of the effort went into optimization (low-overhead memory bus, fast paths for CPU instructions without side effects, decoupling the PPU from CPU, scanline renderer with tile cache). Getting a NES emulator to run well on an MCU with limited registers, no branch predictor, no out-of-order execution, etc. is tougher than you'd expect! It was running at a respectable 90 FPS on RP2350 before I had to put the project on pause.

One year later: AI has taken over. Might as well make the most of it, so I put Opus to work: APU, mappers, USB controllers, UI, storage, more mappers, optimization, composite video, I2S / PWM audio, FDS, ever more obscure mappers. They say code is solved. But LLMs still suck at writing documentation, so here I am typing.

AI disclosure

This project is implemented with heavy LLM assistance. Every feature is human driven and tested. Effort is made to keep the codebase maintainable, but not every code change will receive human review.

Contributing

PRs are not currently accepted. Use the issue tracker for bug reports and feature requests. AI slop will be ignored.

Credits

  • NESDev - essential hardware documentation
  • pico-infonesPlus - feature-rich NES emulator for Pico / Pico 2. It showed what was possible and spawned numerous offshoots.
  • Mesen - debugging tools, color palette, good reference next to NESDev
  • smolnes and chips - emulator bootstrapping
  • emu2413 - adapted for VRC7 sound
  • FirebrandX - color palettes
  • NewRisingSun - database of NES 2.0 headers
  • PicoDVI - DVI output reference
  • PicoHDMI - HDMI over HSTX reference
  • Lola Retro - reference figures for the CRT simulation on PC
  • TinyUSB - USB library for microcontrollers
  • Pico-PIO-USB - PIO-based USB host / device implementation
  • FatFs - filesystem library

The licenses of the code compiled into the firmware are in THIRD_PARTY_NOTICES.md.

About

Fast, accurate, low-latency NES emulator for RP2040 / RP2350

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages