-
Notifications
You must be signed in to change notification settings - Fork 518
Experimental and optional features
You can always run pyboy --help to find an overview of available features and options:
$ python -m pyboy --help
usage: __main__.py [-h] [-b BOOTROM] [--profiling]
[--log-level {ERROR,WARNING,INFO,DEBUG,DISABLE}]
[--color-palette COLOR_PALETTE] [-l [LOADSTATE]]
[-w {SDL2,OpenGL,headless,dummy}] [-s SCALE]
[--disable-renderer] [-d] [--no-input] [--autopause]
[--record-input] [--rewind] [--game-wrapper]
ROM
PyBoy -- Game Boy emulator written in Python
positional arguments:
ROM Path to a Game Boy compatible ROM file
optional arguments:
-h, --help show this help message and exit
-b BOOTROM, --bootrom BOOTROM
Path to a boot-ROM file
--profiling Enable opcode profiling (internal use)
--log-level {ERROR,WARNING,INFO,DEBUG,DISABLE}
Set logging level
--color-palette COLOR_PALETTE
Four comma seperated, hexadecimal, RGB values for
colors (i.e. "FFFFFF,999999,555555,000000")
-l [LOADSTATE], --loadstate [LOADSTATE]
Load state from file. If filepath is specified, it
will load the given path. Otherwise, it will
automatically locate a saved state next to the ROM
file.
-w {SDL2,OpenGL,headless,dummy}, --window-type {SDL2,OpenGL,headless,dummy}, --window {SDL2,OpenGL,headless,dummy}
Specify window-type to use
-s SCALE, --scale SCALE
The scaling multiplier for the window
--disable-renderer Disables screen rendering for higher performance
-d, --debug Enable emulator debugging mode
--no-input Disable all user-input (mostly for autonomous testing)
--autopause Enable auto-pausing when window looses focus
--record-input Record user input and save to a file (internal use)
--rewind Enable rewind function
--game-wrapper Enable game wrapper for the current game
Warning: Features marked with (internal use) might be subject to change.
PyBoy is bundled with several window implementations. The recommended is SDL2, and its installation is described in the installation instructions.
The installations instructions here, will be sparse, as they are mostly for the technically interested.
-
SDL2: Covered by the default installation. -
OpenGL: Install OpenGL and FreeGLUT through the system's package manager. Installpyopengland optionallypyopengl-acceleratethrough pip. -
dummy: No installation required. -
headless: No installation required. Used for rendering to a buffer.
The "window" can be chosen via the arguments supplied to Python. For example:
python3 -m pyboy gamerom.gb --window SDL2
If the pillow package is available, PyBoy can record video from the screen and save it in a .gif file. This requires the following additional dependencies:
# Linux
sudo apt install libsdl2-dev libtiff5-dev libjpeg8-dev zlib1g-dev
# Mac
brew install libjpeg libtiff
These can be installed with apt or whatever package manager your distro uses.
Install the pillow package with pip:
python3 -m pip install pillow
PyBoy will detect whether pillow is present, and screen recording can be triggered with the I key.
By providing the --rewind flag when starting PyBoy, you'll be able to pause the emulation, and rewind the game (for example before you lost the game).
Use the , and . keys to wind backwards and forwards.
By providing the --debug flag when starting PyBoy, you'll be presented with multiple windows showing the inner workings of the graphics of PyBoy.