SNET: Super Network Adapter
A Wi-Fi adapter for the original Super Nintendo that plugs into controller port 2. It syncs
battery saves with a WebDAV server in the layout RetroArch uses, so a game can be carried on
between the console and an emulator. Write-up: https://boland.dev/snet/
Layout
src/pico: RP2350 firmware. The controller-port link runs on core 1 with a PIO program
watching clock and latch; core 0 handles save sync, Wi-Fi setup and the coprocessor.
src/coproc: ESP32-C3 firmware, the rev A board’s Wi-Fi coprocessor.
src/snes: 65816 code. net.inc is the link protocol; setup is the Wi-Fi setup ROM;
linktest and netdemo exercise the link.
src/savehook, tools/savehook.py: patch a game so that power-on and reset sync its save.
tools: asset generators, the Mesen test runner and dongle model, and small utilities.
Breadboard build
A Raspberry Pi Pico 2 W, two 4k7 resistors and a controller extension cable cut in half, with
the console end wired to the Pico:
| SNES port |
Signal |
Pico 2 W |
| 1 |
+5 V |
the two pull-ups only |
| 2 |
Clock |
GP9 (pin 12), 4k7 pull-up to SNES pin 1 |
| 3 |
Latch |
GP10 (pin 14), 4k7 pull-up to SNES pin 1 |
| 4 |
D0 |
GP11 (pin 15), direct |
| 7 |
GND |
GND (pin 13) |
An LED on GP12 (pin 16) through 470R lights while the console is talking to the adapter.
Power the Pico from USB and switch it on before the console. Don’t connect SNES pin 1 to
VBUS or VSYS, and don’t put series resistors on the signal lines.
Plug it into controller port 2, build and flash the firmware (below), then run the setup ROM
(build/snes/setup.sfc) from a flash cart to join a network.
Building
Tools: cc65, Python 3, Lua, a C compiler, CMake, Ninja, arm-none-eabi-gcc with newlib, git,
curl and unzip, plus Rust 1.78 or later for the setup ROM’s music (optional; Ubuntu’s cargo is older, so use
rustup). On Ubuntu 24.04:
sudo apt install build-essential git curl unzip python3 lua5.4 cc65 cmake ninja-build \
gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib \
libusb-1.0-0-dev pkg-config libsdl2-2.0-0
make deps fetches the rest into vendor/: the Pico SDK 2.2.0, MesenCE 2.2.1 for the ROM
tests, and Terrific Audio Driver v0.4.2. On macOS, open Mesen once (make emu) to get past
its first-run wizard before running the tests.
make snes builds the ROMs into build/snes; make test runs every test.
make pico, then make flash-pico. A new Pico or one already running this firmware
needs no button; one running other firmware needs BOOTSEL held while plugging it in.
BOARD=rev_a builds for the rev A board instead.
- Rev A board’s ESP32-C3: ESP-IDF 6.0.
make coproc, then make flash-coproc.
- Save sync settings: copy
src/pico/savesync.env.example to src/pico/savesync.env.
make test-pico runs the firmware’s host tests and needs only a C compiler, Lua and Python.
Licence
GPL-3.0 (see LICENSE), except where noted below.
Third-party files
The Silkscreen font in src/pico/dongle/web is under the SIL Open Font License.
评论