1984 · First Star Software

Boulder Dash

This minisite was contributed by air, unorig. It’s agent-generated and needs a human editor. Clone https://github.com/gamesexplained/gamesexplained and follow kit/START.md to curate games/c64/boulder-dash with me to Gold.

A pause lets the magic wall run out, and the programmer's own labels are still in the file.

02 · Bug: the magic wall's clock

Pausing lets the magic wall run out

A magic wall works for as many seconds as byte 1 of the cave's header says, then stops for good. The wall counts those seconds itself, and stops counting while the game is paused, but only while the pause flag holds 1 ($7E9F). The flag holds 1 for a moment: on its first flash of the status line, the pause screen raises it to 2 ($80D7), and the wall's count runs on. The cave's clock and the sound stop for any value of the flag. So a pause holds the time limit and not the wall, and a player who pauses with the wall humming can come back to a dead one.

03 · Bug: the magic wall cuts a turn short

A boulder on the magic wall stops the cave for a step

The game moves the cave one cell at a time, row by row from the top, and each object's routine hands back to the sweep when it is done. A boulder that falls onto a magic wall is the exception. Its routine ends by jumping into the routine for the diamond sound ($7775), and that routine's return leaves the whole sweep instead of the boulder's turn ($71E6). Everything after that cell, the rest of its row and every row below, sits out the step: boulders below hang in the air and creatures stand still. It happens for every boulder that lands on the wall, alive or dead.

A dead wall is a trap of its own. When its time is up the wall goes back to looking like brick ($7E84), but the game still treats it as magic wall, and a boulder or diamond that falls onto it disappears with nothing coming out underneath ($776E, $72C6).

04 · Quirk: a slow second in Europe

The cave clock counts American seconds

The time on the status line goes down once every 60 frames ($74A9). That is a second on an American machine, which draws its picture 60 times a second. A European machine draws 50, so there each of the game's seconds lasts 1.2 real ones, and cave A's 150 seconds on level 1 last three minutes. The disk First Star sold for European machines counts 60 frames too: on it, 600 frames, twelve real seconds, take ten off the clock. The magic wall's time is counted the same way.

05 · Leftover: the programmer's own names

The author's labels are still in the file

After the last instruction, the file ends with 195 bytes that nothing reads ($8F3D-$8FFF). They are a piece of the assembler's table of labels, left in memory when the game was saved: each entry is a name the programmer typed and the address it stood for. Sixteen survive, from the end of the interrupt routine and the four routines after it. The routine that takes away a man after a death is NXTPLY, next player, because in a two-player game that is what it does next. Names that start with a colon are local to the routine above them, so :LOOP1 and :SK1 each appear twice.

LabelAddressWhat is there
KEY1, :SK3A, :SK4, :EXIT$8A66-$8A90the end of the raster interrupt, after the keys are read: the title's step or the frame's work, then the exit
KEY, :SK1$8A9B, $8AB8the routine that lets the joystick cancel the keys
SETUP0$8AB9sets up a cave: loads it, fills it, draws it
GMINIT, :LOOP1, :LOOP3, :LOOP5$8ADD-$8AFDstarts a new game: three men, scores cleared
NXTPLY, :LOOP1, :SK1, :LOOP2$8B05-$8B18takes a man away and passes play to the other player

One more entry, :SK2, is cut off by the end of the file: its address reads $FF1F, and why the high byte is $FF is not known.

06 · Secret: the same cave every time

Seeds make the caves repeatable

The cave's dirt, boulders and diamonds look random but are not. Each of a cave's five levels has a seed byte in its header, and a small generator started from it places every cell the same way each time ($7085, $8029). The recipe is on the Maps tab, and the page redraws any cave from it. A player who learns where the boulders sit in cave A, level 1, can rely on it. The routine for random bytes elsewhere in the game is a different one, driven by timers ($6E68). It serves the amoeba, Rockford's push and idle animation, the cave's opening and closing, the glisten, and the sound. The fireflies and butterflies make no random choices at all.

07 · Secret: the tune is in the pictures

Tune bytes double as characters

The title tune, 256 bytes of note numbers, starts at $5FE8. So does the tile character set. The start-up copies 1,024 bytes from there to $3000 ($8D11), and the music routine reads the same bytes at their original address ($8754). The first thirty-two tile characters are therefore the tune. Whether the sharing was designed or a happy accident is not known.

08 · Quirk: a boulder moves one push in four

The push succeeds one time in four

When Rockford walks into a boulder beside him, the game takes a random byte and moves the boulder only when its low two bits are zero ($7543). The same step does not count as a move on the other three tries, so the player seems to lean on the boulder until it gives.

09 · Quirk: the easy levels are slow

Speed is a delay loop

The game has no clock for its pace. After each row of the cave, a loop of idle counts runs, for 12, 6, 3, 1 or 0 passes depending on the level ($8065). Level 5 runs flat out.

10 · Open questions

What could not be explained