PFI(1)                                pce                               PFI(1)

NAME
       pfi - convert and modify PFI flux images


SYNOPSIS
       pfi [options] [input-file] [options] [output-file]


DESCRIPTION
       pfi(1) is used to modify and convert PFI flux image files.


OPTIONS
       -c, --cylinder cyl1[-cyl2]
              Select  a  range  of cylinders. To select all cylinders, specify
              all as parameter.

       -f, --info
              Print information about the current  image  or  the  next  image
              loaded.

       -h, --head head1[-head2]
              Select a range of heads. To select all heads, specify all as pa-
              rameter.

       -i, --input filename
              Load an image from filename.

       -I, --input-format format
              Set  the  file format for the next input file. If this option is
              not used, the file format is detected automatically.

              Valid formats are:

              a2r    Applesauce flux image

              pfi    The native PFI format

              scp    Supercard Pro flux image

              raw    Kryoflux raw stream

       -l, --list-short
              List all tracks in the current image, one line per track.

       -L, --list-long
              List all tracks in the current image, one line per revolution.

       -o, --output filename
              Set the output file name. Before exiting, the current image will
              be written to this file.

       -O, --output-format format
              Set the output file format. If this option is not used, the file
              format is determined by the output file name.

              Valid formats are:

              a2r    AppleSauce flux image

              pfi    The native PFI format

              scp    Supercard Pro flux image

       -p, --operation name [arg...]
              Perform an operation on the current image. Valid operations are:

              comment-add text
                     Add text to the image comment.

              comment-load filename
                     Load the image comment from file filename.

              comment-print
                     Print the current image comment.

              comment-save filename
                     Save the current image comment to filename.

              comment-set text
                     Set the image comment to text.

              decode type filename
                     Decode the image and save it to filename.

                     Valid decode types are:

                     pri    Save the decoded image as a PRI image.

                     pri-mac
                            This is synonymous with pri-mac-500.

                     pri-mac-490
                            Save the decoded image as a PRI image. This decode
                            type also overrides the bitrate set  with  the  -r
                            option with the apporpriate variable bitrates used
                            by  Macintosh  double density disk drives at 489.6
                            kbit/s.

                     pri-mac-500
                            Save the decoded image as a PRI image. This decode
                            type also overrides the bitrate set  with  the  -r
                            option with the apporpriate variable bitrates used
                            by  Macintosh  double  density  disk drives at 500
                            kbit/s.

                     text   Save the decoded image in textual form.

              delete Delete the selected tracks.

              double-step
                     Remove odd numbered tracks.

              double-step-even
                     Remove even numbered tracks.

              encode type filename
                     Load an image from filename and encode it.

                     Valid encode types are:

                     pri    Encode a PRI image

                     text   Encode a textual representation of the image  pro-
                            duced by decode text.

              info   Print information about the image.

              quantize rate
                     Quantize  all  pulses  to  rate. After this operation all
                     pulses are an exact multiple of rate.

              rectify rate
                     Adjust all pulse widths to even multiples of  rate.  This
                     may change the track lengths.

              revolutions rev1[-rev2]
                     Extract  revolutions rev1 to rev2 on all selected tracks.
                     Revolutions not within the selected range are deleted.

              scale factor
                     Multiply the pulse widths on all selected tracks by  fac-
                     tor.  This has the same effect as dividing the rotational
                     speed by factor.

              set-clock clock
                     Set the PFI clock rate to clock Hz. The  clock  rate  can
                     also be specified in kilohertz (with a k suffix) or mega-
                     hertz  (with  a  M  suffix).  It can also be one of these
                     symbolic constants:

                     a2r    8000000 Hz

                     kryoflux
                            24027428 Hz

                     scp    40000000 Hz

              set-rpm rpm
                     Adjust the rotational speed of all selected tracks to rpm
                     revolutions per minute by scaling the pulse widths  by  a
                     constant factor.

              set-rpm-mac
                     This is synonymous with set-rpm-mac-500.

              set-rpm-mac-490
                     Adjust  the  rotational  speed  of all selected tracks to
                     match a Macintosh variable speed drive at 489.6 kbit/s.

              set-rpm-mac-500
                     Adjust the rotational speed of  all  selected  tracks  to
                     match a Macintosh variable speed drive at 500 kbit/s.

              shift-index offset
                     Add  offset  clock cycles to all index positions, thereby
                     rotating the track data relative to the index.

              shift-index-us us
                     Add us microseconds to all index positions.

              slack ms
                     Limit the slack data before the first and after the  last
                     index to ms miliseconds.

              wpcom  Simulate write precompensation.

       -r, --data-rate rate
              Set  the  bit rate that is used to decode the image. The default
              is 500000 bits per second.

       -R, --revolution rev
              Use revolution number rev when decoding. The first revolution is
              number 1.

       -s, --set par val
              Set parameter par to val.

              clock-tolerance val
                     Set the clock tolerance in tenth of a  percent.  The  de-
                     fault  is 40. If during decoding the data rate changes by
                     more than the tolerance, a clock event is recorded in the
                     PRI file.

              fold-max bits
                     When folding tracks, compare at most bits bits.  The  de-
                     fault is 16384.

              fold-mode mode
                     Set the track fold mode to mode. Valid modes are:

                     none   Fold the track at the index pulse.

                     maxrun Fold the track at the bit position that results in
                            the longest run of identical bits at the beginning
                            of the two revolutions. This is the default mode.

                     mindiff
                            Fold the track at the bit position that results in
                            the  fewest  differences  between  the two revolu-
                            tions.

              pfi-clock
                     Set the clock rate that is used to encode images. The de-
                     fault is 24027428.

              pfi-fold-compare size
                     Set the pfi fold compare size in pulses.  This  specifies
                     the  number of pulses that are compared between two revo-
                     lutions to find a better index position. The  default  is
                     2048.

              pfi-fold-revolution revolution
                     Set  the  the  revolution to fold. The default is to fold
                     all revolutions.

              pfi-fold-right val
                     If val is non-zero, instead of centering the compare  in-
                     terval on the compare positions, only values to the right
                     of  the  compare  positions  are compared. The default is
                     false.

              pfi-fold-window window-size
                     Set the pfi fold window  size  in  pulses.  During  track
                     folding  a  better  index  position is looked for window-
                     size/2 pulses before and after the current index. The de-
                     fault is 1024.

              slack1 When extracting revolutions using the revolutions  opera-
                     tion  include  this much slack space before the first in-
                     dex. The value is in miliseconds.  The default is 10.

              slack2 The amount of slack space after the last index.  The  de-
                     fault is 10.

              slack  Set slack1 and slack2 to the same value.

              weak-bits val
                     If  val is non-zero enable weak bit detection when decod-
                     ing to PRI.

       -t, --track c h
              Select a range of tracks. This is equivalent to "-c c -h h".

       -v, --verbose
              Enable verbose operation.

       -x, --invert
              Invert the track selection.

       -z, --clear
              Clear the track selection.

       --help Print usage information.

       --version
              Print version information.


SEE ALSO
       pce-img(1), pri(1), psi(1)


AUTHOR
       Hampa Hug <hampa@hampa.ch>

HH                                2022-01-15                            PFI(1)
