]> git.sur5r.net Git - cc65/blobdiff - doc/dio.sgml
Added note on the necessity of tab chars at the beginning of make command lines.
[cc65] / doc / dio.sgml
index 1ec110cb3abd5b52d328f73563098c67e1f33c8d..685e3454f2dc368bc436231649f0408bc78598cb 100644 (file)
@@ -3,7 +3,7 @@
 <article>
 <title>Diskette Sector I/O Routines
 <author>Christian Groessler, <htmlurl url="mailto:cpg@aladdin.de" name="cpg@aladdin.de">
-<date>21.11.2000
+<date>20-Feb-2005
 
 <abstract>
 The cc65 library provides functions to read and write raw disk sectors.
@@ -45,7 +45,7 @@ The read and write functions are:
                                          void *buffer);
 </verb></tscreen>
 
-This function will read the sector specified by sect_num into the memory
+This function will read the sector specified by <tt>sect_num</tt> into the memory
 location at buffer.
 
 <tscreen><verb>
@@ -67,10 +67,37 @@ This function will write the memory contents at buffer to the sector specified
 by <tt>sect_num</tt>. A verification is performed.
 <p>
 
+Use the <tt><ref name="dio_query_sectsize" id="sectsizecount"></tt> function to query
+the size of a sector and the <tt><ref name="dio_query_sectcount" id="sectsizecount"></tt>
+function to query the number of available sectors.
+<p>
+
 All these functions will return 0 for success and an OS specific error code in
 case of failure.
 <p>
 
+<sect>Querying sector size and count<label id="sectsizecount"><p>
+
+Some systems support multiple diskette formats which have different sector sizes
+and/or different sector counts.
+<p>
+
+The following function returns the sector size of the currently inserted disk:
+
+<tscreen><verb>
+    sectsize_t __fastcall__ dio_query_sectsize(dhandle_t handle);
+</verb></tscreen>
+
+On the Atari platform, the sector size is handled specially. Please refer
+to the DIO section in the <htmlurl url="atari.html" name="Atari">
+specific platform documentation.
+<p>
+
+The following function returns the sector count of the currently inserted disk:
+
+<tscreen><verb>
+    sectnum_t __fastcall__ dio_query_sectcount(dhandle_t handle);
+</verb></tscreen>
 
 <sect>Converting sector numbers<p>
 
@@ -89,7 +116,7 @@ way round.
 This function converts track/head/sector to logical sector number.
 
 <tscreen><verb>
-    unsigned char __fastcall__ dio_log_to_phys(_dhandle_t handle,
+    unsigned char __fastcall__ dio_log_to_phys (dhandle_t handle,
                                                 const _sectnum_t *sectnum,
                                                 dio_phys_pos *physpos);
 </verb></tscreen>