Difference between revisions of "UserWiki:SynaMax"

From Video Game Music Preservation Foundation Wiki
Jump to: navigation, search
Line 1: Line 1:
==HERAD Modulator/Carrier Output Level Scaling Macro (0x1E and 0x1F)==
+
==MegaRace HERAD "DFADP.HSQ" Driver==
 
 
*04 = every 1 note decreases register value by 1  [doesn't kick in until velocity 3F?]
 
*01 = every 8 notes decreases register value by 1 (gets louder)
 
*FF = every 8 notes increment register value by 1 (gets softer)
 
*FE = every 4 notes increment register value by 1
 
*FD = every 2 notes increment register value by 1
 
*FC = every 1 note increment register value by 1
 
  
 
{| class="wikitable"
 
{| class="wikitable"
! MIDI Velocity
+
! Offset
! 04
+
! Size
! 03
+
! Description
! 02
+
! Notes
! 01
 
! FF
 
! FE
 
! FD
 
! FC
 
 
|-
 
|-
| 00 || 3F || ||  || 10 || 00 || 00 || 00 || 00
+
| 0x00 || 0x15 || ? ||Changing some values crash the game, while others don't
 
|-
 
|-
| 01 || 3F || ||  || 0F || 00 || 00 || 00 || 01
+
| 0x15 || 0x2 ||  ||Something to do with the song speed (Always 0x0002)
 
|-
 
|-
| 02 || 3F || || || 0F || 00 || 00 || 01 || 02
+
| 0x17 || 0x2 || ? ||(Always 0x1941)
 
|-
 
|-
| 03 || 3F || || || 0F || 00 || 00 || 01 || 03
+
| 0x19 || 0x2 || Song length ||(first two bytes from music file)
 
|-
 
|-
| 04 || 3F || || || 0F || 00 || 01 || 02 || 04
+
| 0x1B || 0x2 || ? ||(Always 0x1941)
 
|-
 
|-
| 05 || 3F || || || 0F || 00 || 01 || 02 || 05
+
| 0x1D || 0x2 || ? ||(OPL Timer?)
 
|-
 
|-
| 06 || 3F || || || 0F || 00 || 01 || 03 || 06
+
| 0x1F || 0x2 || MIDI Measure Counter ||(this counts up after every 96 MIDI ticks and is used for the song loop)
 
|-
 
|-
| 07 || 3F || || || 0F || 00 || 01 || 03 || 07
+
| 0x21 || 0x2 || MIDI Tick Measure Counter ||(Counts down from 0x60 aka 96 MIDI Ticks)
|-
 
| 08 || 3F || ||  || 0F || 01 || 02 || 04 || 08
 
 
|-
 
|-
| 09 || 3F || || || 0E || 01 || 02 || 04 || 09
+
| 0x23 || 0x2 || Song Repeat Counter ||(Counts down from 0xFFFF after passing beginning loop measure)
 
|-
 
|-
| 0A || 3F || || || 0E || 01 || 02 || 05 || 0A
+
| 0x25 || 0x10 || ? ||Changing some values crash the game, while others don't
 
|-
 
|-
| 0B || 3F || || || 0E || 01 || 02 || 05 || 0B
+
| 0x35 || 0x6 || ? ||Table (00 03 01 04 02 05)
 
|-
 
|-
| 0C || 3F || ||  || 0E || 01  || 03 || 06 || 0C
+
| 0x3B || 0x6 || ? ||Table (08 0B 09 0C 0A 0D)
 
|-
 
|-
| 0D || 3F || || || 0E || 01 || 03 || 06 || 0D
+
| 0x41 || 0x6 || ? ||Table (10 13 11 14 12 15)
 
|-
 
|-
| 0E || 3F || ||  || 0E || 01 || 03 || 07 || 0E
+
| 0x47 || 0x18 || Frequency Table || These are the FNUM values that make up the 12 note Chromatic musical scale for HERAD. Basically, changing these values will modify the "tuning" of the scale.
 
|-
 
|-
| 0F || 3F || || || 0E || 01 || 03 || 07 || 0F
+
| 0x5F || 0x12 || FNUM/Block Number Register Values || These register values are sent directly to the OPL chip, however these values are missing the Key-On bit (bit 5, 0xB0-0xB8).
 
|-
 
|-
| 10 || 3F || || || 0E || 02 || 04 || 08 || 10
+
| 0x71 || 0x9 || ? ||Table (00 01 02 08 09 0A 10 11 12)
 
|-
 
|-
| 11 || 3F || || || 0D || 02 || 04 || 08 || 11
+
| 0x7A || 0x16 || Fine Pitch Bend Table ||  
 
|-
 
|-
| 12 || 3F || || || 0D || 02 || 04 || 09 || 12
+
| 0x90 || 0xA || Coarse Pitch Bend Table ||  
 
|-
 
|-
| 13 || 3F || ||  || 0D || 02 || 04 || 09 || 13
+
| 0x9A || 0x2 || ? || Always 0x8000 (Changing this doesn't crash the game, but does pause playback if the value is below 0x80. Playback resumes if value is equal or greater than 80, however the value range only goes up to 0xBF)
 
|-
 
|-
| 14 || 3F || || || 0D || 02 || 05 || 0A || 14
+
| 0x9C || 0x3 || Padding ||(Always 0xEEEEEE, changing this doesn't affect playback)
 
|-
 
|-
| 15 || 3F || || || 0D || 02 || 05 || 0A || 15
+
| 0x9F || 0x2 || ? || Two byte "ping-pong" timer that counts in bits (0x (0x1,0x2,0x4,0x8,0x10,0x20,0x40,0x80)
 
|-
 
|-
| 16 || 3F || || || 0D || 02 || 05 || 0B || 16
+
| 0xA1 || 0x1 || Padding || (Always 0x90, changing this doesn't affect playback)
|-
+
|-  
| 17 || 3F || ||  || 0D || 02 || 05 || 0B || 17
+
| 0xA2 || 0x12 || Current Note Midi Tick Counter || (counts down until next note)
|-
 
| 18 || 3F || ||  || 0D || 03 || 06 || 0C || 18
 
|-
 
| 19 || 3F || ||  || 0C || 03 || 06 || 0C || 19
 
|-
 
| 1A || 3F || ||  || 0C || 03 || 06 || 0D || 1A
 
|-
 
| 1B || 3F || ||  || 0C || 03 || 06 || 0D || 1B
 
|-
 
| 1C || 3F || ||  || 0C || 03 || 07 || 0E || 1C
 
|-
 
| 1D || 3F || ||  || 0C || 03 || 07 || 0E || 1D
 
|-
 
| 1E || 3F || ||  || 0C || 03 || 07 || 0F || 1E
 
|-
 
| 1F || 3F || ||  || 0C || 03 || 07 || 0F || 1F
 
|-
 
| 20 || 3F || ||  || 0C || 04 || 08 || 10 || 20
 
|-
 
| 21 || 3F || ||  || 0B || 04 || 08 || 10 || 21
 
|-
 
| 22 || 3F || ||  || 0B || 04 || 08 || 11 || 22
 
|-
 
| 23 || 3F || ||  || 0B || 04 || 08 || 11 || 23
 
|-
 
| 24 || 3F || ||  || 0B || 04 || 09 || 12 || 24
 
|-
 
| 25 || 3F || ||  || 0B || 04 || 09 || 12 || 25
 
|-
 
| 26 || 3F || ||  || 0B || 04 || 09 || 13 || 26
 
|-
 
| 27 || 3F || ||  || 0B || 04 || 09 || 13 || 27
 
|-
 
| 28 || 3F || ||  || 0B || 05 || 0A || 14 || 28
 
|-
 
| 29 || 3F || ||  || 0A || 05 || 0A || 14 || 29
 
|-
 
| 2A || 3F || ||  || 0A || 05 || 0A || 15 || 2A
 
|-
 
| 2B || 3F || ||  || 0A || 05 || 0A || 15 || 2B
 
|-
 
| 2C || 3F || ||  || 0A || 05 || 0B || 16 || 2C
 
|-
 
| 2D || 3F || ||  || 0A || 05 || 0B || 16 || 2D
 
|-
 
| 2E || 3F || ||  || 0A || 05 || 0B || 17 || 2E
 
|-
 
| 2F || 3F || ||  || 0A || 05 || 0B || 17 || 2F
 
|-
 
| 30 || 3F || ||  || 0A || 06 || 0C || 18 || 30
 
|-
 
| 31 || 3F || ||  || 09 || 06 || 0C || 18 || 31
 
|-
 
| 32 || 3F || ||  || 09 || 06 || 0C || 19 || 32
 
|-
 
| 33 || 3F || ||  || 09 || 06 || 0C || 19 || 33
 
|-
 
| 34 || 3F || ||  || 09 || 06 || 0D || 1A || 34
 
|-
 
| 35 || 3F || ||  || 09 || 06 || 0D || 1A || 35
 
|-
 
| 36 || 3F || ||  || 09 || 06 || 0D || 1B || 36
 
|-
 
| 37 || 3F || ||  || 09 || 06 || 0D || 1B || 37
 
|-
 
| 38 || 3F || ||  || 09 || 07 || 0E || 1C || 38
 
|-
 
| 39 || 3F || ||  || 08 || 07 || 0E || 1C || 39
 
|-
 
| 3A || 3F || ||  || 08 || 07 || 0E || 1D || 3A
 
|-
 
| 3B || 3F || ||  || 08 || 07 || 0E || 1D || 3B
 
|-
 
| 3C || 3F || ||  || 08 || 07 || 0F || 1E || 3C
 
|-
 
| 3D || 3F || ||  || 08 || 07 || 0F || 1E || 3D
 
|-
 
| 3E || 3F || ||  || 08 || 07 || 0F || 1F || 3E
 
|-
 
| 3F || 3F || ||  || 08 || 07 || 0F || 1F || 3F
 
|-
 
| 40 || 3F || ||  || 08 || 07 || 10 || 20 || 3F
 
|-
 
| 41 || 3F || ||  || 08 || 08 || 10 || 20 || 3F
 
|-
 
| 42 || 3E || ||  || 07 || 08 || 10 || 21 || 3F
 
|-
 
| 43 || 3D || ||  || 07 || 08 || 10 || 21 || 3F
 
|-
 
| 44 || 3C || ||  || 07 || 08 || 11 || 22 || 3F
 
|-
 
| 45 || 3B || ||  || 07 || 08 || 11 || 22 || 3F
 
|-
 
| 46 || 3A || ||  || 07 || 08 || 11 || 23 || 3F
 
|-
 
| 47 || 39 || ||  || 07 || 08 || 11 || 23 || 3F
 
|-
 
| 48 || 38 || ||  || 07 || 08 || 12 || 24 || 3F
 
|-
 
| 49 || 37 || ||  || 06 || 09 || 12 || 24 || 3F
 
|-
 
| 4A || 36 || ||  || 06 || 09 || 12 || 25 || 3F
 
|-
 
| 4B || 35 || ||  || 06 || 09 || 12 || 25 || 3F
 
|-
 
| 4C || 34 || ||  || 06 || 09 || 13 || 26 || 3F
 
|-
 
| 4D || 33 || ||  || 06 || 09 || 13 || 26 || 3F
 
|-
 
| 4E || 32 || ||  || 06 || 09 || 13 || 27 || 3F
 
|-
 
| 4F || 31 || ||  || 06 || 09 || 13 || 27 || 3F
 
|-
 
| 50 || 30 || ||  || 06 || 09 || 14 || 28 || 3F
 
|-
 
| 51 || 2F || ||  || 05 || 0A || 14 || 28 || 3F
 
|-
 
| 52 || 2E || ||  || 05 || 0A || 14 || 29 || 3F
 
|-
 
| 53 || 2D || ||  || 05 || 0A || 14 || 29 || 3F
 
|-
 
| 54 || 2C || ||  || 05 || 0A || 15 || 2A || 3F
 
|-
 
| 55 || 2B || ||  || 05 || 0A || 15 || 2A || 3F
 
|-
 
| 56 || 2A || ||  || 05 || 0A || 15 || 2B || 3F
 
|-
 
| 57 || 29 || ||  || 05 || 0A || 15 || 2B || 3F
 
|-
 
| 58 || 28 || ||  || 05 || 0A || 16 || 2C || 3F
 
|-
 
| 59 || 27 || ||  || 04 || 0B || 16 || 2C || 3F
 
|-
 
| 5A || 26 || ||  || 04 || 0B || 16 || 2D || 3F
 
|-
 
| 5B || 25 || ||  || 04 || 0B || 16 || 2D || 3F
 
|-
 
| 5C || 24 || ||  || 04 || 0B || 17 || 2E || 3F
 
|-
 
| 5D || 23 || ||  || 04 || 0B || 17 || 2E || 3F
 
|-
 
| 5E || 22 || ||  || 04 || 0B || 17 || 2F || 3F
 
|-
 
| 5F || 21 || ||  || 04 || 0B || 17 || 2F || 3F
 
|-
 
| 60 || 20 || ||  || 04 || 0B || 18 || 30 || 3F
 
|-
 
| 61 || 1F || ||  || 03 || 0C || 18 || 30 || 3F
 
|-
 
| 62 || 1E || ||  || 03 || 0C || 18 || 31 || 3F
 
|-
 
| 63 || 1D || ||  || 03 || 0C || 18 || 31 || 3F
 
|-
 
| 64 || 1C || ||  || 03 || 0C || 19 || 32 || 3F
 
|-
 
| 65 || 1B || ||  || 03 || 0C || 19 || 32 || 3F
 
|-
 
| 66 || 1A || ||  || 03 || 0C || 19 || 33 || 3F
 
|-
 
| 67 || 19 || ||  || 03 || 0C || 19 || 33 || 3F
 
|-
 
| 68 || 18 || ||  || 03 || 0C || 1A || 34 || 3F
 
|-
 
| 69 || 17 || ||  || 02 || 0D || 1A || 34 || 3F
 
|-
 
| 6A || 16 || ||  || 02 || 0D || 1A || 35 || 3F
 
|-
 
| 6B || 15 || ||  || 02 || 0D || 1A || 35 || 3F
 
|-
 
| 6C || 14 || ||  || 02 || 0D || 1B || 36 || 3F
 
|-
 
| 6D || 13 || ||  || 02 || 0D || 1B || 36 || 3F
 
|-
 
| 6E || 12 || ||  || 02 || 0D || 1B || 37 || 3F
 
|-
 
| 6F || 11 || ||  || 02 || 0D || 1B || 37 || 3F
 
|-
 
| 70 || 10 || ||  || 02 || 0D || 1C || 38 || 3F
 
|-
 
| 71 || 0F || ||  || 01 || 0E || 1C || 38 || 3F
 
|-
 
| 72 || 0E || ||  || 01 || 0E || 1C || 39 || 3F
 
|-
 
| 73 || 0D || ||  || 01 || 0E || 1C || 39 || 3F
 
 
|-
 
|-
| 74 || 0C || || || 01 || 0E || 1D || 3A || 3F
+
| 0xB4 || 0x12 || MIDI Track Position || (counts up until reaching the track end value specified in the music file header)
 
|-
 
|-
| 75 || 0B || || || 01 || 0E || 1D || 3A || 3F
+
| 0xC6 || 0x12 || Start of MIDI Tracks ||(Absolute address in music file, rather than relative address in music file header)
 
|-
 
|-
| 76 || 0A || || || 01 || 0E || 1D || 3B || 3F
+
| 0xD8 || 0x12 || 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.
 
|-
 
|-
| 77 || 09 || ||  || 01 || 0E || 1D || 3B || 3F
+
| 0xEA || 0x12 || 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. If no instrument or note data exist, the values will be 0xFF/0x00 respectively
|-
 
| 78 || 08 || ||  || 01 || 0E || 1E || 3C || 3F
 
|-
 
| 79 || 07 || ||  || 01 || 0F || 1E || 3C || 3F
 
|-
 
| 7A || 06 || ||  || 01 || 0F || 1E || 3D || 3F
 
|-
 
| 7B || 05 || ||  || 01 || 0F || 1E || 3D || 3F
 
|-
 
| 7C || 04 || ||  || 01 || 0F || 1F || 3E || 3F
 
|-
 
| 7D || 03 || ||  || 01 || 0F || 1F || 3E || 3F
 
|-
 
| 7E || 02 || ||  || 01 || 0F || 1F || 3F || 3F
 
|-
 
| 7F || 01 || ||  || 01 || 0F || 1F || 3F || 3F
 
|}
 
 
 
==HERAD Instrument Chunk (WIP)==
 
 
 
Each instrument is 28 bytes long.  There seems to be some metadata with these instruments, possibly an instrument id/number.  There could also be some flags used as well, but that's yet to be determined.
 
 
 
These offsets are still a work in progress and need more research.  Thanks to [[User:Malvineous|Malvineous]] for his documentation on the [http://www.shikadi.net/moddingwiki/AdLib_Instrument_Bank_Format AdLib Instrument Bank Format] which is what this chunk of data is heavily based off of.
 
 
 
{| class="wikitable"
 
! Offset !! Size !! Name !! Description !! OPL base register !! Value range
 
|-
 
| 0x0 || 1 || || <center>Unknown</center> || ||
 
|-
 
| 0x1 || 1 || || <center>Unknown</center> || ||
 
|-
 
| 0x2 || 1 ||  ksl || <center>'''Modulator Key scaling level'''</center> || 0x40 (bits 6-7)
 
|-
 
| 0x3 || 1 || multiple || <center>'''Modulator Frequency multiplier'''</center> || 0x20 (bits 0-3)
 
|-
 
| 0x4 || 1 || feedback || <center>'''Feedback''' </center> || 0xC0 (bits 1-3)
 
|-
 
| 0x5 || 1 || attack || <center>'''Modulator Attack'''</center> || 0x60 (upper four bits)
 
|-
 
| 0x6 || 1 || sustain || <center>'''Modulator Sustain'''</center> || 0x80 (upper four bits)
 
|-
 
| 0x7 || 1 || eg || <center>'''Modulator Envelope gain'''</center> || 0x20 (bit 5) || nonzero value is on
 
|-
 
| 0x8 || 1 || decay || <center>'''Modulator Delay'''</center> || 0x60 (lower four bits)
 
|-
 
| 0x9 || 1 || releaseRate || <center>'''Modulator Release'''</center> || 0x80 (lower four bits)
 
|-
 
| 0xA || 1 || totalLevel || <center>'''Modulator Output Level'''</center> || 0x40 (bit 0-5) || uses all bits; output level can still be modified by output level byte 0x1E
 
|-
 
| 0xB || 1 || am ||<center>'''Modulator Amplitude modulation (Tremolo)'''</center> || 0x20 (bit 7) ||
 
|-
 
| 0xC || 1 || vib ||<center>'''Modulator Frequency Vibrato'''</center> ||  0x20 (bit 6)  ||
 
|-
 
| 0xD || 1 || ksr || <center>'''Modulator Key scaling/envelope rate'''</center> ||  0x20 (bit 4) ||
 
|-
 
| 0xE || 1 || con || <center>'''Connector'''</center> || 0xC0 (bit 0, inverted) || 0: OPL bit set to 1<br>other: OPL bit set to 0
 
|-
 
| 0xF || 1 ||  ksl || <center>'''Carrier Key scaling level'''</center> || 0x40 (bits 6-7)
 
|-
 
| 0x10 || 1 || multiple || <center>'''Carrier Frequency multiplier'''</center> || 0x20 (bits 0-3)
 
|-
 
| 0x11 || 1 || feedback || <center>''Feedback (Ignore)'' </center> || 0xC0 (bits 1-3) || This byte seems to have garbage data in it and is not used
 
|-
 
| 0x12 || 1 || attack || <center>'''Carrier Attack'''</center> || 0x60 (upper four bits)
 
|-
 
| 0x13 || 1 || sustain || <center>'''Carrier Sustain'''</center> || 0x80 (upper four bits)
 
|-
 
| 0x14 || 1 || eg || <center>'''Carrier Envelope gain'''</center> || 0x20 (bit 5) || nonzero value is on
 
|-
 
| 0x15 || 1 || decay || <center>'''Carrier Delay'''</center> || 0x60 (lower four bits)
 
|-
 
| 0x16 || 1 || releaseRate || <center>'''Carrier Release'''</center> || 0x80 (lower four bits)
 
|-
 
| 0x17 || 1 || totalLevel || <center>'''Carrier Output Level'''</center> || 0x40 (bit 0-5) || uses all bits; output level can still be modified by output level byte 0x1E
 
|-
 
| 0x18 || 1 || am ||<center>'''Carrier Amplitude modulation (Tremolo)'''</center> || 0x20 (bit 7) ||
 
|-
 
| 0x19 || 1 || vib ||<center>'''Carrier Frequency Vibrato'''</center> ||  0x20 (bit 6)  ||
 
|-
 
| 0x1A || 1 || ksr || <center>'''Carrier Key scaling/envelope rate'''</center> ||  0x20 (bit 4) ||
 
|-
 
| 0x1B || 1 || con || <center>''Connector (Ignore)''</center> || 0xC0 (bit 0, inverted) || So far, this seems to be always set at zero.
 
|-
 
| 0x1E || 1 || ||<center>'''Modulator Output Level'''</center>  || || 0 = loudest, F = softest
 
|-
 
| 0x1F || 1 || || <center>'''Carrier Output Level'''</center> || || 0 = loudest, F = softest
 
|-
 
| 0x20 || 1 || || <center>Unknown</center> || || Seems to increases Feedback depending on note velocity
 
|-
 
| 0x21 || 1 || || <center>Unknown</center> || || Increases pitch bend range (seems like it's a flag: Fine tune = 0, Coarse tune = 1)
 
|-
 
| 0x22 || 1 || || <center>'''Pitch'''</center> || || Normally set at 0x0, 0xC = an octave higher
 
|-
 
| 0x23 || 1 || ||<center>Unknown</center> || || Has to deal with pitch bend
 
|-
 
| 0x24 || 1 || || <center>Unknown</center> || || Has to deal with pitch bend
 
|-
 
| 0x25 || 1 || || <center>Unknown</center>
 
|-
 
| 0x26 || 1 || || <center>Unknown</center>
 
|-
 
| 0x27 || 1 || || <center>Unknown</center>
 
|}
 
 
 
==HERAD Instrument Chunk (old)==
 
 
 
Each instrument is 28 bytes long.  Instruments usually just use the lower 3-0 bits for these OPL commands but full 8-bit values have been seen. There seems to be some metadata with these instruments, possibly an instrument id/number.  There could also be some flags used as well, but that's yet to be determined.
 
 
 
These offsets are still a work in progress and need more research.
 
 
 
{| class="wikitable"
 
! Offset
 
! Size
 
! Description
 
|-
 
| 0x0
 
| 1
 
| <center>Unknown</center>
 
|-
 
| 0x1
 
| 1
 
| <center>Unknown</center>
 
|-
 
| 0x2
 
| 1
 
| <center>'''Modulator Scaling''' (0xC=4. 0xD=8, etc.)</center>
 
|-
 
| 0x3
 
| 1
 
| <center>'''Modulator Sound Characteristic (bits 3-0)'''</center>
 
|-
 
| 0x4
 
| 1
 
| <center>'''Feedback/Connection''' (0xB=7, OxC=9, 0xD=B)</center>
 
|-
 
| 0x5
 
| 1
 
| <center>'''Modulator Attack'''</center>
 
|-
 
| 0x6
 
| 1
 
| <center>'''Modulator Sustain'''</center>
 
|-
 
| 0x7
 
| 1
 
| <center>'''Modulator Sound Characteristic (bits 7-4)'''</center>
 
|-
 
| 0x8
 
| 1
 
| <center>'''Modulator Delay'''</center>
 
|-
 
| 0x9
 
| 1
 
| <center>'''Modulator Release'''</center>
 
|-
 
| 0xA
 
| 1
 
| <center>'''Modulator Scaling/Output Level''' (uses all bits; output level can still be modified by output level byte 0x1E)</center>
 
|-
 
| 0xC
 
| 1
 
| <center>'''Modulator Sound Characteristic''' (adds +4 to high bits) (Amplitude Modulation Depth / Vibrato Depth?)</center>
 
|-
 
| 0xE
 
| 1
 
| <center>'''Feedback/Connection''' (0x1=6, Ox0=7)</center>
 
|-
 
| 0xF
 
| 1
 
| <center>'''Carrier Scaling'''</center>
 
|-
 
| 0x10
 
| 1
 
| <center>'''Carrier Sound Characteristic (bits 3-0)'''</center>
 
|-
 
| 0x11
 
| 1
 
| <center>Unknown</center>
 
|-
 
| 0x12
 
| 1
 
| <center>'''Carrier Attack'''</center>
 
|-
 
| 0x13
 
| 1
 
| <center>'''Carrier Sustain'''</center>
 
|-
 
| 0x14
 
| 1
 
| <center>'''Carrier Sound Characteristic (bits 7-4)'''</center>
 
|-
 
| 0x15
 
| 1
 
| <center>'''Carrier Delay'''</center>
 
 
|-
 
|-
| 0x16
+
| 0xFC || 0x12 || Pitch Slide Range Flag (first byte) / Root Note Transpose (second byte) for each MIDI track
| 1
 
| <center>'''Carrier Release'''</center>
 
 
|-
 
|-
| 0x1C
+
| 0x10E || 0x12 || Pitch Slide Duration Counter (first byte) / Pitch Slide Duration (second byte) for each MIDI track || The Pitch Slide Counter starts at the value assigned by the second byte.
| 1
 
| <center>Unknown</center>
 
 
|-
 
|-
| 0x1D
+
| 0x120 || 0x12 || 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.
| 1
 
| <center>Unknown</center>
 
 
|-
 
|-
| 0x1E
+
| 0x132 || 0x12 || Modulator Output Level Scaling (first byte) / Carrier Output Level Scaling (Second byte) || These values are taken from the current instrument.
| 1
 
| <center>'''Modulator Output Level''' (0 = loudest, F = softest)</center>
 
 
|-
 
|-
| 0x1F
+
| 0x144 || 0x12 || Modulator Output Level (first byte) / Carrier Output Level (Second byte) || These values are taken from the current instrument.
| 1
 
| <center>'''Carrier Output Level''' (0 = loudest, F = softest)</center>
 
 
|-
 
|-
| 0x22
+
| 0X156 || 0x12 || Modulator Output Level Register (first byte) / Carrier Output Level Register (Second byte) || These are the final register values that are sent to the OPL chip.
| 1
 
| <center>'''Pitch''' (Normally set at 0x0, 0xC = an octave higher)</center>
 
 
|-
 
|-
| 0x23
+
| 0x168 || 0x12 || Panning/Feedback/Connector Register Value ||
| 1
 
| <center>Unknown</center>
 
 
|-
 
|-
| 0x24
+
| 0x17A || 0x12 || ? || (Only affects songs that have loop points)
| 1
 
| <center>Unknown</center>
 
 
|-
 
|-
| 0x25
+
| 0x18C || 0x12 || Loop Start Absolute Address for each MIDI track || (loads after the song passes the loop beginning measure)
| 1
 
| <center>Unknown</center>
 
 
|-
 
|-
| 0x26
+
| 0x19E || 0x24 || ?  || Seems to be just zeros
| 1
 
| <center>Unknown</center>
 
 
|-
 
|-
 +
| 0x1C2 || 0x1 || Terminator || (flashes 0xFF during playback)
 
|-
 
|-
 +
| 0x1C3 || EOF || Binary Data || (starts with "HSQ")
 
|}
 
|}

Revision as of 23:42, 2 January 2017

MegaRace HERAD "DFADP.HSQ" Driver

Offset Size Description Notes
0x00 0x15  ? Changing some values crash the game, while others don't
0x15 0x2 Something to do with the song speed (Always 0x0002)
0x17 0x2  ? (Always 0x1941)
0x19 0x2 Song length (first two bytes from music file)
0x1B 0x2  ? (Always 0x1941)
0x1D 0x2  ? (OPL Timer?)
0x1F 0x2 MIDI Measure Counter (this counts up after every 96 MIDI ticks and is used for the song loop)
0x21 0x2 MIDI Tick Measure Counter (Counts down from 0x60 aka 96 MIDI Ticks)
0x23 0x2 Song Repeat Counter (Counts down from 0xFFFF after passing beginning loop measure)
0x25 0x10  ? Changing some values crash the game, while others don't
0x35 0x6  ? Table (00 03 01 04 02 05)
0x3B 0x6  ? Table (08 0B 09 0C 0A 0D)
0x41 0x6  ? Table (10 13 11 14 12 15)
0x47 0x18 Frequency Table These are the FNUM values that make up the 12 note Chromatic musical scale for HERAD. Basically, changing these values will modify the "tuning" of the scale.
0x5F 0x12 FNUM/Block Number Register Values These register values are sent directly to the OPL chip, however these values are missing the Key-On bit (bit 5, 0xB0-0xB8).
0x71 0x9  ? Table (00 01 02 08 09 0A 10 11 12)
0x7A 0x16 Fine Pitch Bend Table
0x90 0xA Coarse Pitch Bend Table
0x9A 0x2  ? Always 0x8000 (Changing this doesn't crash the game, but does pause playback if the value is below 0x80. Playback resumes if value is equal or greater than 80, however the value range only goes up to 0xBF)
0x9C 0x3 Padding (Always 0xEEEEEE, changing this doesn't affect playback)
0x9F 0x2  ? Two byte "ping-pong" timer that counts in bits (0x (0x1,0x2,0x4,0x8,0x10,0x20,0x40,0x80)
0xA1 0x1 Padding (Always 0x90, changing this doesn't affect playback)
0xA2 0x12 Current Note Midi Tick Counter (counts down until next note)
0xB4 0x12 MIDI Track Position (counts up until reaching the track end value specified in the music file header)
0xC6 0x12 Start of MIDI Tracks (Absolute address in music file, rather than relative address in music file header)
0xD8 0x12 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.
0xEA 0x12 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. If no instrument or note data exist, the values will be 0xFF/0x00 respectively
0xFC 0x12 Pitch Slide Range Flag (first byte) / Root Note Transpose (second byte) for each MIDI track
0x10E 0x12 Pitch Slide Duration Counter (first byte) / Pitch Slide Duration (second byte) for each MIDI track The Pitch Slide Counter starts at the value assigned by the second byte.
0x120 0x12 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.
0x132 0x12 Modulator Output Level Scaling (first byte) / Carrier Output Level Scaling (Second byte) These values are taken from the current instrument.
0x144 0x12 Modulator Output Level (first byte) / Carrier Output Level (Second byte) These values are taken from the current instrument.
0X156 0x12 Modulator Output Level Register (first byte) / Carrier Output Level Register (Second byte) These are the final register values that are sent to the OPL chip.
0x168 0x12 Panning/Feedback/Connector Register Value
0x17A 0x12  ? (Only affects songs that have loop points)
0x18C 0x12 Loop Start Absolute Address for each MIDI track (loads after the song passes the loop beginning measure)
0x19E 0x24  ? Seems to be just zeros
0x1C2 0x1 Terminator (flashes 0xFF during playback)
0x1C3 EOF Binary Data (starts with "HSQ")