Specgraf - Instructions.doc 1 Specgraf 2004 OCRed by Wilko Schröter ANIROG SPECGRAF THE 48K SPECTRUM GRAPHIC DESIGN TOOL By N. E. SALT ANIROG SOFTWARE, 29, West Hill, Dartford, Kent (0322) 92518 © 1984 WARNING It is a condition of sale that this cassette may not be lent or hired. No part of this program may be duplicated, copied or reproduced in any form or by any means without written permission of Anirog Software. I INTRODUCTION 1.1 SPECGRAF is a utility program for the 48K Spectrum designed to aid the user in the design of User Defined Graphics (UDGs) for use in games, graphs etc. The program allows you to hold up to 200 UDGs in memory at any one time. Up to 9 UDGs can be edited on the screen simultaneously in a variety of formats to suit the figure which you are creating. When in edit mode a comprehensive set of options are available including:- rotation, inversion, and mirroring in either horizontal or vertical planes. You can also move the UDGs that you are defining around in the grid and store them in a new position. 1.2 Using the multiple sets of graphics which you create in your own programs is very simple. One method is illustrated in ROLLER on side 2 of your tape. The subroutines required to use this method are saved as TOOLKIT which is also on side 2 of your tape. 1.3 Put the SPECGRAPH side of your tape onto your cassette recorder. Type LOAD "", start the tape and wait. The screen will turn red and you will be greeted by the SPECGRAPH logo when the first block has loaded. When loading is complete the main menu will appear on the screen. Specgraf - Instructions.doc 2 CONTENTS Chapter Section I INTRODUCTION II THE MAIN MENU 1 View whole set 2 Save set to tape 3 Load set from tape 4 Change set 5 Define characters 6 Exit from program 7 Print Byte values III THE FORMAT MENU IV CHARACTER EDITING 1 Introduction 2 The Editing Menu 2.1 Filling 2.2 Erasing 2.3 Blank all pixels 2.4 Invert 2.5 Change first letter 2.6 Storing characters 2.7 Exit from editing 2.8 Rotating figures 2.9 Horizontal mirroring 2.10 Vertical mirroring 2.11 Changing set 2.12 Copying edit screen 2.13 Moving grid 2.14 Reloading grid V USING SPECGRAF GRAPHICS Specgraf - Instructions.doc 3 II THE MAIN MENU Each of the options available is explained in full below. 1. View Whole Set When the program is first loaded the standard Spectrum set of alphabetic characters will be in set 0. If you press 1 when presented with the main menu these characters will be displayed. This option always displays the current set. You can change the current set by pressing 4 when presented with the main menu. At this stage you will find that sets 1 to 9 contain nothing or garbage. 2. Save Set to Tape When option 2 is selected you will be asked to enter a name for the tape file. This is subject to the same conditions as any Spectrum tape file name. The name cannot be blank of more than 10 characters long. When you have entered a name you will be asked for the number of the set which you wish to save. This can be any of the sets between 0 and 9 or "A" if you wish to save all of the sets. When you have entered a number the "Start tape and press any key" message will appear When saving is complete you will be returned to the main menu. 3. Load Set from Tape If you have already saved some sets to tape and you now wish to edit them then you select this option be pressing 3 when presented with the main menu. You will be asked for the name of the tape file which you wish to load. If you just press ENTER then the program will load the first set that it finds on your cassette. The program will ask you which set you want to be loaded. This can be any set from 0 to 9 or "A" if you wish to load all of the sets at once. To load all of the sets you must of course have saved all of the sets together at stage 2 above. You will be returned to the main menu when loading is complete. 4. Change Set When you select option 4 from the main menu you will be asked for the set that you require. Just press the relevant number, between 0 and 9, and you will be returned to the main menu. You can then view the contents of the set selected by pressing 1. 5. Define Characters Selecting option 5 from the main menu will enter the editing mode which is dealt with at III below. 6. Exit from program You should always use this option to break out of SPECGRAF because it restores the system variables before exiting from the program. If for any reason you BREAK out of the program in any other way then RUN the program and use option 6 to exit from it. This will not effect the characters that you have stored in any of the sets. You will be able to access them in the same way as before if you RUN the program once again. If you switch off the computer then the sets will be lost. You should thus save them before switching off. Specgraf - Instructions.doc 4 7. Print Byte Values Option 7 allows you to see the values held in each byte of each of the UDGs in the current set. This can be very useful since the values can then be copied for use in your own programs as an alternative to saving them on tape. The routine which follows would load three "frog" characters into the UDGs A, B, and "C". 10 FOR I = 1 TO 3 20 READ A$ 30 FOR J = 0 TO 7 40 READ N 50 POKE USR A$ + J, N 60 NEXT J 70 NEXT I 100 DATA "A", 247, 20, 220, 252, 252, 220, 20, 247 110 DATA "B", 189, 189, 153, 255, 60, 255, 129, 129 120 DATA "C", 239, 40, 59, 63, 63, 59, 40, 239 III THE FORMAT MENU 1. When option 5 is selected from the main menu you will be presented with the format menu. Nine formats are available within SPECGRAF. This enables you to edit up to 9 UDGs on the screen in the format in which they will appear in the program for which they are being designed. Just press the number of the format that you require. 2. You will then be asked to enter the first character to be defined. Different formats require different numbers of UDGs. For example if you chose format 6 you will need 4 graphic characters whilst format 9 would require 9 graphic characters. You must bear this in mind when choosing the first character to be defined since there must be enough room left in the set to complete the group required for the format that you select. The program will not allow you to run beyond the end of a set. You will just be asked for another starting character. 3. When you have selected the first character to be defined you will be asked for the set required. This can be any of the 10 sets from 0 to 9 but if you want to edit existing characters you will enter the set in which they are held. 4. The screen will now be set up for editing the characters which you have selected. If you selected format 6 and a first character of A in set 0 then the contents of characters A, B, C, and D in set 0 will be put in the grid. Specgraf - Instructions.doc 5 IV CHARACTER DEFINITION 1. INTRODUCTION The screen will be set up in a grid in the format which you selected. If you have selected a format with more than one character in it then the positions of the characters in the grid will be marked by alternate white and yellow backgrounds. The contents of the group of characters which you have chosen to edit will then be copied to the grid and to a miniature screen in the top right of your screen. Both will of course be blank if the characters which you have chosen have not yet been defined. When the loading is complete a flashing cursor will appear at the top left corner of the grid. The cursor can be guided around the grid using either unshifted cursor keys or a Kempston joystick if you have one. The options available are displayed down the right hand margin of the screen. Each of the options is explained below. The current character indicator is situated at the bottom right of the screen. It shows the letter and set of the first of the graphics in the group currently being edited. For instance if it showed A1 and you are using format 6 then using the store option would save the current characters into A, B, C, and D of set 1. 2. Editing Characters 2.1 FILL Pressing "F" will fill the square in which the cursor is situated. The corresponding point in the miniature screen will also be filled. 2.2 ERASE If you press "E" then the square at the current cursor position will be emptied and the corresponding point in the miniature screen unplotted. 2.3 BLANK Pressing "B" will empty the grid. It will also empty the miniature representation of the characters being defined. 2.4 INVERT If you press "I" then every square which has been filled will be erased and every square which is blank will be filled. A negative version of the characters being edited is thus created. 2.5 CHANGE This option is selected by pressing "C" and is used to change the group of characters being defined. Say we have stored a frog in graphics A to D of set 1 and then rotated it. Clearly we do not wish to overwrite the frog which we have stored. This is avoided by using this option to change the current start. When you press "C" the change option will flash. It will continue to flash until you enter the letter which you wish to be the new start for the group being edited. Thus if you press "E" when the change option is flashing the current start will be changed to E1 if you are editing set 1. When you now store your rotated figure it will be stored in graphics E to H of set 1. 2.6 STORE Until you select this option the contents of the graphics which you are defining will remain what it was when you last edited them. If you do not store your graphics before are turn to the main menu then they will be lost. When you select the store option it will flash until storage is complete. Your UDGs will be saved in sequence beginning from the current start. The order of graphics on the grid is across and then down and thus a format 6 display with a current start of A1 will be stored as follows:- A1 B1 C1 D1 2.7 EXIT If you press "X" then you will be returned to the main menu. Remember to store your graphics first if you want to keep them. Specgraf - Instructions.doc 6 2.8 ROTATE This option is allowed only if you have selected one of the square formats (i. e. formats 1, 6, or 9). When the option is selected the characters being edited will be rotated through 90 degrees. This option is invaluable when you need a figure to point in each of the 4 directions available. PACMAN figures or lettering for charts are typical applications. In order to arrive at your 4 figures first store your basic pattern. Now change the current start to the next available free space and rotate the figure. You can now store the new figure and repeat the procedure. 2.9 HORIZONTAL MIRROR This option reflects the left hand side of the grid onto the right. Thus if you want to design a figure which is symmetrical from left to right then you only need to create the left hand side. 2.10 VERTICAL MIRROR The use of this option is similar to horizontal mirror except that the contents of the grid will be reflected from top to bottom. 2.11 NEW SET If you press "N" then the New Set option will flash until you press the number of a valid set (i. e. 0 to 9). When you have selected a new set the number will appear in the current start indicator. 2.12 PRINT If you have a ZX printer attached to your Spectrum then you can copy the display to it by selecting this option. 2.13 MOVE SPECGRAF allows you to move your characters around in the grid and then store them in a new position. To move the grid contents use SHIFTED cursor keys. You will of course lose any pixels that you move outside the grid. 2.14 GET If you press "G" then the contents of the grid will be erased and the grid re loaded beginning with the current start. V USING YOUR GRAPHICS 1. Exit from SPECGRAF and load side 2 of your tape. ROLLER will now load. Two sets of graphics are used by ROLLER. They immediately follow ROLLER on the tape. When the program requires them it will prompt you to press any key. When the program is loaded it will show a rolling man. If you press any key then you will break out of the program. If you now list the program you will see that it is a simple routine merged with TOOLKIT. The program nevertheless illustrates the main points that you need to know to use SPECGRAF graphics in your own programs. 2. Note that you must use the initialisation routine before anything else. This sets up the variables holding the names of the routines and clears space for the graphics sets. It also sets up an array in S( ) which holds the starts of each of the ten sets. Note that the sets are held in this array as 1 to 10 and not 0 to 9 since 0 is an invalid subscript for an array. 3. Use of the sets that you have defined involves putting the names that you have used in N$ and the number of the set in "set" and then calling the subroutine "load". Access to the sets is then achieved by putting the number of the required set in "set" and calling the routine "change". The specified set can then be used as outlined in Chapter 14 of the Sinclair Manual. 4. The method described above entails paging between sets of 20 UDGs. There is an alternative which allows you to use 96 different characters without paging. To do this poke the system variable CHARS with 256 less than the starting address of your graphics. This will redefine the characters from SPACE to the copyright symbol with your own characters. Chapter 25 of the Sinclair manual explains how to alter system variables.