Skip to content

Kautenja/nes-py

Repository files navigation

build-status PackageVersion PythonVersion Stable Format License

nes-py is an NES emulator and OpenAI Gym interface for MacOS, Linux, and Windows based on the SimpleNES emulator.

Bomberman II Castelvania II Excitebike
Super Mario Bros. The Legend of Zelda Tetris
Contra Mega Man II Bubble Bobble

Installation

The preferred installation of nes-py is from pip:

pip install nes-py

Debian

Make sure you have the clang compiler installed:

sudo apt-get install clang

Windows

You'll need to install the Visual-Studio 17.0 tools for Windows installation. The Visual Studio Community package provides these tools for free.

Usage

To access the NES emulator from the command line use the following command.

nes_py -r <path_to_rom>

To print out documentation for the command line interface execute:

nes_py -h

Controls

Keyboard Key NES Joypad
W Up
A Left
S Down
D Right
O A
P B
Enter Start
Space Select

Parallelism Caveats

both the threading and multiprocessing packages are supported by nes-py with some caveats related to rendering:

  1. rendering is not supported from instances of threading.Thread
  2. rendering is supported from instances of multiprocessing.Process, but nes-py must be imported within the process that executes the render call

Development

To design a custom environment using nes-py, introduce new features, or fix a bug, please refer to the Wiki. There you will find instructions for:

  • setting up the development environment
  • designing environments based on the NESEnv class
  • reference material for the NESEnv API
  • documentation for the nes_py.wrappers module

Cartridge Mapper Compatibility

  1. NROM
  2. MMC1 / SxROM
  3. UxROM
  4. CNROM

You can check the compatibility for each ROM in the following list

Disclaimer

This project is provided for educational purposes only. It is not affiliated with and has not been approved by Nintendo.