Repository navigation
Gfx GX Fn GXInitLightColor
wowjinxy edited this page Apr 9, 2026
·
2 revisions
- Category:
Lighting - Matrix Status:
Implemented - Matrix Notes: Verified color storage/packing in light object.
- Matrix Link: Gfx-GX-API-Matrix
- Manual page:
reference/man/gfx/gx/Lighting/GXInitLightColor.html - Reference source:
reference/gx/GXLight.c(GXInitLightColor) - SDK behavior:
- Signature:
void GXInitLightColor(GXLightObj* lt_obj, GXColor color). - Writes the light color into the light object only (no hardware register load).
- Reference implementation stores
GXColorbytes as a packedu32in object color storage.
- Signature:
- Public API declaration:
include/dolphin/gx/GXLighting.h - Runtime implementation:
src/gx/pc_gx.c(GXInitLightColor) - Behavior:
- Packs
GXColor {r,g,b,a}into internal 32-bit color storage and writes into light object state. - Loaded to active backend light state later via
GXLoadLightObjImm/Indx. - Getter path (
GXGetLightColor) returns the stored bytes back toGXColor.
- Packs
- Signature parity:
- SDK: typed
GXLightObj*. - Porpoise: typed in public header; runtime definition uses internal
void*ABI-equivalent pointer.
- SDK: typed
- Behavioral parity:
- SDK: store RGBA color in light object memory.
- Porpoise: same RGBA storage semantics.
- Known divergence:
- Porpoise calls
pc_gx_lightobj_sanitizebefore setting color; SDK reference path directly writes color field.
- Porpoise calls
- GX demo coverage checked
- Pikmin usage path checked
- Matrix status updated if needed
- Notes updated with concrete file/function references
- Verified manual semantics in
reference/man/gfx/gx/Lighting/GXInitLightColor.html. - Verified reference storage behavior in
reference/gx/GXLight.c(obj->Color = *(u32*)(&color)).