This is a very very quick and simple port of xearth 1.0 to Atari ST/TT.
Release 4 of 12.okt 1998.
------------------------------------------------------------------------

   Creates a picture of the earth seen from the space, for example from 
   the current position of the sun.

------------------------------------------------------------------------

Atari NOTES
-----------
Xearth is programmed to run in X-windows, but can run on a Atari with some 
limitations. On my Linux system, the xearth program updates my root window 
(desktop) every 5 minutes, and that looks nice. This is not possible with 
TOS (MagiC, Geneva, N.AES, MultiTOS etc), but Xearth can save a rendered 
picture to a file and this feature will be used here.

You can start xearth with some parameters to change the defaults settings.

The defaults are: 64 color gif picture, size 512*512 pixels. The Picture 
is saved to the file "world.gif" and not to standard output as on un*x 
systems. If the parameter "-gif" is used, then the picture will not be 
saved to a file, but goes through stdout.

When you specify a picture format, the picture will always go through 
stdout. The stdout is normally your screen (text!), unless you redirects 
it to a file, device or program.

Examples: -gif >picture001.gif
          -ppm >picture001.ppm

          -ppm | something that can read input from stdin

If you starts xearth with a doubleclick from the desktop, you can not 
redirect stdout to a file. From a cli (bash, mupfel etc) it will work. The 
">" redirects standard output to the file written after >.

It is NOT possible to use markers nor MODE_X in this port. Forking is 
off course not possible and you can only create one picture at every run. 
All switches regarding x-windows will not work. I've marked the missing 
features in xearth.txt with an asterix.

Choose the right version
------------------------
Two Atari versions exists:

  xearthtt.ttp - for 68030 CPU and 68882 FPU (Atari TT or Falcon with FPU 
                 or better!)
  xearthst.ttp - for 68000 with no FPU (Atari ST, STE, Falcon)

Don't start xearthTT.ttp on a 68000 based ST(e) or on a Falcon with no 
FPU. You will surely regret it.

Set the timezone
----------------

If the TZ variable is not found, the timezone will be set to GMT (~UTC). 
Make sure your date and time is correct, or xearth will calculate a wrong 
position of the sun. 

People living in Germany, Denmark, Norway, Sweden... should have an 
environment variable called 'TZ=CET-1'. (Summertime: 'TZ=CEST-2'). MiNT 
users will proberly use another syntax - your CMOS clock is using 
localtime, right? I use localtime and Linux m68k likes that... Some MiNT 
docs are a little wrong here... Well back to the topic:

I made a little GEM program "TimeZone Check", it will display your 
localtime and gmtime (UTC). Run it and see if UTC time looks right. If so, 
xearth will also calculate the UTC time correct based upon your timezone 
variable.

Speed
-----
A normal 8 MHz ST struggles almost 17 minutes to create a 512x512x64 
world.gif. A TT030 (TT-Ram) with FPU about 28 sec.

BTW, the Lattice 68000 binary version of xearth will do the same in 11 
minutes, so someone may be correct in his statement that the GCC 68000 
math functions are somehow slow. No difference with 68881 FPU inline code 
(GCC versus Lattice). The reason for not using the Lattice compiler is the 
time functions from Lattice library. These functions works better from the 
very 'up to date' mintlib.

Source
------
The source is NOT included, but you can download the source at:

    ftp://cag.lcs.mit.edu/pub/tuna (xearth-1.0.tar.gz)

if you want to compile a version by yourself.

Previous releases of my Atari version had the sources included. But that 
move made the archive just a little too big, so this time I made a diff 
file. So how do I use this diff file?

1) You will need the intact xearth.1.0 source (extracted to a folder).
2) You will need a patch program. (hint: MiNT utilties)
3) Now apply the patch with the command
   patch -u <diff.rel4
4) Now you suddenly have the Atari version ready for a compilation. 
   Beware! The mapdata.c requires a lot of memory to compile if you are 
   using the GCC compiler.

The makefiles makefile.st, makefile.tt are for the Lattice compiler, the 
makefile.gcc is for the GCC compiler. Note, you must compile with 32 bit 
integers.

