|★ APPLICATIONS ★ PROGRAMMATION ★ SPRITES|POPULAR COMPUTING WEEKLY) ★|
|Sprites (Popular Computing Weekly)||Applications Programmation|
These two programs for the Amstrad are a sprite routine and designer.
The first sets up three RSXs, |PRINT, |TYPE and |CHECK. |PRINT takes five parameters - |PRINT, xsize, ysize, x,y,address - where xsize is the width of the sprite in bytes, ysize is the height of the sprite in pixels; x is the horizontal graphics co-ordinate of the top left-hand corner of the sprite; y is the vertical co-ord of the TLHC; address is the address at which the sprite data is held in memory.
|CHECK uses the same parameters as |PRINT but does not place anything on the screen. It checks whether a sprite on the screen has been printed over.
If it has, 1 is returned in location &90B3; if not, this is 0.
The same parameters should be used to check the sprite as those used to print it.
|TYPE is used to select the method of printing. If |TYPE,1 is used, the sprites over-write anything underneath them. |TYPE,2 causes the sprite data to be ORed with the screen data and |TYPE,3 causes it to be ANDed. |TYPE,3 is XOR mode and, using this option, placing a sprite over itself causes the original sprite to be erased with the background untouched.
To use the sprite designer, the Sprites program must be run first, as utilities provided by it are needed.
The cursor is controlled with the cursor arrow keys and a pixel is printed in the selected colour by pressing the space bar.
To change the pen, press P and then use the cursor keys to select the colour. Press return when finished.
To change the ink colour, press I and then use space to select; return finishes this command.
To save to memory, press S and give the inputs as requested.
To load from memory, press R again, replying with the correct inputs.
To save from memory to disc use Q. The length is the width in bytes times the height in pixels.
To load from disc to memory, press L. The screen can be cleared with C.
In mode 2, one byte gives eight pixels across; in mode 1 it gives four, and in mode 0 it gives two.
The sprites are stored in memory from &2000 to &9000. Remember to use the & sign when entering addresses.