benilla-re systems structs docs

TextureDecodeBlp

function · gx · primitive

Address
0x4489a0 · 434 bytes, up to 0x448b51
Signature
uint32_t __fastcall (const char *name, uint32_t fileFlag, void *dest, uint32_t *out[6], uint32_t arg5, uint32_t arg6, uint32_t arg7, uint32_t arg8, uint32_t arg9)
Meaning
Opens a BLP file, picks the GxTex format and type code from the device caps, and decodes the mips into the destination
Confidence
verified, proof one
Finding
gx/textures#format-choice

Finding: Format choice in gx: textures

0x4489a0 opens BLP bytes and decides two values from the colour encoding byte and the alpha depth: the GxTex format and the pixel type code. Alpha encoding 0 (DXT1) gives Dxt1 when the device block 0x58a230 has +0x40 set, otherwise Rgb565 for alpha depth 0 and Argb1555 for more; encoding 1 gives Dxt3 when +0x44 is set, otherwise Argb4444; encoding 7 gives Dxt5 when +0x48 is set, otherwise Argb4444; a colour encoding other than 2 gives Argb8888. The size it returns is the one 0x448b60 leaves (texturesize.md). The file callback 0x44a560 chooses through 0x44a790 instead.

The derivation is in the doc.

Callers 2

Callees 5

Calls and jumps by a bare address, from tables/calls.tsv.