SMB1 Music Format 02/19/06 by JaSp ------------------------- SongParts are the different sections of a song; songs aren't stored with data only so that it can play a same part without having to write it twice or more. For example, the main theme is composed of 33 parts following each other, with 10 different parts (from 0x792D to 0x794D). Headers contains the song part's tempo and the different channel pointers : the main is direct in little endian format (high-low) and is for square1. The others are for square2, triangle and noise, they're relative to the first byte of the main channel. Then you've got the data itself. I didn't search how and where the number of part for the songs are determined. This music format is similar (but not exactly the same, some instruments data may differ for example, so it'll sound like garbage if past in another game) to some other games, such as SMB2 or SMB3. To easily recognize this data, use FCEUXD's Code/Data Logger : start it before a song plays, then get the whole song to reach its end and search for some blue data in the hex editor, you should easily find it. 0x791D -> 0x7967 #SongPart HeaderPointers 0x791D + #SongPart HeaderPointer(1 byte) = #SongPart Header(6 bytes) #SongPart Header : AA BB CC DD EE FF (6 bytes) AA: Tempo BB,CC: Main SongPart Pointer in RAM (square1 channel)(direct;little endian)(decrease by $8000 to get ROM address) DD: Square2 channel pointer (relative; main songpart address + DD) EE: Triangle channel pointer (relative; main songpart address + EE) FF: Noise channel pointer (relative; main songpart address + FF) SongPart data $00 End the whole part (if in square1 data) $01 - $7F Note byte (pitch varies according to value) $80 - $FF Properties byte #1aaabbbb aaa : instrument bbbb : note length