1987 · Imagine

Arkanoid: music

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

Martin Galway's tunes for Arkanoid and the game's twelve sound effects, played by the game's own sound driver running in the page, and the tune the cassette plays while it loads.

01 · Music

Music: Martin Galway's tunes, played by the game's driver

The player below runs the game's own sound driver, $2615-$3429, frame by frame, and plays what it writes to the SID.

The driver's bytes come from this game's Source tab. The title and ending tunes advance once a frame and the others twice (the game calls the driver from its NMI once on the title and twice in play). The tunes set the filter through voice 2, so the player models one, a 6581's: real chips differ from each other in cutoff by large factors. The drums on the title screen are not here: they are samples written to the volume register by other code, which this model of the chip does not play.

A tune is started with music_start_tune ($262B), Y = 7 × tune + 5, which picks a 7-byte record in the table at $342A: three voice pointers and a tempo byte. Each voice reads its own sequence of two-byte notes and commands $C0-$F0, dispatched through three vector tables at $3F00, $3F32 and $3F64, one per voice. A tick is seven calls: the filter ($2B5D), a sequencer per voice and an effects routine per voice. Only voice 2 drives the filter, and only voice 2 can call 6502 code from inside a tune, which the title tune uses to set filter bits that another routine ORs into the volume register.

Tune 7 is complete and the game never starts it: a search for its start value finds no caller. Tune 3's record is empty.

02 · Sound effects

Sound: twelve effects, each on all three voices

Every effect in Arkanoid takes the whole chip. The game starts one with three calls to sound_effect_start ($272F), one 31-byte patch for each voice, and the same driver that plays the tunes plays it out.

EffectWhen the game plays itPatches
Bouncethe ball comes off the Vaus, or a held ball is let go$2000 ($ACAA, $AAF4)
Bricka brick breaks$205D ($B26F)
Enlargethe E capsule is caught$20BA ($AA53)
Laserthe Vaus fires$2117 ($A7AA)
Metala silver brick takes a hit and holds, or the ball strikes gold$2174 ($B0BD, $B050)
Enemyan enemy is destroyed$21D1 ($9F2A)
Exitthe Vaus slides out through the Break exit$222E ($A48C)
Catchthe ball sticks to the Vaus under the C power$228B ($AC7C)
Startafter the intro, before round 1; the game waits for it to end$22E8 ($F04F)
Vaus lostthe last ball falls and the Vaus explodes$2345 ($9B15)
Doh hitthe ball hits Doh$23A2 ($B12A)
Doh destroyedDoh's 23rd hit, before the ending$23FF ($9659)

Each button runs the game's own driver on the listing's bytes: sound_reset ($2690), the effect's three calls to $272F, then the driver's seven routines twice a frame, as in play, until sound_busy ($3417) reports silence. The start effect gets one call a frame, as on the title, where the driver runs once a frame. $272F turns the filter off, so no filter is modelled here.

A patch sets a voice's pitch and pulse envelopes (bytes $00-$17), its waveform and envelope registers ($18-$1A, written straight to the chip), how long the gate stays open ($1B), how long the effect lives ($1C) and the starting pitch ($1D-$1E). The catch is the bounce cut short: the same three starting pitches, with the gate open for 5 ticks instead of 15 and a life of 8 instead of 90.

Because an effect takes all three voices, a new one would cut short whatever is playing, so the game keeps a hold ($0216, with its strength in $0217, counted down once a frame by $F8AD). The extra-life tune, whether from points or the P capsule, the enlarge, exit and Vaus-lost effects set a strong hold, which lasts until the sound has finished. The laser and the enemy set a weak one for 30 frames. The bounce, catch, brick and metal effects give way to either kind; the laser and the enemy give way only to a strong one.

03 · The loading tune

Music: the Ocean loading tune, by Martin Galway

The 1987 cassette brings its own music: Martin Galway's second loading tune for Ocean, from 1985. About a minute into the tape it starts, and it plays for three and a half minutes while the title picture fills in on the screen (Graphics) and the rest of the game loads. The game never plays it.

The player runs the tune's own code and notes, as the cassette leaves them in memory, once a frame as the cassette calls it. The High Voltage SID Collection holds the same code and notes as Galway's Ocean Loader 2.

The tune plays at full volume and never uses the filter. After its first 46 seconds it repeats every 4 minutes 13 seconds, so on the tape, which stops it after 3 minutes 38 seconds, when the last of the game has loaded, it never comes round.