Gfx GX Fn GXSetTevAlphaIn - wowjinxy/libPorpoise GitHub Wiki

GXSetTevAlphaIn

  • Category: Texture Environment
  • Matrix Status: Implemented
  • Matrix Notes: Implemented with typed TEV alpha args and per-stage state updates.
  • Matrix Link: Gfx-GX-API-Matrix

Official SDK (Reference)

  • Manual page: reference/man/gfx/gx/Tev/GXSetTevAlphaIn.html
  • SDK source: reference/ACGC-PC-Port/src/static/dolphin/gx/GXTev.c (GXSetTevAlphaIn)
  • SDK behavior:
    • Programs TEV alpha combiner inputs a,b,c,d for one TEV stage.
    • Writes TEV stage alpha-input register fields; no direct alpha-op mutation.
    • SDK debug path asserts stage range and argument ranges (a..d <= 7).

libPorpoise Implementation

  • Public API declaration: include/dolphin/gx/GXTev.h
  • Runtime implementation: src/gx/pc_gx.c (GXSetTevAlphaIn)
  • Behavior:
    • Stores a,b,c,d per TEV stage in renderer state and marks TEV state dirty.
    • Ignores out-of-range stage by returning early.

SDK vs Porpoise Diff

  • Signature parity:
    • Signatures match (GXTevStageID, four GXTevAlphaArg operands).
  • Behavioral parity:
    • Stage-local alpha-input programming behavior matches TEV semantics.
  • Known divergence:
    • SDK debug path asserts on invalid stage/operand ranges; Porpoise fail-soft ignores invalid stage and does not enforce operand-range asserts in this setter path.

Validation Checklist

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

Working Notes

  • No runtime code change required in this pass.