Pinky

Pinky is an NES emulator written entirely in Rust from scratch, based on publicly available documentation. You can even run it in your Web browser.

Features

  • Accurate Emulation: Provides cycle-accurate emulation of the 6502 CPU, PPU, and APU.
  • Test Suite: Includes a test suite based on various test ROMs.
  • PPU Test Suite: Automatically generated from a transistor-level simulation of a real PPU.
  • Mapper Support: Supports NROM (0), MMC1 (1), UxROM (2), AxROM (7), and UNROM 512 (30) mappers.
  • Libretro Core: Can be compiled as a libretro core.
  • WebAssembly: Can be compiled into WebAssembly for running in web browsers.

Current Limitations

  • Unofficial 6502 Instructions: Most unofficial 6502 instructions are not supported.
  • Additional Mappers: Limited mapper support.
  • PPU Sprite Overflow: Inaccurate emulation.
  • Savestate Support: Currently not implemented.
  • PAL Support: Not available.

Despite these limitations, Pinky can effectively emulate several popular NES games like Super Mario Brothers, Donkey Kong, and Tetris.

Getting Started

Pinky is split into multiple crates for modularity:

  • pinky-libretro: Contains the libretro core. To compile:

    cd pinky-libretro
    cargo build

    This builds a shared object (e.g., libpinky_libretro.so) that can be used with RetroArch:

    retroarch -L libpinky_libretro.so your_rom.nes
  • pinky-devui: A simple SDL2-based frontend. Run it by passing the path to your game ROM on the command line.

  • nes-testsuite: Contains an emulator-agnostic test suite of NES ROMs, which can be integrated with other emulators by implementing a single trait (see nes/src/testsuite.rs).

  • rp2c02-testsuite: A PPU test suite autogenerated with Visual2C02, a transistor-level simulator of an actual NES PPU.

  • nes: Contains the core emulator. mos6502 includes the 6502 interpreter, useful for emulating other 6502-based systems.

Why Another NES Emulator?

Creating a game console emulator is a rewarding and enjoyable project. Writing an NES emulator is particularly accessible due to the extensive documentation available for the NES hardware. Emulating the NES provides a great learning experience and the satisfaction of playing classic games on software you've built yourself.

Pinky is designed for enthusiasts and developers who appreciate the technical challenge and joy of creating an emulator from scratch.

For more information and to contribute to the project, visit the Pinky repository.

Similar Projects

Rustfinity.com

Links

  1. Home
  2. Learn Rust
  3. Get Started
  4. Practice Rust
  5. Challenges
  6. Tutorials
  7. Blog
  8. Open source
  9. Learn Gleam

Socials

  1. GitHub
  2. X

Legal

  1. Privacy Policy
  2. Terms of Service