#emulator #6502 #nes

no-std runes

No-std NES emulator library and minimal emulator written purely in Rust

14 releases

0.2.3 Jul 9, 2018
0.2.2 Jul 8, 2018
0.2.1 Feb 5, 2018
0.1.9 Jan 22, 2018
0.1.1 Nov 19, 2017

#4 in Emulators

Download history 98/week @ 2018-11-01 19/week @ 2018-11-08 18/week @ 2018-11-15 34/week @ 2018-11-22 75/week @ 2018-11-29 24/week @ 2018-12-06 26/week @ 2018-12-13 115/week @ 2018-12-20 13/week @ 2018-12-27 15/week @ 2019-01-03 18/week @ 2019-01-10 6/week @ 2019-01-17 3/week @ 2019-01-24 3/week @ 2019-01-31 2/week @ 2019-02-07

171 downloads per month

MIT license

3.5K SLoC


https://img.shields.io/crates/v/runes.svg https://img.shields.io/crates/l/runes.svg

As we know, there have been a ton of NES emulator implementations in various kinds of languages (mostly C). All of these emulators come with different accuracy and portability. RuNES is an attempt to build a reasonably accurate (cycle-level accurate), light-weight and efficient emulation core library using Rust. Unlike sprocketnes or pinky, RuNES strives to provide with a clean and minimal core library without standard library (i.e., without Box, Rc, Vectors, etc.) that could be compiled and easily ported to embedded environments. Of course, a minimal but usable SDL-based GUI is also provided as a demonstration of use.


  • Core library with minimal use of the Rust core crate, and zero use of std.

  • Lightweight and clean code base.

  • Support standard 6502 instruction set (unofficial instruction will be considered in the future).

  • Load/save the machine state.

  • Cycle-level accuracy (in-progress).


  • Never use std in the core library.

  • At the same time, avoid unsafe as much as possible, but use it at discretion to improve performance: remove unnecessary checks within a very localized context.

  • Keep the core library code base minimal.

Build the Example Emulator


# for Ubuntu
# install Rust toolchain (https://www.rustup.rs/):
# $ sudo apt install curl gcc
# $ curl https://sh.rustup.rs -sSf | sh
# and add $HOME/.cargo/bin to your $PATH
# install SDL2 by:
# $ sudo apt install libsdl2-dev        # install SDL2 library

git clone https://github.com/Determinant/runes.git
cd runes
cargo build --examples --release        # build the binary
target/release/examples/runes --help    # see the help message

Mac OS X

# install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install Xcode command line tools
xcode-select --install
# install SDL2
brew install sdl2
# rust up
curl https://sh.rustup.rs -sSf | sh
# build RuNES and enjoy
git clone https://github.com/Determinant/runes.git
cargo build --examples --release

No runtime deps

  • dev clap 2.29
  • dev sdl2 0.31+unsafe_textures