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

   

gSPObjLoadTxtr

Format
gSPObjLoadTxtr(Gfx *gdl, uObjTxtr *tx)
gsSPObjLoadTxtr(uObjTxtr *tx)
Arguments
  • gdl is the pointer to the display list
  • tx is the pointer to the texture load data structure
What This Macro Does
It is an S2DEX microcode macro that loads the texture data into the uObjTxtr data structure by referring to the texture loading parameters held by three data structures. It must be used before you can draw sprites.

It processes the following three different texture types (methods) distinguished by the uObjTxtr structure�s type member:
  • Texture load using LoadBlock
  • Texture load using LoadTile
  • TLUT load
Texture loading by using LoadBlock can be faster than texture loading by using LoadTile. However, there is a limitation to loadable texture width. For more information about this see the LoadBlock section in the "S2DEX Microcode" section of the N64 Programming Manual.

Corresponding to the three different methods, three different data structures are defined. These three 24-byte data structures (uObjTxtrBlock_t, uObjTxtrTile_t, and uObjTxtrTLUT_t) are constructed the same way; they just have different member variable names. The three data structures are combined into a union (the uObjTxtr structure).

Loadblock uObjTxtrBlock_t Data Structure Members
  • type is G_OBJLT_TXTRBLOCK
  • *image is the texture source address on DRAM
  • tmem is the TMEM word address of the loading destination
  • tsize is the texture size
  • tline is the texture width
  • sid is the status ID {0, 4, 8, or 12}
  • flag is the status flag
  • mask is the status mask
LoadTile uObjTxtrTile_t Data Structure Members
  • type is G_OBJLT_TXTRTILE
  • *image is the texture source address on DRAM
  • tmem is the TMEM word address of loading destination
  • twidth is the texture width
  • theight is the texture height
  • sid is the status ID {0, 4, 8, or 12}
  • flag is the status flag
  • mask is the status mask
TLUT Load uObjTLUT_t Data Structure Members
  • type is G_OBJLT_TLUT
  • *image is the texture source address on DRAM
  • phead is the first TLUT area number between 256 and 511
  • pnum is the number of TLUT to be loaded - 1
  • zero is the always 0
  • sid is the status ID {0, 4, 8, or 12}
  • flag is the status flag
  • mask is the status mask
For detailed information on S2DEX microcode GBI macros and data structures, please see the "S2DEX Microcode" area of the N64 Programming Manual.

The three structures are unioned into the gSPObjLoadTxtr data structure, which in turn distinguishes each structure by using the value of its type member. For more information about how these structures are processed, please see the "S2DEX Microcode" section of the N64 Programming Manual.

The S2DEX microcode optimizes the loading process by using these data strutures. For example, the loading destination area data is included in the texture data structure. Therefore, rather than performing analysis using the RSP, simple calculation determines whether or not the loading operation needs to be performed. See Also S2DEX Microcode
guS2DInitBg


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