|★ APPLICATIONS ★ PROGRAMMATION ★ BUILD A MONSTER ★|
|Build a Monster|The Amstrad User)||Poke a Monster|The Amstrad User)|
This program was developed mainly because of the need to design new sprites for the "Roland on the Run" game which recently appeared in a number of parts in the English Amstrad Computer User, and to find out how the screen memory is used and addresses when using multicoloured sprites. As 'Roland'is in Mode 1, this program is also designed to build sprites in that Mode.
In Mode 1, one byte controls the colour of four pixels. Each pixel is controlled by two bits. Bits 7and 3 control the leftmost pixel; the next pixel across is controlled by bits 6 and 2; the next by bi ts 5 and 1; and finally the rightmost pixel by bits 4 and 0. For example, take the binary number 00000001 and look at bits 4 and 0 as a pair. Putting them side by side (01) the two bits can no w be read as a normal binary number. In this case the answer is 1 which represents INK 1 for the rightmost pixel. If the binary number was 00010000, then bits 4 and 0 would read 10, which, when read as abinary number gives 2, making the rightmost pixel INK 2. The monsters in 'Roland'use 64 bytes - this program builds sprites of the same size for use in the 'Roland'game.
Inside the Program
When a pen number is keyed in, it is given a predetermined decimal number and will produce the correct binary number for the bit. When the 'P' (Place in memory) is pressed a FOR...NEXT loop is set up producing 256 bits, which in turn are combined in fours to produce 64 bytes. The bytes are converted to a hex number and stored as the data.
Running the Program
On running the program, you will notice a flashing cursor in the top left hand comer of a large square. The square is the working area in which the sprite is built. The cursor is moved about the screen via the cursor keys. There is no need to follow a pattern - just move the cursor around and input the pen number you wish a pixel to be at a chosen point.(0=Black, l=White, 2=Red and 3=Blue). With the background already black there is no need to fill it. Build your sprite with the other three colours using 0 (black) to wipe out any errors. At any time during the building of your sprite 'P can be pressed. This will pole the information into screen memory producing an actual size sprite in the small square. The cursor then returns to the work area allowing alterations. Continue building your sprite and when happy with it, press'S' which will save the data to disc or tape. If you find that you are not happy with the sprite, then press 'L' and the data will be loaded allowing further alterations. Pressing the control and V keys sends the hex data to a printer.
The hex data produced by this program (representing your sprite) can now be placed into the unassembled listing of 'Roland', or it can be poked in after the Roland program is running. The size of the sprite is two characters high by two characters wide. We suggest that you make a drawing of your sprite in a 16 x 16 grid prior to running the program -it will make the building process easier.