# play-2600 **Lineage:** a2600-python → a2600-rust → a2600-rust-fast → **play-2600** · fixes start in a2600-python and flow down by merges · [family charter](https://github.com/alewman/emulator-lineage/blob/main/docs/charter.md) The Atari 2600 in the browser, live at play-2600.supertux.com (deploys are Aubrey's call). The board is [a2600-rust-fast](../a2600-rust-fast) at `ac4b2ed` (every bus cycle identical to a2600-rust, which is identical to a2600-python) behind wasm-bindgen, unchanged; the page is play-gb's, itself play-nes's. A host (charter "The tiers"): it runs the board and defines no hardware behaviour. "The site matches the native board" is execution fidelity, not hardware accuracy: what the board knows about the hardware, and how well, is a2600-python's. **This repository replaces an archived one.** An earlier play-2600 ran an archived board; this one was written from play-gb and play-nes and the restarted a2600-rust-fast, without reading the archived site, its deployed files or the archived boards in any form. scripts/build-wasm.sh # web/pkg/ (toolchain 1.93.1, wasm-bindgen 0.2.128, wasm-opt); refuses a board not at ac4b2ed scripts/build-dist.sh # dist/, the static site scripts/build-native-bench.sh # the board's own a2600-bench, natively, for the gate bash -lc 'FRAMES=600 node scripts/check-node.mjs' # the gate: wasm vs native board, save states, run-ahead, speed ROM=game.a26 node scripts/check-browser.mjs # headless Chromium: load, run, Reset, rewind, phone layouts, console errors node scripts/check-included.mjs # headless Chromium: each included game starts; licence and notice files served node scripts/check-paddle-range.mjs # headless Chromium: Big Top Bounce's bat reaches both walls from the picture's edges node scripts/check-paddle-strip.mjs # headless Chromium, a phone: the touch paddle strip, the finger against the bat NO_INTRO_DIR=... node scripts/paddle-table.mjs # web/paddle-games.json: the paddle games' SHA-1s from the player's own set ROM=game.a26 FRAMES=600 [RUN_AHEAD=2] node scripts/bench-node.mjs scripts/deploy.sh [--no-build] # Aubrey only ## What it does - A cartridge from a file, a drop, a link or `?rom=` (`.a26`, `.bin`, `.rom`, or a `.zip` or `.7z` holding one); the last twelve are kept on the device (IndexedDB) with a save state each. Nothing is uploaded. No firmware or artwork is included. Four homebrew games are included, listed in the chooser after the recent ones, each with its licence or notice beside it in `web/games/` (sources, commits and SHA-1s in [web/games/SOURCES.md](web/games/SOURCES.md)): - **2048 2600** by Carlos Duarte do Nascimento (Chester), after Gabriele Cirulli's 2048, https://github.com/chesterbr/2048-2600, MIT licence (its cartridge art, by Jenn Harrison, is not included); - **Berta and Butterflies** by vandalton, https://github.com/vandalton/BertaAndButterflies, MIT licence; - **Big Top Bounce**, an original paddle game made for this family of emulators (alewman, the family's bigtop-2600 at `99a78af`, its NTSC build), MIT licence. It opens with paddles and its own paddle range (below); - **Sky Saviour 2600** by Flump Studios, https://github.com/FlumpStudios/SkySaviour2600 and https://flump-studios.itch.io/sky-saviour-2600: no licence file; shared on its README's "please feel free to share, hack and crack away!" (Aubrey's ruling, 2026-11-19), quoted in `web/games/sky-saviour-2600-NOTICE.txt`. Other candidates are in [docs/included-candidates.md](docs/included-candidates.md). - The cartridge's scheme is the board's own detection (`cartridge::load`). In a browser the board cannot read MAME's software list, so it is the board's detector alone ([docs/issues/0002](docs/issues/0002-softlist-needs-a-file.md)); every scheme the board builds loads (2K, 4K, F8, F6, F4 and their Super Chip forms, FA, E0, 3F, FE, E7, CV, UA, F0, 32-in-1, DPC, and Supercharger loads through the board's own BIOS stub). - The console (NTSC, PAL or SECAM row) is the player's choice per game, else guessed by the page: the file's No-Intro name, else the program's line count over its first frames (290 or more lines: PAL). The board has no region detection of its own ([docs/issues/0001](docs/issues/0001-no-region-detection.md)). The colours are the machine row's palette (the board's palettes.rs: MAME's BSD-3 NTSC and PAL tables, nocash's SECAM colours). - Controllers, per game: two joysticks, paddles (four), a Driving controller (left port, a joystick on the right) or two keypads, through the board's controllers.rs. The front panel: Select and Reset (held), TV type colour or B&W (none on SECAM, whose D3 is grounded), left and right difficulty A or B, under the picture, in Settings, and on keys. - Keyboard: arrows or WASD and Space (or Z, X) for the left joystick, I J K L and Right Shift for the right one (the board's window's keys); F1 or Left Shift Select, F2 or Enter Reset, F3 TV type, F4 and F6 the difficulties; F5/F7 save/load a state; P or Pause pauses; R or Backspace (held) rewinds; F9 sound on and off. Right Shift stays the right joystick's fire (the family's Select key is Right Shift where it is free; provisional, 2026-11-23). Paddles: Left/Right turn paddle 1, or the mouse over the picture (its button fires), or a controller's left stick (controllers 1-4 are paddles 1-4). The mouse turns paddle 1 only; touch turns it with the pad's left and right. All of them turn a paddle over the whole knob, unless a game has its own range (`GAME_DEFAULTS` in `web/app.js`, by the file's SHA-1, under the player's own choices): Big Top Bounce's bat spans pot positions 0.00-0.28 only, so for it the mouse across the picture, a stick across its travel and the keys' 1.2 s sweep cover 0.28 (picture's left edge) to 0 (right edge), and the bat reaches both walls with the mouse at the picture's edges (`node scripts/check-paddle-range.mjs`). Keypads: 1 2 3 / Q W E / A S D / Z X C and the numeric keypad. Controllers go by position (any face button fires, Select/Back is Select, Start is Reset); an unmapped pad's hat-switch d-pad is read as play-nes reads it; the left trigger rewinds and the right stick pressed (R3) pauses. Touch: play-gb's 8-way round pad, one FIRE button, Select and Reset; in landscape the picture takes the full height and the pad floats over the margins. Settings can buzz on each touch press (Android; off at first). The controls are the family's (emulator-lineage `docs/proposals/2026-11-play-controls.md`): `web/controls.js` is a copy of play-nes's, its second line naming the play-nes commit, checked by play-nes's `scripts/controls-drift.sh`. - **The touch paddle strip.** A game running with paddles (its own defaults, the paddle table below, or the player's choice in Settings) shows a strip on a touch screen, the picture's width, right under it: above the pad when the phone is upright, under the picture on its side (the picture gives up the strip's height; the d-pad steps aside; FIRE stays bottom-right). The finger's place along the strip is paddle 1's place, absolutely, as the mouse over the picture is, over the game's paddle range; the finger that lands on it owns it until lifted, even off it, and presses nothing else; lifting it leaves the paddle where it is; the strip does not fire (FIRE, under the other thumb, does). A mark shows where the paddle is. A game may turn the paddle over the middle of the strip only (`stripSpan`), so the finger sits under its bat: Big Top Bounce's wide bat's centre travels from picture x 29 to 131 of 160, so its span is 18.1-81.9% of the strip (MEASURED). `scripts/check-paddle-strip.mjs` measures it: inside the span the bat's centre is within 2 picture pixels of the finger (4.5 CSS pixels upright on a 390-pixel phone, 5.6 on its side); past the ends the bat stays at the wall. Paddles 2-4 stay on controllers 2-4 and the J/L keys. - **Which games use paddles.** `web/paddle-games.json` lists 25 commercial paddle games (70 SHA-1s: each No-Intro file and the ROM inside it), made by `scripts/paddle-table.mjs` from our own list of titles hashed against the player's `$NO_INTRO_DIR` set; no ROM and no other emulator's database (Stella's is GPL) is used. Those games open with paddles, under the player's own choice. - The picture is 160 colour clocks wide and a fixed window of lines tall (NTSC lines 24-257 after VSYNC, PAL and SECAM 30-309), shown at 4:3. The window is a presentation choice: it holds every drawn line of the games probed (docs/status.md); a game that draws outside it loses those lines on screen only. - Sound: the TIA's samples (two a line) resampled linearly to the page's rate, a 20 Hz high-pass for the standing level, through play-gb's AudioWorklet. The console's analogue output stage is not modelled. - Frames are paced by the console's own clock: a frame lasts as many lines as the program made it, so sound and picture keep time on a program with 263 or 312 lines. ## Run-ahead and rewind (play-gb's, play-nes's) Both rest on the board's `state::save_state` / `load_state` (about 5 KB a state) and on the page's own line collector, which is copied with them (the board's television keeps its line buffer private, so the page collects lines itself by the board's rule: a new frame when VSYNC ends, or after `MAX_LINES` lines). - **Run-ahead** (Settings: Off, 1 or 2 frames): the real frame runs and gives the sound; then a state, `n` frames more with the same inputs, paint, and the state back. - **Rewind** (hold R or Backspace, a controller's left trigger, or the bar's ⏪): a deflate-fast state every 4 frames, about a minute kept (48 MB cap); holding loads the newest each frame and forgets it, so it goes back 4x as fast as the game ran. A frame ends when the television's frame ends (VSYNC falling), not when the next VSYNC starts as `System::run_frames` counts, so the picture shown is the frame just finished (no frame of lag). The Driving controller's knob position is the host's and is saved beside the board's state. ## Status Measured numbers, the gate and what no human has checked yet: [docs/status.md](docs/status.md). ## Licence MIT ([LICENSE](LICENSE)). [NOTICE](NOTICE) repeats the notices that travel with the compiled board (MAME's BSD-3 palette tables); the site serves it as `NOTICE.txt`. `scripts/build-dist.sh` first writes `web/notices.html` (`python3 -I scripts/notices.py`): every component the wasm is built from, its licence, and its LICENSE and NOTICE files and the licence notices kept in its sources, verbatim, linked from the start panel and Settings, About. It stops the build when a family crate has no LICENSE file. A notice a pinned crate owes but does not carry goes in `notices/` (none here). The page opens with the included games' terms and attribution (`notices/games.json`), quoting the licence and notice files served beside them. The build stops when a file in `web/games/` or `INCLUDED` has no entry there, or a game's SHA-1 is not its entry's: a new build of Big Top Bounce needs its entry's SHA-1 updated with SOURCES.md.