Classic Computer Magazine Archive COMPUTE! ISSUE 94 / MARCH 1988 / PAGE 72

Color Pad

Forrest Bentley

Perhaps the best Commodore 64 drawing program COMPUTE! has ever published, "Color Pad" includes many features and fast response. Features such as Fill, Square, Ellipse, Text, and Transfer—a powerful copy-and-paste option—make designing spectacular screens quick and easy. A joystick and a disk drive are required.

"Color Pad" is a full-featured drawing program that allows you to create detailed multicolor pictures using a joystick. Every program option is available through a single keypress, making the program easy to use. And Color Pad has a wide variety of functions, from Draw mode to Ellipse and Fill options.

Worth noting here is Color Pad's unique copy feature, Transfer. With Transfer, any section of the screen can be duplicated and saved to disk for later use. You can not only transfer objects from one section of the screen to another, but you can also transfer objects from one complete drawing to another.

Typing It In

Color Pad is composed of Programs 1 through 4. Program 1 is written in BASIC, so it is recommended that you use the "Automatic Proofreader," found elsewhere in this issue, to assist you in typing it in. Programs 2, 3, and 4 are each written in machine language and must be entered using "MLX," the machine language entry program found elsewhere in this issue. When you run MLX, answer the prompts as follows for each program:

Program 2

Starting address: 80E8
Ending address: 92C7

Program 3

Starting address: C000
Ending address: CEBF

Program 4

Starting address: 92E0
Ending address: 9CB7

After typing in each program, save a copy to disk. Save Program 1 with the filename COLOR PAD, Program 2 with the filename COLOR PAD.O, Program 3 with the filename COLOR PAD2.O, and Program 4 with the filename COLOR PAD3.O, all on the same disk. When run, Color Pad looks for the programs with these filenames.

Typing In Multiple Sittings

Programs 2–4 are quite long machine language programs. If you want to stop typing one of the listings at some point and resume later, press SHIFT-S and follow the screen prompts. Remember to note the line number of the last line you typed in.

When you are ready to continue typing, load MLX, answer the starting and ending address prompts, then press SHIFT-L. MLX asks for the filename you gave to the partially typed-in program. After the load is complete, press SHIFT-N and tell MLX the line number you stopped at. Now, continue typing as before. When you finish typing, MLX automatically prompts you to save the program.

Starting Up

To run Color Pad, plug a joystick into port 2, turn on your 64, and enter LOAD "COLOR PAD",8. After the program is loaded, type RUN and press RETURN. After a while, Color Pad's multicolor bit-mapped screen appears. Pressing fl returns you to BASIC.

Once in Color Pad's bit-mapped screen, you'll notice a pen-shaped sprite indicating where you're plotting. The joystick controls the pen. To draw, the pen must be down. The joystick's fire button toggles the pen up and down. So you know the current orientation of your pen, two dark lines appear within the pen when it's down.

"Color Pad" can produce beautiful, detailed color screens such as this one.

The transfer function can be used to stamp images.

Color Pad contains many drawing tools for the computer artist. The following describes these tools and how to access and use each of them.

The Basics

Brushes: Color Pad offers a selection of two brushes: large and small. To select a new brush, press B. Your pen changes in size to reflect the new size of your brush.

Eraser: If you make a mistake—and we all do—you'll want an eraser. To access the eraser, press E. The eraser end of the pen opens up to indicate that Erase mode is in effect. Now, when the pen is down, you erase points rather than draw them. The eraser uses the current brush shape. To return to Draw mode, press D.

Drawing Color: This option allows you to access the 64's palette of 16 colors. To change the color your pen draws with, press the space bar. The border color indicates the new color. Pressing the space bar repeatedly cycles through all 16 different colors. To cycle backward through the colors, press SHIFT-SPACE.

The Commodore 64 allows only four colors in any eight by eight pixel area. If you try to use more than four colors in an eight by eight block, one color will "splash" into another. Just be careful when using multiple colors in a small area.

Pen Color: To change the color of your pen, press A. Continue to press A until you find the color you want. This does not change the plotting color, just the color of the pen sprite. It's best to choose a pen color that contrasts well with the paint and canvas colors.

