1986 · Hewson Consultants

Uridium

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

Steve Turner's title tune and every sound effect, played by a port of the game's own sound driver, in which a note of music is a sound effect like any other.

01 · Music

Music: the title tune

Steve Turner's title tune, played by the game's own sound driver ported to JavaScript.

The driver at $0E23, ported and run once a frame through the site's model of the SID. The port was checked against the game's code in a 6502 simulator: 99,762 calls, the tune to its end and every effect on every voice, with every SID write in the same order. test_ports.py beside this page repeats the check.

Music and sound effects share one driver, and a note of music is a sound effect. The song ($3D2C) is 22 rows of three pattern numbers, one per voice. Each pattern byte is a note: its length in the high four bits and its pitch in the low four, with control bytes that set the octave and the instrument. The sequencer ($0E6B) steps every fifth frame. For each new note it writes the note's frequency into the instrument's 16-byte effect record and asks for that effect on the voice, exactly as the game asks for an explosion. The seven instruments are effects $27 to $2D.

An effect record holds a voice set-up (waveform, envelope and how long the gate stays open), a start frequency and a step added to it every frame, a pulse width that sweeps, a time after which the step reverses or the frequency restarts, a duration, and the effect to chain after it.

02 · Sound effects

Sound: the effects voice that doubles as the dice

Every effect the game asks for, on the voices it uses.

The same port, given the requests the game makes for each event, on the voices it uses. An effect asked for with bit 7 set starts even over a forced effect already sounding; others wait their turn. Each effect, on each voice, with and without bit 7, was compared with the game's code to its end, and test_ports.py plays every button here through the SID model to check that it sounds.

Voice 3 has a second job. Whenever no effect is using it, the driver sets it to noise at the highest frequency and turns its output off through bit 7 of $D418. Every random choice in the game, from a fighter's decision to fire to the order of the stars, reads its waveform at $D41B. The table of 256 random bytes at $0800 starts life as a copy of the sound driver's own code and is stirred with that noise at each life.