Classic Computer Magazine Archive ANTIC VOL. 5, NO. 5 / SEPTEMBER 1986

WEATHER MAPS FROM SPACE


ST WEFAX DECODER

Degas graphics from satellite pictures

by PATRICK BASS, ANTIC ST Program Editor


With the ST version of WEFAX Decoder you can reconstruct weather satellite pictures on your Atari ST and convert them to DEGAS graphics files.

In this article, we deal exclusively with the operating instructions and special features of WEFAX Decoder for the ST. For additional information on the overall program structure and details about the international Weather Facsimile system, see the related stories in this issue. Also, please note that this program won't work unless you use it with the WEFAX Interface hardware described elsewhere in this issue.

ST WEFAX Decoder is written in MC68000 asrembly Language aa implemented with AS68.PRG. This is the assembler included with the Atari ST Developer's Kit. However, the program should work fine with any 68000 assembler using standard Motorola mnemonics--such as the Metacomco Macro Assembler or the assembler provided with Haba Hippo C.

This program is substantially different from Antic's other programs for the Atari ST. For example, ST WEFAX Decoder makes no calls to GEM and doesn't even recognize that GEM exists. The closest we get are a few calls to Atari XBIOS and use of the Line-A interface to plot points on screen.

    A typical enhanced WEFAX chart received with the ST WEFAX program.

TYPING IT IN

Using your favorite text editor or word processor, carefully type in the listing, STFAX.S, and save a copy to disk.

(Antic Disk subscribers can skip to the Program Operation section of this article. STFAX.S is on Side B of the monthly disk--along with the STFAX.TOS listing explained later. Follow the ST Help file instructions for transferring the programs to an ST 3.5-inch disk.)

After you type in the listing and save a copy, assemble it into an executable program. Although either assemblers may operate differently, the method I used for assembling with AS68 is as follows. First, you will need a disk with these 10 programs on it:


1. AS68            .PRG 
2. AS68SYMB        .DAT 
3. BATCH           .TTP 
4. LINK68          .PRG
5. OSBIND          .O 
6. RELMOD          .O 
7. RM              .PRG 
8. WAIT            .PRG        
9. ASM             .BAT 
10. STFAX          .S  
 

The top eight programs are obtained from the Atari ST Developer's Kit, and you have already typed in number 10, STFAX.S. But what about ASM.BAT, number 9?

You'll need to create your own ASM.BAT batch file, but it's quite short. This file consists of the following lines of code:

as68 -1 -u %1.s
link68 [u,s] %1.68k=%losbind
rm %1.o
relmod %1.68k %l.tos
rm %1.68k
wait

NOTE that the -1 in the first line is a lower-case letter I---all other similar looking characters are number ones.

When finished, save the above file to disk as ASM.BAT. This is the file which will instruct the BATCH program how to assemble and link the STFAX.S program together.

With all the needed files on one disk, preferably a RAMdisk, double-click on BATCH.TTP, and in the resulting dialog box type in ASM STFAX without the .s extender. AS68 will assemble and LINK68 will link your resulting .o file together with OSBIND.O to create a finished TOS program. When finished, you'll find STFAX.TOS on your desktop. This is your WEFAX program.

PROGRAM OPERATION

STFAX operates in any ST resolution, color or monochrome. Insert your STFAX disk and double-click on the STFAX.TOS program icon. The program will show a small title box, and the hashing cursor indicates when it's ready to receive commands from the keyboard. Yes, STFAX is completely keyboard-driven, so you can retire your mouse for awhile.

Following are the active keys and their functions

Q --Quit the program.
L --Load a WEFAX picture from disk.
S --Save a WEFAX picture In DEGAS format to disk.
C --Clears the screen.
I --Inverses the image current on-screen.
                                                                             Sports Wirephoto recieved with the 8-bit WEFAX program.

R --Resets the picture to the top and restarts the picture scan.
Z --Puts the scan to Sleep (Zzz).
> --Increases the number of timer "ticks" between interrupts. (Do not press the [SHIFT] key while typing this key.)
< --Decreases the number of timer "ticks" between interrupts. (Do not press the [SHIFT] key while typing this key.)
1 --Sets default values for 60 LPM pictures.
2 --Sets default values for 120 LPM pictures.
K --Rotates the LineSkip value from 0 through 3 and back.
- --Decreases the number of columns shown onscreen.
+ --Increases the number of columns shown onscreen. (Do not press the [SHIFT] key while typing this key.)
A --Adjusts the sync bar towards the left of the screen.
[SPACEBAR]-Switches between the text screen and the WEFAX screen.

TAKE A PICTURE

To receive and save a WEFAX picture, tune your shortwave radio to a WEFAX chirp. Plug the WEFAX Interface's radio lead into the earphone jack and its computer lead into the parallel port in back of the ST, with the power lead going to either joystick port.

Do not fully insert the interface's plug into the earphone jack, or you may disengage your radio's speaker. For best results, you should slowly insert the plug only part-way into the earphone jack, so that your interface can receive a signal without disengaging the speaker. As an alternative, you may wish to connect a small speaker to the interface's audio input so you may listen to the signal as it is interpreted. This way, you can correct for frequency drift, or turn up the volume to compensate for a fading signal.

With the ST WEFAX Decoder program running, tap the [SPACEBAR] to switch to the WEFAX Screen. Now press the [R] key. The WEFAX picture will start appearing across the top scan line. You may wish to press the [K] key to increase the number of scan lines skipped between updates. This is needed because WEFAX Pictures are at least 800 scan lines high, and we can capture (at most) 400 lines of picture information. For example, a [K] line skip of 1 will capture every other line of the picture.

When the picture is finished, the scan will stop automatically. To save the picture in DEGAS format, press the [SPACEBAR] to switch back to the text screen. The WEFAX picture is still available by pressing the [SPACEBAR] again. While still at the text screen, press [S], then type in your desired filename for the picture. Remember, DEGAS wants different extenders fo the different picture resolutions. Type in .PI1 for low resolution, .PI2 for medium resolution and .PI3 for high resolution.

PROGRAM TAKE-APART

It's not necessary to describe the program again here, because ST WEFAX Decoder's logic follows the 8-bit version very closely, even down to sharing labels and functions. There liberal comments sprinkled through out the important sections of code, so you should be able to follow the logic flow easily. See the 8-bit WEFAX Decoder article in this issue fo detailed take-apart information.

On the left is a typical WEFAX chart sequence received with our 8-bit WEFAX program. On the right is a similar chart produced by the National Weather Service.