Re: [cc65] dio_query_sectcount() on Atari ?

From: Oliver Schmidt <ol.sc1web.de>
Date: 2012-10-19 16:29:38
Hi,

> That's what I did in one of the tools I implemented that uses DIO to copy
> disks... there's no telling exactly if your disk will have 720 sectors, 1040
> sectors, or some other number depending on strange emulator-based disk
> formats (Atari disks can go up to 65535 sectors with some popular DOSes.)  I
> just read until I get an error (after three retries) and then call that the
> end of the disk copy.

That's interesting. Usually DOSes of the type we're talking here about
use some bitmap to mark free and used sectors. And the DOS needs to
know how large that bitmap is in order to know where to stop reading
bits when i.e. looking for a free sector. Typically that information
(if nothing else helps) can be used to quite easily find out the
number of sectors present.

Just out of curiosity: Is it possible to explain to a non-Atari
insider in in reasonable length why such an approach doesn't work on
the Atari?

> Personally, I'd prefer to see a routine that works 100% of the time,
> regardless of disk format so that the function returns what the programmer
> thinks it will return: the number of sectors on the disk.  If the programmer
> doesn't like the standard way this is done, they can always write their own
> routine and accept the incompatibility and special cases such a custom
> routine would entail.

A dio_query_sectcount() that does something smart im most/many cases
and falls back to some brute force approach if nothing else helps
would be fine for me too - with the one exception of reading all
sectors until a failure happens, because that should rather be done by
the application itself.

Regards,
Oliver
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Oct 19 16:30:51 2012

This archive was generated by hypermail 2.1.8 : 2012-10-19 16:30:55 CEST