Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

Module state

Module state 

Source
Expand description

GTE – Geometry Transformation Engine (COP2).

32 data registers + 32 control registers, all in fixed-point. Vertices and matrix elements are signed 1.3.12 (i16 × 1/4096); translations and color-bias terms are signed 31.0; intermediate accumulation runs in 64-bit signed with a 44-bit overflow check before truncation to 32-bit MAC1..3.

Each function call clears FLAG, runs its math (which may set the per-result saturation/overflow bits), then folds the error bits into the master FLAG[31]. Software polls FLAG to detect geometry that would otherwise wrap or clip incorrectly.

The division used by RTPS/RTPT is the documented unsigned Newton-Raphson iteration off a 257-entry seed table – keeping the exact PSX algorithm matters because games consume the resulting SX2/SY2 values directly and any drift moves vertices on screen.

Reference: nocash PSX-SPX, section “GTE Coprocessor”. Cross-checked against PCSX-Redux’s gte.cc interpreter.

§Provenance

Implemented from public hardware documentation (nocash PSX-SPX, “GTE Coprocessor”) and parity-verified against PCSX-Redux’s gte.cc (https://github.com/grumpycoders/pcsx-redux), GPL-2.0-or-later. The division seed table and saturation rules are hardware behaviour. PSoXide is released under GPL-2.0-or-later for compatibility with that reference; see LICENSE and docs/license-audit.md.

Structs§

Gte
Full GTE state. Field grouping matches the PSX register map: vectors / FIFOs / accumulators in data-prefixed fields, matrices and translations in ctrl-prefixed fields. The MFC2/MTC2 paths pack and unpack these into 32-bit views.
GteProfileSnapshot
Monotonic diagnostic counters for GTE command pressure.