aboutsummaryrefslogtreecommitdiff
path: root/xfd2atr.rst
blob: 11b84046eb67bc9e99b7c84c78c78013dee7a161 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
.. RST source for xfd2atr(1) man page. Convert with:
..   rst2man.py xfd2atr.rst > xfd2atr.1
.. rst2man.py comes from the SBo development/docutils package.

=======
xfd2atr
=======

------------------------------------------------------------
Convert an Atari 8-bit XFD (raw) disk image to an ATR image.
------------------------------------------------------------

.. include:: manhdr.rst

SYNOPSIS
========

*xfd2atr* [*-sd*] *infile.xfd* [*outfile.atr*]

DESCRIPTION
===========

**xfd2atr**  generates and adds a 16-byte ATR header to an XFD
image. If no **-s** or **-d** options are given, xfd2atr tries to
guess the density based on the file size.

OPTIONS
=======

-s
  Assume the image uses single density (128-byte) sectors, instead
  of trying to guess the density from the file size.

-d
  Assume the image uses double density (256-byte) sectors, instead
  of trying to guess the density from the file size.

NOTES
=====

You  may  use **-** for *infile* to read from standard input and/or
**-** for *outfile* to write to standard output. If a filename is
supplied for *outfile*,  it  will  always  be  used  as-is (no *.atr*
extension will be appended).

If *outfile* is omitted, it is constructed like so:

  - If reading from standard input, write to standard output.

  - If reading from a file whose name ends with an *.xfd*  or  *.XFD*
    extension, replace the extension with *.atr*.

  - Otherwise, append *.atr* to the input filename.

Since XFD images are raw dumps with no header or structure, it's
impossible to know the correct density (bytes/sector) for a given
image  for certain.

However,  no  known Atari-compatible disk format uses other than 128
or 256 bytes per sector (or possibly 512, for some hard disk images,
but **xfd2atr** doesn't support these). This means any file that isn't a
multiple of 128  bytes  in size will be rejected.

Likewise,  no  known format uses an odd number of sectors, and
it's assumed that all double-density images will begin with  3
single-density boot  sectors  (true  of  all  floppy  images you're
ever likely to run across; may not be true of hard disk images).

Given these assumptions, **xfd2atr** is able  to  make  an  educated
guess about  the  correct  sector size and count to use for the ATR
header it generates. If it guesses wrong, the resulting ATR image
will  be  unusable;  if this happens, re-run **xfd2atr** and force the
density with **-s** or **-d**.

EXIT STATUS
===========

Exit status is zero for success, non-zero for  failure.  Further,
exit status will be 1 for errors involving file I/O (file not found,
permissions, etc), and 2 for structural errors in the XFD file.

.. include:: manftr.rst