gDPLoadBlock [Macro]

Function

gDPLoadBlock

Loads a texture image

Syntax

#include <ultra64.h>        /* gbi.h */
gDPLoadBlock(Gfx *gdl, u32 tile, u32 uls, u32 ult, u32 lrs, u32 dxt )
gsDPLoadBlock(         u32 tile, u32 uls, u32 ult, u32 lrs, u32 dxt )

Arguments

gdl
Display list pointer
tile
Tile descriptor index (3-bit precision, 0~7)
uls
The texture tile's upper-left s coordinate (10.2, 0.0~1023.75)
ult
The texture tile's upper-left t coordinate (10.2, 0.0~1023.75)
lrs
The texture tile's lower-right s coordinate (10.2, 0.0~1023.75)
dxt
The amount of change in value of t per scan line (12-bit precision, 0~4095)

Description

Loads a texture from DRAM into texture memory (TMEM). The texture image is loaded into memory in a single transfer. This is a low-level macro that is not used in regular programs.

Note

The maximum number of texels that can be loaded with this command is 2048 texels. To load into the full 4 KB of TMEM, you must load the texture using G_IM_SIZ_16b (16 bits per texel) and then change the tile to the correct texel size. This is normally performed by g*DPLoadTextureBlock, so if you make direct use of this low-level macro, then you will need to do this tile manipulation in the application.

Also, note that this macro does not perform 64-bit alignment on every line, so the data must be aligned in advance.

Comment

The uls, ult and lrs coordinates are only used for the loading of tiled textures. They specify the coordinates in texel space of the corners of the subtile loaded into TMEM. For details, see Section 13.9.3 "LoadBlock Command" in the N64 Programming Manual.

See Also

gDPLoadTextureBlock, gDPLoadTextureBlock_4b, gDPLoadTextureTile, gDPLoadTextureTile_4b, gDPLoadTLUT_pal16, gDPLoadTLUT_pal256, and guLoadTextureBlockMipMap

Revision History

02/01/99   Completely rewritten