An experiment in AI-assisted retro demoscene coding: Claude writing 6502 assembly for the BBC Micro, tested live via the jsbeeb-mcp server — a headless BBC Micro emulator Claude can talk to directly.
plasma — a classic demoscene plasma effect in MODE 2 (160×256, 16 colours).
The screen is filled once with a static pattern computed from two sine waves
(sin(x×3) + sin(y×5)), with the result mapped to one of the 16 available
colours. After that, the palette registers are rotated every frame via the
Video ULA — making the whole thing animate for free, with zero per-frame
redraw cost.
Claude was given access to jsbeeb via the jsbeeb-mcp MCP server, which lets it:
- Write 6502 assembly source
- Assemble it with BeebAsm
- Boot the resulting
.ssddisc image in a headless BBC Micro emulator - Take screenshots to see the result
- Iterate until it looks right
The CLAUDE.md file in this repo contains the reference material Claude used
(screen memory layout, pixel encoding, hardware register addresses, etc.).
You'll need BeebAsm:
makeThis assembles all src/*.asm files into build/*.ssd disc images.
Load build/plasma.ssd into any BBC Micro emulator (e.g.
jsbeeb, BeebEm,
b-em) and press Shift+Break to autoboot.
Or on real hardware, load it onto a floppy and boot it the old-fashioned way.
- Mode 2 — 160×256 pixels, 16 colours, screen memory at
&3000–&7FFF - Screen memory is organised in 8×8 character cells across 80 CRTC columns
(not 20 — see
CLAUDE.mdfor the full explanation of this gotcha) - Each byte encodes 2 pixels with an interleaved bit layout; a lookup table maps colour index → byte value
- Palette animation uses
&FE21(Video ULA palette register): cycling all 16 logical colours through 8 physical colours each vsync - Zero-page locations
&70–&75used for loop variables and screen pointer - Vsync via OSBYTE 19 (
LDA #19: JSR &FFF4)
src/plasma.asm — the plasma effect source
CLAUDE.md — reference material for Claude (BBC Micro internals)
Makefile — builds src/*.asm → build/*.ssd
