7bca5fab5b
git-svn-id: svn://svn.compuextreme.de/Viitor/V962/Viitor_cc65@4352 504e572c-2e33-0410-9681-be2bf7408885
56 lines
1.9 KiB
HTML
56 lines
1.9 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.20">
|
|
<TITLE>Diskette Sector I/O Routines: Converting sector numbers</TITLE>
|
|
<LINK HREF="dio-3.html" REL=previous>
|
|
<LINK HREF="dio.html#toc4" REL=contents>
|
|
</HEAD>
|
|
<BODY>
|
|
Next
|
|
<A HREF="dio-3.html">Previous</A>
|
|
<A HREF="dio.html#toc4">Contents</A>
|
|
<HR>
|
|
<H2><A NAME="s4">4.</A> <A HREF="dio.html#toc4">Converting sector numbers</A></H2>
|
|
|
|
|
|
<P>Since the read and write functions expect a sector number, for systems where
|
|
the sectors aren't addressed by a logical sector number (e.g. CBM drives),
|
|
there are 2 conversion functions. One of them converts a logical sector number
|
|
to a head/track/sector triple. The other conversion function works the other
|
|
way round.</P>
|
|
<P>
|
|
<BLOCKQUOTE><CODE>
|
|
<PRE>
|
|
unsigned char __fastcall__ dio_phys_to_log (dhandle_t handle,
|
|
const dio_phys_pos *physpos,
|
|
sectnum_t *sectnum);
|
|
</PRE>
|
|
</CODE></BLOCKQUOTE>
|
|
</P>
|
|
<P>This function converts track/head/sector to logical sector number.</P>
|
|
<P>
|
|
<BLOCKQUOTE><CODE>
|
|
<PRE>
|
|
unsigned char __fastcall__ dio_log_to_phys (dhandle_t handle,
|
|
const _sectnum_t *sectnum,
|
|
dio_phys_pos *physpos);
|
|
</PRE>
|
|
</CODE></BLOCKQUOTE>
|
|
</P>
|
|
<P>This function converts a logical sector number to track/head/sector notation.</P>
|
|
|
|
<P>Note, that on systems which natively use logical sector numbers (e.g. Atari),
|
|
the conversion functions are dummies. They ignore head/track
|
|
(<CODE>dio_phys_to_log</CODE>) or return them as zero (<CODE>dio_log_to_phys</CODE>).
|
|
The logical sector number is returned as physical sector and vice versa.</P>
|
|
|
|
|
|
|
|
<HR>
|
|
Next
|
|
<A HREF="dio-3.html">Previous</A>
|
|
<A HREF="dio.html#toc4">Contents</A>
|
|
</BODY>
|
|
</HTML>
|