# nes-py
**Repository Path**: kaze_to_hi/nes-py
## Basic Information
- **Project Name**: nes-py
- **Description**: A Python3 NES emulator and OpenAI Gym interface.任天堂游戏模拟器,devilmaycry812839668/gym-tetris 游戏依赖于这个环境
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: https://github.com/Kautenja/nes-py
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 1
- **Created**: 2025-03-20
- **Last Updated**: 2025-03-20
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
[![build-status][]][ci-server]
[![PackageVersion][pypi-version]][pypi-home]
[![PythonVersion][python-version]][python-home]
[![Stable][pypi-status]][pypi-home]
[![Format][pypi-format]][pypi-home]
[![License][pypi-license]](LICENSE)
[build-status]: https://travis-ci.org/Kautenja/nes-py.svg
[ci-server]: https://travis-ci.org/Kautenja/nes-py
[pypi-version]: https://badge.fury.io/py/nes-py.svg
[pypi-license]: https://img.shields.io/pypi/l/nes-py.svg
[pypi-status]: https://img.shields.io/pypi/status/nes-py.svg
[pypi-format]: https://img.shields.io/pypi/format/nes-py.svg
[pypi-home]: https://badge.fury.io/py/nes-py
[python-version]: https://img.shields.io/pypi/pyversions/nes-py.svg
[python-home]: https://python.org
nes-py is an NES emulator and OpenAI Gym interface for MacOS, Linux, and
Windows based on the [SimpleNES](https://github.com/amhndu/SimpleNES) emulator.
# Installation
The preferred installation of `nes-py` is from `pip`:
```shell
pip install nes-py
```
## Debian
Make sure you have the `clang++` compiler installed:
```shell
sudo apt-get install clang
```
## Windows
You'll need to install the Visual-Studio 17.0 tools for Windows installation.
The [Visual Studio Community](https://visualstudio.microsoft.com/downloads/)
package provides these tools for free.
# Usage
To access the NES emulator from the command line use the following command.
```shell
nes_py -r
```
To print out documentation for the command line interface execute:
```shell
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](https://github.com/Kautenja/nes-py/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
0. NROM
1. MMC1 / SxROM
2. UxROM
3. CNROM
You can check the compatibility for each ROM in the following
[list](https://github.com/Kautenja/nes-py/blob/master/nesmapper.txt)
# Disclaimer
**This project is provided for educational purposes only. It is not
affiliated with and has not been approved by Nintendo.**