Friday, July 15, 2011

i64 Diskette Image header

A "D64 file" is an image file of a real Commodore 1541 diskette. D64s, and related formats, have been around since the 90s. In a previous post, I explained that it might be nice to see a more flexible, parametric approach to Commodore disk images.

I'm currently calling this format "i64", although I haven't fully settled on it.

An old draft of the format is here.

In short, it's simply an optional header block, with parametric data explaining the structure of the image and important offsets.

It's present in any disk image which is of a non-standard size.  For example, if a .d81 file is not the correct size for a d81 image, then look at the first block for the i64 custom header. If it's present, it's located in the first 256 bytes of the disk image -- where a header ought to be located. Otherwise, drive on as usual.

This fancy new header tells us very explicit things about the image.

Structure is 8 bytes, and lays out the four zones of every Commodore disk: the number of tracks per zone, and the number of sectors per track within that zone. Also whether the disk is double-sided (thereby duplicating the zone data for side 2).

Error data can either be prepended to the actual tracks, or appended.

The locations of the disk header block, directory and BAM are required. Offsets to the header and BAM data are required, and how the BAM is stored in the case of dual-sided disks, or indeed if the BAM exists at all.

An autoboot BAM offset, if any. A boot track, if any.

Interleaves.

The disk's default format type and DOS type.

Whether the REL field is used for the LSU.
Whether the file's timestamp is stored in the directory entry.
Whether the Directory is allowed to freely grow and range, like any other file.
Whether the image is allowed to grow dynamically, or is pre-allocated on creation.

No comments:

Post a Comment