Capcom "6C80" Sound Engine/Music Format Documentation ======================================= version 0.21 by Matrixz Games that use this sound engine -------------------------------- DarkWing Duck MegaMan 3 MegaMan 4 MegaMan 5 MegaMan 6 Mighty Final Fight RockBoard TaleSpin The Little Mermaid Other games i think use this sound engine (or a similiar variant) ----------------------------------------------------------------- Chip' n' Dale Gargoyle's Quest 2 Little Nemo: The Dream Master Duck Tales 2 6C80?? ------ Had to give the thing a name, so i did after what's usually byte 2 and 3 in the sound engine. Credits to Sephiroth3 for insight on music data. Song Banks ====================================== I belive that all games using this format uses the MMC3 mapper. The games uses two 8kb rom banks for the sound engine, music and sound effects wich is loaded to $8000 and $A000 in the memory map. And in the games i've seen, a extra 8kb bank for extra music or/and sound effects, wich is swapped into $A000. These can be any of the switchable 8kb banks in the rom. To find the start of the sound engine bank, open the rom in a hex editor and try searching for $4C,$6C,$80. Here is a little list of bank adresses in some games: Sound Engine/ Additional BGM/SFX BGM/SFX 2 BGM/SFX Bank - Adress - Bank - Adress - Bank - Adress MegaMan 3: $16 - $2C010 $17 - $2E010 $18 - $30010 MegaMan 4: $1E - $3C010 $1F - $3E010 $1D - $3A010 MegaMan 5: $18 - $30010 $19 - $32010 $1A - $34010 MegaMan 6: $34 - $68010 $35 - $6A010 $36 - $6C010 Song Adress Table ====================================== The song adress table is in the sound engine bank. As far as i know, it is always at the Sound Engine Bank adress + $A43. Here's a 2 byte pointer to every song, in non-integer (high byte then low byte). These are NES Memory Map pointers, so you'll have to convert them to find them in the rom. Just subtract $8000 and add the adreess of the Sound Engine Bank to do that. Example: Song pointer: $81A5 Sound Engine Bank adress: $30010 This means, the rom offset of the song is $301B5 Song Format ====================================== If the first byte in the song is 0, it's a song. Or else, it's actually a sound effect. Documentation on sound effects might be added later. The song has 4 channels: Square 1, Square 2, Triangle (Bass, Bassdrums etc.) and Noise (Used as drums etc.) Following the first byte on 0, is 4 X 2-byte-pointers, wich points to the start of the data for each channel. These work exactly in the same manner as the pointers in the song adress table, so: Just subtract $8000 and add the adreess of the Sound Engine Bank to do that. Yeah! The channel data is mixed up of commands and notes. Commands tells how the notes shall sound, controls loops, tempo etc. They can use one or more operands to them. In my list, a +[?] means a operand on one byte. Here is a list of commands. All the ID's are in, but im not sure how all works yet. ----------------------------------------------------------------------------------------------------- ID Name Operands Comment ----------------------------------------------------------------------------------------------------- 00 ?? Toggle 3/4? 01 ?? Wait for signal? 02 ?? Delay?? 03 ?? Add 2 to Octave? 04 ?? +[Value] ??? 05 Speed +[High],+[Low] Higher Value means Higher Speed. Default: 01,00 06 Length +[Time] Set Tone Lenght 07 Volume +[Volume] Set Volume ($00 - $0F) 08 Instrument +[Instrument] Set Instrument to use 09 Octave +[Octave] Set Octave (0-7, 8 and 9 is lower than 0. A equals 0) 0A Global Transpose +[Value] Transpose All Channels. Default: 00 0B Transpose +[Value] Transpose for Channel. Default: 00 0C Tune +[Value] Tune Pitch. Lower=Higher, Highter=Lower. Default: 00 0D Slide +[Speed?] Slide to next note effect 0E Loop1 +[Times]+[High]+[Low] Loop, Level 1 Depth. Times = Logical Times 0F Loop2 +[Times]+[High]+[Low] Loop, Level 2 Depth. Times = Logical Times 10 Loop3 +[Times]+[High]+[Low] Loop, Level 3 Depth. Times = Logical Times 11 Loop4 +[Times]+[High]+[Low] Loop, Level 4 Depth. Times = Logical Times 12 ??1 +[???]+[High]+[Low] Jump to Adress second time executed, with loop? ???=Times? 13 ??2 +[???]+[High]+[Low] Jump to Adress second time executed, with loop? ???=Times? 14 ??3 +[???]+[High]+[Low] Jump to Adress second time executed, with loop? ???=Times? 15 ??4 +[???]+[High]+[Low] Jump to Adress second time executed, with loop? ???=Times? 16 Jump +[High]+[Low] Jump to Adress 17 End Channel End 18 Tone Type +[Type] Bits 0-1: Duty Cycle, bits 2-7: Downslide Speed??? Here is a list of note byte ID's: -------------------------------- ID Note Lenght -------------------------------- 20 Delay 64th 21 C-1 64th 22 C#1 64th 23 D-1 64th 24 D#1 64th 25 E-1 64th 26 F-1 64th 27 F#1 64th 28 G-1 64th 29 G#1 64th 2A A-1 64th 2B A#1 64th 2C B-1 64th 2D C-2 64th 2E C#2 64th 2F D-2 64th 30 D#2 64th 31 E-2 64th 32 F-2 64th 33 F#2 64th 34 G-2 64th 35 G#2 64th 36 A-2 64th 37 A#2 64th 38 B-2 64th 39 C-3 64th 3A C#3 64th 3B D-3 64th 3C D#3 64th 3D E-3 64th 3E F-3 64th 3F F#3 64th -------------------------------- 40-5F = 32th Note 60-7F = 64th Note 80-9F = 8th Note A0-BF = Quarter Note C0-DF = Half Note E0-FF = Whole Note The following ID's also have Daly and the notes from C-1 to F#3, just with different lenght. You can just look up the table above.