**************************************
* FAST EXTENTION by Baz Molloy       *
* Copyright January 1996 (C)         *
**************************************

* LEGAL STUFF *

This extention is PD and can copied freely as long as all documentation is included and none of the files are altered in anyway. 

* ABOUT IT *

I wrote this extension because I needed faster commands than the ones that STOS provided, this is just the first beta version and all the commands included work to my knowledge, but i have only been able to test it on my 1Mbyte STFM, so I cannot be sure if it will work on an STE or FALCON. This extension is still being developed and a lot more commands are being developed, but I can't give a date when they'll be finished.

* INSTALLING IT *

To install the extension just copy the file called FAST.EXG to your STOS directory, if you have the compiler then copy the file called FAST.ECG to your compiler directory. The extension files last letter can be changed if you already have an extension with the letter G.

* LIST OF COMMANDS *

************************************************************************************************

FAST WASH Scr

This is a very fast version of STOS's CLS, it will clear the screen in about half the time.
Scr is the screen you wish to clear. If you wish to clear reserved screens then you must give the address of the screen not just the number of it.
EG:
	10 FAST WASH START(5)	clears screen 5
	20 FAST WASH LOGIC	clears logic screen

************************************************************************************************

DEAD MOUSE

This command will hide the mouse pointer and deactivate the mouse tracking routine inside STOS, which speeds up programs which don't require the use of the mouse.
EG:

	10 DEAD MOUSE

************************************************************************************************

ALIVE MOUSE

This command will restore the mouse pointer and its tracking routine.
EG:
	10 ALIVE MOUSE

************************************************************************************************

FAST SINGLE SUM Num,Addsub,Addr,Low,Upp,Type

This command will add/subtract an amount from a multiple array of numbers.

Num is the size of the array, Addsub is the amount to add or subtract( to add use positive numbers, to subtract use negative numbers), Addr is the start address of the array you wish to add/subtract to, Low is the lower limit, Upp is the upper limit and Type is the type of check you want to perform on the values in the array after the add/subtract.

So instead of using EG:

	10 DIM A(1000)
	20 FOR B=1 TO 1000
	30 A(B)=A(B)+7
	40 NEXT

Use:

	10 DIM A(1000)
	20 FAST SINGLE SUM 1000,7,VARPTR(A(0)),0,60,0

The check types are: 

0=no check.
1=If value>upper limit then value=lower limit or If value<lower limit then value=upper limit.
2=If value>upper limit then value=upper limit or If value<lower limit then value=lower limit.

This command works with integer values ONLY. It will NOT work with floating point variables.

************************************************************************************************

FAST MULTIPLE SUM Num,Addr1,Addr2,Low,Upp,Type

This is similar to the FAST SINGLE SUM except that it will add/subtract the contents of one array to another instead of using just one value.
Num is the size of the array, Addr1 is the start address of the array holding the values you wish to add, Addr2 is the start address of the array holding the values you want to add to, Low is the lower limit, Upp is the upper limit and type is the type of check.
EG:
	10 DIM A(1000),B(1000)
	20 FOR C=1 TO 1000 : B(C)=RND(200) : NEXT
	30 FAST MULTIPLE SUM 1000,VARPTR(A(0)),VARPTR(B(0)),0,500,0
	
Check type is the same as FAST SINGLE SUM.

This command works with integer values ONLY. It will NOT work with floating point variables.

Both of the SUM commands I think will work with values from -2147483648 right up to 2147483647, I've tested them but can't always be sure.

************************************************************************************************

FAST PLOT LOW Scr,Num,Xaddr,Yaddr,Stataddr,Coladdr

This is a very fast plot command which will plot multiple number of points on the screen in low resolution in any colour at high speed.

Scr is the screen address to plot on, Num is the number of plots to do, Xaddr is the start address of the array holding the X-coords, Yaddr is the start address of the array holding the Y-coords, Stataddr is the start address of the array holding the status of the points to plot and Coladdr is the start address of the array holding the colour of each point to plot.

The status array determines if that particular point is to be plotted or not, 0=Don't plot, 1=Plot.
EG:
	10 DIM X(1000),Y(1000),STAT(1000),COL(1000)
	20 FOR A=1 TO 1000 : X(A)=RND(319) : Y(A)=RND(199) : STAT(A)=1 : COL(A)=RND(16) : NEXT
	30 FAST PLOT LOW LOGIC,1000,VARPTR(X(0)),VARPTR(Y(0)),VARPTR(STAT(0)),VARPTR(COL(0))

************************************************************************************************

FAST PLOT MED Scr,Num,Xaddr,Yaddr,Stataddr,Coladdr

This is very similar to FAST PLOT LOW except that it is for medium resolution and can use only 4 colours.
Parameters are the same as FAST PLOT LOW.
	 
************************************************************************************************

FAST PLOT HIGH Scr,Num,Xaddr,Yaddr,Stataddr,Coladdr

This is very similar to FAST PLOT MED except that it is for high resolution and can use only 2 colours.
Paramenters are the same as FAST PLOT MED.

All of the FASP PLOT commands are clipped, so will not draw a point if it is outside the screen boundaries, this stops a lot of computer crashes caused by points being plotted outside screen memory.

* END OF LIST *

I am still working on more commands right now as you read this and I suppose I'll eventually get around to finishing them.
If you find a problem when using this extension then if you could let me know I could fix it, also if you find a bug of some sort I would appreciate it if you could send all the details you can about it so I can fix it.

If you have any ideas for new commands then contact me at :
	
	Baz Molloy
	88 Grove Road
	Ansty
	Warwickshire
	CV7 9JE
	England

and remember that my assembly language is still limited so don't expect me to write a routine to play back samples at 30 Khz while animating large sprites.