1986 · Micro Power

Doctor Who and the Mines of Terror

This minisite was contributed by air, unorig. It’s currently claimed by unorig who is editing it to reach a Gold tier standard.

Five tunes, four of them chosen by where the Doctor stands, played here through the game's own music player.

Music

A tune for each part of the mine

The music never stops while the Doctor explores. Every other frame the game looks at where he is and picks one of four tunes for that part of the mine, and it starts the new tune from the top the moment he crosses into another part (music_update, $74EA). Press a tune to hear it, or click the mine.

The game's music player ($7548-$7647) ported to JavaScript and played through the site's model of the SID chip. The port matches the player itself, run in a 6502 simulator on the game's bytes, in all 25 sound registers after each of 30,000 frames of every tune. The map is coloured from the tests at $74F5-$7534: the Doctor's height and how far across the mine he is.

TuneWhere it playsNotes, voice 1 and 2Before it repeats
0the middle third of the mine, and the upper right206 and 14543 seconds
1the left half, above the bottomone list of 251, shared30 seconds
2the bottom of the mine, below height $0300, where the TARDIS lands174 and 13231 seconds
3nowhere: no test chooses it174 and 224 seconds
4a band on the right, from height $0300 to $03FF138 and 12158 seconds

Note counts from the length lists at $1F00-$2D3F; times are the player's first pass through each tune at 50 frames a second.

The disk also plays a title tune while it waits for the player to press space. That tune is a file of its own, THEME, which the boot program loads at $1000 and stops before the game loads, so none of it is in the game's code and it is not one of the five here.10

The player

Two voices, two lists each, and nothing else

The player is one of the simplest a Commodore game could have. Two of the SID chip's three voices play, both with a sawtooth wave and each with a fixed envelope, set once when a tune starts (sid_init_list, $756B). Each voice reads two lists: the notes, as the SID's own frequency numbers, high byte first, and how long each note lasts (music_step, $75C0). There are no instruments, no effects, and no repeats. One step before a note ends, the player switches its voice off, so every note is separated from the next by a short gap.

The tune ends when either voice reaches a length of 0, and both voices start again from the top ($7647). So the two halves of a tune do not have to be the same length, and whichever is longer never plays its last notes. In tune 4, voice 2 has 264 steps of music that are never heard.

Tune 1 saves memory a different way. Both voices read the same list: voice 2 starts at note 121 ($2520), so the second half of the melody is played against the first. When voice 2 reaches the end, both start over, and voice 1 never gets far past its middle.

Tune 3 is built from other tunes' lists. Its first voice plays tune 2's notes from the fifth note on, to tune 2's rhythm from the first ($2768), so notes and lengths are four apart, and its second voice is the last 22 lengths of the same list ($26C0). Nothing in the game picks tune 3. Heard, it is a jumble, because its notes and lengths were never written to go together, which suggests a tune that was never finished.

Sound effects

The third voice

The third voice plays the 24 sound effects, from thirteen tables of settings ($C677). A lower-numbered effect cuts off a higher one (sound_start, $C7C7), and the effects are updated every other frame ($C818).