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.

One tune, played by two voices stepping through pairs of note numbers.

01 · Music: the title tune

Two voices, one pair of notes at a time

The only music is the tune on the title screen. During play the game makes sound effects only.

The page plays the 128 note pairs with a triangle wave on the Web Audio clock, using the SID chip's frequency formula for a PAL machine. It is an approximation of the sound chip, and the envelope shape is a guess at the real one. Voice 1 is drawn in the lighter colour, voice 2 in the darker, and voice 1's bars are one pixel shorter, so the two stay apart without relying on colour.

02 · How the tune is stored

256 bytes of note numbers, read in pairs

The tune is a list of note numbers with no durations. Each step of the music routine ($8754) takes two bytes from $5FE8: the first for voice 2 and the second for voice 1. Each number selects a 16-bit frequency from a table of 49 notes that rise by semitones from $02DC to $2DC0 ($86CA). The step counter runs through 128 pairs and then wraps, and each wrap adds one to a second counter; when it reaches 2 and the demonstration flag is set, the title hands over to play, which runs the demonstration ($87CA).

The title step runs twice a frame, at both of the raster interrupt's lines ($87EE), and the music routine works on every other step, so once a frame. It holds each pair for eight of those calls, so a pair of notes lasts eight frames, about a sixth of a second on a PAL machine. In most pairs one voice repeats a note while the other moves: first voice 2 repeats a low note under short figures in voice 1, then voice 1 holds a high note while voice 2 moves.

The tune bytes also sit at the start of the tile character set in the program file. The start-up copies the whole block to $3000 as characters ($8D11), which means the first thirty-two tile characters hold the tune and are not drawn as tiles. That the two uses share the same bytes is what the code shows; whether it is deliberate is not known.

03 · Sound: the effects

Short bursts on three voices

Most effects are set by tables of SID register values and played by one routine every frame ($7D09). The explosion, the low-time beep and a few short ticks write the sound chip directly.

EffectVoiceSettings
Diamond picked up1Pitch $1478, waveform $11 ($7522)
Diamond falling or landing, boulder into the magic wall1A random pitch, waveform $11 ($71C0)
Boulder thud1Noise, pitch $0932 ($71E7)
Explosion2Noise, pitch $1432 ($713D)
Quota reached, cave start3Pitch from $2F32 ($7418)
Low time2A beep that rises as the last second digit falls ($7424)