Examples
--------
You can start xearth with no arguments, and it will use the default 
settings. When xearth is finished, look for a file called world.gif in the 
folder. The gif picture displays the current look of the earth seen from 
the sun.

Some examples calling xearth with arguments: (please do read xearth.txt, 
or you will miss some nice features, unless your're good at guessing)

  Seen from a fixed position - 56 North 20 East:
      
      xearth -pos 'fixed 56 20'

  A 320x200 pixels picture:

      xearth -size '320 200'

If you start xearth from the desktop, you shouldn't enter xearth in the 
beginning of the line.

Download the Whirlgif package and see a rotating world with a (animated) 
gif viewer (example Cab >= 1.5).


Now, what was it?
-----------------
(1) Select xearthst.ttp or xearthtt.ttp according to your hardware and 
    rename it to xearth.ttp
(2) Make an environment variable called TZ=timezone +- gmt difference
(3) Run xearth.ttp
(4) Start your viewer (not included) and open world.gif

You will only need the TTP program from this package to render a picture. 
All other files are just for your information.

This quick port was done by: (21.dec.1996)

   Tommy Andersen

   e-mail: tommya@post3.tele.dk (emails welcome)
   Visit http://home3.inet.tele.dk/tommya/



CHANGED in Atari version:
~~~~~~~~~~~~~~~~~~~~~~~~~
6.jan.1997
----------
Saving a ppm did not work correct, stdout was translated by library. 
Fixed.

8.jan.1997
----------
Use -gif for output gif-file to stdout and not WORLD.GIF. This means:
 xearth                     gives WORLD.GIF
 xearth -gif >picture.gif   gives picture.gif
 xearth -ppm >picture.ppm   gives a picture.ppm in the ppm format

9.jan.1997
----------
Usage changed, -switches for x-windows deleted. Date of compilation and 
my name added to version info.

26.june.1998
------------
Well, better release my quick port of xearth to the public. Rewriting this 
text. The Lattice gmtime function can't cope with CEST timezone, so this 
time I used the GCC 2.8.1 compiler with the lastest mintlib (pl48). Check 
the gmtime calculation with "TimeZone Check". It's compiled with the GCC 
compiler too.


12.october.1998
---------------
Well, I've just compiled the complete mintlib pl48 again with a corrected 
print function. On non MiNT system, the Xearth help messages are printed 
in a skewed way. That's fixed now.

The Timezone program can be positioned more freely now. It can go far 
more left if your AES supports it.

By the way, I got response from a HADES060 user .... he can render the 
picture [see speed] in 4-5 sec. That's fast!

Compiled with -finline-functions (GCC). Performance improved on ST version 
(20 min down to 17 min), still much slower than the Lattice version.


Final notes:
-----------
 -time 0 gives wrong result, use -time 1. (lattice)
 Long filenames are supported, as usual.

-----
 X11.c, markers.c and resources.c not used in Atari version
------------------------------------------------------------------

Copyright (C) 1989, 1990, 1993, 1994, 1995 Kirk Lauritz Johnson

Parts of the source code (as marked) are:
  Copyright (C) 1989, 1990, 1991 by Jim Frost
  Copyright (C) 1992 by Jamie Zawinski <jwz@lucid.com>

Permission to use, copy, modify and freely distribute xearth for
non-commercial and not-for-profit purposes is hereby granted without
fee, provided that both the above copyright notice and this permission
notice appear in all copies and in supporting documentation.

Unisys Corporation holds worldwide patent rights on the Lempel Zev
Welch (LZW) compression technique employed in the CompuServe GIF image
file format as well as in other formats. Unisys has made it clear,
however, that it does not require licensing or fees to be paid for
freely distributed, non-commercial applications (such as xearth) that
employ LZW/GIF technology. Those wishing further information about
licensing the LZW patent should contact Unisys directly at
(lzw_info@unisys.com) or by writing to

  Unisys Corporation
  Welch Licensing Department
  M/S-C1SW19
  P.O. Box 500
  Blue Bell, PA 19424

The author makes no representations about the suitability of this
software for any purpose. It is provided "as is" without express or
implied warranty.

THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
