Classic Computer Magazine Archive ST-Log ISSUE 23 / SEPTEMBER 1988 / PAGE 34

APPLICATION

ALL RESOLUTIONS

THE DEGAS

ELITE FAST LOADER

by Charles F. Johnson

Charles F.Johnson is a professional musician, and now semi-professional computer programmer/reviewer/author. He lives in Los Angeles with his wife Patty and Spike, the world's most intelligent (and gluttonous) cat. Charles is a sysop on the ANALOG and STLog Atari SIGs on DELPHI; his username is CFJ.

Anyone who uses Tom Hudson's excellent DEGAS Elite paint program will really appreciate this desk accessory. The DEGAS Elite Fast Loader lets you load both DEGAS Elite-compressed pictures and Tiny format-compressed pictures into your current workscreen in Elite, and it decompresses them almost ten times faster than DEGAS Elite itself! The DE Fast Loader is written in 100% machine language, for maximum speed and compactness. It detects the presence of DEGAS Elite, and will not work unless Elite is present. In addition, you must not have changed the name of the DEGAS Elite main program; it must be called "DEGELITE.PRG" on the disk you load it from.

The DE Fast Loader lets you load DEGAS Elite-compressed pictures and Tiny format-compressed pictures into your workscreen, and decompresses them ten times faster than DEGAS Elite itself!

How to use the DE Fast Loader

First, type in the ST BASIC program in Listing 1, save it to disk, and make sure you've typed it all correctly by running it through ST-Check (see page 52 of this issue). When you run this program it will create a file on drive A called "DELOADER.ACC"; this is the desk accessory file which should be placed on your boot disk. You may be booting with a special disk containing GDOS.PRG when you run DEGAS Elite; if so, DELOADER.ACC should be placed in the main directory of this disk.

When you use this disk to boot your ST, the DE Fast Loader will automatically be installed among the accessories in your Desk drop-down menu. If you try to call the DE Fast Loader from the desktop, or from any program except DEGAS Elite, you will see an alert box reminding you that Elite must be currently running in order for the DE Fast Loader to work.

Let's load some pictures! Double-click on DEGELITE.PRG, and when you see Elite's main screen, click on DE Fast Loader in the Desk menu. Now you should see the DE Fast Loader's title box, with three buttons labeled DEGAS, Tiny and Cancel. Cancel will exit without loading a picture; click on DEGAS or Tiny and a GEM Item Selector box will appear to let you choose a picture file to load. DEGAS Elite presently allows up to eight drawing screens at once, depending on the amount of RAM installed in your ST. The DEGAS Elite Fast Loader will always load pictures to the currently selected screen; the color palette for all images will be changed as well.

Try loading a .PCI (compressed low resolution) picture with DEGAS Elites Load Pic option, accessible from the File drop-down menu. Now load the same picture file with the DE Fast Loader. You won't believe the difference. If you have Tom Hudson's public domain TINYLOAD accessory (which also loads Tiny pictures into DEGAS Elite), you'll notice a similar speed increase with DE Fast Loader's Tiny picture decompression action. Now you can spend your time using Elite's dazzling array of drawing tools, instead of waiting for picture files to load!

How it works

When Tom Hudson re-wrote the original DEGAS program and resurrected it as DEGAS Elite, he built in some special features that allow the program to communicate with and receive commands from other applications or desk accessories. The procedure goes something like this:

An accessory uses the AES appl__find, function to determine if DEGAS Elite is running or not. When you call appl__find you pass it the filename of a program to search for (this is why DEGAS Elite's filename must be DEGELITE.PRG); the function returns the application ID number of the program if that program is currently on GEM's active applications list. If appl__find is successful, the accessory and DEGAS Elite may send messages to each other using the AES appl__write function, which must be passed the application ID (obtained from the appl__find call) of the program that will receive the message, and a pointer to a buffer which holds the message to be sent. "Messages" are normally 16 bytes in length. GEM has a number of predefined messages which deal with things like window sliders and scroll bars, timer events, drop-down menu selections, and the opening and closing of desk accessories. In addition to the standard GEM messages, DEGAS Elite defines and recognizes several custom messages, allowing a certain degree of "remote control" by an external application. (The "external application" in this case is, of course, the DE Fast Loader.)

This "message pipeline" enables the DE Fast Loader to find out the memory addresses of DEGAS Elite's drawing screens, and change its current color palette. Unfortunately, the DEGAS Elite message pipeline system includes no commands to set color animation parameters; so the DE Fast Loader will ignore color animation data in picture files.