|First Game:||Danger Freak (AMI)|
MDAT is a song format and part of TFMX (The Final Musicsystem Extended) created by Chris Hülsbeck for the Commodore Amiga and later enhanced for the Atari ST. On the Amiga, each MDAT file comes with an SMPL file.
Until early 1991, TFMX only supported the Amiga's normal 4 voices. Oktalyzer already emulated 8 voices, but Hülsbeck did not like the sound quality. Meanwhile, back since 1988, Jochen Hippel was developing music drivers that played 4 samples on the Atari ST in order to emulate the Amiga. When Hülsbeck heard Turrican (AST), he realized that only low sounds should be mixed, and asked Hippel if he could have his source code. Since then, TFMX supports 7 voices. This was first used in Turrican II: The Final Fight (AMI); in fact, Hülsbeck called the title song a demonstration. However, 7 voices are also CPU-intensive and were only used in title, high-score and ending songs, whereas in-game songs stayed at 4 voices (or 3 when sound effects tended to drown a 4th musical voice anyway).
MDAT files also have an editable 40x6 intro-text, which mostly was either "(Empty)" or
Date : dd.MM.yy Time : HH:mm
with either x's or an actual date and time.
The official editor and most players use the mdat.* and smpl.* extensions. DOS games use *.tfx and *.sam. Some players use other extensions, but their source is unknown.
- APlayer - BeOS
- DeliPlayer - Windows 32
- DeliTracker - Amiga
- Delix - XMPlay
- EaglePlayer - Amiga
- Jam - Atari ST, Windows 32
- Modizer - iOS
- TFMX decoder - foobar2000
- tfmx-play - Unix
- TFMX plugin - XMMS
- tfmxplay - Windows 32
- TFMXPlug - Winamp
- UADE - UNIX
Hülsbeck also mentioned (without name) a very buggy DOS player from his Soundfactory CD.
- TFMX-Editor - Amiga
How to Obtain
MDAT files usually have to be manually extracted from game files, a process that is different for pretty much every game that uses them.
One MDAT file can store up to 32 songs. Some of them may be subsets of other songs -- subsets that probably were made by the arranger for quick testing and are neither used by the game, nor (probably) should be recorded.
MDAT and SMPL files are separated due to the Amiga's different RAMs. SMPL files must be in the Chip RAM as the sound chip can access only that. MDAT files should be in the Fast RAM as the driver can indeed access it faster.
Early MDAT files have exactly 128 patterns (each addressed by a table at 200h), 128 macros (table at 400h), a track table at 600h, and pattern 7Fh is a table of sound effects (8 bytes per entry). Since early 1990, the sound effect table can be at 200h, the track table address at 1D0h, the truncated pattern-table address at 1D4h, and the truncated macro table address at 1D8h.
When using 7 voices, TFMX maps voices 0 to 2 to the Amiga's normal voices and additionally mixes virtual voices 4 to 7 together into the Amiga's voice 3. The effect of a person using voice 3 directly is not researched.
Normally, everything is in big endian (the Amiga's native order). However, the DOS game driver expects the three addresses at 1D0h (and oddly, or lazily, only them) in little endian (the PC's native order).
- exotica.org.uk/wiki/TFMX - Unofficial format specification and game music.