MegAnimator
Atari moviemaking was never easier
by JACOB DONHAM
MegAnimator is a versatile and easy-handling picture animation system that moves as many as 64 image frames in a single presentation. This BASIC program works on 8-bit Atari computers with at least 48K memory and disk.
Two of the Atari's most impressive features are character set redefining and page-flipping. MegAnimator combines both of these tools into a powerful, easy-to-use animation system.
MegAnimator has five parts-Block Editor, Frame Editor, Movie Editor, Movie Player and the MegAnimator Main Menu. I wrote it this way so that I could use every bit of memory available. Because any movie requires many frames to simulate motion, moving computer graphics gobbles up available RAM at an alarming rate. If you RUN the Movie Player, then press [BREAK] and type PRINT FRE(0), you will probably see that less than 100 bytes of memory remain in an 800XL. The rest is taken up by the movie
GETTING STARTED
To take your best shot at becoming the next Walt Disney, type in Listing
1, MOVPL.BAS; Listing 2, BLKED.BAS; Listing 3, FRMED.BAS; Listing 4, MOVFD.BAS
and Listing 5, MEGMATORBAS. Check them all with TYPO II and SAVE a separate
copy of each. The movie files created by these programs are around 132
sectors each, so it's handy to leave that much room available on your MegAnimator
program disks.
To create a movie with MegAnimator, RUN MEGMATOR.BAS. This menu program will let you access all of the other programs. First, use the Block Editor to create one or more sets of blocks. Next, use the Frame Editor to draw as many as 104 frames of animation with the basic building blocks you just created with the Block Editor. Third, put them all together and create the actual movie with the Movie Editor. The Movie Editor requests filenames of your block sets and frames, then combines that information into a master control file. Finally, the Movie Player loads and displays your completed masterpiece.
DISK OWNERS: A MegAnimator demonstration movie is on your February disk. (Type-in BASIC listings of a full-scale MegAnimator cartoon would be far too long to print in the magazine.) To view the movie, select the Movie Player from the Main Menu and at the prompt, type ANTIC
BLOCK EDITOR
The Block Editor is used to Edit, Load, or Save a set-up of Blocks.
Selecting the Edit Block option brings up another menu with a box next
to it. The cursor square in the upper left-hand corner of the screen can
be moved with the joystick to choose one of 64 blocks you can edit. (You
can't see the blocks because you haven't put anything in them yet.)
Press the joystick button over a chosen block and it will appear in the box, enlarged and with a small plus in the upper left-hand corner. Move the plus around with the joystick and add or remove a dot by pressing the button.
Now you can press any of the numbers displayed, and that option will be executed. They're rather self-explanatory-Scroll Up means moving upward. The only obscure choice, Reverse Block, turns all on pixels off, and all off pixels on. The [RETURN] key brings you back to the Main Menu.
When loading and saving block sets, you don't need to type the drive number or an extender when prompted for a filename. The program automatically puts these in for you, saving the set with an extender of .SET
FRAME EDITOR
Option 4 of the Frame Editor menu, Load Block Set, shows what your
frames will look like. The Edit Frames option takes you to another new
menu with six choices. You will see the cursor square in the upper left-hand
corner. If you load a block set you created, it will show up here.
Move the square to select the block you want to draw with. Press the joystick button to go to the drawing screen. The current frame is displayed next to the menu. You can change to another frame by selecting Option 1. There are 64 frames, numbered 0 to 63.
Other selections let you choose which of four colors to draw with, or copy from another frame to the current frame so you can repeat similar parts of a picture. The Parameters function lets you change the frame settings- which include four sound voices, eight available block sets and a delay for that frame.
MOVIE EDITOR
Now all that keeps you from becoming the next Walt Disney is learning
to animate your creations. Luckily, this is the easiest part. The Movie
Editor asks you for all the necessary information and creates a movie file,
ready for displaying with the Movie Player.
Keep in mind that while you can have a total of 104 frames, you can only edit 64 with the Frame Editor. If you specify more than 64 frames, the Movie Editor asks you for a second filename for the remaining frames. As stated above, you may have as many as eight block sets. If you ask for a block set in Parameters that you haven't loaded with the Movie Editor, you will be shown the place in the sequence memory where it should be. Usually this is blank, but sometimes it contains garbage. If you want a blank block set, just save an empty one.
MOVIE PLAYER
Finally, select Movie Player and type in the filename for your movie
file. The file title you specified will be displayed as the various frames
and block sets are loaded, and your movie will run.
PROGRAM NOTES
Two machine-language routines are used-a display list interrupt routine,
and a block memory SAVEr/LOADer that calls CIO. Because they both reside
in the first bytes of Page 6, there is a lot of awkward switching in the
SAVE/LOAD routines to ensure that the proper code is there when the DLI
is needed.
Everyone seems to have a pet method for clearing out memory, such as resetting the string pointer and clearing the string, or using a machine language routine. I simply tell the computer to write to the area I wanted cleared (via locations 88 and 89) and PRINT a CHR$(125). This puts the computer's built-in routines to good use.
Lines 1650-1658 are a subroutine that, given IN and BT, converts IN to a binary representation, inverts the bit specified by BT, converts it back to decimal and places the result in OT. I first tried BASIC 's slow exponent operator, then I created my own routine to find, for example, 2^ x. Finally I created an array called PW, which contains powers of two and is many times faster than the exponentiation function
FILE FORMATS
The Block Editor saves a block set directly from memory as a five-sector,
512-byte file. Although these files probably couldn't be loaded by other
character editors because they don't contain the second half of the set,
the Block Editor has no trouble loading files created by other editors.
Just remember to use only the first 64 characters.
The Frame Editor saves all 64 pages (one frame per page) from 96 to 160 at the top of memory In each page, bytes 0-239 are the screen, 240-243 are sound voices 0-3, 248 is the block set, and 249 is the delay in jiffies (1/60 of a sceond). The unused bytes from 244-247 were supposed to contain color register values, but I ran out of XL memory in Movie Player, so I couldn't implement it.
The Movie Editor creates a very simple file consisting of all the information
you provide, in ATASCII format.
Jacob Donham is from San Rafael, Califoria. He wrote MegAnimator during a two-week period when he should have been studying for high school finals.
Listing 1: MOVPL.BAS Download
Listing 2: BLKED.BAS Download
Listing 3: FRMED.BAS Download
Listing 4: MOVED.BAS Download
Listing 5: MEGMATOR.BAS Download
On Disk: ANTIC.MOV Download
,
LADY.FRM Download
,
LADY1.SET Download
,
LADY2.SET Download
,
LADY3.SET Download
,
LADY4.SET Download
,
LADY5.SET Download
,
LADY6.SET Download