N64® Functions Menu

al - Audio Library Functions
gDP - DP GBI Macros
gdSP - General GBI Macros
gSP - SP GBI Macros
gt - Turbo Microcode RDP
gu - Graphics Utilities
Math - Math Functions
nuSys - NuSystem
os - N64 Operating System
sp - Sprite Library Functions
uh - Host to Target IO
64DD - N64 Disk Drive

Nintendo® Confidential

   

gSPBgRect1Cyc

Format
gSPBgRect1Cyc(Gfx *gdl, uObjBg *bg)
gsSPBgRect1Cyc(uObjBg *bg)
Arguments
  • gdl is the pointer to the display list
  • bg is the pointer to the drawing data structure uObjBg, which is the structure that holds the BG drawing information
What This Function Does
It is one of the BG drawing GBI macros provided by the S2DEX microcode. Use it to enlarge or reduce the BG screen. Its features and limitations include:
  • Scale change (magnifying / shrinking) is possible.
  • Scrolling in a closed region (making vertical / horizontal loop) is possible.
  • Horizontal texture flipping is possible (not vertical texture flipping).
  • Drawing in 1 Cycle mode only.
  • Texture interpolation display is possible, subpixel movement is possible only in the horizontal direction.
  • Anti-aliasing is not possible.
It loads the texture data from DRAM to TMEM, and then draws. It cannot be used in Copy mode. Unlike gSPBgRectCopy, this macro supports BG scaling. BG scaling is controlled by the uObjScaleBg_t structure�s member variables scaleW and scaleH. When you use this macro to magnify, the image is clipped by the frame size. Conversely, when you use this macro to shrink, the frame is sometimes clipped by image size. Refer to the S2DEX sample program for more about this. Frame clipping during shrinking can sometimes be slightly greater or lesser depending on calculation error. When a precise size is required, calculate and set the values for frameW and frameH on the CPU side.

Bilinear interpolation display is supported by gSPBgRect1Cyc. When bilinear interpolation is used, the RDP drawing performance decreases compared to when it is not used. The rate of this decrease in performance is greater when a smaller number of image lines are loaded in TMEM at one time. When drawing a 320X240 image in a 320X240 frame with no scaling is compared to drawing a 640x480 image at 1/2 reduction, the share of overhead taken by using bilinear interpolation will be greater when shrinking the 640x480 image. This causes a substantial drop in performance when a 640x480 image is similarly reduced and displayed using point sampling. Considering that the effects of bilinear interpolation diminish when used in reducing images, as discussed above, you should probably consider switching to point sampling display when reducing an image.

The gSPBgRect1Cyc macro draws an image by automatically dividing it into several subplanes, but it is possible that the drawing result will unexpectedly develop unnatural wrinkles during the division process if the division is done carelessly. This is especially noticeable when the image is scrolled. The member variable imageYorig has been provided for uObjScaleBg_t to prevent these wrinkles. The value of imageYorig refers to the Y coordinate of the origin for scaling, but it also describes the division origin of a subplane. It is thus possible to prevent the wrinkles described above.

For more detailed information on S2DEX microcode GBI macros and data structures, please see the "S2DEX Microcode" area of the N64 Programming Manual.

See Also
guS2DInitBg
S2DEX Microcode
gSPBgRectCopy


Nintendo® Confidential

Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.


Copyright © 1998
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last updated January 1998