•  Back 
  •  Drive functions 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help page 
  •  Show info about hypertext 
  •  View a new file 
Topic       : TOS - The Operating System
Author      : 
Version     : tos.hyp (December 19, 2008)
Subject     : Programmieren/Atari
Nodes       : 3010
Index Size  : 93790
HCP-Version : 5
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Title
@help       : 
@options    : +g -i -s +x +zz -t4
@width      : 70
View Ref-File4.13.3  Flopfmt                                                    TOS

 Name:         »Floppy format« - Format specific tracks on a floppy

 Opcode:       10

 Syntax:       int16_t Flopfmt( void *buf, int32_t filler, int16_t 
               devno, int16_t spt, int16_t trackno, int16_t sideno, 
               int16_t interlv, int32_t magic, int16_t virgin );

 Description:  The XBIOS routine Flopfmt formats one or more tracks on 
               a floppy disk. The following apply:

                Parameter  Meaning

                buf        Pointer to a segment of memory where the 
                           data for one track may be stored

                filler     For all TOS versions < 1.02 unused, and to 
                           be set to 0. From Blitter-TOS onwards: If 
                           interlv = -1, then filler is to be treated 
                           as a pointer to a table of sector numbers 
                           (16 bit words). This makes it possible to 
                           choose the order of the sectors on the 
                           track freely.

                devno      0 = Drive A:, 1 = Drive B:

                spt        Sectors per track (normal: 9). If the 
                           cookie _FDC is set, then in addition values 
                           of 18 (High Density) or 36 (Extra High 
                           Density) sectors are permitted. Switching 
                           between the various write modes takes place 
                           at 13 (HD) or 26 (ED).

                trackno    Number of the track (0..79)

                sideno     0: Side 1
                           1: Side 2 (for double-sided disks)

                interlv    Determines how many physical sectors lie 
                           between two logical sectors in each case 
                           (normal: 1).

                magic      Must be 0x87654321, otherwise no formatting 
                           will be performed.

                virgin     Bit-pattern that is written during 
                           formatting into each sector (normal: 
                           0xe5e5). The upper four bits may not be 
                           set, as otherwise this would be interpreted 
                           by the controller as a command.

               Note: As of the Blitter-TOS, the desktop allows a list 
               of sector numbers to be passed to arrange tracks in a 
               spiral format in such a way that the least possible 
               time is lost at track changes waiting for the next 
               sector.

               For a normal format (9 sectors per track) the memory 
               segment specified with the parameter buf must have a 
               size of at least 8 kbyte; in other cases the buffer may 
               have to be increased above this.

 Return value: The function returns 0 when no error has occurred in 
               formatting the track. Otherwise a NULL-terminated list 
               of the faulty sectors will be written as a int16_t 
               array into the buffer buf.

 Availability: All TOS versions.

 Group:        Drive functions

 See also:     Binding   Flopwr