Repository navigation
Gfx GX Fn GXGetLightColor
wowjinxy edited this page Apr 9, 2026
·
2 revisions
- Category:
Lighting - Matrix Status:
Implemented - Matrix Notes: Verified light color getter returns RGBA channels from light object state.
- Matrix Link: Gfx-GX-API-Matrix
- Manual page:
reference/man/gfx/gx/Lighting/GXGetLightColor.html - Reference source:
reference/gx/GXLight.c(GXGetLightColor) - SDK behavior:
- Signature (manual):
void GXGetLightColor(GXLightObj* lt_obj, GXColor* color). - Reference source uses
const GXLightObj*and copies packed color (obj->Color) into outputGXColor. - Getter only; no GX/XF register writes.
- Signature (manual):
- Public API declaration:
include/dolphin/gx/GXGet.h - Runtime implementation:
src/gx/pc_gx.c(GXGetLightColor) - Behavior:
- Reads packed internal light color and writes
color->r/g/b/aexplicitly by byte. - Matches SDK intent of round-tripping color set by
GXInitLightColor. - Performs output null check (
if (color)) before write.
- Reads packed internal light color and writes
- Signature parity:
- SDK manual:
GXLightObj*; SDK source oftenconst GXLightObj*. - Porpoise header:
GXLightObj*; runtime uses internalvoid*ABI-compatible implementation.
- SDK manual:
- Behavioral parity:
- SDK: copies packed light color to output color struct.
- Porpoise: returns same RGBA channel values from internal packed representation.
- Known divergence:
- SDK source uses raw packed copy (
*(u32*)color = obj->Color) with platform-layout assumption. - Porpoise performs explicit per-byte field assignment, which is safer across compilers while preserving values.
- SDK debug path asserts invalid inputs; Porpoise fail-soft skips write when
color == NULL.
- SDK source uses raw packed copy (
- GX demo coverage checked
- Pikmin usage path checked
- Matrix status updated if needed
- Notes updated with concrete file/function references
- Verified SDK stores/gets color through packed
u32path inGXLight.c. - Verified Porpoise packs with
pc_pack_gxcolor_u32and unpacks by explicit byte assignment in getter.