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

   

gSPViewport

Format
#include "gbi.h"

typedef struct {
   short vscale[4];
   /* scale, 2 bits fraction */

   short vtrans[4];
   /* translate, 2 bits fraction */

/* both arrays are padded to
   the 64-bit boundary */
} Vp_t;

typedef union {
   Vp_t   vp;
   long long int force_structure_alignment;
} Vp;

gSPViewport(Gfx *gdl, Vp *v)
gsSPViewport(Vp *v)
Arguments
  • gdl is the pointer to the graphics display list
  • v is the pointer to the viewport (segmented address)
  • vscale is the scale applied to the normalized homogeneous coordinates after 4x4 projection transformation
  • vtrans is the offset added to the scaled number
What This Macro Does
It sets up the viewport region of the graphics pipeline and loads the viewport projection parameter. Both vc and vo are S13.2 numbers.

Both the vscale and vtrans numbers are in screen coordinates. Array indices of 0, 1, 2 correspond to x, y, z. An array index of 3 is used for padding.

See Also
gDPSetScissor



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