(back to project list)

Disassembly of Bomber for the Apple II

Bomber, by Bob Bishop, was published in 1978 on cassette tape by Softape.

There appear to be two different versions: one with a 1978 copyright, and an updated 1979 release that keeps score, makes some clicking noises, and changes the speed and direction of the tank after a hit (video here). The updated version calls a monitor routine at $FB84 that went away in the autostart ROM, so it only works on the original Apple II -- it crashes on an Apple ][+, and stalls waiting for a key on an enhanced //e. (FWIW, the title screens on both versions say 1978, but if you list the BASIC program after the game starts, the newer version has a REM statement with 1979.) Incompatibility with the Apple ][+ might explain why most game collections include the older version.

The game itself is very simple: hit a key to drop a bomb from a moving plane onto a moving tank. If it hits, you're rewarded with a grand explosion. This could be considered an early example of particle effects.

exp05 exp07 exp09 exp12

This is a disassembly of the original (non-score-keeping) version.

Bomber is copyright 1978 Softape.

How it Works

Most Apple II arcade games move rectangular blocks of pixels around. Bomber does everything at the individual pixel level.

The plane, tank, and bomb are part of a single stream of X/Y pixel coordinates. The plane is composed of 55 pixels, the tank 71, and the bomb 2, for a total of 128. Each X/Y coordinate is stored as a pair of 8-bit integers, so all moving pieces can be stored in exactly 256 bytes. The Apple II hi-res screen is 280 pixels wide, but to fit in a byte only values from 0 to 255 can be used, so there's a blank area on the left and right edges of the screen.

Each coordinate also has a movement vector, expressed as a pair of 8.8 fixed-point values. On every game frame, the individual movement vectors are applied to all 128 coordinates. Most of the time this just shuffles the plane one direction and the tank the other direction, making per-pixel vectors a very expensive solution to a simple problem. When a bomb hits a tank, however, the system demonstrates its value.

On impact, the trivial movement vectors on the tank's pixels are replaced with a pre-set collection of generally upward-moving vectors. This causes the tank's pixels to fly up into the air. On every frame, gravitational acceleration is applied to the movement vectors, pulling the fragments toward the ground in an aesthetically pleasing fashion.

Integer BASIC Wrapper

The game uses a trick to embed a machine-language program inside an Integer BASIC program. When first run, the program relocates the binary portion to $0800, and then changes its own "start of program" pointer to point to a second chunk of BASIC code that starts the game. The details are explained in the disassembly listing.

The motivation for doing this was likely to make it easier to load from cassette tape. A purely binary program would have to be loaded with an explicit range command from the system monitor (e.g. 800.1200R), while a BASIC program just requires a friendly "LOAD".

Copyright 2020 by Andy McFadden