| ★ APPLICATIONS ★ CREATION GRAPHIQUE ★ RSX DEFINE/PLACE (POPULAR COMPUTING WEEKLY) ★ |
A new image![]() | Everything in its place![]() |
Part two of Brian Cadge's graphics command program for the CPC 464 This week we finish off with the rest of the assembler listing and some more detail about the workings of the program itself. The | Place command simply replaces a previously stored image at the character position given. The coordinates, xpos and xpos are as used by the Locate command, the program automatically takes into account the current mode. These commands are fairly idiot proof — you cannot display an image which has not yet been defined. However, take care to keep Himem right, as defining more images than you have reserved space for could cause Basic to be corrupted. The advantages of using these new commands over using normal UDG characters is that they can be different shapes and can contain as many colours as the mode allows. They also operate a lot faster than using Print, which is useful in fast games. Moving on to the workings of the program. The program begins by defining the new commands, done by setting up the registers and making a call to the Firmware at $BCD1 which Logs an RSX onto the operating system. When a command is encountered, control is passed to the routine via the jump table. The A register then contains the number of parameters passed in the command, and IX points to the last parameter, IX+2 points to the last but one and so on. Two other Rom routines are used. The first is at $BC1A which returns the screen Ram address of the character position given in HL (H=column, L=row), top left of the screen at position (0,0). This is needed as hardware scrolling used on the Amstrad means that the screen doesn't always start in the same place. The other routine used is at $BC26, which returns the address in HL of the screen byte which is displayed below the current one addressed by HL. This is needed for the same reason as above. To get the program going on your machine, type in the Basic loader program and Save, then Run it. If all goes well you should get Ready, and you can now New the program and load or type in a program to use the new commands. It is interesting to note that there is one built in RSX command—try typing |BASIC. PCW |
| ![]() |
|