Home

Awesome

<p align="center"> <img src="https://user-images.githubusercontent.com/2184469/42918029-a8364c66-8ad1-11e8-8147-2653091ccd38.png" width="50%" /> </p>

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.

<table align="center"> <tr> <td> <img width="256" alt="Bomberman II" src="https://user-images.githubusercontent.com/2184469/84821320-8c52e780-afe0-11ea-820a-662d0e54fc90.png" /> </td> <td> <img width="256" alt="Castelvania II" src="https://user-images.githubusercontent.com/2184469/84821323-8ceb7e00-afe0-11ea-89f1-56d379ae4286.png" /> </td> <td> <img width="256" alt="Excitebike" src="https://user-images.githubusercontent.com/2184469/84821325-8d841480-afe0-11ea-9ae2-599b83af6f65.png" /> </td> </tr> <tr> <td> <img width="256" alt="Super Mario Bros." src="https://user-images.githubusercontent.com/2184469/84821327-8d841480-afe0-11ea-8172-d564aca35b5e.png" /> </td> <td> <img width="256" alt="The Legend of Zelda" src="https://user-images.githubusercontent.com/2184469/84821329-8d841480-afe0-11ea-9a57-c9daca04ed3b.png" /> </td> <td> <img width="256" alt="Tetris" src="https://user-images.githubusercontent.com/2184469/84822244-fc15a200-afe1-11ea-81de-2323845d7537.png" /> </td> </tr> <tr> <td> <img width="256" alt="Contra" src="https://user-images.githubusercontent.com/2184469/84822247-fcae3880-afe1-11ea-901d-1ef5e8378989.png" /> </td> <td> <img width="256" alt="Mega Man II" src="https://user-images.githubusercontent.com/2184469/84822249-fcae3880-afe1-11ea-8271-9e898933e571.png" /> </td> <td> <img width="256" alt="Bubble Bobble" src="https://user-images.githubusercontent.com/2184469/84822551-79411700-afe2-11ea-9ed6-947d78f29e8f.png" /> </td> </tr> </table>

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 KeyNES Joypad
WUp
ALeft
SDown
DRight
OA
PB
EnterStart
SpaceSelect

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:

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.