1988 · Electric Dreams (Activision)

R-Type

This minisite was curated by unorig.

The longest tune in the game, over two minutes, sits in the ending’s file and never plays. Here are all 35 tunes and all 23 sound effects, played by the game’s own music code.

Music

Four tunes for every stage, three for the ending

Chris Hülsbeck and Ramiro Vaca are credited with the music and sound effects in the ending's own text. Each stage's first file brings a copy of the music driver and a block of music data with four tunes: the stage's theme, the boss music, the stage-end jingle and the game-over jingle. Pick a tune to hear the game's own driver play it.

Each button plays the tune with the game’s own music code, started as the game starts it. The filter is a model of one 6581 sound chip, and real chips differ.

StageTuneWhat it isStarted atLength
1 · The encounter0Boss$57AC, when the boss appearsPlays 921 frames (18.4 s), then repeats the last 640 (12.8 s)
1Game over$5E55, at GAME OVEREnds after 259 frames (5.2 s)
2Stage end$0A2E, as a stage ends and the ship comes to restEnds after 387 frames (7.7 s)
3Stage theme$08A4 at each new life, $32C5 after a deathPlays 2,689 frames (53.7 s), then repeats the last 1,920 (38.3 s)
2 · The living cave0Boss$946F, at column $9B4A, as the cave switches to its second character setPlays 921 frames (18.4 s), then repeats the last 640 (12.8 s)
1Game over$5E55, at GAME OVEREnds after 259 frames (5.2 s)
2Stage end$0A2E, as a stage ends and the ship comes to restEnds after 387 frames (7.7 s)
3Stage theme$08A4 at each new life, $32C5 after a deathRepeats every 1,760 frames (35.1 s)
3 · The huge battleship0Boss$9598, from the stage's frame hook, once the scroll counter reaches $9C00Plays 921 frames (18.4 s), then repeats the last 640 (12.8 s)
1Game over$5E55, at GAME OVEREnds after 259 frames (5.2 s)
2Stage end$0A2E, as a stage ends and the ship comes to restEnds after 387 frames (7.7 s)
3Stage theme$08A4 at each new life, $32C5 after a deathPlays 3,073 frames (61.3 s), then repeats the last 2,304 (46.0 s)
4 · Fortress at the front0Boss$57AC, when the boss appearsPlays 921 frames (18.4 s), then repeats the last 640 (12.8 s)
1Game over$5E55, at GAME OVEREnds after 259 frames (5.2 s)
2Stage end$0A2E, as a stage ends and the ship comes to restEnds after 387 frames (7.7 s)
3Stage theme$08A4 at each new life, $32C5 after a deathRepeats every 1,536 frames (30.6 s)
5 · The nest0Boss$57AC, when the boss appearsPlays 921 frames (18.4 s), then repeats the last 640 (12.8 s)
1Game over$5E55, at GAME OVEREnds after 259 frames (5.2 s)
2Stage end$0A2E, as a stage ends and the ship comes to restEnds after 387 frames (7.7 s)
3Stage theme$08A4 at each new life, $32C5 after a deathRepeats every 960 frames (19.2 s)
6 · The transport system0Boss$92F5, from the stage's frame hook, once the map has stoppedPlays 921 frames (18.4 s), then repeats the last 640 (12.8 s)
1Game over$5E55, at GAME OVEREnds after 259 frames (5.2 s)
2Stage end$0A2E, as a stage ends and the ship comes to restEnds after 387 frames (7.7 s)
3Stage theme$08A4 at each new life, $32C5 after a deathRepeats every 2,048 frames (40.9 s)
7 · A destroyed city0Boss$9415, from the stage's frame hook, once the map has stoppedPlays 921 frames (18.4 s), then repeats the last 640 (12.8 s)
1Game over$5E55, at GAME OVEREnds after 259 frames (5.2 s)
2Stage end$0A2E, as a stage ends and the ship comes to restEnds after 387 frames (7.7 s)
3Stage theme$08A4 at each new life, $32C5 after a deathRepeats every 1,536 frames (30.6 s)
8 · The heart of the Bydo empire0Boss$57AC, when the boss appearsPlays 921 frames (18.4 s), then repeats the last 640 (12.8 s)
1Game over$5E55, at GAME OVEREnds after 259 frames (5.2 s)
2Stage end$0A2E, as a stage ends and the ship comes to restEnds after 387 frames (7.7 s)
3Stage theme$08A4 at each new life, $32C5 after a deathRepeats every 1,792 frames (35.8 s)
The ending0Ending theme$8025, as the ending startsRepeats every 1,280 frames (25.5 s)
1UnusedNever: nothing in the ending asks for itRepeats every 1,760 frames (35.1 s)
2UnusedNever: nothing in the ending asks for itRepeats every 6,528 frames (130.2 s)

Frames are PAL frames, 50.12 a second. A tune that repeats goes back to its loop position, not its start, so the first pass is longer than the ones after it.

The driver

One driver, copied into every stage

The driver sits at $6370-$6D3F in every stage's first file, byte for byte the same code, and the resident program reaches it only through five jumps at the start: $6370 plays one frame, $6373 silences the chip, $6376 asks for a sound effect, $6379 asks for a tune and $637C points the driver at its music data. The data follows at $6D40. The ending's file carries the same driver moved up by $490 bytes, to $6800, with its data at $71D0.

The data block starts with 22 offsets that music_data ($6564) turns into addresses. A tune is a column of the tune table: its start, loop and end positions, its tempo and the rows in each pattern. Each position names, for each of the three voices, a pattern, a transposition and an instrument. A pattern is a list of notes, each played through an instrument with its own pulse sweep, vibrato, detune and, on voice 1, a filter sweep (start_instrument, $6730).

Sound effects

Every shot and explosion borrows the tune’s third voice

The sound effects use the same tracks as the music. Positions 0 to 22 of the third voice’s track hold no tune at all: start_sound ($6544) plays the pattern at the effect’s position on that voice in place of the music, for as many rows as the tune’s header says. So every explosion, shot and pick-up interrupts the melody’s third voice for a moment, and an effect can only sound while a tune is playing.

Stage 1’s copies of the 23 effects, each played over stage 1’s theme with the theme’s other two voices left out, until the effect’s time runs out. The names come from the code that asks for each one; six have no caller in the program.

The resident program asks for an effect through play_sound ($33FB), which lets only some effects through when they come too fast, so a stream of shots does not drown out an explosion. A boss that dies plays one of four explosions at random, picked from the timer of the first CIA chip (boss_dies, $5DB1).

The ending

The ending plays one of its three tunes

The ending's music data holds three tunes. ending_start asks for tune 0 at $8025, and no other instruction in the file asks for a tune, so tunes 1 and 2 never play. Tune 2 is the longest piece in the game, 130 seconds before it repeats. Press "Ending · 2" in the player above to hear it.