This graphic utility will allow you to print any sprite created with the help of EASYsprite MAKER.
Up to 255 sprites of different size and shape are allowed. The program uses a simple PRINT #3 command (or LPRINT).
A typical command would be…
PRINT #3;CHR$ 16;CHR$ 4;AT 10,12;CHR$ 8;
This would print sprite n# 8 at position 10 (row), 12 (column) in ink green (4).
The MC code is relocatable and is about 256 bytes long and compatible with both SPECTRUM 48k and TS2068.
How to create and edit a sprite is explained in the EASYsprite MAKER instructions.
To use Sprite Printer in your program you must first load Sprite Printer (the MC program) and enter the address desired (the highest address possible without overwritting the UGD is 65112, the maximum possible address overwritting the UDG is 65280 [65536-256]) once loaded the program will display many important pokes and addresses…
OPEN CHANNEL #3…….This USR call is used to open the sprite printer utility.
CLOSE CHANNEL #3……This USR call is used to close the sprite utility and return to the regular TS2040 printer. If you use a print driver for a large size printer, RANDOMIZE USR x (address to activate the print driver), it will have the same effect.
SPRITE FILE………..This is the address where you must poke the sprite file address. (more on that later)
You can define the printing area by poking the maximum or minimum possible positions, these addresses are shown with the labels…
MIN LEFT COLUMN…….Minimum position to the left (0 to 31)
MAX RIGHT COLUMN+1….Maximum position to the right +1 (1 to 32)
TOP……………….Highest possible position (0 to 21)
BOTTOM+1…………..Lowest possible position +1 (1 to 22)
POKING THE SPRITE FILE ADDRESS…
Assuming you load the SPRITE PRINTER at 65112 (usual address) you will be given 65236 for SPRITE FILE, that is the address where you must poke the address of the sprite file. Supposing your sprite file is at address 60000…
LET A=60000 (sprite file address)
LET B=65236 (where to poke the sprite file address)
POKE B,A-256*INT (A/256)
POKE B+1,INT (A/256)
It’s that simple.
TYPICAL EXAMPLE…
Assuming the SPRITE PRINTER is at 65112
10 RANDOMIZE USR 65112 (open sprite printer)
20 LET A=60000 (sprite file address)
30 LET B=65236 (explained in last par.)
40 POKE B,A-256*INT (A/256): POKE B+1,INT (A/256)
50 PRINT #3;AT 10,10;CHR$ 1;
60 STOP
I won’t explain this small program you should be able to understand it…
PRINTING A SPRITE…
You already know that to print a sprite you (PRINT #3;at x,y;CHR$ sprite), but to print a sprite in color, inverse, bright, etc. because the ROM will not accept PRINT #3;PAPER 5;AT x,y.., you must print the character used for PAPER (which according to the user’s manual page 240 is 17).
So to print a sprite in paper 4 (green) you must PRINT #3;CHR$ 17;CHR$ 4;AT x,y; CHR$ sprite. It is the same for INK, BRIGHT, FLASH, OVER, and INVERSE.
So PRINT #3;CHR$ 20;CHR$ 1;CHR$ 16;CHR$ 1;AT 12,20;CHR$ 2; would print sprite n#2 at 12,20 in INK blue (chr$ 16;chr$ 1) in INVERSE 1 (chr$ 20;chr$ 1).
Note that this will do the same as the last example…
INVERSE 1: INK 1: PRINT #3;AT 12,20;CHR$ 2;
MULTIPLE SPRITE PRINTING…
PRINT #3;AT 10,10;CHR$ 1;#3;AT 20,20;CHR$ 2;#3;…etc…
This is the only way to print multiple sprite with one (1) print statement (NOTE THE #3 BETWEEN EACH SPRITE TO PRINT!)
IMPORTANT NOTICE…
If you wish to print a sprite in INK x, or FLASH x etc, you must ALWAYS put all “CHR$” before the “AT”, except for the sprite CHR$.
If you wish to print 3 sprites red in one statement…
PRINT #3;CHR$ 16;CHR$ 2;AT 10,10;CHR$ 1;#3;CHR$ 16;CHR$ 12;AT 12,12;CHR$ 2;#3;CHR$ 16;CHR$ 2;AT 20,20;CHR$ 3;
OR
INK 2: PRINT #3;AT 10,10;CHR$ 1;#3;AT 12,12;CH$ 2;#3;AT 20,20;CHR$ 3;
Note that in the first example you must repeat CHR$ 16;CHR$ 2; each time if the permanent color is not RED (2), in the second example INK 2: makes the permanent color RED and displays all 3 sprites in RED.
To have some more ideas how to use the SPRITE PRINTER load the SPRITE DEMO program BREAK IT, and look around in the basic, it may give you some more ideas how to use it.
Loading name SPRITE
Program type Graphic utility
Written by Eric Boisvert