SNES Controller Studio

Browser-based timeline editor for creating and editing .DAT recording files used by the RP2040 SNES Controller Man-in-the-Middle Replay Device.

Open index.html in any modern browser. No server, no installation, no dependencies — everything runs locally in a single HTML file.

Getting Started

  1. Open index.html in your browser.
  2. Click Load to open an existing .DAT file, or start editing the default 5-second blank recording.
  3. Use the timeline to paint button presses, then click Save to download the .DAT file.
  4. Copy the saved file to your SD card and play it back on the device.

Interface Overview

Toolbar (top bar)

Controller Preview (center)

A visual SNES controller that shows the button state at the current playhead position in real time. Pressed buttons are highlighted with a red overlay.

Transport Bar (middle bar)

Timeline (bottom)

A horizontally scrollable canvas showing all 12 SNES buttons as rows. Each colored block represents a frame where that button is pressed.

Legend (left side) — Displays the button names in the order they appear on the timeline. Click a legend item to lock/unlock that button.

Canvas (right side) — The main editing area. Shows button data, selection highlights, the playhead, and second markers.

Timeline Interaction

Mouse Controls

ActionEffect
Left-clickMove playhead to that frame
Left-dragScrub playhead across frames
Shift+clickExtend selection to clicked frame
Right-click / Ctrl+clickPaint: toggle button state under cursor
Right-drag / Ctrl+dragPaint across multiple frames
Middle-click+dragPan the timeline horizontally
Scroll wheelZoom in/out centered on the mouse position

Keyboard Shortcuts

KeyAction
SpacePlay / Pause
Ctrl+CCopy
Ctrl+XCut
Ctrl+VPaste
EscapeClose overlays (About / Notes)

Keyboard shortcuts are disabled while typing in the filename input field or the notes textarea.

Button Locks

Click any button name in the timeline legend to lock it. Locked buttons display a padlock icon and a reddish background in both the legend and the timeline row.

When locks are active:

Locks are reset automatically when a new file is loaded.

Recording Notes

Click the Notes button in the toolbar to open an overlay with a text area where you can write free-form notes about the recording (game title, level, required setup, etc.).

Notes are stored as trailing metadata in the .DAT file, appended after the event data. The RP2040 firmware never reads past the event data, so the metadata is completely invisible to the device.

Event Limit

The RP2040 firmware supports a maximum of 25,000 RLE events per recording buffer. The editor enforces this limit on all operations:

The current event count is always visible in the transport bar status display.

Frames vs. Events

A frame is one 16.67 ms poll cycle (1/60th of a second). An event is one RLE entry that stores a 16-bit button state and a duration (number of consecutive frames with that exact state). Holding the same combination of buttons for 120 frames produces just 1 event. Rapidly alternating states produces many events. The event count determines file size and device compatibility, not the frame count.

File Format

All .DAT files use the same binary format as the RP2040 firmware:

OffsetSizeContent
04 bytesMagic ID: 0x53454E53 (ASCII "SNES" on little-endian)
44 bytesuint32_t event count
8+4 bytes eachRLE event array

Each RLE event is 4 bytes:

Button Bit Layout

BitButton
0B
1Y
2Select
3Start
4Up
5Down
6Left
7Right
8A
9X
10L
11R
12–15Always 1 (unused)

0xFFFF = all buttons released (idle frame).

Trailing Metadata (Notes)

The editor optionally appends a metadata block after the last RLE event. This block is only present when the user has entered notes.

OffsetSizeContent
end of events4 bytesMetadata magic: 0x4D455441 ("META" on little-endian)
+44 bytesuint32_t byte length of UTF-8 text
+8N bytesUTF-8 encoded notes string

All values are little-endian. The firmware never reads past the declared event count, so this block is invisible to the RP2040.

Browser Compatibility

Tested in modern Chromium-based browsers (Chrome, Edge) and Firefox. Requires JavaScript enabled. No external network requests are made — the tool works entirely offline.

License

This project is licensed under the Mozilla Public License 2.0.

Recording Notes

SNES Controller Studio
About | Repo
SNES Controller
Frame: 1 / 300
Events: 1 / 25000