gDPLoadTextureBlock
Loads texture as a contiguous texture block
Syntax
#include <ultra64.h> /* gbi.h */
gDPLoadTextureBlock(
Gfx *gdl,
u32 timg,
u32 fmt,
u32 siz,
u32 width,
u32 height,
u32 pal,
u32 cms,
u32 cmt,
u32 masks,
u32 maskt,
u32 shifts,
u32 shiftt )
gsDPLoadTextureBlock(
u32 timg,
u32 fmt,
u32 siz,
u32 width,
u32 height,
u32 pal,
u32 cms,
u32 cmt,
u32 masks,
u32 maskt,
u32 shifts,
u32 shiftt )
Arguments
Description
Loads a texture from DRAM into texture memory (TMEM). Because this macro loads the texture image into a contiguous region in memory, it is the most efficient way to load a texture. DRAM transfers are also most efficient with large blocks.
This macro is actually comprised of a number of 64-bit GBI commands. Thus, if you need to find out the exact size of the display list, you need to consider how many GBI commands it is comprised of.
Regarding the fmt argument:
G_IM_SIZ_(Size) | ||||
8b | 16b | 32b | ||
G_IM_FMT_ (Format) |
RGBA | X (5/5/5/1) |
X (8/8/8/8) | |
YUV | X | | ||
CI | X | | ||
IA | X (4/4) |
X (8/8) |
||
I | X | |
Regarding the cms and cmt arguments, multitple specifications can be made with a bit sum of the following flags:
Regarding the masks and maskt arguments:
Regarding the shifts and shiftt arguments:
The values specified by shifts and shiftt (the shift parameter values) represent the amount by which the s,t coordinates are shifted to the left or to the right. This is used for the MIP-mapping, detail, and sharp mode settings. The values 0-10 are interpreted as right shifts, and the values 11-15 are interpreted as left shifts (see the table below).
Shift parameter value | Shift amount |
0 | No shift |
1 | >> 1 |
2 | >> 2 |
... | |
9 | >> 9 |
10 | >> 10 |
11 | << 5 |
12 | << 4 |
13 | << 3 |
14 | << 2 |
15 | << 1 |
For details about each argument, see Section 13.4 "Tile Attributes" in the N64 Programming Manual. Also, for information about using this macro, see Section 13.5 "Tile Descriptor Loading" in the N64 Programming Manual.
Note
To load a 4-bit texture, use the gDPLoadTextureBlock4b macro, no matter what the type.
Also, note that operation is not currently guaranteed for G_IM_FMT_YUV (YUV format).
Comment
There are some restrictions regarding the loading of textures with this macro. To ignore the restrictions, use the gDPLoadTextureBlockS macro. However, that form of the macro requires that every 32 bits in the odd lines of the texture data be pre-swapped. This kind of texture data is created using rgb2c with the -S option. You enter a number after -S to indicate how many texels to swap at a time. That is to say, if the texture you are creating is 32bit or 16bit, you enter 2, 4 for 8bit, and 8 for 4bit. To learn about the restrictions on loading, see Section 13, Appendix A "LoadBlock Line Limits" and Section 13.8 "Texture Memory" in the N64 Programming Manual. Also, note that additional texture macros are defined in <gbi.h>
See Also
gDPLoadTextureBlock_4b, gDPLoadTextureTile, gDPLoadTextureTile_4b, gDPLoadTLUT_pal256, gDPSetTextureDetail, guLoadTextureBlockMipMap, and rgb2c
Revision History
02/01/99 Completely rewritten.
03/31/99 Modified the Description.