1985 · Datasoft

The Goonies

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/the-goonies with me to Gold.

Four tunes and twenty-one sound effects, played by John A. Fitzpatrick's Pearl Music Player, which leaves the third voice free for the effects while a scene plays.

The tunes

Four tunes for ten scenes

The music driver at $BA00 carries the text PEARL MUSIC PLAYER COPYRIGHT 1984 JOHN A. FITZPATRICK ($BA34). It holds four tunes, and a table gives each scene the one it plays (scene_jingles, $09F9).

The game's own music driver ported to JavaScript and played through the site's model of the SID. Each tune is started the way the game starts it. The port was checked against the driver itself, run on the bytes of the listing: every SID register matched on every frame, over 30,000 frames of each tune.

TuneVoicesLengthWhere it plays
0three50 secondsthe title and the attract mode, and the ending
1two50 secondsscenes 1, 5, 7, and 8
2two50 secondsscenes 3 and 4
3two38 secondsscene 2

Scene 6 has no tune. The tunes do not loop by themselves. Each pass, the main loop checks whether the tune has ended and starts it again from the top ($092C). S switches the music off for every scene except the ending, whose tune plays regardless ($0905).

Which tune, if any, is the film's song, Cyndi Lauper's "The Goonies 'R' Good Enough", has not been established. The ZZap!64 panel was unimpressed, rating the sound 35 % with "Terrible tunes and few FX".3

The driver

Each voice reads a stream of notes and commands

A tune is three streams of bytes, one for each of the SID's voices (f_C02E). The player runs once a frame from the raster interrupt (play_tune, $BBDB). It counts down the tempo, and on each tick counts down every voice's note, releasing the note a step before its end and reading the voice's next bytes when the note is over (voice_next, $BCC4).

A byte with bit 7 clear is a note: 0 is a rest, and anything else picks one of 84 frequencies ($BF81, $BFD5) after the tune's transposition is added. A byte with bit 7 set is a command, numbered by bits 4 to 6, and $FF ends the tune (voice_commands, $BD07).

CommandWhat it setsWhere
0 and 7the length of the voice's notes, from a table that includes dotted and triplet values$BD49
1the filter$BD63
2the waveform, the envelope, or whether the note is held$BD7C
3one of eight instruments$BE6C
4the pulse width, from the next two bytes$BEAA
5one of eight filter settings$BEC5
6the tempo, from the next byte$BEFE

The four tunes use only command 0. Run on the kit's 6502 machine from start to end, the driver reads 1,166 commands across the four tunes, and every one sets a note length. The six other routines are there for tunes that this game does not have. The table of filter settings that command 5 would read even overlaps a tune's notes at $C08E.

The effects

Effects take a voice by priority

The game asks for every sound by number, 0 to 24, through start_sound ($92C7). A table (sound_table, $9384) says which four of the 25 are tunes and gives each of the other 21 an effect, a priority, and whether it may restart over itself.

An effect goes to one of the three voices. A free voice takes it. Otherwise it takes over a voice whose effect has a priority no higher than its own, and if every voice is busy with something more important, the effect is not played. A tune claims voices 1 and 2 at priority $7F, which no effect can match, so during a scene every effect plays on voice 3. Tune 0 claims all three voices ($9325).

Each effect is a short script of its own commands, run by one of three effect players, a frame at a time (effects_play, $C921). Swapping the Goonies with fire, for example, plays sound 6 ($0B62).