TRS-80 Emulators for Windows and MS-DOS

Matthew Reed's emulators, utilities, and development tools for TRS-80 Models 1/3/4

HDV 1.0 File Format (HDV1)

I designed this emulator hard disk format back in 1997 for my MS-DOS based TRS-80 Model 1/3 emulator. I intended for it to be used by an emulator-based hard disk driver which communicated directly with the emulator using special hooks.

But it also worked surprisingly well for a hardware emulated hard drive and became the unoffical standard for TRS-80 emulated hard drives. The odd data structure comes about because it was derived from an earlier (no longer in use) disk image format.

My Windows TRS-80 emulator uses an updated version of this format (HDV version 2.0). But version 1.0 is still useful because of its simplicity: any sector position can be calculated using just the information in the header.

Each file starts with a 256 byte header, and sectors follow sequentially after.

0 – 1 Magic number (0x56, 0xcb)
2 Version of format: 0x10 = version 1.0
3 Checksum (not used)
4 Must be 1
5 Must be 4
6 Media type (must be 0 for hard disk)
7 Write protection: 0x80 if write protected, 0x00 if not
8 Flags:
bit 7-1: reserved
bit 0: set if auto-boot
9 – 10 Reserved
11 DOS type (only needed for auto-boot):
0 = Model 4 LS-DOS
1 = Model I/III LDOS
2 = CP/M
3 = NEWDOS
12 – 25 Reserved
26 If non-zero, number of heads per cylinder

If zero, number of heads per cylinder is calculated as number of sectors per cylinder (byte 29) divided by 32.

27 Number of cylinders per disk (high 3 bits)
28 Number of cylinders per disk (lower 8 bits)

This is the number of cylinders on the drive. which shouldn’t be higher than 1024. To preserve backwards compatibility, values of 0 in both bytes 27 and 28 means 256.

29 Number of sectors per cylinder
30 Number of granules per track (deprecated)
31 Directory cylinder (deprecated, should be 1)
32 – 71 Reserved
72-103 Reserved for storage of auto-boot data
104-255 Reserved

Thanks to Tim Mann, Pete Cervasio, Andrew Quinn, and Frederic Vecoven for suggestions.