King's Bounty Music Format
King's Bounty stores it's PC speaker music in the EXE file*.
- Note: The 1990 version of the EXE is compressed by unknown compression, and so is not described here yet. The offsets listed are for the 1995 version.
|0x18B5D||BYTE str||Tunes (2 bytes per note, 0xFF marks end)|
|0x18B97||UINT16LE freq||Note palette (frequencies)|
|0x18C47||UINT16LE delay||Duration palette|
|0x18C67||UINT16LE offsets||Offsets into tunes (add 0x15850)|
For example, tune #0's offset (at 0x18C67) is 0x330D, which leads us to 0x18B5D (0x15850+0x330D). There, we see:
0x28 0x07 0xFF
Which are: index into note palette, index into duration palette, end marker. In default palettes, note 0x28 is 65 hz, and duration 0x07 is a 15 ms delay.