1985 · Mastertronic

Hunter Patrol

This minisite awaits a maintainer’s check. A model this site has not proven yet worked on it (claude-sonnet-5-5), so a maintainer will measure its listing on one it has (how the check works).

The title tune runs on a timer of its own, 53 ticks a second, a little faster than the screen, and it stops only because play takes the interrupt back.

01 · The tunes

Two tunes: one for the title screen, one nobody hears

Press a tune to hear it. The title tune plays whenever the title screen is up, before the first game and after each one. The second tune is on the disk but nothing in the game plays it.

The game's own music code playing the bytes on the Source tab: Rob Hubbard's driver (music_play, $A006) for the title tune and the small player at $10A0 for the other. Every write to the sound chip matched the game's own, in order.

The title tune

Before each title screen start_music ($14F0) clears the sound chip's filter routing and calls $A000, the first of the driver's three entry points. music_start ($ADD0) takes over the interrupt: it turns off the raster interrupt the game uses in play and starts timer A of CIA 1, one of the C64's two timer chips, with a period of $4800 + 1 cycles. That is 53.45 calls a second on a PAL machine, a little faster than the screen's 50 frames. Each call of music_irq plays one tick and hands on to the KERNAL's own interrupt routine, which still reads the keyboard while the title is up.

The driver's second entry, $A003, stops the music (music_stop), but the game never calls it. When play starts, setup_raster_irq ($1370) turns off the timer's interrupt and points the vector back at the game's raster routine, and that alone ends the tune.

The tune is three tracks, one for each voice ($A527). A track is a list of pattern numbers, and each of the 40 patterns ($A52D) is a run of notes. A note byte gives the note's length, whether it is tied to the last one, and whether an instrument number follows; then comes the note itself, whose pitch the table at $A32D gives. Fifteen instruments of eight bytes each ($A427) set the waveform, the pulse width and the envelope, and switch on the driver's effects: vibrato, a sweeping pulse width, portamento, a drum and a falling pitch, and an octave jump on alternate ticks. A track ends with $FF, which sends it back to its start, so the tune repeats until the game starts. One time through takes 10,801 ticks, 3 minutes 22 seconds.

The tune nobody hears

The bytes from $1000 to $116F hold a second, much simpler player, and its notes are at $8200. Nothing in the game reaches it: no instruction or pointer in memory names $1000, and none of it ran in play. Its start routine would set CIA 1's timer to $3000 + 1 cycles, about 80 calls a second, and point the interrupt at $102E.

The player gives all three voices the same sawtooth sound from the settings at $8010. It reads its notes two bytes at a time, and whichever voice finishes its note first takes the next one, so one list of notes is shared out among the three voices. The first byte picks one of twelve notes from $1145, and the second its octave and its length, one of five from 8 to 128 ticks. A note of 32 ticks or more lets go 16 ticks before its end; the shorter ones are held to the last tick. At the end marker ($FF at $8346), after 2,241 ticks or 28 seconds, the player starts the tune again. The Discoveries page sets it beside the game's other leftovers.