Skip to content

mattgodbolt/bbc-claude-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BBC Micro Claude Demo

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.

The Demo

plasma — a classic demoscene plasma effect in MODE 2 (160×256, 16 colours).

Plasma effect running on BBC Micro

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.

How It Was Made

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 .ssd disc 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.).

Building

You'll need BeebAsm:

make

This assembles all src/*.asm files into build/*.ssd disc images.

Running

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.

Technical Notes

  • 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.md for 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–&75 used for loop variables and screen pointer
  • Vsync via OSBYTE 19 (LDA #19: JSR &FFF4)

Repo Structure

src/plasma.asm   — the plasma effect source
CLAUDE.md        — reference material for Claude (BBC Micro internals)
Makefile         — builds src/*.asm → build/*.ssd

About

Experimental repo to let claude play about with bbc micro stuff

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors