-----------------------------------------------------------------------------
                     SpriteClip v3.0 by CrASH_Man                   04/25/99
-----------------------------------------------------------------------------

SpriteClip v3 AND/XOR version
- Insanely optimized sprite AND/XOR routine w/ new algorithm (+200 spr/sec)

Only the AND/XOR routine has been updated using the new algorithm.


Please feel free to use SpriteClip in your programs, but remember to give
me credit for my work.


-----------------------------------------------------------------------------
 To Contact CrASH_Man
-----------------------------------------------------------------------------
       IRC: EFNet/CrASH_Man
       ICQ: 5942763
  homepage: http://lfx.org/crashware
     email: crashman@crashware.lfx.org

-----------------------------------------------------------------------------
 Files in Archive:
-----------------------------------------------------------------------------
 SPR30   .TXT Documentation

 SPR30AX .INC Sprite routine include file for AND/XOR routine v3.0
 SPR21X  .INC Sprite routine include file for XOR only routine v2.1

 SPRTEST .ASM Example for using sprites for AND/XOR routine
 SPRTEST .82P Compiled format (ready to upload to calculator)

 SPRTESTX.ASM Example for using sprites for XOR only routine
 SPRTESTX.82P Compiled format (ready to upload to calculator)

 SPR21AX .INC Sprite routine include file for AND/XOR routine v2.1  (old)
 SPR20   .INC Sprite routine include file for AND/XOR routine v2.0  (old)
 SPR13   .H   Sprite routine include file for AND/XOR routine v1.3  (old)
 SPR12   .H   Sprite routine include file for AND/XOR routine v1.2  (old)
 SPR11   .H   Sprite routine include file for AND/XOR routine v1.1  (old)
 SPR10   .H   Sprite routine include file for AND/XOR routine v1.0  (old)

 Old files are included for people who want to check them out.

-----------------------------------------------------------------------------
 Usage:
-----------------------------------------------------------------------------
 Both SPR30AX and SPR21X should be able to be used in the same program.

".INCLUDE SPR30AX.INC" is needed to use the AND/XOR routines.
".INCLUDE SPR21X.INC" is needed to use the XOR only routines.

 To use the AND/XOR routine:
-----------------------------------------------------------------------------
CALL PutSprClp        Puts a sprite pointed by HL at (B, C) in GRAPH_MEM
CALL SetSpriteHeight  Sets the height of sprites used by PutSprClp to A

[DefaultSpriteHeight] needed for compiling, as an integer definition.

#DEFINE NO_MOD_AX     DefaultSpriteHeight can't be changed. (saves 16 bytes)

 To use the XOR only routine:
-----------------------------------------------------------------------------
CALL PutSprClpXOR      Puts a sprite pointed by HL at (B, C) in GRAPH_MEM
CALL SetHeightXOR      Sets the height of sprites used by PutSprClpXOR to A

[DefaultXSpriteHeight] needed for compiling, as an integer definition.

#DEFINE NO_MOD_X      DefaultXSpriteHeight can't be changed. (saves 13 bytes)

-----------------------------------------------------------------------------
 The AND/XOR mask
-----------------------------------------------------------------------------
   The AND mask is first put on the screen, then the XOR is put on the
 screen.  The result turns out so that:

   00 = White           01 = Black
   10 = Unchanged       11 = Inverted

 For example:
 ------------
  AND mask     +  XOR mask        Result

 .DB %11100111   .DB 00011000  =  ...XX...      O is white
 .DB %11000011   .DB 00100100  =  ..XOOX..      X is black
 .DB %10000001   .DB 01000010  =  .XOOOOX.      . is transparent
 .DB %00011000   .DB 10011001  =  XOO^^OOX      ^ is inverted
 .DB %00011000   .DB 10011001  =  XOO^^OOX
 .DB %10000001   .DB 01000010  =  .XOOOOX.
 .DB %11000011   .DB 00100100  =  ..XOOX..
 .DB %11100111   .DB 00011000  =  ...XX...

-----------------------------------------------------------------------------
 Speed Improvement:
-----------------------------------------------------------------------------
 All times are for completely drawn sprites (non-clipped) with height = 8.

 MaxClk  is the clock count for sprites unaligned by 7 pixels.

 AvgClk  is the average clock count for a drawn sprite.

 Spr/sec is based on times assuming that you only draw sprites.

     Version     MaxClk  AvgClk   Spr/sec
  -------------  ------  ------  ---------
  v 1.3-AND/XOR   4374    3005      1950

  v 2.0-AND/XOR   2410    2410      2450

  v 2.1-AND/XOR   2381    2381      2500
  v 2.1-XOR       1819    1483      4000 (was incorrectly calculated in v2.1)

  v 3.0-AND/XOR   2199    2199      2700

-----------------------------------------------------------------------------
 Revision History:
-----------------------------------------------------------------------------
 v0.9 10/04/97 - Complete clipping except for minor bug in top-left corner.
 v1.0 10/05/97 - Complete clipping anywhere...  Kewl!!
 v1.1 10/09/97 - Clipping w/OR XOR Masks, variable sprite height
 v1.2 02/14/98 - Clipping w/AND XOR Masks, no more EX or EXX used
 v1.3 03/25/99 - Optimizations
 ---
 v2.0 04/02/99 - Super-optimized: faster, unrolled, self-modifying code
                 No difference in speed for aligned/non-aligned sprites.
                 No longer saves registers. (for speed)
 v2.1 04/17/99 - A couple more slight optimizations to save some more clocks
                 Added an XOR only version
                 Allows saving space by not being able to modify the sprite
                    height by a #DEFINE.
 ---
 v3.0 04/25/99 - New, faster shifting algorithm
