Skip to content
rob-smallshirePublic

About

A BBC Micro emulator with separate backend and front-end.

Resources

Stars

12 stars

Watchers

0 watching

Forks

Repository files navigation

The Shape of Beebium: a sunset over a mirrored floor with a cylinder, a cuboid and a pyramid

Beebium

CI Test count

A different take on a BBC Micro emulator, with a Chromium-inspired architecture.

Overview

Different emulators serve different purposes. Some prioritise nostalgia and game compatibility. Others focus on accuracy or preservation. Beebium's primary goal is to serve as a foundation for tools for creating new software for the BBC Micro and its coprocessors.

The architecture reflects this goal: a headless emulation core that runs as a server, with frontends connecting via gRPC. This separation will enable integration with IDEs, test harnesses, continuous integration pipelines, and custom development tools, not just standalone GUI emulators.

Moreover, this architecture also facilitates native GUIs with first-class host platform integration, rather than the compromises required by cross-platform graphics toolkits. The macOS frontend uses Swift and Metal. A Windows frontend can use WinUI 3 and Direct3D. A Linux frontend can use GTK or Qt. Each platform's code remains clean and idiomatic, unencumbered by the complexity of accommodating other platforms.

Key Features

  • Cycle-accurate 6502 emulation — NMOS and CMOS variants supported
  • Seven machine variants — Model B, B+, B+ 128K, and Model B with the notional ROM/RAM, ATPL Sidewise, Watford ROM/RAM and Integra-B boards
  • Floppy disc support — SSD and DSD (DFS), ADFS (.adf/.adl/.adm/.ads) and HFE flux-level images, all with read/write
  • Cassette tapes — UEF and CSW tape images and WAV recordings and live audio input (through a model of the machine's analogue input), loaded through the emulated Serial ULA, and recording on UEF tapes, so a program can SAVE to a blank tape made from a shipped C15 to C90 template (docs/cassette.md)
  • Pluggable peripherals — each a loadable extension:
    • Coprocessors — Acorn 65C02 (3 MHz) and 65C102 (4 MHz) second processors, and the Acorn ARM Evaluation System (a 6.67 MHz ARM1 with 2 or 4 MB), contributed from AESulator
    • Serial — IP232, RFC 2217 (client and server), host serial port, and loopback adapters
    • Econet transports — AUN over UDP, and Piconet bridging to real Econet hardware
    • Storage — Acorn SCSI host adapter and SCSI hard-disc targets
    • Real-time clock — Acorn user-port RTC module
    • Sound -- Hybrid Music 5000 synthesiser and Music 3000 expander on the 1 MHz bus, with the board's own analogue output filter (docs/music-5000.md)
    • Analogue port -- the uPD7002 converter with its measured conversion timing, a joystick, and the Voltmace Delta 14B/1 adapter with two Delta 14B handsets in the analogue and user ports together; a client sets their sticks and buttons through ControllerService (docs/analogue-port.md)
  • Headless core — deterministic, UI-free emulation server
  • Process separation — core and frontends communicate via gRPC
  • Platform-native frontends — native UI using Cocoa and Metal on macOS

Get Beebium

The complete emulator — the app, the servers, the ROMs, presets and extensions — is published on the releases page.

The macOS app

The full BBC Micro emulator in a single download. Grab the DMG for your Mac from the latest release, open it, and drag Beebium into your Applications folder — there are separate builds for Apple Silicon (macos-arm64) and Intel (macos-x86_64). Or install it with Homebrew:

brew install --cask rob-smallshire/beebium/beebium-gui

Requires macOS 13 (Ventura) or newer.

The Linux app

On Debian 13 (trixie) and Raspberry Pi OS (trixie), or Ubuntu 26.04 LTS, amd64 or arm64, download the beebium-client package for your distribution (.debian13 or .ubuntu26.04 in its name) and beebium-server from the latest release, and install both with apt, so their dependencies come too:

sudo apt install ./beebium-client_*.debian13_arm64.deb ./beebium-server_*_arm64.deb

Then start Beebium from the desktop's menu. The app finds the servers by itself; if you keep them somewhere else, say where in Settings > Configure Beebium.

There is no Windows app yet. On Windows, run Beebium through the headless servers below.

Headless servers, for developers

Drive Beebium from the Python or TypeScript client, from CI, or from your own gRPC client — or point the macOS app above at a server running on another machine (it discovers them on your LAN automatically via mDNS/Bonjour). Each package puts the four servers (Model B, B+, B+ 128K, ROM/RAM) on your PATH, with the ROMs and extensions bundled.

  • Any platform (Python) — pip install beebium beebium-server (beebium is the client library; beebium-server ships the servers)
  • Linux — self-contained .deb (Debian / Ubuntu / Raspberry Pi OS) and .rpm (Fedora / RHEL / openSUSE) for amd64 and arm64, or a .tar.gz for any distro
  • macOS — brew install rob-smallshire/beebium/beebium-server on Apple Silicon, or a self-contained tarball (Apple Silicon or Intel)
  • Windows — scoop bucket add beebium https://github.com/rob-smallshire/scoop-beebium then scoop install beebium-server, or a self-contained zip

Direct download links for every package are on the releases page.

Architecture

Beebium architecture: clients drive headless emulator servers over gRPC

A single headless core serves every frontend over gRPC — a well-defined protocol boundary rather than a UI wired into the emulator. Frames flow through a lock-free queue, so a client may drop frames while the emulation loop runs on without ever blocking.

Usage

If you installed the macOS app, just launch it and choose a machine — everything it needs is inside the bundle.

To drive Beebium programmatically — for testing, automation, or CI — use the Python client. Install it, with the optional server wheel, from PyPI:

pip install beebium beebium-server

With beebium-server present, launch() needs no arguments: it finds the server and its ROMs in that wheel.

from beebium.client import Beebium

with Beebium.launch() as bbc:
    bbc.expect("BASIC")             # wait for the BASIC prompt
    bbc.keyboard.type("PRINT 2+2")
    bbc.keyboard.press_return()
    print(bbc.expect("4"))          # -> 4

The client can type on the keyboard, read the screen in any display mode, peek and poke memory, drive the debugger, and mount discs. See the Python client README for the full API, the pytest bbc fixture, and more examples. A TypeScript client (npm install @beebium/client) offers the same control from Node.

Building from source

You need this only to contribute to Beebium or to run an unreleased version — users should install from the channels under Get Beebium.

Prerequisites

  • CMake 3.16+ and a C++20 compiler (Clang 14+, GCC 11+)
  • gRPC and Protobuf — via Homebrew on macOS (brew install cmake grpc protobuf), your distro's -dev packages on Linux, or vcpkg on Windows
  • Catch2 v3.x is fetched automatically
  • For the Python client: Python 3.12+

Server and core

cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel

The server executable, beebium-server, lands in build/src/server/ with each machine model's name beside it (beebium-model-b, beebium-master-128, ...); the beebium-servers target builds it and every plugin. Run the test suite with:

ctest --test-dir build --output-on-failure

Some integration tests run only when an optional tool (beebasm, pySerial, tcpser) is on the PATH, and skip cleanly otherwise — see Testing with real 6502 code.

macOS app

The app embeds the server executables in its bundle, so the servers are built first. The CMake macos-app target does both:

cmake --build build --target macos-app    # build servers + app
cmake --build build --target macos-run    # ... and launch it

To work in Xcode directly, or for self-contained distribution builds, see docs/building.md and docs/macos-app-packaging.md.

Python client

For development, install the client editable against your checkout:

pip install -e clients/beebium-python-client

Project Structure

beebium/
├── src/
│   ├── 6502/           # Cycle-accurate 6502 library (C)
│   ├── core/           # Emulator core library (C++)
│   ├── service/        # gRPC service implementations
│   └── server/         # Standalone server executable
├── clients/
│   ├── macos/                      # Native macOS frontend (Swift)
│   ├── beebium-python-client/      # Python client library
│   └── beebium-typescript-client/  # TypeScript client library
├── tests/              # Catch2 test suite
├── docs/               # Documentation
└── scripts/            # Development scripts

Documentation

Component and subsystem documentation lives in docs/. Some entry points:

Development

After cloning, install the git hooks:

./scripts/install-hooks

This sets up a pre-commit hook that verifies copyright notices in source files.

License

Beebium is licensed under the GNU General Public License v3.0. Files derived from sources licensed under GPL-3.0 only carry that licence instead of "or any later version": currently src/core/include/beebium/disc/Intel8271.hpp, derived from beebjit.

Acknowledgments

  • Tom Seddon - The 6502 library is ported from B2, Tom's excellent BBC Micro emulator
  • Matt Godbolt - Creator of jsbeeb, from which VIA timing tests and 1MHz bus stretching logic were adapted
  • Chris Evans (@scarybeasts) - Hardware-validated VIA timing data measured on real BBC Master hardware, and CRTC 6845 edge case tests from beebjit. Beebium's Intel 8271 disc controller model is derived from beebjit's, which Chris built from his reverse engineering of the chip; Intel8271.hpp is therefore GPL-3.0 only
  • Nicola Salmoria and MAME contributors - Hardware-verified SN76489/SN76496 sound chip behaviors documented in MAME, including LFSR tap positions, noise reset behavior, and chip variant differences
  • David Banks (hoglet) - The Tube ULA register 3 FIFO test program from his Tube ULA Re-Implementation thread, with measurements of a real Ferranti Tube ULA that Beebium's Tube register behaviour is validated against
  • James (acheton1984) - The Tak benchmark reconstruction, timed on real BBC Micro and second-processor hardware, which showed Beebium's 6502 Second Processor running fast and now anchors its timing tests; the Acorn ARM Evaluation System coprocessor plugin, written from the documents in his AESulator project and contributed as #313; and careful, generous testing of Beebium releases
  • Dominic Plunkett (dp111) - The 6502 instruction timing test suite, which times almost every documented and undocumented 6502 instruction against a 1MHz VIA and now guards Beebium's core, VIA timer and 1MHz bus stretching
  • Ken Lowe (KenLowe) - Documenting and reverse engineering the Computech Integra-B board: the rebuilt IBOS 1.20 User Guide and the board schematic that Beebium's Integra-B emulation is built from
  • Richard Webb (UKWebb) - Allowing the use of his Master 128 diagnostic ROM, which tests every RAM region and the board's hardware from the MOS socket, to exercise Beebium's Master 128; it found the 1770's missing index pulse, and the LK18/LK19 links are modelled from his notes
  • The BBC Micro community at Stardot

Third-Party Libraries

About

A BBC Micro emulator with separate backend and front-end.

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

⌂ Proxy