# The site: emu.supertux.com ## Principle The page is a cabinet, not a lab notebook. A visitor should be playing within a minute of arriving, on a phone or a desktop, and should never have to read about Z80 conformance to get there. Everything the Galaxian page shows to make its point (the rung table, ZEXALL, the pins) stays in this repository and in CI. The page has one sentence about it and a link, on an About panel, for the few who want it. The Galaxian page is the direct ancestor; what its visitors hit is the starting list of things to fix here: choosing the zip on every visit, silent sound on phones until the first tap was explained, a landscape-first layout for a portrait game, no way to keep a high score. ## First visit 1. The page loads to a cabinet-styled frame with the screen dark and one clear action: **Add your Galaga ROM set**. A drop zone, a file picker, and a "paste a link" field (kept from Galaxian: fetched by the browser directly from that host, archive.org's `/cors/` path works, `?rom=` on load still works for sharing a link to a phone). One line says the file is read on this device only and never uploaded. 2. Verification failures are in human words: which set this is looking for (the MAME `galaga` parent set, "Galaga (Namco rev. B)", 16 files), and what was found instead, member by member. Merged sets, other revisions and bootlegs are refused with a sentence saying why, not a hash dump. 3. After the first successful verification the set is stored in the origin's IndexedDB. Every later visit boots straight into attract mode. A **Forget ROM** control in settings clears it. 4. Attract mode starts on its own. Sound is unlocked on the first tap, click or key (the Galaxian lesson); until then a small "tap for sound" hint sits on the screen and then disappears for good. Volume and mute are remembered. ## Playing - **Portrait first.** Galaga is a 224x288 vertical screen. On a phone in portrait the screen fills the width with the touch controls below it (left, right, fire large; start small; a coin control only when not in free play). On desktop the screen is centred at the largest integer scale that fits, with a fullscreen button. Landscape phones get the screen at full height with controls at the sides. - **Controls.** Keyboard (arrows or A/D, space, 1 and 2 for start, 5 for coin, P for pause), any standard-mapping gamepad (a toast says "controller connected" and shows the three buttons that matter), touch. A control map is one tap away, not printed under the screen. - **No coins unless wanted.** If the DIP switches offer free play it is the default; otherwise pressing Start with no credit inserts a coin first. The cabinet's coin step exists for people who want it, in settings. - **Pause** when the tab is hidden or the page loses focus; resume on return. - **Save and resume.** The board snapshot code the oracle needs already serialises everything. On page hide the snapshot goes to IndexedDB; on the next visit the page offers "Resume where you left off" beside "New game". Galaga's board has no NVRAM, so the high-score table lives only in RAM; the same mechanism keeps it across visits. - **Settings sheet** with consumer wording for the DIP switches (lives, bonus life, difficulty, free play, cabinet), a scanline overlay toggle (off by default), volume, control map, Forget ROM, and About. Every choice is remembered on the device. ## Under the page - **Offline.** A web app manifest and a service worker cache the page and the `.wasm`; with the ROM in IndexedDB the game works with no network, and phones offer "Add to Home Screen". This is cheap and is the difference between a demo and something people keep. - **Performance.** Three Z80s at 3.072 MHz is about 2.3 million instructions a second; the wasm core does 170 million. The board runs on the main thread as Galaxian does, paced by `requestAnimationFrame` with the 120 Hz fix, and the page shows nothing about frame rate unless it falls behind, when a quiet indicator appears. - **Privacy.** No analytics, no network requests after load except a ROM URL the visitor pasted. - **About panel.** Four sentences: what it is, that the ROMs are the visitor's own and never leave the device, that the CPU is a certified core and the board is checked against MAME in the repository, and the links. ## Hosting `emu.supertux.com` already resolves to this machine (the same wildcard as `galaxian.supertux.com`) and answers 404 because no Traefik router exists. The deploy is the Galaxian one with the name changed: `deploy/emu.yml` copied to `/docker/compose/apps/emu.yml`, `dist/` rsynced to `/docker/appdata/emu`, `scripts/deploy.sh` printing the deployed commit. Only `apps/emu.yml` is touched in the stack checkout. `galaga.supertux.com` is currently a hand-written JavaScript Galaga clone page from April 2026 (`/docker/appdata/galaga/index.html`, "Galaga - Clone"). It is unrelated to this project and is left alone; whether it later redirects to `emu.supertux.com` is the user's call. The game is served at the site root for now. The shell/board seam described in [build-approach.md](build-approach.md) is what would let a second game live at a path beside it later; nothing on the page presumes that yet.