BBC Micro

BBC MICRO · GRAPHICS ROMALPHA · USE AT YOUR OWN RISK

EGFX

An original graphics service ROM for the BBC B and Master. BASIC or assembler programs call it for masked sprites, particles, lines, shapes, text, tile maps and double-buffered presentation, through one OSWORD request.

EGFX 0.6 is a 32 KB sideways ROM service, shipped as two 16 KB images that are always installed together. It is not command-compatible with the Acorn GXR or other period graphics ROMs. The same ROM and disc work locally or across the Tube with an Acorn 6502 second processor, because every call goes through MOS OSWORD &C0.

Download and launch

Downloads arrive with the beta release.

Put EGFX.rom and EGFX2.rom in any two free sideways slots (the examples use 4 and 6 on a Master). On a BBC B with DFS 0.90, EGFX must sit above the DFS ROM (the project launcher uses slots 15 and 13), because DFS 0.90 claims OSWORD calls it does not own. Boot the disc for the six-scene demo; other examples are CHAIN-able from it.

MODE 1
CHAIN "START"     : REM six-scene demo; 1-6 select, SPACE cycles, +/- sprite count
CHAIN "GFXBAS"    : REM the BASIC example
CHAIN "SHAPES"    : REM also CURVES, UI, TILES, TEXT, COMP, SNAKBAS

Contents

05 · What’s new in 0.6

06 · Performance

The figures that most affect a BASIC program’s design:

MeasurementValueSource
Fixed cost of one call from BASIC≈1.7 cs, before any drawingBreakout profiler, dirty begin (Master 128, B-em)
Breakout, full redraw every frame0.1–0.5 fpsStarter chapters 3–7
Breakout, dirty frames + batch + blit≈4.7 fps in playMeasuring
Batching ten sprites≈22% less submission workNative cycle benchmark; pixels unchanged
Full-frame BEGINclears all 20 KBAvoid it on every frame: use dirty begin or tile-region restore

Rules of thumb: from BASIC, count calls before you count pixels. Size each sprite frame to its art, because an 8×8 ball in a 16×16 frame still costs a 16×16 traversal. Keep sprite X positions on multiples of 4 for the fast path.

07 · Architecture

Every request is a 64-byte block with the EG signature and interface version 1, passed to OSWORD &C0. The ROM copies it, draws, and answers &A5. Unknown functions are left unclaimed, so a missing ROM is detected immediately. Master builds draw to the hidden shadow page and flip at vsync; a BBC B draws to its single visible screen and may tear.

EGFX is 32 KB of code, so it occupies two sideways slots. INIT finds the second image through the MOS ROM type table and every call then works across both: a program never needs to know which image does the work.

Main RAMOwner
&2400–&26FFparticle pool, staging, the trampoline into the second ROM image, trail ring and bank gate
&2700–&28FFshape/UI scratch, transform scratch, presentation state, tile and world state (only when those services are initialised)
&2A00–&2A0Dlegacy parameter block
&2B00–&2B45MOS request copy and dispatch scratch

BASIC clients must set HIMEM=&2400 before any PROC call and keep TOP below &2200.

08 · Six-stage demo

EGFX demo scene 1
Stage 1: orbiting masked sprites
EGFX demo scene 2
Stage 2: gravity fountain
EGFX demo scene 3
Stage 3: connected comet trail
EGFX demo scene 4
Stage 4: radial star burst
EGFX demo scene 5
Stage 5: clipping and line drawing
EGFX demo scene 6
Stage 6: 48-sprite stress test

These captures and the original 5–11 fps scene figures come from EGFX 0.1, which cleared the whole frame every time. They show what the demo looks like, not how fast 0.6 runs.

Validation

A py65 test suite runs the real ROM code on a simulated NMOS 6502 with BBC B, Master shadow-screen and sideways-bank memory models. It checks pixel-exact sprite output at clipped and aligned edges, that nothing is written to the visible screen or to ROM, page flipping, pool limits and request rejection. The ROMs offered here were rebuilt from the repository head on 25 October 2026, reproduce byte-for-byte, and ran the Breakout game in B-em. That is not acceptance on real hardware.