Two new graphics commands for the CPC 464 by Brian Cadge The graphics potential of the CPC464 is very promising, as can be seen from some of the first software to become available. However, in Basic the user is restricted to using user designed characters. The disadvantages of these are their size and the fact that only two colours can be present in each cell. To get more colours we have to individually plot the points using Plot and Draw. This is clearly too slow for fast action games. Fortunately, it is quite simple to extend the Locomotive Basic (or any other language for that matter), using Resident System Extensions (RSX's). The program presented here gives you two new graphics commands. Firstly, here is an explanation of how to use the new commands from Basic. All RSX commands start with the | character (obtained using shift and @ together), and these commands are called Define and Place. Their syntax is: |DEFINE, image, width, height |PLACE, image, xpos, ypos Notice thai a comma appears straight after the command name and before the first parameter. This is essential, as is the I character; if either is missed out then you'll get a syntax error. The first parameter in both commands is image which is a number referring to the particular image you wish to address. The first image is numbered 0, the next 1 and so on. The more images you want the more memory you must reserve. As set up by the Basic loader you get space for two images, numbered 0 and 1. For every extra image you must lower Himem by 256 bytes. Width is the width of the image in screen bytes (not in characters or pixels), there are always 80 column bytes on the screen, and so in Mode 2 one character is one byte wide, in Mode J a character is two bytes wide, and in Mode 0 it is four bytes wide. Height is the height of the image in characters. The maximum size of an image is 7 x 4. This command assumes that the image to be stored is located in the top left of the screen- Therefore, you set up your character using Plot etc, and then use j define to get it off the screen. So in mode 1, to copy the equivalent of one character cell you would use: |DEFINE, 0, 2, 1. |