Skip to content

Floppy Support ‐ Working With Disk Images

dbalsom edited this page Aug 27, 2024 · 3 revisions

This information is intended for a future release of MartyPC and describes features currently in development.

Image Types

MartyPC supports three basic image types, raw sector disk images, advanced sector-based images, and bitstream-level images.

Raw Sector Images

  • File extensions: IMG, IMA, DSK, etc.
  • Raw sector images are ubiquitous, easily the most common type of disk image used with PC emulators. These files simply contain raw sectors in order, which are all assumed to be exactly 512 bytes. No header is present, but the layout of the disk can generally be determined by the file size.
  • The obvious limitation of this format is that any non-standard disk layout cannot be represented. However, these images are very convenient and simple if working with non-copy-protected images.
  • MartyPC can save the currently loaded disk image to IMG format, although data loss may occur if the disk contains non-standard layout, formats, or disk metadata.
  • IMZ files created by the popular WinImage tool are simply ZIP files containing a single IMA raw image file. These are also supported.

Advanced Sector-Based Disk Images

Sector-based images encode byte data for each sector, typically with metadata about the sector's id markers and data CRC status. These images can support many copy-protected titles, but may fail to encode more advanced protections, sometimes produce impossible track encodings, and are not ideal for archival purposes or research.

  • ImageDisk (IMD)
    • ImageDisk is a format developed by Dave Dunfield as an open alternative to TeleDisk format images, although it has some limitations.
  • Teledisk (TD0)
    • A disk image format used by Sydex TELEDISK, an early commercial disk-copying program.
    • No official documentation exists, however Dave Dunfield published notes on the disk format and the format is supported by a number of tools and emulators.
    • Multiple versions exist, including different compression algorithms. Version 2 Teledisk images may be compressed with LZHUF compression. Version 1.x images may use a custom LZW implementation instead.
    • fluxfox currently only supports Version 2.x Teledisk images. It uses LZHUF decompression code from retrocompressor by dfgordon.
  • PCE Sector Image (PSI)
    • One of several image formats developed by Hampa Hug for use with his emulator, PCE. A flexible format based on RIFF-like data chunks.

Bitstream Disk Images

Bitstream images store the low-level FM or MFM encoded bit stream of each track on a diskette. These images typically can encode most protection types seen on the PC, given the appropriate metadata (weak and damaged bits), but are more complex than sector images to manipulate and write back to.

  • PCE Raw Image (PRI)
    • One of several image formats developed by Hampa Hug for use with his emulator, PCE. Along with track bitstream data, PRI supports weak bit masks.
  • MFM Bitstream Image (MFM)
    • A bitstream format created for use with the HxC drive emulation software.
    • Only MFM-encoded track data is included. There is no support for weak bits or other metadata.
  • HFE Bitstream Image (HFE)
    • Another format associated with the HxC software, HFE is also a bitstream container, however unlike MFM it supports multiple encoding types. There are several versions of HFE supported by HxC, HFEv3 being the newest, however the format is still considered experimental and not finalized. MartyPC can read 'plain' v1 HFE files.
  • 86Box Floppy Image (86F)
    • A format designed around the internal representation of disks in the 86Box emulator. Bitstream based and flexible in terms of per-track parameters, it also allows exact encoding of bitcell length to support track wrapping.

Zip Files

  • Not a disk image per-se, but MartyPC has support for ZIP files containing a single disk image. The image will be extracted and mounted. This is the basis for IMZ support.
  • If multiple files are present in a ZIP container, MartyPC will instead attempt to build a standard disk image containing a FAT filesystem from the contents of the ZIP file. See the page on Image Mounting for more details.

Loading Disk Images

Compatible image formats should automatically appear in the floppy image browser. When loading a disk image, keep an eye out for notifications in the bottom-right of the screen - if the disk image cannot be loaded, an error will appear there.

If you believe you've encountered a valid disk image of the above format that does not load in MartyPC, please open an issue to let me know.

Saving Disk Images

MartyPC cannot save images in all the formats that it can read. MartyPC is generally aware of the requirements needed to encode the currently loaded image, and disk image formats incapable of representing the image accurately will not be available. The exception to this is IMG, which can always be written, but not without data loss. A copy-protected disk image written to IMG will no longer function. The purpose of allowing IMG is mostly for compatibility with external tools or extraction of FAT filesystems.

If you wish to preserve functionality of a modified disk image, the following formats are suggested:

  • Bitstream Images: 86F
  • Sector Images: PSI

Analyzing Disk Images

MartyPC can display a lot of information about a disk image, including track layout and track/sector hex dumps.

To open the floppy image display window, select the 'Image info...' option from the Media menu.