diff --git a/include/apple2.enc.h b/include/apple2.enc.h index 5cd23ad..6f8068b 100644 --- a/include/apple2.enc.h +++ b/include/apple2.enc.h @@ -9,7 +9,55 @@ * with using other values for it, and this one in particular is used in * WinApple, so I went with it. */ -#define ENC_VOLUME 0xfe +#define ENC_VOLUME 0xfe + +/* + * The number of tracks that a DOS 3.3 disk would have. + */ +#define ENC_NUM_TRACKS 35 + +/* + * The number of sectors within a single track of data for a DOS 3.3 + * disk. + */ +#define ENC_NUM_SECTORS 16 + +/* + * A decoded sector is 256 bytes long + */ +#define ENC_DSECTOR 0x100 + +/* + * And a track--being composed of 16 sectors--is 4096 bytes long, or 4k + * bytes. (256 * 16 = 4096) + */ +#define ENC_DTRACK 0x1000 + +/* + * An encoded sector is 382 bytes long, and is comprised of a sector + * header plus padding bytes both before _and_ after the data field. + */ +#define ENC_ESECTOR 0x17e + +/* + * An encoded track contains 16 sectors, as mentioned for ENC_DTRACK. + * But it also contains some additional padding (48 bytes-worth). + */ +#define ENC_ETRACK 0x1810 + +/* + * A sector header consists of some byte markers--all byte markers in + * 6-and-2 encoding are 3 bytes long--and also some metadata, such as + * the track number, the sector number, the volume, and an XOR'd + * combination of all three. + */ +#define ENC_ESECTOR_HEADER 0xe + +/* + * The track header (as mentioned for ENC_ETRACK) is 48 bytes of--well, + * nothing really, just padding. + */ +#define ENC_ETRACK_HEADER 0x30 extern int apple2_enc_4n4(vm_segment *, int, vm_8bit); extern int apple2_enc_sector(vm_segment *, vm_segment *, int, int);