1984 · Datasoft

Bruce Lee

This minisite was contributed by 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/bruce-lee with me to Gold.

One tune in the game, played only on the title screen by John A. Fitzpatrick’s Micropearl Music Player, and thirteen sound effects that fight over the SID’s three voices.

Listen

The title tune and the effects

Each button runs the game’s own code from its listing on the site’s model of the C64’s 6502 processor, heard through the site’s model of its SID sound chip. The tune is set up the way the title screen sets it up and played a frame at a time; each effect is started through the game’s own play_sound ($2509).

The tune

A music player with its maker’s name inside

The tune is played by a separate music player at $E000, whose text reads “MICROPEARL MUSIC PLAYER COPYRIGHT 1983 JOHN A. FITZPATRICK” ($E315). Nothing on screen shows it.

The title screen’s raster interrupt calls the player once a frame (irq_menu_bottom, $152C, calling $E006). It reads three streams of notes and commands, one for each voice of the SID ($E8D0, $E97D, $EA31): a byte with bit 7 clear is a note, and the commands that follow set the next notes’ length, the waveform, the envelope, an instrument, the pulse width, the filter, or the tempo (voice_next_note, $E578).

Before it starts the tune, the title screen writes a song list of song 0 followed by $FF, which sends the player back to the start of the list ($06CC-$06DA). The tune therefore repeats for as long as the title screen is up, every 1,154 frames, about 23 seconds. In play the game has no music, only effects.

The player’s song table has room for a second song, but song 1’s three voice addresses point into the sound-effect code at $EB00 and beyond (song_table, $E8C0). Nothing ever asks for it.

The effects

Three players, one per voice

The effects have a player of their own, copied three times, once for each voice of the SID ($EB03, $EF73, $F073), and all three run once a frame (frame_work, $15A8). An effect is a script of steps, each a command byte followed by a duration, a note, an envelope, a pulse width, or a waveform as the command needs (sfx_scripts, $EBE5).

play_sound ($2509) puts a new effect in the first free voice. When all three are busy it takes the voice playing the effect of lowest priority, as long as the new one’s priority is at least as high ($2572). There are fifteen scripts; nothing asks for effects 3 and 8.

EffectWhenPriorityAsked for by
0a jump11jump_sound, $1FC4
1an enemy turns to face Bruce; a door flashes open12action_10_turn, $2235; room_0, $3642
2Yamo comes in10spawn_yamo, $0CD5
4a flying kick8continue_action, $2008
5a punch, or an enemy’s strike7action_11_punch, $226A; $22BD
6Bruce’s punch, kick, or landing hits; the Wizard throws a fireball9hit_sound, $2E29
7an enemy’s strike lands6check_collisions, $29C3
9a swinging object moves0draw_object, $404E
10a passage opens; a human Yamo is taken over1wall_sound, $424F
11the Wizard is beaten2wizard_beaten, $3DAF
12a deadly character is touched3deadly_tile, $304B
13a mine explodes4animate_mines, $3228
14a lantern or the bonus fall is taken5collect_lantern, $2F04

The loading tune

Music: the cassette brings a tune of its own

The cassette plays a second tune while the game loads, over a screen of credits in white on black. It starts with the credits and stops when the last of the game is in, two and a half minutes or so later. The cassette's own code plays it, not the Micropearl player, and the Datasoft disk shows its credits in silence.

The player runs the cassette's own code and notes, as the cassette leaves them in memory,, once a frame as the cassette does.

The notes and everything else the tune does come from one list ($EF80), read a byte at a time: a note and how long it lasts, or a run of bytes to write into memory, the sound chip's registers among them. It plays at full volume on the pulse waveform alone, and never uses the filter. After its first 38 seconds it repeats every 1 minute 18 seconds.