[cc65] Atari sector size detection

Date view Thread view Subject view

From: Shawn Jefferson (sjefferson_at_sd62.bc.ca)
Date: 2002-10-24 21:27:09


>As workaround I can provide you a small assembler function which you
>can call to set the sector size by hand, but for the official lib I'd
>like to have a way to autodetect it.
>
>I have a xf551 which supports 256 byte sectors. Does anyone of the
>atarians on this list know how to detect the disk format of an
>inserted disk? Preferably not with SpartaDOS calls but with SIO
>commands...

Well, I did some poking around in Mapping, Atari System Reference Manual, and the SpartaDOS manual, and I could only find that SpartaDOS has implemented this function:

CHKDSK, Purpose  To read information about a disk.
  
CIO Data

iccom   =   47 
icbal   =   low byte of 'Dd:' address 
icbah   =   high byte of 'Dd:' address 
icbll   =   low byte of buffer address 
icblh   =   high byte of buffer address 

CIO Output Results

buffer   =   results of CHKDSK operation (17 bytes) 
+0   =   version number of disk, 0 if Atari DOS format 
+1   =   number of bytes per sector, 0 if 256 
+2   =   total number of sectors on disk (2 bytes) 
+4   =   Number of free sectors on disk (2 bytes) 
+6   =   volume name, always "AtariDOS" for Atari DOS format disks (8 bytes) 
+14   =   volume sequence number, 0 if Atari DOS format 
+15   =   volume random number, 0 if Atari DOS format 
 
I also attempted to disassemble the D: handler routines, but I'm afraid I couldn't comprehend what Sparta was doing with the SIOV vector and handler table.  I've heard that spartados resides under the OS, so maybe that is making it difficult for me to find the routine.  Anyway, I figured if they implemented it, you should be able to look at their code and get an idea of how to implement it yourself.

The status command doesn't appear to give you this type of information, so I can't even guess at how they get all this information on the disk.



----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-10-24 21:27:34 CEST