Pen Speed: You can speed up and slow down the pen's movement by pressing the plus and minus keys, respectively. Be careful when increasing your pen's speed—this program can move very fast.

Clear: The garbage can is probably an artist's most important tool. Everyone needs to throw away his or her work once in a while. The Clear option gives you this ability by disposing of your current sketch and giving you a clean slate. You may also wish to use the Clear option to begin a new drawing after saving the current one to disk.

To clear a sketch, press C. The pen vanishes, acknowledging your keypress. If you really wish to toss your sketch into the garbage can, press C again and the screen will clear. If you change your mind, press any key other than C and the pen will return, leaving your drawing intact.

Oops: Here you can dig through your garbage and pull out an old version of your drawing. The Oops option restores your drawing back to a previous state. To enter Oops mode, press O. The pen will vanish. Press O again to restore the sketch. Pressing any other key aborts the Oops process.

To specify the "previous state" that your drawing is restored to, press SHIFT-O. Whenever you press SHIFT-O, your drawing is copied into the Oops buffer, where it can be recalled by pressing O twice. The sketch is also copied into the Oops buffer whenever you use one of the function key options or display a directory.

It's a good idea to press SHIFT-O before making drastic modifications to a sketch. This way, you always have a good sketch to Oops back to.

Lines And Shapes

Lines: This option, a straight-edge tool, lets you draw accurate, straight lines.

To draw a line, move your pen to where you want the line to start and press L. A plus sign (+) appears on the screen at the location of your pen. Now, move your pen to where you want the line to end, and press the fire button. Instantly, a line is drawn using the current brush.

