guS2DEmuBgRect1Cyc

guS2DEmuBgRect1Cyc Function

Function

guS2DEmuBgRect1Cyc

Emulates gSPBgRect1Cyc

Syntax

#include <ultra64.h>        /* gs2dex.h */
void guS2DEmuBgRect1Cyc(Gfx **gdl, uObjBg *bg);

Arguments

dgl
Pointer to the display list
bg
Pointer to the uObjBg data structure

Return Value

None.

Description

It renders a background (BG) image which can be scaled up and down.The call guS2DEmuBgRect1Cyc(&gdl, bg) can be used in place of gSPBgRect1Cyc(gdl++, bg). This function's resulting GBI code can be used in both S2DEX and the F3DEX series microcode. Because of this, one microcode can be processed to display both a scaled scrolling BG screen and a 3D model at the same time. For details, see gSPBgRect1Cyc.

Note

To notify the main routine about a scissoring box setting and texture filter setting, you must call the guS2DEmuSetScissor function before calling this function.

Comment

The uObjBg structure is shown below:

typedef	struct {
     u16  imageX;    /* x-coordinate of upper-left position of texture (u10.5) */
     u16  imageW;    /* Texture width (u10.2)*/
     s16  frameX;    /* x-coordinate of upper-left position of transfer destination frame (s10.2)*/
     u16  frameW;    /* Transfer destination frame width (u10.2) */
     u16  imageY;    /* y-coordinate of upper-left position of texture (u10.5) */ 
     u16  imageH;    /* Texture height (u10.2) */
     s16  frameY;    /* y-coordinate of upper-left position of transfer destination  frame (s10.2) */
     u16  frameH;    /* Transfer destination frame height (u10.2) */
     u64  *imagePtr; /* Address of texture source in DRAM */
     u16  imageLoad; /* Method for loading the BG image texture */
     u8   imageFmt;  /* Texel format G_IM_FMT_*  */
     u8   imageSiz;  /* Texel size G_IM_SIZ_* */
     u16  imagePal;  /* Position of palette */
     u16  imageFlip; /* Image inversion on/off (horizontal direction only) */
     u16  scaleW;    /* x-direction scale value (u5.10) */
     u16  scaleH;    /* y-direction scale value (u5.10) */
     s32  imageYorig;/* image drawing origin (s20.5) */
     u8	padding[4];
} uObjScaleBg_t;
typedef union {
     uObjBg_t       b;
     uObjScaleBg_t  s;
     long long int  force_structure_alignment;
} uObjBg;

See Also

guS2DEmuSetScissor, gSPBgRect1Cyc

Revision History

03/01/99 Completely rewritten.