This repo contains firmware, scripts, documentation, and PCBs for creating a Tool Assisted Speedrun replay device for the Nintendo Entertainment System (NES) and Super Nintendo Entertainment System (SNES). It is based on the Cypress PSoC 5LP. A development kit: CY8CKIT-059 is commonly used to build this replay device as it is available from multiple electronics distributors and available for less than $15 USD.
This requires a Windows environment to perfrom the steps due to the Cypress PSoC Creator IDE application.
- Download and install the Cypress PSoC Creator IDE
- Clone this repository to your machine (or alternatively download the tar/zip ball)
- Open the TASBot.cywrk file with Cypress PSoC Creator
- Click on Build => Clean and Build TASBot
In the Output window you should see many messages scroll by ending with
Rebuild Succeeded
- Click on Debug => Program
In the Output window you should see many messages scroll by ending with
Device 'PSoC 5LP CY8C5888LT*-LP097' was successfully programmed
- Close Cypress PSoC Creator
- The device is now ready for use
The PSoC5 needs to be physically attached to the NES/SNES via some kind of cable. This can be via a breadboard and jumper wires or elaborate setups with visualization boards, RJ45 connectors, and custom cabiling.
Depending on the movie you want to replay depends on if a "normal" extension cable can be used to connect the PSoC5 and the console. If the movie only uses one controller or Y cable configuration (no multitaps) an extension cable may be able to be used and directly connected to the PSoC5. Best case is to always check your extension cables for compatibility or build your own.
There isn't much need for multi-tap support for replay devices as most TAS ACEs are done with Y cable or normal controller configurations.
The PSoC 5 has fully re-configurable pins. The below layout describes the default configuration.
Some lines have two PCB Pins specified. This means that there should be a connection from both pins to the given SNES/NES controller pin.
PSoC Name | Description | PCB Pin | SNES Pin | NES Pin |
---|---|---|---|---|
P1_D0[1:0] | Player 1 D0 | 120,121 | 4 | 4 |
P1_D1[1:0] | Player 1 D1 | 122,123 | 3 | 6 |
P1_D2[1:0] | Player 1 D2 | 124,125 | 2 | 7 |
P1_Latch | Player 1 Latch | 21 | 5 | 3 |
P1_Clock | Player 1 Clock | 20 | 6 | 2 |
PSoC Name | Description | PCB Pin | SNES Pin | NES Pin |
---|---|---|---|---|
P2_D0 | Player 2 D0 | 126,127 | 4 | 4 |
P2_D1 | Player 2 D1 | 26,27 | 3 | 6 |
P2_D2 | Player 2 D2 | 24,25 | 2 | 7 |
P2_Latch | Player 2 Latch | 23 | 5 | 3 |
P2_Clock | Player 2 Clock | 22 | 6 | 2 |
PSoC Name | Description | PCB Pin |
---|---|---|
Vis_D0 | Visualization D0 | 15 |
Vis_D1 | Visualization D1 | 16 |
Vis_D2 | Visualization D2 | 17 |
Vis_D3 | Visualization D3 | 30 |
Vis_Latch | Visualization Latch | 154 |
Vis_Clock | Visualization Clock | 14 |
The overall schematic design of the replay device:
The detailed schematic of the controller ports:
The replay device is supported on any platform that supports Python3 and supports USB Serial devices.
- Install python3 for the platform you want to run your replay device on
- Install pip
- Clone this repository to your machine (or alternatively download the tar/zip ball)
- Install the python prerequisites:
- Type:
pip3 install pyserial
(you may need sudo or just pip depending on how python is installed on your system) - NOTE: Do not install the
serial
python library. If you have it installed remove it by typingpip3 uninstall serial
. It will cause conflicts. If you see the error:AttributeError: module 'serial' has no attribute 'Serial'
the serial library is installed and must be uninstalled.
- Type:
- Use the correct Python script to run the movie file
- The Python scripts are located in the Scripts directory
- You have to use the correct script for the movie you want to play back:
- NES - play_r08.py
- SNES YCable/Single - play_r16y.py
- SNES Multitap - play_r16m.py
- Type:
python3 {nameOfScript} {serialDevice} {pathToMovieFile}
OR./{nameOfScript} {serialDevice} {pathToMovieFile}
- Where
{nameOfScript}
is the name of one of the scripts listed above - Where
{serialDevice}
is the name/path of the serial device created by the replay device. example:/dev/ttyACM0
,COM3
,/dev/tty.usbmodem1411
, etc. - Where
{pathToMovieFile}
is the path to an .r08 or.r16m.
- Where
- Best practice is to start with the console off, run the python script, then turn the console on.