guS2DEmuBgRect1Cyc
Emulates gSPBgRect1Cyc
#include <ultra64.h> /* gs2dex.h */
void guS2DEmuBgRect1Cyc(Gfx **gdl, uObjBg *bg);
None.
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.
To notify the main routine about a scissoring box setting and texture filter setting, you must call the guS2DEmuSetScissor function before calling this function.
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;
guS2DEmuSetScissor, gSPBgRect1Cyc
03/01/99 Completely rewritten.