Breakout

TUTORIAL · BREAKOUT · UNDER THE HOOD DBETA

D · Measuring the frame

Every speed decision in this tutorial was checked by timing it. The disc includes an instrumented copy of the game, so you can repeat the measurements.

The profiling build

CHAIN "PROF" runs the game with TIME readings around each stage of the loop. After 60 frames (or Q) it switches to MODE 7 and prints the centiseconds spent in each stage: divide by the frame count to get the cost per frame. The extra TIME reads add a little overhead, so use PROF to compare versions, not to quote absolute speeds.

Frame by frame

The source repository also builds a test disc with a self-steering copy of the game, PERF, that logs the time of each frame and what happened in it (sound, brick repair, HUD) into the unused RS423 buffer at &0A00, where a debugger script reads it back. These are its figures on 29 October 2026, B-em Master 128 at standard speed, timed by the guest's own 100 Hz clock:

FrameTime
Ordinary frame in play19–22 cs (about 5 frames a second)
Wall or bat bounce, with its sound20 cs: EAudio adds nothing measurable
Brick broken (ball moves, brick erased on one page)29–32 cs
Next frame (brick erased on the other page)22–26 cs
Worst seen (two bricks in consecutive frames)36 cs

A brick hit shows why the work is spread out. If the hit frame also held the ball still, erased the brick and redrew the HUD, it would take about 38 cs and the next frame 36 cs, and the ball would visibly stop at every hit. Moving the ball away from the brick in the same frame, and redrawing the HUD two frames later, keeps the hit frame near 30 cs with the ball still moving.

Reading the numbers

Compiled BASIC

Beeb-dev's experimental BASIC cross-compiler cannot build this game yet: on 29 October 2026 it still rejected ordinary loop arithmetic such as sc%=sc%+10, early ENDPROC, $ indirection and run-time string building. BRICKFALL is a good test for it once it can, and PERF is ready to measure the difference.

← The bat blit Breakout overview →