******************************************************************
*Document type: Library reference
*Readme file name: manspr.txt
*Library prefix: spr
*Library name: Sprite
*Version: 1.21
*Creator: H.E
*Created: 05-30-1995
*Comments: None
******************************************************************

[Handling Problems Created by SSHOFF (11/95)]

SSHOFF was used in the internal function SPR_InitSlaveSH of the 
function SPR_2Initial. Since the use of SSHOFF can cause problems, 
the following steps were taken:

a) Removed code in SPR_InitSlaveSH that executed SSHOFF.
b) Added SPR_2Initial2 (function does not contain the 
SPR_InitSlaveSH function call) from the 5-2-2.SPR_2Initial 
function.

For the reasons above, the application must use SPR_2Initial and 
SPR_2Initial2 based on the status of the slave CPU in the 
following manner:

a) SPR_2Initial: Use when the slave CPU is halted.
b) SPR_2Initial2: Use when the slave CPU is running.

As a result, the application must monitor the operation of the 
slave CPU.

[Ver. 1.20 Bug Fix]

The slave control variable was identical to the slave control 
variable found in version 1.10 of the Cinepak library. This naming 
problem created a link error which was corrected with the 
following changes in the variable names:

- Old variable names:

	SlaveCommand, SlaveState, SlaveParam

- New variable names:

	SPR_SlaveCommand, SPR_SlaveState, SPR_SlaveParam

1. Additional Information

1.1. Basic Sprite Display Processing Library

None

1.2. Expanded Sprite Display Processing Library

* For optimization purposes, the sprite command and Gouraud table 
work area is placed in work RAM according to the area size 
specified with the work area definition macro.

* #define USE_DMA_LEVEL n becomes unnecessary and the command and
character data transfers to VRAM is DMA'd unconditionally.

1.3 Sprite 3D Display Library

* Over 4X Speed Increase Compared With Version 1.02

Note, however, that the increase in performance is applicable when 
the number of clusters is small and the number of polygons per 
object is large.

* Optimized Clipping

The clipping scheme was modified for optimization purposes.  As a 
result, the meaning of the clipLevel value in the clip mode set 
function SPR_3SetClipLevel(Uint16 clipLevel, Fixed32 clipZmin, 
Fixed32 clipZmax) has changed to the following:

clipLevel: clip level number

    0 = No clipping.

    1 = Clipping on a perspective Z coordinate boundary.
        Polygons with center point Z values that are out of the
        specified Z range are not drawn.

    2 and above = 
        Clipping is done based on a perspective pyramid
        where the entire frame buffer is considered as the screen
        area. A polygon that has any point outside this pyramid is
        not drawn.

* Change in Object Table Handling

The object table's surface center point coordinate table 
specification was eliminated. This is area no longer used. 
Specification of this area is ignored.

* Change in Optimization Method

The optimization method has changed so that the #define 
SPR_3USE_DOUBLE_BUF specified before the 3D work area definition 
macro has been eliminated. This define will be ignored even if it 
is specified.

1.4. Changing the Sprite Execution Environment

The slave SH2 and DSP are used to speed up 3D and 2D processing. 
However, there are cases in any given application where it is 
undesirable for those system resources to be used by the library. 
If this is the case, the use of these system resources can be 
enabled or disabled by either defining or commenting out the 
#define statements (shown below) at the beginning of sega_spr.h 
and recompiling the sprite and/or scroll libraries.

/*------------------------------------------
* Select 3D & Sprite Execution Environment
*----------------------------------------*/
#define  SPR_SYNC_VB_OUT
#define  USE_SLAVE
#define  USE_DSP
#define  USE_INBETWEEN_OBJECT
#define  USE_DEBUG_INFO

Each #define statement is described as follows:

(1) SPR_SYNC_VB_OUT

When SPR_SYNC_VB_OUT is defined, the wait for the 
SCL_DisplayFrame() sprite frame buffer switch exceeds the V blank 
period, thereby increasing the processing time by 1 field. The 
scroll register write can be done during the V blank period 
without waiting for SCL_DisplayFrame(). Commenting out this define 
allows sync between the scroll screens and sprites during the V 
blank.

(2) USE_SLAVE

When this is defined, the slave SH2 is used in parallel along with 
the main SH2. Commenting this define out prevents the slave SH 
from being used.

(3) USE_DSP

When USE_DSP is defined, the coordinate transform matrix 
calculations are done with the DSP in parallel the SH side. 
Commenting the define out disables this feature.

(4) USE_INBETWEEN_OBJECT

With this definition, linked object polygons can be processed. If 
there are no linked object polygons, commenting this out provides 
minor performance improvements in the 3D library.

(5) USE_DEBUG_INFO

When this is defined, the number of polygons calculated and drawn 
using SPR_3DrawModel() are set in the variables below. Since these 
values are cumulative, make sure to clear them from the 
application side as necessary.

extern int dbgComputePol; /* number of polygons calculated */
extern int dbgDrawPol;    /* number of polygons drawn */

These variables are already defined in sega_spr.h.

2. Planned Function/Performance Improvements

None

***************************end of file***************************
