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

psx_gte_core/
lib.rs

1// SPDX-License-Identifier: GPL-2.0-or-later
2//! Pure-Rust GTE shared math types and host state machine.
3//!
4//! The math types are register-shaped and are available on every target.
5//! The full software GTE state machine is compiled only for non-MIPS
6//! builds: on real PS1 hardware the SDK talks to COP2 directly instead
7//! of running the simulator on the CPU.
8//!
9//! No I/O, no inline assembly, no PS1 hardware bindings. Everything is
10//! `core::cmp`-only arithmetic; safe to use from any host or target.
11//!
12//! - [`math`]: fixed-point types ([`Vec3I16`], [`Vec3I32`],
13//!   [`Mat3I16`]) shared across the GTE / GPU layers.
14//! - [`state::Gte`] (non-MIPS only): full register state + the 21 documented function
15//!   opcodes (RTPS / RTPT / MVMVA / NCLIP / NCDS / AVSZ3 / etc.).
16//!   Driven via [`Gte::execute`] with a 32-bit command word.
17
18#![no_std]
19#![warn(missing_docs)]
20
21pub mod math;
22#[cfg(not(target_arch = "mips"))]
23pub mod state;
24pub mod transform;
25
26pub use math::{Mat3I16, Vec3I16, Vec3I32};
27#[cfg(not(target_arch = "mips"))]
28pub use state::{Gte, GteProfileSnapshot};
29pub use transform::{cos_1_3_12, sin_1_3_12};