From 48872cf8d1b391f2a6e6bfe87e6723514c092cd9 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 21 Feb 2018 11:23:25 -0600 Subject: [PATCH] Add docblock comment for apple2_dd_sector_num --- src/apple2.dd.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/apple2.dd.c b/src/apple2.dd.c index fcdeea5..ec569f5 100644 --- a/src/apple2.dd.c +++ b/src/apple2.dd.c @@ -49,6 +49,23 @@ apple2_dd_create() return drive; } +/* + * If we suppose that DOS 3.3 and ProDOS disk _images_ have their tracks + * and sectors laid out in a logical or linear sense (tracks 0-35, + * sectors 0-16, in that order), then this function will return the + * sector within one track as it would be _physically_ laid out on the + * disk media. + * + * As you might suppose, the physical layout is different from the + * logical one. Sectors are physically laid out in an interleaved + * manner, where a sector from the first half of a track are mixed in + * with sectors from the latter half; this is keep the distance your + * disk drive would need to rotate to get to an arbitrary, given sector + * at a somewhat minimum. (For instance: suppose you were on sector 1, + * and you needed sector 2, but the disk media had already rotated to + * sector 3; you now need to do another full rotation to get back to + * sector 2.) + */ int apple2_dd_sector_num(int type, int sect) {