SDK source: reference/gx/GXTev.c (GXSetTevOrder, around lines 1115+)
Verified SDK behavior:
Stores raw stage map ID (gx->texmapId[stage] = map) and programs normalized BP values.
Normalizes map as (map & ~GX_TEX_DISABLE) and falls back to GX_TEXMAP0 if out of range.
Normalizes coord to GX_TEXCOORD0 when coord is NULL/invalid.
Enables texture lookup only when map != GX_TEXMAP_NULL and GX_TEX_DISABLE is not set.
Maps GX_COLOR_NULL to zero raster channel selector (RAS1_CC_Z path in SDK source).
libPorpoise Implementation
Runtime implementation area: src/gx
Public API surface: include/dolphin/gx
Current implementation:
src/gx/pc_gx.c (GXSetTevOrder) now mirrors SDK map/coord normalization behavior.
Added per-stage tex_lookup_enable state (src/gx/pc_gx_internal.h) so lookup enable is derived from map NULL/disable flags, not only map index range checks.