Classic Computer Magazine Archive COMPUTE! ISSUE 48 / MAY 1984 / PAGE 82

64 Hi-Res Graphics Editor

Gregg Peeie, Assistant Programming Supervisor

Just as a word processor allows you to expand your writing skills by giving you power to manipulate text freely, "Hi-Res Graphics Editor" allows you to easily draw, erase, and edit images on the 64's hi-res screen. Once you have finished your drawing, you can even send the results to your 1525 printer.

The Editor expands on the graphics techniques in "Picture Perfect," using the sprite capability of your 64 to create and modify intricate designs on the screen. Parts of pictures can be "imprinted" onto a sprite and "planted" on another area of the screen. You can then enlarge the sprite to full-screen size and edit it more precisely.

Type It In With MLX

Hi-Res Graphics Editor is in two parts. First you must type in Program 2 using the MLX program elsewhere in this issue. After saving Program 2 to disk or tape, reset your machine by turning it off.

Now type in Program 3, the BASIC part of Hi-Res Graphics Editor. SAVE it to disk or tape.

To run the program, first LOAD the file created by MLX with this format:

LOAD "your filename",8,l for disk
LOAD "your filename",l,l for tape

Now enter this line and press RETURN:

POKE 642,128:POKE 44,128:POKE 32768,0:NEW

This moves BASIC to a safe place in memory—leaving plenty of room for hi-res screens. You must type this line each time before you LOAD Program 3.

Next, LOAD the BASIC program—Program 3. Type RUN, press RETURN, and you are in the Editor.

Set The Joystick Speed

The first prompt in Hi-Res Graphics Editor is for joystick speed. Enter a number from 1 to 10 (10 is fastest). The lower the number, the more control you have over drawing. You can experiment with these numbers to find the best speed for your purposes.

Next, the screen clears and a rectangle appears in the center. This is the sprite cursor. Press the letter D and the box will change into an arrow. You are now in Draw Mode. With a joystick in port 2, you can move this arrow around the screen.

Pressing the fire button draws on the screen. If what you have drawn is invisible, press B to change the background color and F to change the foreground color. Repeat each of these keys to step through the sequence of all possible colors.

Erasing With The Arrow

If you wish to erase what you have drawn, engage the SHIFT LOCK key on the keyboard. Then hold down the fire button and use the joystick to point the arrow at any pixel you want to erase. To start over with a clean slate, just press the fl key. This clears the screen.

Sprite Mode can be accessed by pressing the A (Add), S (Stamp), C (Copy), or E (Erase) key. Let's explore the most interesting of these, hitting the letter C.

Using the joystick, move the rectangle around the screen until it's superimposed on part of your original drawing. (If you have cleared the screen, you can return to draw mode by pressing D.) Press the fire button, and the contents of the screen "under" the sprite will be copied onto the sprite.

You can enter Add Mode at any time by pressing A. In this mode, you can move your sprite around the screen and "plant" the image anywhere you like. (You add the image of the sprite to the images already on the screen.) If you hold the button down while you move the sprite, the sprite's image becomes a wide "brush," which you can use for calligraphy and to create other interesting effects.

A Graphic Stamp

Stamp Mode replaces the contents of the screen with the contents of the sprite. And if you make a mistake in your drawing, use E, Erase Mode. This mode transforms the sprite cursor into a giant eraser which clears any pixels it passes over.

A Sprite Editor

You can create your own sprites by enlarging the sprite to full screen proportions. Hold down the f7 key briefly. The screen will clear and an enlarged image of the sprite will appear in the upper left corner of the screen. To edit this sprite, press the fire button of the joystick as you move the cursor in this area. Erasing is simple. Just engage the SHIFT/LOCK key, and instead of drawing to the sprite image, you will erase parts of the sprite. The fl key clears the sprite, just as it cleared the screen in hi-res mode.

If you want to save or load a hires screen, you must do it from this sprite definition mode. Hold the CTRL key while you press L for LOAD, and a series of prompts will then appear for loading from disk or tape. Likewise, holding CTRL and S allows you to save to disk or tape.

Anytime you wish to return to hires mode, simply hold f7 down for a moment. You can then use the sprite definition you have just created to produce intricate pictures on the hires screen.

Two Graphics Screens

The Editor contains a feature which allows you to have two full screens of graphics in memory at one time. Press T to toggle between them. When you first try this function, the screen will fill with garbage if nothing has been created on the alternate screen. (There is undefined data in this area.)

Clear the screen (using the f1 key) to start with a new palette. Draw a new design on this screen, and press T (toggle) to return to the old screen. Pressing T again takes you back to your second creation, and so on.

Printing Your Creation

Since an image created on a computer screen will last only as long as the power is on, a hires screen dump is included. Just press the letter P, and your 1525 printer (or 1525 compatible printer) will print the contents (minus the sprite cursors) of the screen.

Here's a summary of the commands in the Hi-Res Graphics Editor:

D Draw Mode
SHIFT
LOCK on Erase draw (in sprite definition mode, erase parts of sprite)
A Add Mode; overlay sprite with screen
C Copy screen to sprite
S Stamp Mode; replace what is onscreen with sprite image
E Erase under sprite
F Sequence through foreground colors
B Sequence through background colors
T Toggle between screens
fl Clear screen (hi-res and sprite definition modes)
f7 Change from hi-res to sprite definition and vice versa
CTRL-L Load screen from disk or tape; available only from sprite definition mode
CTRL-S Save screen from disk or tape; available only from sprite definition mode
P Produce printout on 1525 printer