NNSG2dOamExEntryFunctions

Structure Definitions

typedef struct NNSG2dOamExEntryFunctions
{
NNSG2dGetOamCpacityFuncPtr        getOamCapacity;
NNSG2dGetOamCpacityFuncPtr        getAffineCapacity;
NNSG2dEntryNewOamFuncPtr          entryNewOam;
NNSG2dEntryNewOamAffineFuncPtr    entryNewAffine;
    
}NNSG2dOamExEntryFunctions;

typedef u16     (*NNSG2dGetOamCpacityFuncPtr)();
typedef u16     (*NNSG2dGetOamAffineCpacityFuncPtr)();
typedef BOOL    (*NNSG2dEntryNewOamFuncPtr)( const GXOamAttr* pOam, u16 index );
typedef u16     (*NNSG2dEntryNewOamAffineFuncPtr)( const MtxFx22* mtx, u16 index );

NNSG2dOamExEntryFunctions.getOamCapacity

Pointer to function that can use the expanded OAM manager and gets the number of OAM attributes.
This function returns the number of OAM attributes. What this returned value represents is the number of OAM attributes that can be loaded in hardware OAM.
Note that this differs from the number of OAM chunks (numPooledOam) that is given as a parameter when the expanded OAM manager is initialized.

If the registered number of chunks is greater than the value returned by getOamCapacity, the expanded OAM manager puts the registered OBJ across multiple frames and displays by time-sharing.

NNSG2dOamExEntryFunctions.getAffineCapacity

Pointer to function that can use the expanded OAM manager and gets the number of OAM affine parameters. If the expanded OAM manager does not manage affine parameters, you can set NULL.
If the registered number of affine parameters is greater than the value returned by getAffineCapacity, the expanded OAM manager loads the registered affine parameters using time-sharing across multiple frames and shows the OBJ that are using the affine parameters.

NNSG2dOamExEntryFunctions.entryNewOam

Pointer to the function that registers OAM attributes. As arguments, it takes the OAM attribute and the OAM attribute number. The OAM attribute No. index is like the number of times that entryNewOam gets called. If the OAM manager supplied with G2d is used for implementing entryNewOam, the index parameter does not get used.

Example of implementation using OAM manager

static u16 OamMgrExCBEntryOamAffine_( const MtxFx22* pMtx, u16 index )
{
#pragma unused( index )
return NNS_G2dEntryOamManagerAffine( &myOamMgr_, pMtx );
}

Example of implementation where OAM manager is not used

static BOOL CallBackEntryNewOam(const GXOamAttr* pOam, u16 index)
{
const u32 szByte = sizeof( GXOamAttr );

DC_FlushRange( (void*)pOam, szByte );
GX_LoadOAM( pOam, index * szByte, szByte );

return TRUE;
}

NNSG2dOamExEntryFunctions.entryNewAffine

Pointer to the function that registers OAM affine parameters. It takes the matrix storing the affine parameter and the affine parameter number as arguments. If the expanded OAM manager does not manage affine parameters, you can set NULL. As with entryNewOam, the affine parameter number index is like the number of times that entryNewAffine gets called.

Example of implementation using OAM manager

static u16 OamMgrExCBEntryOamAffine_( const MtxFx22* pMtx, u16 index )
{
#pragma unused( index )
return NNS_G2dEntryOamManagerAffine( &myOamMgr_, pMtx );
}

See Also

NNS_G2dSetOamManExEntryFunctions, NNS_G2dGetOamManExInstance

Revision History

06/06/2005 Initial version.