Rare (NES Driver)
Rare (NES Driver) is an unofficial name of the sound driver used in all of Rare's NES game. It was one of the most popular sound drivers on the NES, being used in almost 50 games. According to David Wise, it was first programmed by Rare's founder Chris Stamper and later programmed by Mark Betteridge. It isn't exactly clear when Mark worked on the driver, but his first credit is in Cobra Triangle, so he can be assumed as a sound programmer.
David Wise was the only person to compose music in the driver, but others used the driver for sound effects. To compose music for the NES, he had to write the music in 6502 assembly machine code. To do this, Wise would have to write with hexadecimal numbers. In an interview, David Wise elaborated how it worked:
Rare developed game show adaptations of Card Sharks, The Price is Right and Password, as well as Roller Thrasher, and Wolverine (the one by the Pickford brothers, no relation to the released one by Software Creations), but the game was never finished/released. It is assumed that they would have used the same sound driver.
The driver was used in all regions; North America, Europe, and Japan. The first game to use the driver was Slalom, released in 1987. The last game to use the driver was Battletoads Double Dragon, released as late as 1993.
The driver is one of the few to take advantage of the DPCM channel, but only in rare instances. It was used in Pin-Bot for sound effects, and was used in the Battletoads games, and makes its most notable appearance as the pause music to Battletoads.
B-5 = 38 A#5 = 3B A-5 = 3F G#5 = 42 G-5 = 46 F#5 = 4B F-5 = 4F E-5 = 54 D#5 = 59 D-5 = 5E C#5 = 64 C-5 = 6A B-4 = 70 A#4 = 77 A-4 = 7E G#4 = 86 G-4 = 8E F#4 = 96 F-4 = 9F E-4 = A9 D#4 = B3 D-4 = BD C#4 = C9 C-4 = D5 B-3 = E2 A#3 = EF A-3 = FD G#3 = 10C G-3 = 11C F#3 = 12D F-3 = 13F E-3 = 152 D#3 = 167 D-3 = 17C C#3 = 193 C-3 = 1AB B-2 = 1C4 A#2 = 1DF A-2 = 1FC G#2 = 21A G-2 = 23A F#2 = 25C F-2 = 280 E-2 = 2A6 D#2 = 2CE D-2 = 2F9 C#2 = 326 C-2 = 356 B-1 = 389 A#1 = 3BF A-1 = 3F8 G#1 = 435 G-1 = 475 F#1 = 4B8 F-1 = 501 E-1 = 54E D#1 = 59E D-1 = 5F4 C#1 = 64D C-1 = 6AE
Using the Driver
As David Wise explained above, the music is written in 6502 assembler macros; first, the note pitch itself is written, followed by the length. For example, here's the bassline from the menu theme from Wheel of Fortune (NES):
db $80,$06,$8C,$06,$8F,$06,$8C,$06,$91,$06,$8A,$06,$8B,$06,$8C,$06 db $80,$06,$8C,$06,$8F,$06,$8C,$06,$91,$06,$8C,$06,$93,$0C
The driver doubles the time of the length counter. For example, normally $06 frames should be equivalent of a 16th note at 150 BPM. However, because it is doubled, it plays 12 frames instead, which would be an 8th note at 150 BPM.
Here is a breakdown of the above text written in Music Macro Language:
t150 r8 b1+8 d2+8 b1+8 e2+8 a1+8 as1+8 b1+8 ;r = Rest, Note/Octave+Length (notation), s = Sharp r8 b1+8 d2+8 b1+8 e2+8 b1+8 fs2+4
Here is a table to the note values:
BC = B-5 BB = A#5 BA = A-5 B9 = G#5 B8 = G-5 B7 = F#5 B6 = F-5 B5 = E-5 B4 = D#5 B3 = D-5 B2 = C#5 B1 = C-5 B0 = B-4 AF = A#4 AE = A-4 AD = G#4 AC = G-4 AB = F#4 AA = F-4 A9 = E-4 A8 = D#4 A7 = D-4 A6 = C#4 A5 = C-4 A4 = B-3 A3 = A#3 A2 = A-3 A1 = G#3 A0 = G-3 9F = F#3 9E = F-3 9D = E-3 9C = D#3 9B = D-3 9A = C#3 99 = C-3 98 = B-2 97 = A#2 96 = A-2 95 = G#2 94 = G-2 93 = F#2 92 = F-2 91 = E-2 90 = D#2 8F = D-2 8E = C#2 8D = C-2 8C = B-1 8B = A#1 8A = A-1 89 = G#1 88 = G-1 87 = F#1 86 = F-1 85 = E-1 84 = D#1 83 = D-1 82 = C#1 81 = C-1 80 = Rest
None of the games that use the driver have had their source code released.