Gfx GX Fn GXInitLightPosv - wowjinxy/libPorpoise GitHub Wiki

GXInitLightPosv

  • Category: Lighting
  • Matrix Status: Implemented
  • Matrix Notes: Official macro API; added SDK-compatible vector macro wrapper.
  • Matrix Link: Gfx-GX-API-Matrix

Official SDK (Reference)

  • Manual page: reference/man/gfx/gx/Lighting/GXInitLightPosv.html
  • Reference header: reference/gx/GXLighting.h
  • SDK behavior:
    • Macro API, not a standalone function:
      • #define GXInitLightPosv(lo, vec) (GXInitLightPos((lo), *(f32*)(vec), *((f32*)(vec)+1), *((f32*)(vec)+2)))
    • Accepts either f32[3] or any struct with first three f32 members (x,y,z layout).
    • No direct register write; only updates light object fields via GXInitLightPos.

libPorpoise Implementation

  • Public API header: include/dolphin/gx/GXLighting.h
  • Implementation style:
    • Macro-only, matching SDK expression and pointer arithmetic layout.
    • Forwards directly to GXInitLightPos, so runtime behavior is identical to that function's path.

SDK vs Porpoise Diff

  • Signature parity:
    • SDK: macro (lo, vec) wrapper.
    • Porpoise: macro (lo, vec) wrapper.
  • Behavioral parity:
    • SDK: reads three contiguous f32 values and calls GXInitLightPos.
    • Porpoise: same contiguous f32 reads and same forward call.
  • Known divergence:
    • None identified for this macro.

Validation Checklist

  • GX demo coverage checked
  • Pikmin usage path checked
  • Matrix status updated if needed
  • Notes updated with concrete file/function references

Working Notes

  • Verified against manual macro text in reference/man/gfx/gx/Lighting/GXInitLightPosv.html.
  • Verified header macro parity in reference/gx/GXLighting.h and include/dolphin/gx/GXLighting.h.