Contents

Technical Documentation - Dungeon Master II Music triggers (CD.DAT, MD.DAT, SONGLIST.DAT)

Overview

In the versions of Dungeon Master II that have music, there is a data file that defines the dungeon locations where a music track should be played.
The file consists of a list of 4 bytes records. The list is not limited in size. Each time the party moves, the game checks that list and if it finds an entry corresponding to the current party location, it plays the specified music track.
Each version of the game uses one of two formats for this data file.

Note: the dungeon consists of a set of 44 maps (each up to 32x32 squares). Each map has an associated level and multiple maps may be located on the same level, like level 6 in Dungeon Master II. Each map also has X and Y offsets to position the maps on the level.

Format 1: level coordinates

This format is used in PC-9821, FM-Towns, Macintosh JP and Sega CD / Mega CD versions. They all contain the same 40 bytes file named CD.DAT. It defines 10 locations in the dungeon where music is played.
There is no wildcard to apply the same music to a whole level.

  • Byte 0: X coordinate in the level: X coordinate in the map (value between 0 and 31) added to the X offset
  • Byte 1: Y coordinate in the level: Y coordinate in the map (value between 0 and 31) added to the Y offset
  • Byte 2: Level index
  • Byte 3: Music track index to play at the location

Format 2: map coordinates

This format is used in Amiga, PC and Macintosh US versions. They all contain a 176 bytes file but with a different name and content for each version: CD.DAT (Amiga), SONGLIST.DAT (PC), MD.DAT (Macintosh US). It defines a music to play for each of the 44 maps in the dungeon.
There is a wildcard to apply the same music to a whole map: if the X coordinate is set to 0xFF then the specified Y coordinate is ignored and the music is played everywhere on the specified map.
All three versions have both X and Y set to 0xFF for all 44 maps but this is not mandatory.

  • Byte 0: X coordinate in the map (value between 0 and 31) without adding the offset
  • Byte 1: Y coordinate in the map (value between 0 and 31) without adding the offset
  • Byte 2: Map index
  • Byte 3: Music track index to play at the location