* Rot2D.s - rotate points
********************************************************
* ** NAME: Rot2D - rotate an (x,y) point in 2D around angle 
*                  all calcluations are signed 1.7 fixed point
*
* Category:
*
* Purpose:
*
* Entry: (A[B],C[B]) is (x,y) in 1.7 signed fixed point
*        (B[B],D[B]) is (sin,cos)
*
* Exit:  (A[14-15],C[14-15]) is new (x,y) in 1.7 signed fixed point
*
* Alters: A,B,C,D  except [B] fields (original values unchanged)
*
* Calls: MulAdd
*
* Stack Levels: 1
*
* Notes: todo - is one value pos, loop on it - faster to mult in loops by a lot!
*             - at least mask with 0FF00 instead of FFF00 for negatives <- is correct?
*						
*  Date     Prog	 Modification
* ------  --------  --------------
*
********************************************************
Rot2D
	ACEX		B			* prepare for x' = x cos + y sin
	GOSUB		MulAdd		* do it to C[14,15]
	ACEX		W			* now A[14,15] = x' and back to original state
	A=-A		B			* prepare for y' = -x sin + y cos
	GOSUB		MulAdd		* do it
	A=-A		B			* restore A = x
	RTN

* end - Rot2D.s