PSXLE (or PSX __L__earning __E__nvironment) is an PlayStation 1 (PSX) emulator, written in C, that allows programmatic control of PlayStation games. This documentation covers the associated Python library PSXLE-py, which allows simple per-game integration with OpenAI Gym and other Python applications. The design and development of PSXLE is shown in the paper on arXiv.
Note: a pre-built version of
psxle will soon be available from http://carlospurves.com/, if you're using this version, you can skip to "Installing".
The following are requirements to build
psxle on your own computer. Note that this has only been tested on Ubuntu 16.04+ and other systems may require additonal steps.
cmake can be used directly for a system-wide installation, you can make use of the pre-prepared
build_psxle script to automate the process for most cases. You should then be able to build
The default build directory will be set to
./psxle_build (relative to where the script runs), although you can choose a different directory as an argument to the build script.
To install, run:
The Python library's main function is to expose a
Console class to represent a PlayStation instance. This class is designed to support interations that broadly fall into four categories:
killcontrol the executing process of the emulator
unfreezewill freeze and unfreeze the emulator's execution, respectively
speedis a property of
Consolewhich, when set, will synchronously set the speed of execution of the console, expressed as a percentage relative to default speed
release_buttonsimulate a press down and release of a given controller button, call these control events
touch_buttonholds, pauses for a given amount of time and then releases a given button
delay_buttonadds a (millisecond-order) delay between successive control events
write_byteto directly read and write console memory.
clear_memory_listenerscontrol which parts of console memory will have asynchronous listeners attatched when the console starts
wake_memory_listenertell the console which listeners are active
stop_recording_audiocontrrol when the console should record audio and when it shoud stop
get_screensynchronously returns an
np.arrayof the console's instantaneous visual output
Using a combination of these methods allows for the creation of a game abstraction. See the PSXLE paper on aXiv for more discussion. More information will be made available here soon.
Note: console emulation requires a disk image of a game. None are provided here. These should be obtained legitimately through purchased copies and used only for personal use.
To begin running a PlayStation console (assuming installation is successfull), run:
python3 quickstart.py <PATH TO ISO>
This will start a console to run the specified game and enter a python REPL with a
Console object given by
c. You can type, for example
c.freeze to freeze the console, or
c.speed = 200 to run the console at double speed.