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
- Compact EGSP v3 sprites (functions 36–37): square 2, 4, 8, 16 or 32-pixel frames with masks, mirror and 90° rotation, read from disc-loaded sideways RAM or directly from a read-only companion ROM. EGSP v3 is now the only sprite format; the old pre-shifted packs are gone.
- Screen-byte blitters. A MODE 1 sprite at a 4-pixel-aligned X, untransformed and fully on screen, is drawn four pixels per byte. Other cases use a pixel-run blitter that writes each screen byte once. World and primitive drawing go through the same byte blitters.
- Master dirty-frame begin (function 38, payload
&FF): selects the hidden page without clearing it, so a game repaints only what moved. The Breakout tutorial shows the pattern. - Batches. Up to eight sprites (34) or eight lines (42) per request, validated completely before anything is drawn.
- Fast trig (39–40, plus direct entries
&8175/&8178), a single-pixel plot (41), adjustable text spacing, a transparent-glyph text mode and one-shot text colour. - Multi-frame world kinds in the optional world compositor (11–15).
- 32 KB. EGFX outgrew one 16 KB ROM, so it now ships as two images,
EGFX.romandEGFX2.rom, installed together.
06 · Performance
The figures that most affect a BASIC program’s design:
| Measurement | Value | Source |
|---|---|---|
| Fixed cost of one call from BASIC | ≈1.7 cs, before any drawing | Breakout profiler, dirty begin (Master 128, B-em) |
| Breakout, full redraw every frame | 0.1–0.5 fps | Starter chapters 3–7 |
| Breakout, dirty frames + batch + blit | ≈4.7 fps in play | Measuring |
| Batching ten sprites | ≈22% less submission work | Native cycle benchmark; pixels unchanged |
| Full-frame BEGIN | clears all 20 KB | Avoid 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 RAM | Owner |
|---|---|
&2400–&26FF | particle pool, staging, the trampoline into the second ROM image, trail ring and bank gate |
&2700–&28FF | shape/UI scratch, transform scratch, presentation state, tile and world state (only when those services are initialised) |
&2A00–&2A0D | legacy parameter block |
&2B00–&2B45 | MOS request copy and dispatch scratch |
BASIC clients must set HIMEM=&2400 before any PROC call and keep TOP below &2200.
08 · Six-stage demo






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.