APE Technical Information

As the Altair Peripheral Emulator moves forward I will post "Finalized" information relating to the project here. Keep in mind that even "Finalized" - "Is subject to change without notice" – you have been warned.
The ".ape" file format
The first 2 bytes (1 & 2) of an “.ape” file currently contain a UInt16 whose value represents the “Sector Size” of the “Floppy Disk” and is either 128 or 512. Other values and encoded information in the future will likely identify “Hard Disk” and capacity. Byte 3 begins Track 0, Sector 1 for “Sector Size” bytes. Byte 3 + Sector Size begins Track 0, Sector 2. The pattern continues for 26 sectors per track if Sector Size is 128 and 8 sectors per track if Sector Size is 512. Tracks 0 to 76 are represented in the files. The files are “formatted” by APE for use by CP/M 2.2 whose directory information begins on Track 2, Sector 1. Since CP/M 2.2 uses a “Logical” to “Physical” sector map the sectors do not appear sequentially in the file when Sector Size is 128. There is no mapping when the sector size is 512 and the file sequentially represents Track 0, Sector 1 to Track 76, Sector 8. The rest of the file “format” is left strictly up to the OS (CP/M in this case) using APE which deals only with “physical” Tracks and Sectors. So these are “real” CP/M disk images that can be transferred “directly” to physical media.
See "
Q: What is included in the APE Utility Package for CP/M?" in the
FAQ for some related information.
The APE "Serial Bus" protocol
The APE "Serial Bus" protocol is currently a "work-in-progress" and is not yet ready for inclusion here. In general terms short “Command Frames” are exchanged between the OS (CP/M in this case) and APE. These “Command Frames” employ a simple checksum to verify communication. The “Command Frames” are used to drive a state machine within APE to prepare for “Sector Data” transfer. Sectors are of a fixed size of either 128 or 512 bytes of data and also employ a simple checksum to verify communication. Any checksum errors result in re-transmission of the “Command Frame” or “Sector Data.”