CoCo Draw v5.1 Instructions This software was designed to run on the VCC Emulator at the highest over-clock speed and to have the disk drive over-clocked as well. Make sure to set both before loading to avoid errors and to have optimal performance. I believe this will run on a stock CoCo 3, but it will be extremely slow compared to the emulators. After setting the proper settings, type RUN"DRAW" and the program will begin. CoCo Draw (CD) has a fully programmed graphical user interface. Use a joystick/ mouse (mouse preferred) to move the cursor and click to perform functions. As you look at the screen you will notice a palette of colors at the bottom of the screen. Just to the right of that are two color filled boxes. The one on the top (full block) is the foreground color and the one on the bottom (block with top-left corner out) is the background color. Simply left click (foreground color) or right click (background color) on a color to change the current color. Above the color palette you will notice it says, "X: Y:". This will display the current X and Y coordinate the cursor is at when a file is opened. Click on the icon that looks like an open folder (3rd one down on the right side of the icons). This is the "OPEN" icon. It will show a list of CD files that are on the disk and then prompt you to type in one of them. Type WELCOME and press enter. Notice after the file is loaded the name of the file appears next to the X and Y coordinate display. Move the cursor over the "zoomed" image of the file. Notice the X and Y coordinates change with the movement of the cursor. An important note, the top-left corner of the "zoomed" image is 0-X and 0-Y. And the bottom-right corner will display one number lower than the width and height you entered for the picture. Example, if your picture is 32x32 pixels (just like "WELCOME") the bottom-right coordinate would be 31-X and 31-Y. To exit CD there is a little box with an x at the top right of the screen. Move the cursor over the box and click. You will then be asked if you are sure you want to exit or not. Click on YES and you will exit, click on NO and you will return to your work. Now I will cover the icons and the functions associated. We will start at the top-left corner of the icons and work our way left to right and down. The first icon is the PENCIL icon. Clicking this will set the current tool to the PENCIL. You will notice that the currently selected tool is printed below the icons. The PENCIL tool is used to draw one pixel at a time on the canvas. All of the tools only work inside the "zoomed" image. Try using the pencil now. Now instead of the clicking the left button, try clicking the right button. Notice the difference? Left-button=foreground color and right-button=background color. No matter which tool you have selected clicking the right button will always set the one pixel to the background color. You DO NOT have to have the PENCIL selected to use this feature. The next icon is the LINE tool. To use the LINE tool click on the canvas. You will hear a beep. This sets the starting position of the line. Next click on the end position and the line will be draw in the current foreground color. If you click off the canvas you will hear a beep. You cannot select any other tools, icons or colors until the line is complete. Next we have the BOX/ BOX FILL tool. Left clicking will select the BOX tool and right clicking will select the BOX FILL (displayed as BOX F) tool. These work exactly the same as the LINE tool, but draw boxes instead. BOX draws the outline of a box and BOX FILL draws a filled box. Next to the BOX/ BOX FILL tool is the FILL tool. This will "paint" the foreground color inside a closed line drawn in the background color. USE THIS TOOL CAREFULLY. Make sure you have a completely closed line and the background color set to the same color as the line and then click to paint. If you don't the whole screen will be painted and your work will be lost. Sorry, no way around this one! Wish there was! And now comes the SAVE/ SAVE AS... icon. Left clicking will quickly save the current file using the filename displayed below the "zoomed" image. Right clicking will prompt you to enter a new filename to save the image as. This is useful when drawing animation frames as you can just alter the same image and save it under a different name. Next is the OPEN icon, which you already used to open "WELCOME". Files DO NOT store the palette information, so if the colors need to be changed you can either load in a palette or alter the current palette with our next icon. The PALETTE icon (a circle with little crosses erased from it). When you click this you will be prompted to click on a color displayed in the window. Then move the joystick/ mouse left and right to set the new color. Click the button when you're finished and you will return to your work. SAVE PALETTE icon. Click this to save the current palette to disk. LOAD PALETTE icon. Click to load a palette from disk. A list is not displayed. And finally the NEW icon. Click this to start a new image. You will be prompted for the filename, width and height. The maximum for width and height is 32 pixels. You will have to either do this or OPEN an image before you can start editing. The .SPT file format is simple. The first thing store is the image width and then the image height. Then it is followed by the number that corresponds with the palette slot number for the X and Y coordinate. The program "LOADER" will show you exactly how to load an image into BASIC and display it on the HSCREEN2 The .PLT file format is simply a numeric list of the palette slots. You can see how to load and utilize this in your basic program in the first code line of "LOADER" My next feat will be to design a level editor where you can graphically place "objects" (the sprites you draw with CD) onto the HSCREEN2 and then store the grid information in a file to be used by your program to setup levels in a game. I have provided in this document a list of variables and sub-routines used in CD so that you can make modifications to the program. If you do make mods, please send them to me I would like to check them out. If you want to make a suggestion for improvement, please feel free to send that to me as well. I hope you can utilize CoCo Draw 5.1 and enjoy playing around with it. Regards, Paul Variables and Arrays: F$()- Stores drawing info for the font FC- Stores the palette slot of the foreground color BC- Stores the palette slot of the background color JX- Stores the joystick/ mouse x position JY- Stores the joystick/ mouse y position JH- Stores the last position of the joystick x position JV- Stores the last position of the joystick y position FO- Used to tell if a file is open or not 0=no, 1=yes T$- Stores the string for text you want drawn on the screen (used with subroutine 2005) TX- X position for text drawing TY- Y position for text drawing. Text is drawn from the bottom up so, add 5 pixels. C- Stores palette slot used to draw text R- Text reading position. Used as a position marker when reading the text from T$. (used in subroutine 2005) P= Used to pause after mouse clicks: FORP=0TO2000:NEXTP T- Stores what tool is currently selected: 0=none, 1=pencil, 2=line, 3=box, 4=box fill, 5=paint F$- Stores image filename used for disk storage PW- Stores image width. First variable printed to the images .SPT file PH- Stores image height. Second variable printed to the images .SPT file N$- Used in subroutine 2110 (backspacing) V- Stores a value of a string. Used when inputing image width and height LX, LY- Stores the starting X and Y positions for line, box and box fill EX,EY- Stores the ending X and Y positions for line, box and box fill PF$- Stores the palette filename used for disk storage PC- Stores the palette slot picked for changing. FN$, EX$- Stores filename and extension for the directory search perform when opening a file D$()- Stores filenames found in the directory search that have the extension .SPT A- ASCII code returned from PEEK(135) used for all keyboard input. EXEC 44539:A=PEEK(135) waits for keyboard input and then returns the ASCII value of the key pressed to A I$- String used for keyboard input X2- Stores last X coordinate for the zoomed image Y2- Stored last Y coordinate for the zoomed image I think that's all of them. I'm pretty sure I wrote them all down as I went along, but I could be mistaken. Subroutines: Main input loop are lines 40-125 and 990, 1000 goes to 40 2000- Updates color box 2005- Draws text from T$ at TX and TY in color C 2010- If CHR$(13) (enter) is found in T$ this will send text to the next line 2015- Get joystick coordinates 2030- If the joystick moves this will move the cursor 2035- Pick color from the palette 2040- Quit Y/N? 2080- New 2110- Backspace for keyboard input 2115- Print text being inputed 2160- Draw X and Y coordinates of the cursor on the zoomed image 2185- Pencil tool 2195- Line tool 2230- Box 2270- Set and draw the endpoint for line/ box tools 2275- Redraw zoomed image from actual size image. 2280- Set starting X and Y postions for line/ box tools 2290- Box Fill tool 2325- Fill tool 2345- Save 2365- Save as new filename 2390- Open 2440- Change palette slot 2490- Save Palette 2515- Load Palette 2540- Erase pixel (right click in zoomed image and draw background color)