After the line is drawn, the plus sign moves to the current pen position (the line's endpoint), ready for another line. By allowing you to draw connecting lines like this, triangles, rectangles, and other polygons are easily created.

While in line mode, you may change your mind as to where the start of the line should be. To do this, simply press L again, and the plus sign exchanges places with the pen. To exit line mode, press RETURN.

Rays: Press R to enter ray mode. Rays work like lines, with one exception. After a ray is drawn, the + sign remains where it was before the ray was drawn. To exit ray mode, press RETURN.

Square: To draw a square, press S. Four plus signs appear, indicating the shape and size of the square. Move the joystick right or left to increase or decrease the horizontal length of the square. Similarly, move the joystick up or down to increase or decrease the vertical height of the square. Once you have the shape you want, press the fire button. Now, move the square to where you want it and press the fire button again. The square is placed onto the screen. To escape from this mode, press RETURN.

Diamond: A diamond is a square that sits on its corner. To draw a diamond, press Q. Four plus signs appear. As with a square, use the joystick to determine the shape of the diamond and press the fire button. Move to the desired location on the screen and press fire to draw the object. Pressing RETURN exits diamond mode.

Ellipse: To draw a circle or an ellipse, press I. Again, you are presented with four plus signs. Move the joystick to determine the shape of the ellipse. Once you have the shape you want, press the fire button. Now, move the plus signs to where you want the ellipse drawn and press the fire button again. An ellipse is placed onto the screen. To escape from this mode, press RETURN.

The Extras

Fill: To fill an enclosed area on your sketch, move the pen inside the area and press F. Make sure that there aren't any holes in the edges, or the paint will leak out. To terminate a Fill before it is finished, press RETURN.

After an area is filled, you may want to refill it with a different color. To do this, lift the pen up, select the new color using the space bar, and press F again. The new color covers the old color.

Fill reads the color under the pen's point and fills until it reaches a different color. If the color under the pen matches the current drawing color, the fill is stopped.

Text: With this tool, you can draw text in several different sizes. To place text onto a drawing, press T. The pen changes to an underline cursor. Now, simply type in your message. The cursor keys and the RETURN key can be used to move the cursor around the screen.

When you reach the end of the screen, the cursor does not automatically move to the next line. You must manually move to the next line using the cursor-down key or the RETURN key. The fl key exits Text mode.

To erase a character while entering text, press f3. The cursor splits in two, indicating that you're in Erase mode. Now, use the cursor keys to move on top of the incorrect letter and retype that same letter. Just as with correctable ribbon on a typewriter, the offending letter is deleted from the screen. Press f3 again to draw characters.

Toggling the text cursor between Draw and Erase is identical to setting the pen to Draw and Erase. For instance, if you wish to enter reverse letters on a solid object, type your letters in Erase mode.

To increase the size of your characters, press the up-arrow key (↑, not the cursor-up key). Each time you press this key, the character size increases. The left-arrow key (←) reduces the character size.

To give words a three-dimensional look, type a word in black, back up to the first letter in the word using the cursor keys, press fl, move the pen a few pixels up and left, select a different paint color by pressing the space bar, press T to enter text mode, and retype the word.

Transfer: This option offers three important tools—a photocopier, scissors, and paste. You can select an area of the screen, copy it, and then paste the copy anywhere on your sketch.

To begin the transfer, move the pen to the upper-left corner of the area that you wish to select and press X. As with the square tool, four plus signs appear. Move the plus signs with the joystick to form a square that encloses the area to be transferred. Press the fire button and the enclosed area is copied. Now, move to where you want the copy to be placed and press the fire button again. The copy is pasted onto the sketch.

After you're through making all the copies you want, press RETURN and the pen reappears. If you want to retransfer the same copy later, just press N. The selection square reappears. Move to where you want the copy placed and press the fire button.

To transfer a copy to another sketch, press X, select an area, press RETURN to exit Transfer mode, press f4 to load a new drawing, and press N to transfer the copy. Transfers may also be saved to disk for later use (see below).

If you use a drawing tool that uses the plus signs (like Square or Ellipse) between the transfer and retransfer functions, the retransfer does not work properly. In this case you have to copy the original again, or save it to disk and load it back in.

Zoom: To add detail to your pictures, Color Pad offers Zoom mode. You activate Zoom mode by pressing Z. A square area defined by four plus signs appears. Move the square area over the section of the screen that you wish to edit and press fire. The selected area is enlarged to fill the entire screen.

To edit this magnified view of your sketch, simply use your pen and draw. If you wish to erase pixels, enter Erase mode by pressing E. Press D to return to Draw mode. You can change the color that your pen draws with by pressing the space bar. To move the Zoom viewing area around the sketch, use the cursor keys.

Press RETURN to restore your screen to normal. The Zoom selection square remains on the screen for you to use. If you wish to exit Zoom mode entirely, press RETURN again. Zoom mode is perfect for adding final touches to a detailed drawing.

Special Features

Exchange- Color: After drawing for a while, you may want to exchange all occurrences of one color for another. To do this, lift the pen up, move the point of the pen on top of the color that you want to change, press the space bar until you find the color that you want, and press SHIFT-A. All occurrences of the old color switch with the new color.

Rapid Colors: For interesting color effects, turn on Rapid Colors by pressing SHIFT-R. When activated, the drawing color rapidly cycles between all 16 colors. Press SHIFT-R again to turn this mode off. Rapid Colors affects all drawing functions, such as Draw, Ellipse, and Fill.

Shading: Shading allows you to draw using different patterns or shades. Press SHIFT-S to activate Shading. When activated, the pen toggles quickly between Draw and Erase mode, creating a shading effect. The speed at which the pen switches between drawing and erasing depends on the speed of your pen. You can adjust the pen speed by pressing the plus and minus keys. To turn off Shading, press SHIFT-S again.

Shading can be useful for drawing dotted lines. Try using the Fill option using different pen speeds while Shading is on. You can create some very interesting graphics this way.

Screen Scroll: By using the cursor keys, you can move a drawing around on the screen. Any part of the drawing that moves off the edge of the screen is erased, so be careful. It is a good idea to create borders for your drawings last, just in case you accidentally hit a cursor key.

Swap: With Swap, you can have two sketches in memory at one time. When you press f2, the current screen "swaps" with the one stashed in memory. When loading, saving, or printing a sketch, only the current screen—the one that's visible—is affected.

Using Color Pad's Transfer feature, you can copy objects from one screen to the other. Just press X for Transfer, select an area, press RETURN to exit Transfer mode, press f2 to Swap screens, and press N to Transfer a copy to the alternate screen.

Screen Copy: Pressing f8 copies the current screen to the alternate screen. The border changes color briefly while the current screen is being duplicated. When the border color returns to normal, both screens are identical.

Help: All of Color Pad's options are documented in an online help screen. The f7 key opens the help screen and RETURN closes it.

File Commands

Directory: Pressing SHIFT-RETURN prints the current disk directory to the screen. To resume drawing, press RETURN.

Save: To save your sketch, press f3. The program prompts you for a filename. When saved, the characters CP. are added to the beginning of the filename to help you remember which files are Color Pad files. For this reason, you must enter a filename with 13 or fewer characters. Pressing RETURN without entering a filename exits this option.

Load: Here you can load a previously saved sketch by pressing f4. When the program prompts you, enter the filename that you used to save the sketch (without the added CP.). The sketch is loaded and ready for editing. Pressing RETURN without entering a filename returns you to Draw mode.

Save Transfer: This option allows you to save a transfer. A transfer is a selected portion of your sketch (see the Transfer description above). To save a transfer, press f5. The program prompts you for a filename. Transfer files are saved with the characters CX. added to the beginning of the filename. You may exit this option by pressing RETURN without entering a filename.

Load Transfer: This option allows you to load a previously saved transfer. To load a transfer, press f6. When the program prompts you, enter the filename that you used to save the sketch (without the added CX.). The transfer is loaded and ready for use. You may exit this option by pressing RETURN without entering a filename.

After the transfer is loaded, the retransfer function is automatically called and you are presented with the four + symbols. Press RETURN if you do not wish to place the transfer yet.

Quitting

Exit: To exit the program, press fl. If you exit Color Pad accidentally, entering RUN immediately restarts the program with your drawing intact.

Using Color Pad Pictures

From Color Pad To BASIC

Programs 5 and 6 allow you to load Color Pad pictures from BASIC. You may use these pictures in your own programs, or simply create a Color Pad slide show that exhibits your finest creations.

To begin, type in Programs 5 and 6. Program 5 is written in BASIC, so be sure to use the "Automatic Proofreader" to ensure accurate entry.

Program 6 is written in machine language. You must enter Program 6 using "MLX," the machine language entry program found elsewhere in this issue. Enter the following starting and ending addresses for Program 6:

Starting address:   C350
Ending address:     C437

Save Program 5 and 6 to the same disk. Save Program 6 using the filename CPBASIC.O. Program 5 looks for Program 6 using this filename.

When you run Program 5, the computer requests the filename of a Color Pad file. Insert the disk containing the desired picture and enter the picture's filename. After the picture loads, it is displayed on the screen. Press any key to exit the program.

You can modify Program 5 for your own purposes. For example, by deleting line 150 and changing line 160 to

160 FL$ = "MYPICTURE"

the program automatically loads and displays the drawing saved as MYPICTURE.

Graphics programmers may be interested to know that Color Pad's bitmapped picture loads into memory at 8192-16383. The text screen is still located at 1024-2023. Because the multicolor drawing resides in the BASIC workspace, a POKE 52,32:POKE 56,32:CLR is necessary to keep BASIC from intruding on your picture. These POKEs, however, reduce the workspace to a little under 6K.

From Koala Pad To Color Pad

Program 7 is a machine language program that transfers files created by Koala Pad's Koala Paint program into Color Pad. To use Program 7, you must first type it in using MLX. Enter the following values when prompted:

Starting address:  C000
Ending address:    C047

When you are finished, save the program as CONVERT.O. Now, to convert the picture to Color Pad format, enter the following lines. Note that the A in line 10 should be changed to specify the desired Koala Pad file.

NEW
10 F$ = CHR$(129) + "PIC A*" : REM WHERE "A" IS THE PICTURE'S LETTER
20 IF L = 0 THEN L = 1 : LOAD F$, 8, 1
RUN
LOAD "CONVERT.O", 8, 1
SYS 49152
LOAD "COLOR PAD", 8
248 POKE 821, 87
RUN

When Color Pad runs, the converted Koala Pad drawing appears on the screen, ready for you to edit or save.