So I decided to really dive in and take a close look at the HERAD driver in MegaRace. Amazingly, I was able to figure out a lot of stuff!
0x15:Something to do with the song speed (Always 0x0002)
[0x2 bytes long]
0x17:?(Always 0x1941)
[0x2 bytes long]
0x19:Song length (first two bytes from music file)
[0x2 bytes long]
0x1B:?(Always 0x1941)
[0x2 bytes long]
0x1D:Most likely OPL Timer
[0x2 bytes long]
0x1F:MIDI Measure Counter (this counts up after every 96 MIDI ticks and is used for the song loop)
[0x2 bytes long]
0x21:MIDI Tick Measure Counter (Counts down from 0x60 or 96 MIDI Ticks)
[0x2 bytes long]
0X23:Song Repeat Counter (Counts down from 0xFFFF)
[0x2 bytes long]
0x35:Feedback Table?
[0x7 bytes long]
0x3D:Table?
[0xA bytes long]
0x47:Frequency Table
[0x18 bytes long]
0x5F:FNUM/Block Number Register Values
[0x12 bytes long]
0x71:Velocity Table
[0x9 bytes long]
0x7A:? (Fine-tune Pitch table?)
[0x16 bytes long]
0x90:Pitch Bend Table
[0xA bytes long]
0x9A:? (Always 0x0080)
[0x2 bytes long]
0x9C:Padding? (Always 0xEEEEEE)
[0x3 bytes long]
0x9F:Two byte "ping-pong" timer that counts up in bits (0x1,0x2,0x4,0x8,0x10,0x20,0x40,0x80)
[0x2 bytes long]
0xA1:Padding? (Always 0x90)
[0x1 byte long]
0xA2:NoteOff Midi Tick Counter (counts down until next note)
[0x12 bytes long]
0xB4:MIDI Track Position (counts up until reaching the track end value specified in the music file header)
[0x12 bytes long]
0xC6:Start of MIDI Tracks (Absolute address in music file, rather than relative address in music file header)
[0x12 bytes long]
0xD8:List of MIDI tracks using drum keymap instrument. If MIDI track uses keymap instrument, the absolute offset of the instrument in the music file will be used. If the instrument changes back to a normal instrument, the value zeros out.
[0x12 bytes long]
0xEA:Current Instrument (first byte) / MIDI Pitch (second byte). The pitch here is after any transpose macros have been applied. Also, if the keymap instrument is used, the first byte will display the instrument(s) that are actually being played.
[0x12 byte long]
0xFC:Pitch Slide Range Flag (first byte) / Root Note Transpose (second byte) for each MIDI track.
[0x12 byte long]
0x10E:Pitch Slide Duration Counter (first byte) / Pitch Slide Duration (second byte) for each MIDI track.
[0x12 byte long]
0x120:Pitch Slide Counter (first byte) / Pitch Slide Range (second byte) for each MIDI track. The Pitch Slide Counter starts at 0x40 (unless it is transposed) and either goes up or down depending on Pitch Slide Range value.
[0x12 byte long]
0x156:Output level Registers for each MIDI track?
[0x12 byte long]
0x168:Feedback/Panning Registers for each MIDI track?
[0x12 byte long]
0x17A:Waveform Select Registers for each MIDI track?
[0x12 byte long]
0x1C3: Start of HSQ decompression routine?
------
So yeah, that definitely answers a lot of unknowns in the HERAD driver. The driver that was being loaded in my copy of MegaRace is DFADP.HSQ, so that's the one that I'm going to stick with when reverse engineering. It's really cool to look "under the hood" and see how all these hexadecimals all come together to make music. 😀