SCREEN DESIGN and FINE SCROLLING for ADVAN LANGUAGE DESIGNS BASIC COHPILER WARNING This software and manual are both protected by U.S. Copyright Law (Title 17 United States Code). Unauthorized reproduction and/or sales may result in imprisonment of up Lo one year and fines of up to $10,000 (17 USC 506). Copyright infringers may also be subject to civil liability. SCREEN DESIGN documentation (C) Copyright 1985 William Graziano All Rights Reserved SCREEN DESIGN software (C) Copyright 1985 William Graziano All Rights Reserved ATARI is a trademark of ATARI, Inc. DISCLAIMER OF WARRANTY THIS SOFTWARE AND MANUAL ARE SOLD "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OR MERCHANTABILITY. THE SELLER'S SALESPERSONS MAY HAVE MADE STATEMENTS ABOUT THIS SOFTWARE. ANY SUCH STATEMENTS DO NOT CONSTITUTE WARRANTIES AND SHALL NOT BE RELIED ON BY THE BUYER IN DECIDING WHETHER TO PURCHASE THIS PROGRAM. THIS PROGRAM IS SOLD WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES WHATSOEVER. BECAUSE OF THE DIVERSITY OF CONDITIONS AND HARDWARE UNDER WHICH THIS PROGRAM MAY BE USED, NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED. THE USER IS ADVISED TO TEST THE PROGRAM THOROUGHLY BEFORE RELYING ON IT. THE USER MUST ASSUME THE ENTIRE RISK OF USING THE PROGRAM. ANY LIABILITY OF SELLER OR MANUFACTURER WILL BE LIMITED EXCLUSIVELY TO PRODUCT REPLACEMENT OR REFUND OF THE PURCHASE PRICE. Advan Screen Design and Fine Scrolling Introduction You will find two disks in the center of this manual. Make sure the write protect tab is on each one. Put one in a safe place; it is your back up. The Advan screen design program, SCREEN.COD, allows you to design a graphics display using one of the standard graphics modes or a custom mode. With a custom mode you can mix several different graphics modes in one display and you can even specify horizontal and/or vertical fine scrolling. After designing a display, you can save it to a disk. With the Advan BASIC special command, LSCREEN, you can load the display from your program Two special program files are also on the disk, CPLOT.APP and SCROLL.APP. When appended to a program, CPLOT.APP provides the commands (i.e., special named subroutines) CPLOT@, SPLOT@, CPRINT@, CLOCATE@, and FNLOC%. These commands let you print and PLOT points to custom displays. The standard PLOT, PRINT, LOCATE, and LOCATE commands won't work with these custom displays because of the mixing of the graphics modes. When appended to a program, SCROLL.APP gives the command SCROLL@, allowing you to do horizontal and vertical fine scrolling. 1. Loading the Screen Design program To run SCREEN.COD insert the Screen Design disk and then type EXEC SCREEN.COD. or if you have a two disk system you can insert the disk into drive two and type EXEC D2:SCREEN.COD. First, a menu with four options is presented: 1 is to design a display , 2 is to save a display to a disk file,3 is to load a previously saved display, and 4 is to end the program and return to the BASIC. Type the number next to the option you want. 2. Designing a display When you type 1, the program displays a list of the available graphics modes. Modes 0 through 15 are the standard graphics modes. Appendix A has a description of each one. Mode 256 is the custom graphics mode. Adding 128 to the graphics mode number causes the system to use the alternate character set. Adding 16 deletes the text window at the bottom of the screen. Adding 64 causes the player-missiles to be enabled when your program loads the display with the LSCREEN command. For example, if you type 444 (=256+128+64) , followed by RETURN, you will have a custom graphics mode with an alternate character set and with player-missiles. If you select a custom mode, the program asks a series of questions to obtain the information needed to specify the display. See Section 5 (p.5) for a discussion of custom modes. After you have selected the mode and if necessary, provided the information for a custom display, the program will activate the display. You will see a flashing cursor in the center of the screen. Now you can begin to create the screen design. -1- The following is a list of the commands you can use. To execute a command, type the letter or symbol which stands for the command. Don't press RETURN unless you are directed to do so. C--- stands for color or character. If you are in a graphics mode, typing C causes the system to display the colors available for the mode you selected. Type the number or letter which appears above the color you want. If you are in a text mode, all the possible characters will be displayed. Move the cursor to the desired character. (You may use the joystick or the cursor keys to move the cursor. The joystick must be in port 1. You don't need to press the control key when using the cursor keys.) Note that depending on the mode, alternate colors or an inverted form may be available for a character. To get an inverted form or a different color, press the space bar one or more times. When you reach the desired color or character form, press RETURN or the joystick trigger. The system will return to the display you are working on. >--- Pressing > or the joystick trigger causes the color or character you selected with the C command to be plotted at the cursor location. The cursor is then shifted one position to the right. If it was at the line end, it will move to the start of the next line. T--- allows you to change a color register. On 4OO/8OO/XL/XE computers, the colors available in a given mode depend on what is in the color registers. First you are asked to enter the number of the register you would like to change. For the player missile color registers use the player missile number plus 5. For the five screen display color registers use the color register number. Next, you are asked to choose from the 16 available colors. Enter the number or letter which appears above the color you want. Then you are asked to choose the brightness; enter the corresponding number. Finally, the program returns you to the display. Note that Appendix A gives the color registers used in each mode. <--- erases the point at the cursor location and shifts the cursor one position to the right. If it was at the line end, it will move to the start of the next line. Cursor keys--- pressing one of the cursor keys moves the cursor in that direction, or you can use a joystick in port 1. Note that these keys will move the cursor even if the control key is not pressed. M--- stands for move, and tells the program you would like to move the cursor to a given column and row. After pressing M, you enter the column number, a comma, the row number, and then press RETURN. The cursor is moved to the specified location. I--- stands for insert text. In the text modes, using the C command to specify the characters to be plotted can be rather slow. Instead you can type I followed by the letters or symbols you want displayed, and then RETURN. while you are typing the letters, the program switches to a special display so that you can use the edit keys. Remember, in modes 1 and 2 you can use inverse and small letters to specify different colors for the characters. (See Ch. 13 in the Advan BASIC manual). D--- stands for done, and returns the system to the initial menu where you can save the display to a disk, return to BASIC, or load a display which you previously saved to a disk. -2- E--- stands for erase, and erases the entire screen. Be careful with this key! H--- stands for help, and displays a list of most of the commands. In addition, in the lower right corner it gives the cursor location, the maximum cursor column and row numbers, and scroll information (if scrolling is used). Pressing RETURN causes the display you were working on to reappear. U--- stands for undo, and undoes the last PLOT command. That is, the display is restored to what it was just before the last plot command. Pressing U a second time undoes the next to last PLOT command. Pressing U n times will undo the last n PLOT commands n must be 510 or 1ess. G--- sends you to the same menu you used to specify the current graphics mode. You can now select a new graphics mode or you can select the same mode, but change whether or not player missiles will be activated and whether or not to use the alternate character set. If you choose the same mode, add 32 to the mode number and type this number. The 32 stops the display from being cleared. For example, suppose you selected mode 1 and later decide you want player missiles. When asked to enter the mode, type 97 (=1+32+64) followed by RETURN. W--- stands for drawto, and draws a line from the last PLOTted point to the current, cursor location. O--- draws a circle whose center is the current cursor location. The last plotted point is on the circumference and determines the radius. If you decide you dont want the circle while it is being drawn, press RETURN to stop the drawing process. Pressing U undoes the last point plotted on the circle. Repeated pressing of U undoes the rest of the points PLOTted on the circle (up to 510). L--- draws an ellipse whose center is the current cursor location. The last two PLOTted points determine the axes; one must be the major axis (the greatest distance from the center), and the other the minor axis (the shortest distance from the center). Pressing RETURN stops the drawing process. R--- draws a circular arc from the next to last PLOTted point. clockwise to the last PLOTted point. The current cursor location is a point on the arc and determines the amount of curvature. Pressing RETURN stops the drawing process. F--- stands for fill. If you place the cursor inside a figure and press F, the figure will be filled with the color or character you have selected. Note that the figure must be completely enclosed or the whole screen will be filled. Pressing RETURN sLops the filling process. S--- stands for scroll (see Section 6, p.8), and is used after you have set up a scrolling display. After pressing S, you must enter a number, a comma, another number, and then RETURN. This causes the display to be scrolled to the horizontal location specified by the first number and the vertical location specified by the second number. If you have selected full scrolling, the help display (reached by pressing H) will have the current and maximum values for the horizontal and vertical scroll in the lower right hand corner. -3- B--- used to define a rectangular box. To define the box, place the cursor at the lower left corner of the desired box and press B. Next, move the cursor to the upper right corner of the box and press B. Lines will be drawn defining the sides of the box. The last color command (C key) determines the color or character used for the lines. To erase the lines defining the box use the X command. Note that you can define only one box at a time. After the box has been defined, the P command can be used to reproduce the figure in the box at other screen locations. X--- undoes the lines drawn with the B command. Note that plotting or erasing any screen point will also cause these lines to be removed. You must remove the lines for one box before you can define another box. P--- stands for put box (see the B command). To cause the display within the box to be reproduced at another screen region, move the cursor to the lower left corner of the new region and press P. You can reproduce the figure within the box as many times as you want. Z--- stands for zero (see B and P commands). If you use the P command and then decide you don't like the result, press Z to erase the figure (if you haven't moved the cursor). Otherwise, move the cursor back to the lower left corner of any box region and press Z. You can also use Z in the same way to erase the figure in the original box. However, the original box cannot be reproduced after being erased. A--- allows you to design characters for the alternate character set. Section 7 (p.12) describes this process in detail. 3. Saving and loading a display to a disk Saving a display When you have finished designing a display, type D to return to the initial menu. Then type 2 to save the display. First the program will ask for the disk drive number. After you enter this number the directory of the disk in that drive will be printed. Next the program asks for the file name and then it will save the display. If you change your mind, pressing RETURN without entering a name will abort the save operation and return you to the initial menu. If you have used an alternate character set the data for that set will also be saved to the file. You might want to design only an alternate character set and/or a custom graphics mode, and then do all of the plotting of screen data in your BASIC program. In this case, you should not PLOT any data to the display while in the design option. This will reduce the size of the file saved to the disk and reduce the time required to load the file. After the data has been saved you will be returned to the initial menu. If you want to return to the display you were working on, type 1 (the design display option). When the program asks for the graphics mode, add 32 to the graphics mode and then type this number followed by RETURN. Loading a display from a disk Typing 3 while in the initial menu allows you to load a previously saved -4- display. After the file has been loaded, the program will shift immediately into the design optlon of the program. You can then modify or continue to design the display. When you are finished, you can save the display back to the same or a different disk. Loading data from a BASIC program LSCREEN is an Advan BASIC command to load screen display data from a disk file. For example, suppose you want to load the screen data from the file named DATA.001 on disk 1. The following BASIC line would do this. 100 LSCREEN 1%,"DATA.001" This opens the file on disk 1 named DATA.001 and assigns it a channel number equal to one. After the data is loaded, the file is automatically closed. Just as in any OPEN command, the channel number must be 0,1,2, or 3. While the LSCREEN command is being executed, no other file can be using the same channel number. 4. Returning to BASIC When you have finished with SCREEN.COD you can return to BASIC. To do so, you must be in the initial menu and then type 4, The system will print the message 'INSERT BASIC DISK&RETURN'. You can eirher insert the Advan BASIC Master disk into drive 1 or another disk with the BASIC on it (i.e., a disk formatted with FORMAT1.COD. See Ch. 17 of the Advan BASIC manual). After you have inserted the disk into drive 1, press RETURN. 5. Custom graphics modes The standard graphics modes use the same mode (with the possible exception of a text window) for the entire display. Moreover, they use the standard width display, which leaves a border around the display area. The ATARI computers, however, can use a wide display mode which eliminates these borders. If you want, to do scrolling, this is a very helpful feature since you usually want objects to enter and leave at the edge of the viewing area, rather than at the borders. Advan custom graphics modes use the wide display and also al1ow you to mix graphics modes in a given display. In addition, they allow vertical and horizontal fine scrolling. To use these custom modes, you need to understand a little about how a display is designed. A screen display is divided into horizontal lines (screen lines), with the number visible depending on the TV or monitor. Usually it is about 216, but it could be as small as 192 or as large as 256. A single display line uses from 1 to 16 screen lines depending on the mode. For example, a mode 0 display line uses 8 screen lines (i.e., each character is 8 lines high). On the other hand, a mode 8 display line uses only one screen line. To set up a display you need to provide a list of the modes you want to use for the display lines; this is called a display list and is actually a series of commands to the graphics processor in the ATARI. For example, your list might be 30 commands long with each command specifying mode 0. Since each mode 0 display line is 8 screen lines, this is more than most TVs can display. The first line would be completely -5- above the top of the average TV screen, and the last one or two lines would probably be below the bottom of the screen. Thus, there would be no border at the top or bottom. The standard mode 0 display list has 27 commands. The first three are the same and each specifies eight blank screen lines. The last 24 specify 24 node 0 display lines. Now lets consider a mixed mode display. You might start with the first three commands the same as the standard mode 0 display (each specifying 8 blank lines). Next, you might have 12 commands specifying mode 0 and then 12 specifying mode 1. This will give a display with the top half mode 0 and the bottom half mode 1. To design such a display, you need to specify the custom graphics mode 256. Next, the program asks what graphics mode you want for each display line, starting with zero, the first line. The possibilities are 0 to 15 or B for blank. In this case, you want screen line 0 to be blank, so type B. Next it asks how many blank screen lines. You type 24. Because one display list command can produce from one to eight blank screen lines, the program sets up the first three commands to each produce eight blank screen lines. Next, the program says you are on screen line 24, and asks what mode you want to use for the third display line. You type zero.Then the program says that each mode 0 display line uses eight screen lines. Next it asks how many mode 0 lines it should set up. You want 12, so type 12. The program says that you are on screen line 120 and asks what mode you want to use for display line 15. You want mode 1, so you type 1. The program says that each mode 1 line uses eight screen lines and asks how many mode 1 lines it should set up. You type 12. Next, the program says that you are on screen line 216 and asks what mode you want for the display line 27. You are now done and can type D. This ends the display list and sends you to the display you have just set up so you can begin working on it. When the program asks for the mode number, there are several options available to you in addition to those already mentioned. Here is a description of these options: U--- stands for undo, If you make a mistake in specifying the mode number or the number of display lines in the previous entry, typing U removes the entry and allows you to redo it. The number of times you type U determines how many entries are removed. E--- stands for erase, and Allows you to start over at display line 0. LIST--- lists information about the display list commands you have entered. LLIST--- same as LIST, except output is to the printer. DLIST--- gives detailed information for the display list you are working on, including, the memory location of each display list command and the memory location of the data for that command. In addition, for scrolling modes it gives the maximum amount you can scroll in the horizontal and vertical directions, as well as the maximum row and column numbers which can be used in the special plot to scrolling display subroutines (see Section 6, p.8), DLLIST--- same as DLIST, except output is to the printer. -6- Special notes: 1) In a custom display you cannot mix modes 8,9,10, and 11. For example, if you use mode 9 in the display, you cannot use modes 8, 10, and 11. 2) Because the custom modes use wide display features, the left and right edges of the display are normally off the screen. One problem with this is that the cursor can be moved off the screen and you might lose track of it. If this should happen, type H. This will send you to the help menu which lists the horizontal and vertical location of the cursor in the lower right hand corner. 3) In Advan BASIC the maximum number of bytes a display can use is 8191. The program will give an error message if you try to exceed this limit. CPLOT@ command Normally the PLOT command is used in BASIC to set a screen point to a given color. PLOT, however, will not work for custom modes; CPLOT@ is used instead. its format is CPLOT@ integerexpression,integerexpression As with PLOT, you must give a COLOR command before using CPLOT@. The second integerexpression is the display line you want to PLOT to. The first integerexpression is the horizontal position in the line. The following table gives its maximum value for each possible mode. The minimum value is always zero. Mode Max. Horiz. Position 1,2 23 0,3,12,13 47 4,5,9,10,11 95 6,7,14,15 191 8 383 Before you can use CPLOT@ you must append CPLOT.APP, which is located on the disks which came with this manual. Like PUSING.APP, it will not appear when you list the program it is appended to. See Appendix B if you want to use CPLOT@ to PLOT character data (i.e., data in modes 0,1,2,12, and 13). CPRINT@ command The Advan BASIC PRINT command cannot be used with custom displays; CPRINT@ is used instead. Its format is CPRINT@ stringexpression,integerexpression,integerexpression The stringexpression gives the string to be displayed. The first integerexpression specifies the column number (0 is the left most). The second integerexpression specifies the display line number (0 is the top). -7- Special note: Remember, in modes 1 and 2 you can use inverse and small letters to specify different colors for the characters. See Chapter 13 in the Advan BASIC manual for more information. CPOS@ and FNLOC% commands The BASIC commands POS and LOCATE cannot be used with custom displays. Instead, CPOS@ is used to go to a specific position on the display, and FNLOC% can then be used to get the value of the point displayed at the position. For example, the following program segment stores in the variable T% the value of point number four in display line number three. 100 CPOS@ 4%,3% 110 T%=FNLOC% Remember that the top display line is numbered 0 and the left most point in the line is numbered 0. Before you can use CPOS@ and FNLOC% you must append CPLOT.APP. Note that in text modes, FNLOC% will return the character number and not the ASCII code (see Appendix B). 6. Designing scrolling displays One feature of custom modes is that you can set up a scrolling display. Advan BASIC Allows two types of scrolling--- full and limited. During the process of designing a custom mode, you are asked to specify the mode number for each display line. If you want to set up a scrolling region you need to make a special entry at the first display list command for that region. Full scrolling region When you are asked the mode number for the first line of the scrolling display, enter the mode number, a space, an S, and then RETURN. The S tells the program to set up a full scrolling region in your display and to reserve a region in memory for the scroll data. At any one time, only a portion of the scroll data is displayed on the screen. Using the SCROLL@ command (described below), you can specify which portion of the scroll data is displayed. That is, the visible portion is like a window which can be positioned over any part of the scroll display data. Next the program asks how many display lines. This is used to set up the vertical size of the window (i.e., the vertical size of the visible portion of the scroll data). Enter the number which is one greater than the number of visible lines you want. Next it asks how many bytes per line. This is used to set up the horizontal width of the scroll data region in memory. Table 6-1 shows the standard number of bytes per line for each mode. For most TVs the number of bytes visible is somewhat smaller than the number shown. Finally it asks for the number of scroll lines, in order to set up the vertical size of the scroll data region in memory. -8- Table 6-1 # of. Bytes per Mode Horiz. Line 0,7,8,9,10,11,12,13,15 48 1,2,5,6,14 24 3,4 12 Full vertical scrolling is possible only if the number of scroll lines exceeds the number of display lines. Suppose, for example, that you specify 15 display lines and 36 scroll data lines. (Because of the way ATARI hardware is set up, only 14 lines plus the top screen line of the bottom display line will be visible). You can choose which 14 scroll lines you want to be visible. For example, you could display the last part of line 9, all of lines 10 through 22, and the top part of line 23. Full horizontal scrolling is possible only if the number of bytes per line exceeds the standard number of bytes for a display line. For example, if you are using mode 2 and specify 24 bytes per line, no horizontal scrolling is possible (see Table 6*1). If you specify 50 bytes per line, however, You can choose which 24 bytes will be displayed. For example, for each display line in the scrolling region, you might display five eighths of the twentieth line byte, bytes 21 through 43, and three eighths of the forty fourth line byte. (Actually, most TVs will cut off part of the left and right edges of the line.) Now lets set up a sample scrolling display. Suppose you want to use mode 2 for the entire screen and you want to be able to scroll the entire screen. First, select graphics mode 256. When the program asks what graphics mode you want to use for display line 0, type B. When the program asks how many blank lines, type 4. Few, if any, TVs have the first four screen lines visible, and so there wont be a border at the top of the screen. Next, the program says you are on screen line 4 and asks what graphics mode you want for display line one. Type 2, a space, an S, and RETURN. The program says that each mode 2 display line uses 16 screen lines, and asks how many mode 2 lines. You want the display to go below the bottom of the screen on a typical TV, so that there will be no border on the bottom. If you choose 15 display lines, you will be down to screen line 229 (=16*14+1+4), which is well below the bottom of the typical TV. So you type 15. The program now asks the number of bytes per line. Suppose you type 50. Next, you are asked the number of scroll lines. You might type 36. The actual numbers you choose will depend on the size of the scroll data area you want. For the numbers shown above, the scroll area is 1800 bytes (=50*36). The display is using about 336 bytes (=24*14), so that only about one fifth of the scroll data is being displayed at a time. Next, the program says that you are on screen line 229, and asks what mode to use for display line 16. At this point you are done and you can type D. This will send you to the display you have just designed, and you can begin plotting data to the display. In the above example, the whole display will be scrolled. There can't be more than one full scrolling area, but you can have areas above and/or below it that are non-scrolling. For example, you could have put a mode 0 -9- line at the top and bottom of the display, and cut the number of mode 2 scrolling lines to 15. Then when you scroll, the mode 0 lines are unaffected and only the mode 2 lines are changed. On ATARI computers, maintaining the display requires a significant fraction of the computer's time. Full scrolling displays require even more time, and in some cases the time required is more than available. It is important to keep the number of visible scroll display lines as small as possible. Modes 2 and 13 give the best results since each display line gives 16 screen lines, letting you cover large screen areas with the minimum number of display lines. Modes 0, 1, 2, and 12 also work fairly well; however, if you try to fill the entire screen (i.e., no top or bottom border) with one of these modes you may have problems. If the display requires more computer time than is available the screen will not be stable and/or you will get garbage on the screen. Limited scrolling Remember, that the custom graphics modes are wider than the standard ones. In fact, the left and right parts of each line are normally off the screen. You can set up a display line so that it can be shifted to the right by an amount you specify, but the amount is rather limited. For example, in mode 1 you can shift right only by the width of about two characters. This allows you to see the two characters which are normally off the left screen edge. For certain types of patterns in a line, you can make the pattern seem to move to the right by gradually increasing the amount of the line's right shift. When you reach the maximum, go to a zero shift t and then start increasing the right shift again. To make the line seem to move left, first go to the maximum right shift and then gradually reduce the right shift. When you reach zero, go back to the maximum right shift and then start decreasing again. Remember, this works only for certain patterns, such as perhaps a checkerboard. You can also set up a group of display lines so that they can be shifted up vertically by an amount you specify, but the amount is not large. The maximum shift is one less than the number of screen lines in the display line. For example, mode 1 uses 8 screen lines per display line; thus the maximum shift for this mode is 7. If you set the vertical shift to 0, only the top screen line of the bottom display line will be visible and the other lines will be in an unshifted position. If you set the vertical shift at 1, all of the lines of the group will be shifted up by one screen line. The top screen line of the first (top) scroll display line will disappear and the top two screen lines of the bottom scroll line will become visible. If you set the vertical shift at 7, the group will be shifted up by seven screen lines. The top seven screen lines of the first scroll display line will disappear, and all of the scroll bottom line will be visible. You can sometimes use the vertical shift to make certain patterns seem to move up or down. To set up a group of display lines for limited horizontal scrolling, enter the graphics mode number, a space, an H, and RETURN. For example, when the program asks for the mode number for a given display You could type 1, a space, an H, and RETURN. When it asks how many lines you could type 6. This sets up six mode 1 display lines. If you use the SCROLL@ command (see below) to set a right shift of 1, all six of these lines will be shifted -10- right by one, as will any other display lines set up for horizontal shifts. To set up a group of display lines for limited vertical scrolling, enter the graphics mode number, a space, a V, and RETURN. When asked for the number of display lines, give the number of lines you want to be visible. Then specify one more line of the mode, but this time dont include the V. Only the top screen line of this last line will be visible. For example, suppose you want six mode 1 lines in the display and you want to be able to shift them vertically. When asked which graphics mode, type 1, a space, a V, and RETURN. When asked the number of lines, type 6. When asked again for the mode, type 1 and RETURN and then type I for the number of lines. You can set up a group of lines so that they can be shifted both horizontally and vertically. When asked which graphics mode, type the mode, a space, HV, and RETURN. Special note: In a scroll window, part of the top and/or bottom display lines are not visible. If you are in a text mode and you move the cursor to one of these lines, it might not be visible. Either move the cursor off this line or use the S command to change the amount you have scrolled. SCROLL@ command The format is SCROLL@ integerexpression,integerexpression This command is used to scroll the display for both the full and limited scrolling modes. Before you can use this command you must append SCROLL.APP. This is one of the special subroutines and is on the disks which came with this manual. Like PUSING.APP, it will not be shown when you list the program it is appended to. In the limited scrolling mode, the first integerexpression gives the amount to shift the display right. Its maximum value is 15 and its minimum is 0. The second integerexpression gives the amount to shift the display up. For modes or 11 3,12, and 13 the maximum is 7. For modes 2 and 3 it is 16. For modes 4 and 5 it is 3. For modes 6 and 7 it is 1. For all other modes limited vertical scrolling is not possible. For the full scrolling mode, the first integerexpression gives the amount to shift the display left. The second integerexpression gives the amount to shift the display up. The maximums depend on the number of scroll lines and the number of bytes per line. If you go to the help list (press H while working on the main display), the current and maximum values for horizontal and vertical scrolling are listed in the lower right corner. SPLOT@ command The format is SPLOT@ integerexpression,integerexpression SPLOT@ is used to PLOT data to any point in the scroll data area. CPLOT@ and CPRINT@ can be used only to PLOT data to the part of the scroll data which is being displayed (i.e., in the window). The first integerexpression gives the horizontal position, and the second integerexpression gives the -11- scroll line number for the point to be plotted. As with the PLOT command, you must give a COLOR command before using SPLOT@. Note that the top scroll line is line zero, not line one. The maximum value of the second integerexpression is the number of scroll lines minus one. The maximum value of the first integerexpression is the number of bytes per line times the number of data points per byte minus 1. Modes 0, 1, 2, 12, and 13 have one data point (character) per byte. Modes 9,10, and 11 have two data points per byte. Modes 3, 5, 7, and 15 have four per byte. Modes 4, 6, 8, and 14 have eight per byte. The DLIST command will list the maximum values for the two integerexpressions. Before you can use SPLOT@ you must append CPLOT.APP. Like PUSING.APP, this is a special subroutine and will not appear when you list your program. See Appendix B if you want to use SPLOT@ to PLOT character data (modes 0,1,2,12, and 13). 7. Designing an alternate character set While in the screen design option, you can type A to create or modify an alternate character set. The program switches from the screen you are designing to a special display. The top part of this display lists some of the commands you can use. On the left side near mid-screen is a list of the ATARI characters. At the bottom will be displayed any alternate characters you have designed. Initially, all the alternate characters are blank, except for the second one, which is a uniformly colored rectangle. This character serves as a cursor. You can modify it, but the first and second characters should never be identical, or you might have problems seeing the cursor. On the right side of the screen, near the middle, is an 8x8 grid which is an enlarged representation of a character. Each character in both the ATARI and alternate character sets has 64 points, each of which can be on or off. To design a character, move the cursor into the 8x8 grid, using the cursor keys or a joystick plugged in port 1. Note that you don't need to hold the control key down to use the cursor keys. To turn on a point in the alternate character you are designing, move the cursor to the point in the 8x8 box and press the > key or the joystick trigger.To turn off a point, move the cursor to the point and then press the < key or the joystick trigger. Note that pressing the joystick trigger just reverses the point, turning it on if it was off, and vice versa. then you have finished designing an alternate character, move the cursor to the location where you want to save it, and press the space bar or the joystick trigger. If you want to modify a character you have already saved, move the cursor to the characters location in the alternate character set and press RETURN. This will display the character in the 8x8 grid. Now you can move the cursor into the grid and make the changes. When you are finished, move the cursor to the location in the alternate character set where you want to save the character. Then press the space bar or the joystick trigger. If you want to erase all the points in the 8x8 grid, press E. In many cases you will want to put some of the ATARI characters into your alternate character set. To do this, move the cursor to the ATARI character and press RETURN or the joystick trigger. This will place the character in the 8x8 grid. Then move the cursor to the alternate character set location where you want to save the character and press the space bar or the joystick trigger to save the character. -12- There is another way to save an ATARI character to the alternate set. First, place the cursor on the ATARI character and press T (stands for transfer). The character will be saved directly to the alternate set. If it was the fourth ATARI character, it will also be the fourth character in the alternate set. The T command is particularly useful if you want to transfer several ATARI characters. For example, suppose you want to put the numbers 0 to 9 into your alternate set. Place the cursor on the ATARI zero and press T ten times. Each time you press T, a character will be transferred and the cursor will move to the next ATARI character. Depending on the mode, the alternate characters can take on different colors or be inverted (the 'on' points will be shown off and the 'off' points will be on). To see the available colors or the inverted mode, press C. Pressing C again will either return the alternate set from the inverted mode, or change it to another color. Pressing C four times will cycle the alternate set through all possible colors. In text modes 1 and 2 there are 64 possible characters. Text modes 0,12, and 13 have 128 characters. The storage space for the last 32 of these 128 characters, however, conflicts with the space used for missiles. So if you use the last 32 characters, you cannot use the four missiles. When you finish designing the alternate set, press D (stands for done), and you will return to the screen display you are designing. Later, if you want to modify the alternate set, type A and all the characters you designed will be there. Make your changes and type D again. Special information for modes 12 and 13 Modes 12 and 13 are somewhat different from modes 0, l, and 2. As you know, mode 0 characters are eight points wide. Mode 12 and 13 characters are only four points wide; but because each point is twice as wide as in mode 0, the characters are the same width. Moreover, mode 12 characters are the same height as mode 0, while mode 13 characters are twice as high. For mode 1 and 2 characters, all the 'on' points have the same color and the 'off' points another color; thus for a given character on the screen, only two colors are possible. In modes 12 and 13, however, a character can be composed of one to four colors. This is because each point is made up of two positions in the 8x8 grid. The color of a point is determined by what is in both positions. If both are off, the color is specified by color register 4. If the first is off and the second on, the color is specified by color register 0. If the first is on and the second off, the color is specified by color register 1. If both positions are on, the color is specified by color register 2. Consider the following row of a character in mode 12 or 13. X stands for 'on' and 0 for 'off': X0XX000X. The first point has 'on-off' and has the color of color register 1 . The second point has 'on-on' and the color of color register 2. The third point has 'off-off' and the color of color register 4. The fourth point has 'off-on' and the color of color register 0. Special note: You have one more option in working with modes 12 and 13. If you add 128 to the number in the COLOR command, you will get the same character, but any point with 'on-on' will use color register 3 instead of register 2. -13- Appendix A Graphics Modes Mode 0 Text mode with 24 lines 40 characters per line Main screen area uses one color with two brightness levels Border color set by color register 4 Background color set by color register 2 Character color set by color register 2, character brightness set by color register 1 Mode 1 Text mode with 24 lines 20 characters per line Each character is twice as wide as mode 0 character Border and background color set by color register 4 Color set by color register 0, 1, 2, or 3 Mode 2 Same as mode 1, except 12 lines and the characters are twice as high as mode 1 Mode 3 Four-color graphics mode with 24 lines 40 points per line The points are like small rectangular boxes Border and background color set by color register 4 A PLOT command using COLOR 1% plots a color set by color register 0 (Note: not by color register 1) COLOR 2% corresponds by color register 1 COLOR 3% corresponds by color register 2 Mode 4 Two-color graphics mode with 48 lines 80 points per line Border and background color set by color register 4 A PLOT command using COLOR 1% plots a color determined by color register 0 (Note: not by color register 1) Mode 5 Same as mode 3, except 48 lines, 80 points per line Mode 6 Same as mode 4, except 96 lines, 160 points per line Mode 7 Same as mode 3, except 96 lines, 160 points per line Mode 8 Graphics mode with 192 lines 320 points per line Main screen has one color with two brightness levels Border color set by color register 4 Background color set by color register 2 A PLOT command with COLOR 1% plots a color determined by color register 2 with brightness determined by color register 1 Mode 9 Graphics mode with 192 lines 80 points per line One color with 16 brightness levels Border color and brightness set by color register 4 Color of points plotted in main screen area set by color register 4 -14- Brightness of plotted points set by the number in COLOR command (min 0 to max 15) Mode 10 Graphics mode with 192 lines, 80 points per line Border and background color set by player missile register 0 The table shows how the color registers are associated with the number in the COLOR command COLOR 1% Player missile color register 1 COLOR 2% Player missile color register 2 COLOR 3% Player missile color register 3 COLOR 4% Main screen color register 0 COLOR 5% Main screen color register 1 COLOR 6% Main screen color register 2 COLOR 7% Main screen color register 3 COLOR 8% Main screen color register 4 Mode 11 Graphics mode with 192 lines, 80 points per line 16-colors with all colors having the same brightness Border and background color set by color register 4 Brightness of plotted display points set by color register 4 Color of plotted display points set by number in COLOR command (see Table 13-2 in Advan BASIC Manual) Mode 12 Special text mode with 24 lines, 40 characters per line Almost always used with an alternate character set (see Section 6) Mode 13 Same as mode 12, except 12 lines, and characters twice as high as mode 12 Mode 14 Same as mode 4, except 192 lines, 160 points per line Mode 15 Same as mode 3, except 192 lines, 160 points per line Appendix B Using PLOT, CPLOT@, and SPLOT@ for Text Data Normally you would use PRINT or CPRINT@ to display text data; however, PLOT, CPLOT@, and SPLOT@ can also be used. Before using these PLOT commands you need to use the COLOR command to specify the character to be plotted. For the PLOT command use the ASCII code (see Appendix A of Advan BASIC manual); for CPLOT@ and SPLOT@ use the character location in the character set. When working with an alternate character set you normally know the character number rather than the ASCII code. In this case CPLOT@ and SPLOT@ are very easy to use. For instance, if you want to display the third alternate character use COLOR 2% (remember the first alternate character is numbered 0) and then use the CPLOT@ or SPLOT@ command. The following tables show how to use CPLOT@ with ASCII code and PLOT with character location number. - 15- CPLOT@ and SPLOT@--Modes 0,1 2,13 ASCII code Number in COLOR command 0-31 ASCII code+64 32-95 ASCII code-32 96-127 ASCII code CPLOT@ ASCII and SPLOT@--Modes 1 and 2 ASCII code Color reg. # used No. in COLOR for character command 32-63 0 ASCII code 1 ASCII code-32 2 ASCII code+128 3 ASCII code+96 64-95 0 ASCII code+32 1 ASCII code+64 2 ASCII code+160 3 ASCII code+192 PLOT--Modes 0,12,13 Character Number No. in COLOR command 0 to 31 character no. +64 32 to 95 character no. -32 96 to 127 character number PLOT--Modes 1 and 2 Character No. Color Register No. in COLOR command 0 to 31 0 character no +32 1 character no 2 character no +160 3 character no +128 32 to 63 0 character no +64 1 character no +96 2 character no +192 3 character no +224 Note that to show a mode 0 character in inverse, add 128 to the number in the COLOR command. To use color register 3 instead of 2 for a mode 12 or 13 character, add 128 to the number in the COLOR command (see special information on modes 12 and 13). -16-