RE: [cc65] dio_query_sectcount() on Atari ?

From: Shawn Jefferson <sjefferson1shaw.ca>
Date: 2012-10-25 08:47:16
> From: owner-cc65@musoftware.de [mailto:owner-cc65@musoftware.de] On Behalf
> Of Fatih Aygün

<snip>

> >Atari.  There's no good method to quickly determine the number of sectors
> on
> >a disk. :)
> 
> 
> I believe there is:
> 
> 1 - Read the 4th sector. (the xf551 drive had a bug, it returned the wrong
> PERCOM info after reading the normally 128-byte boot sectors, a read from
> sector 4 eliminates this chance)
> 
> 2 - Read status (SIO command 0x53) and save that info.
> 
> 3 - Request a PERCOM block. If it succeeds use that information.
> 
> 4 - If reading PERCOM block fails assume 1050, 810 (or even 815) or
> compatible. Use the status byte 0 to differentiate between single,
> enhanced (medium) and double density. (bit 5 is set if double density and
> bit 7 is set if enhanced density). If we're only looking for sector count,
> only the bit 7 matters.

This is a good solution, didn't think of the status command!  I can think of
at least a few scenarios where this wouldn't work (devices that don't
support Percom block that aren't 1050 or 810 disk drives-for instance early
MyIDE), but I don't think that would be very many.



----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Oct 25 08:48:14 2012

This archive was generated by hypermail 2.1.8 : 2012-10-25 08:48:19 CEST