Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:Atari ST and MSA disk images

From ReverseEngineering.wiki
Format
Platforms Platform:Atari ST
Magic 0E 0F (MSA)
Extensions .st .msa
On this wiki Facts · Code · Notes · Topics

Atari ST floppy images: .ST is a raw 512-byte-sector dump (9-11 sectors per track, 80-82 tracks); .MSA (Magic Shadow Archiver) adds a 10-byte big-endian header (0x0E0F, sectors per track, sides-1, start track, end track) and run-length compresses each track with the 0xE5 marker.

ST

Plain track-by-track dump (tracks 0-81, side 0 then side 1 per track), 9, 10 or 11 sectors of 512 bytes; MAME clamps the sector count to 9-11 and the track count to 82.

MSA header (big endian, 10 bytes)

  • 0: signature 0x0E0F
  • 2: sectors per track (9-11)
  • 4: number of sides minus one (0 or 1)
  • 6: first track
  • 8: last track (below 82) Each stored track is a u16 big-endian length followed by that many bytes. If the length equals sectors x 512 the data is raw; otherwise it is compressed.

MSA compression

A byte 0xE5 introduces a run: the next byte is the value and the following big-endian u16 the repeat count; any other byte is literal. The writer uses a run for more than 4 equal bytes and always for a literal 0xE5.

Sources

MAME src/lib/formats/st_dsk.cpp lines 150-226 (header read, uncompress, compress, identify), commit 1d7a454ed79e97d35d2a9f127ac029ead94711d6.

Code & repositories

  • https://github.com/mamedev/mame @ 1d7a454ed79e97d35d2a9f127ac029ead94711d6 · license: BSD-3-Clause (declared by the contributor; GitHub's detector did not recognize COPYING)
    MAME src/lib/formats/*_dsk.cpp and tzx_cas.cpp: floppy and tape image loaders
    Tested on: source read, not run: source reading only · checked 2026-10-18; last activity 2026-10-18; Note: the latest release ships binaries; the wiki links only the source, never the binaries