Nugget
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions
psyqo::GTE Namespace Reference

Namespaces

namespace  Kernels
 The GTE math kernels.
 

Classes

struct  PackedVec3
 A GTE-compatible short vector. More...
 

Typedefs

typedef FixedPoint< 12 > Long
 A GTE-compatible 32-bits fixed point number.
 
typedef FixedPoint< 12, int16_t > Short
 A GTE-compatible 16-bits fixed point number.
 

Enumerations

enum class  Register {
  VXY0 , VZ0 , VXY1 , VZ1 ,
  VXY2 , VZ2 , RGB , OTZ ,
  IR0 , IR1 , IR2 , IR3 ,
  SXY0 , SXY1 , SXY2 , SXYP ,
  SZ0 , SZ1 , SZ2 , SZ3 ,
  RGB0 , RGB1 , RGB2 , RES1 ,
  MAC0 , MAC1 , MAC2 , MAC3 ,
  IRGB , ORGB , LZCS , LZCR ,
  R11R12 , R13R21 , R22R23 , R31R32 ,
  R33 , TRX , TRY , TRZ ,
  L11L12 , L13L21 , L22L23 , L31L32 ,
  L33 , RBK , GBK , BBK ,
  LR1LR2 , LR3LG1 , LG2LG3 , LB1LB2 ,
  LB3 , RFC , GFC , BFC ,
  OFX , OFY , H , DQA ,
  DQB , ZSF3 , ZSF4 , FLAG
}
 The list of available GTE registers. More...
 
enum  Safety { Unsafe , Safe }
 Whether to insert nops after register operations. More...
 
enum class  PseudoRegister {
  Rotation , Light , Color , V0 ,
  V1 , V2 , SV , LV ,
  Translation , ScreenOffset
}
 The list of available GTE pseudo registers. More...
 

Functions

template<>
void writeSafe< Register::VXY0 > (Short x_, Short y_)
 
template<>
void writeSafe< Register::VZ0 > (Short z_)
 
template<>
void writeSafe< Register::VXY1 > (Short x_, Short y_)
 
template<>
void writeSafe< Register::VZ1 > (Short z_)
 
template<>
void writeSafe< Register::VXY2 > (Short x_, Short y_)
 
template<>
void writeSafe< Register::VZ2 > (Short z_)
 
template<>
void writeSafe< Register::OTZ > (Short z_)
 
template<>
void writeSafe< Register::IR0 > (Short x_)
 
template<>
void writeSafe< Register::IR1 > (Short x_)
 
template<>
void writeSafe< Register::IR2 > (Short x_)
 
template<>
void writeSafe< Register::IR3 > (Short x_)
 
template<>
void writeSafe< Register::R11R12 > (Short x_, Short y_)
 
template<>
void writeSafe< Register::R13R21 > (Short x_, Short y_)
 
template<>
void writeSafe< Register::R22R23 > (Short x_, Short y_)
 
template<>
void writeSafe< Register::R31R32 > (Short x_, Short y_)
 
template<>
void writeSafe< Register::R33 > (Short z_)
 
template<>
void writeSafe< Register::L11L12 > (Short x_, Short y_)
 
template<>
void writeSafe< Register::L13L21 > (Short x_, Short y_)
 
template<>
void writeSafe< Register::L22L23 > (Short x_, Short y_)
 
template<>
void writeSafe< Register::L31L32 > (Short x_, Short y_)
 
template<>
void writeSafe< Register::L33 > (Short z_)
 
template<>
void writeSafe< Register::LR1LR2 > (Short x_, Short y_)
 
template<>
void writeSafe< Register::LR3LG1 > (Short x_, Short y_)
 
template<>
void writeSafe< Register::LG2LG3 > (Short x_, Short y_)
 
template<>
void writeSafe< Register::LB1LB2 > (Short x_, Short y_)
 
template<>
void writeSafe< Register::LB3 > (Short z_)
 
template<>
void writeSafe< Register::ZSF3 > (Short z_)
 
template<>
void writeSafe< Register::ZSF4 > (Short z_)
 
template<>
void writeUnsafe< Register::VXY0 > (Short x_, Short y_)
 
template<>
void writeUnsafe< Register::VZ0 > (Short z_)
 
template<>
void writeUnsafe< Register::VXY1 > (Short x_, Short y_)
 
template<>
void writeUnsafe< Register::VZ1 > (Short z_)
 
template<>
void writeUnsafe< Register::VXY2 > (Short x_, Short y_)
 
template<>
void writeUnsafe< Register::VZ2 > (Short z_)
 
template<>
void writeUnsafe< Register::OTZ > (Short z_)
 
template<>
void writeUnsafe< Register::IR0 > (Short x_)
 
template<>
void writeUnsafe< Register::IR1 > (Short x_)
 
template<>
void writeUnsafe< Register::IR2 > (Short x_)
 
template<>
void writeUnsafe< Register::IR3 > (Short x_)
 
template<>
void writeUnsafe< Register::R11R12 > (Short x_, Short y_)
 
template<>
void writeUnsafe< Register::R13R21 > (Short x_, Short y_)
 
template<>
void writeUnsafe< Register::R22R23 > (Short x_, Short y_)
 
template<>
void writeUnsafe< Register::R31R32 > (Short x_, Short y_)
 
template<>
void writeUnsafe< Register::R33 > (Short z_)
 
template<>
void writeUnsafe< Register::L11L12 > (Short x_, Short y_)
 
template<>
void writeUnsafe< Register::L13L21 > (Short x_, Short y_)
 
template<>
void writeUnsafe< Register::L22L23 > (Short x_, Short y_)
 
template<>
void writeUnsafe< Register::L31L32 > (Short x_, Short y_)
 
template<>
void writeUnsafe< Register::L33 > (Short z_)
 
template<>
void writeUnsafe< Register::LR1LR2 > (Short x_, Short y_)
 
template<>
void writeUnsafe< Register::LR3LG1 > (Short x_, Short y_)
 
template<>
void writeUnsafe< Register::LG2LG3 > (Short x_, Short y_)
 
template<>
void writeUnsafe< Register::LB1LB2 > (Short x_, Short y_)
 
template<>
void writeUnsafe< Register::LB3 > (Short z_)
 
template<>
void writeUnsafe< Register::ZSF3 > (Short z_)
 
template<>
void writeUnsafe< Register::ZSF4 > (Short z_)
 
template<>
void writeSafe< PseudoRegister::Rotation > (const Matrix33 &in)
 
template<>
void writeSafe< PseudoRegister::Light > (const Matrix33 &in)
 
template<>
void writeSafe< PseudoRegister::Color > (const Matrix33 &in)
 
template<>
void writeSafe< PseudoRegister::V0 > (const Vec3 &in)
 
template<>
void writeSafe< PseudoRegister::V1 > (const Vec3 &in)
 
template<>
void writeSafe< PseudoRegister::V2 > (const Vec3 &in)
 
template<>
void writeSafe< PseudoRegister::Translation > (const Vec3 &in)
 
template<>
void writeSafe< PseudoRegister::ScreenOffset > (const Vec2 &in)
 
template<>
void writeUnsafe< PseudoRegister::Rotation > (const Matrix33 &in)
 
template<>
void writeUnsafe< PseudoRegister::Light > (const Matrix33 &in)
 
template<>
void writeUnsafe< PseudoRegister::Color > (const Matrix33 &in)
 
template<>
void writeUnsafe< PseudoRegister::V0 > (const Vec3 &in)
 
template<>
void writeUnsafe< PseudoRegister::V1 > (const Vec3 &in)
 
template<>
void writeUnsafe< PseudoRegister::V2 > (const Vec3 &in)
 
template<>
void writeUnsafe< PseudoRegister::Translation > (const Vec3 &in)
 
template<>
void writeUnsafe< PseudoRegister::ScreenOffset > (const Vec2 &in)
 
template<>
PackedVec3 readSafe< PseudoRegister::SV > ()
 
template<>
PackedVec3 readSafe< PseudoRegister::LV > ()
 
template<>
PackedVec3 readUnsafe< PseudoRegister::SV > ()
 
template<>
PackedVec3 readUnsafe< PseudoRegister::LV > ()
 
template<>
void read< PseudoRegister::LV > (Vec3 *ptr)
 
template<>
void read< PseudoRegister::LV > (Vec3 &ptr)
 

Typedef Documentation

◆ Long

typedef FixedPoint<12> psyqo::GTE::Long

A GTE-compatible 32-bits fixed point number.

◆ Short

typedef FixedPoint<12, int16_t> psyqo::GTE::Short

A GTE-compatible 16-bits fixed point number.

Enumeration Type Documentation

◆ PseudoRegister

enum class psyqo::GTE::PseudoRegister
strong

The list of available GTE pseudo registers.

Enumerator
Rotation 
Light 
Color 
V0 
V1 
V2 
SV 
LV 
Translation 
ScreenOffset 

◆ Register

enum class psyqo::GTE::Register
strong

The list of available GTE registers.

Enumerator
VXY0 
VZ0 
VXY1 
VZ1 
VXY2 
VZ2 
RGB 
OTZ 
IR0 
IR1 
IR2 
IR3 
SXY0 
SXY1 
SXY2 
SXYP 
SZ0 
SZ1 
SZ2 
SZ3 
RGB0 
RGB1 
RGB2 
RES1 
MAC0 
MAC1 
MAC2 
MAC3 
IRGB 
ORGB 
LZCS 
LZCR 
R11R12 
R13R21 
R22R23 
R31R32 
R33 
TRX 
TRY 
TRZ 
L11L12 
L13L21 
L22L23 
L31L32 
L33 
RBK 
GBK 
BBK 
LR1LR2 
LR3LG1 
LG2LG3 
LB1LB2 
LB3 
RFC 
GFC 
BFC 
OFX 
OFY 
DQA 
DQB 
ZSF3 
ZSF4 
FLAG 

◆ Safety

Whether to insert nops after register operations.

The GTE is a coprocessor, and as such, register operations are not guaranteed to be completed before the next instruction. This means that triggering a GTE operations right after writing to a register may result in the operation using the old value of the register. To avoid this, nops can be inserted after register operations to ensure that the register is updated before the next GTE operation. Use the Safe option to insert nops, or the Unsafe option to avoid them, if you are sure that the register will not be used immediately after the operation.

Enumerator
Unsafe 
Safe 

Function Documentation

◆ read< PseudoRegister::LV >() [1/2]

template<>
void psyqo::GTE::read< PseudoRegister::LV > ( Vec3 ptr)
inline

◆ read< PseudoRegister::LV >() [2/2]

template<>
void psyqo::GTE::read< PseudoRegister::LV > ( Vec3 ptr)
inline

◆ readSafe< PseudoRegister::LV >()

template<>
PackedVec3 psyqo::GTE::readSafe< PseudoRegister::LV > ( )
inline

◆ readSafe< PseudoRegister::SV >()

template<>
PackedVec3 psyqo::GTE::readSafe< PseudoRegister::SV > ( )
inline

◆ readUnsafe< PseudoRegister::LV >()

template<>
PackedVec3 psyqo::GTE::readUnsafe< PseudoRegister::LV > ( )
inline

◆ readUnsafe< PseudoRegister::SV >()

template<>
PackedVec3 psyqo::GTE::readUnsafe< PseudoRegister::SV > ( )
inline

◆ writeSafe< PseudoRegister::Color >()

template<>
void psyqo::GTE::writeSafe< PseudoRegister::Color > ( const Matrix33 in)
inline

◆ writeSafe< PseudoRegister::Light >()

template<>
void psyqo::GTE::writeSafe< PseudoRegister::Light > ( const Matrix33 in)
inline

◆ writeSafe< PseudoRegister::Rotation >()

template<>
void psyqo::GTE::writeSafe< PseudoRegister::Rotation > ( const Matrix33 in)
inline

◆ writeSafe< PseudoRegister::ScreenOffset >()

template<>
void psyqo::GTE::writeSafe< PseudoRegister::ScreenOffset > ( const Vec2 in)
inline

◆ writeSafe< PseudoRegister::Translation >()

template<>
void psyqo::GTE::writeSafe< PseudoRegister::Translation > ( const Vec3 in)
inline

◆ writeSafe< PseudoRegister::V0 >()

template<>
void psyqo::GTE::writeSafe< PseudoRegister::V0 > ( const Vec3 in)
inline

◆ writeSafe< PseudoRegister::V1 >()

template<>
void psyqo::GTE::writeSafe< PseudoRegister::V1 > ( const Vec3 in)
inline

◆ writeSafe< PseudoRegister::V2 >()

template<>
void psyqo::GTE::writeSafe< PseudoRegister::V2 > ( const Vec3 in)
inline

◆ writeSafe< Register::IR0 >()

template<>
void psyqo::GTE::writeSafe< Register::IR0 > ( Short  x_)
inline

◆ writeSafe< Register::IR1 >()

template<>
void psyqo::GTE::writeSafe< Register::IR1 > ( Short  x_)
inline

◆ writeSafe< Register::IR2 >()

template<>
void psyqo::GTE::writeSafe< Register::IR2 > ( Short  x_)
inline

◆ writeSafe< Register::IR3 >()

template<>
void psyqo::GTE::writeSafe< Register::IR3 > ( Short  x_)
inline

◆ writeSafe< Register::L11L12 >()

template<>
void psyqo::GTE::writeSafe< Register::L11L12 > ( Short  x_,
Short  y_ 
)
inline

◆ writeSafe< Register::L13L21 >()

template<>
void psyqo::GTE::writeSafe< Register::L13L21 > ( Short  x_,
Short  y_ 
)
inline

◆ writeSafe< Register::L22L23 >()

template<>
void psyqo::GTE::writeSafe< Register::L22L23 > ( Short  x_,
Short  y_ 
)
inline

◆ writeSafe< Register::L31L32 >()

template<>
void psyqo::GTE::writeSafe< Register::L31L32 > ( Short  x_,
Short  y_ 
)
inline

◆ writeSafe< Register::L33 >()

template<>
void psyqo::GTE::writeSafe< Register::L33 > ( Short  z_)
inline

◆ writeSafe< Register::LB1LB2 >()

template<>
void psyqo::GTE::writeSafe< Register::LB1LB2 > ( Short  x_,
Short  y_ 
)
inline

◆ writeSafe< Register::LB3 >()

template<>
void psyqo::GTE::writeSafe< Register::LB3 > ( Short  z_)
inline

◆ writeSafe< Register::LG2LG3 >()

template<>
void psyqo::GTE::writeSafe< Register::LG2LG3 > ( Short  x_,
Short  y_ 
)
inline

◆ writeSafe< Register::LR1LR2 >()

template<>
void psyqo::GTE::writeSafe< Register::LR1LR2 > ( Short  x_,
Short  y_ 
)
inline

◆ writeSafe< Register::LR3LG1 >()

template<>
void psyqo::GTE::writeSafe< Register::LR3LG1 > ( Short  x_,
Short  y_ 
)
inline

◆ writeSafe< Register::OTZ >()

template<>
void psyqo::GTE::writeSafe< Register::OTZ > ( Short  z_)
inline

◆ writeSafe< Register::R11R12 >()

template<>
void psyqo::GTE::writeSafe< Register::R11R12 > ( Short  x_,
Short  y_ 
)
inline

◆ writeSafe< Register::R13R21 >()

template<>
void psyqo::GTE::writeSafe< Register::R13R21 > ( Short  x_,
Short  y_ 
)
inline

◆ writeSafe< Register::R22R23 >()

template<>
void psyqo::GTE::writeSafe< Register::R22R23 > ( Short  x_,
Short  y_ 
)
inline

◆ writeSafe< Register::R31R32 >()

template<>
void psyqo::GTE::writeSafe< Register::R31R32 > ( Short  x_,
Short  y_ 
)
inline

◆ writeSafe< Register::R33 >()

template<>
void psyqo::GTE::writeSafe< Register::R33 > ( Short  z_)
inline

◆ writeSafe< Register::VXY0 >()

template<>
void psyqo::GTE::writeSafe< Register::VXY0 > ( Short  x_,
Short  y_ 
)
inline

◆ writeSafe< Register::VXY1 >()

template<>
void psyqo::GTE::writeSafe< Register::VXY1 > ( Short  x_,
Short  y_ 
)
inline

◆ writeSafe< Register::VXY2 >()

template<>
void psyqo::GTE::writeSafe< Register::VXY2 > ( Short  x_,
Short  y_ 
)
inline

◆ writeSafe< Register::VZ0 >()

template<>
void psyqo::GTE::writeSafe< Register::VZ0 > ( Short  z_)
inline

◆ writeSafe< Register::VZ1 >()

template<>
void psyqo::GTE::writeSafe< Register::VZ1 > ( Short  z_)
inline

◆ writeSafe< Register::VZ2 >()

template<>
void psyqo::GTE::writeSafe< Register::VZ2 > ( Short  z_)
inline

◆ writeSafe< Register::ZSF3 >()

template<>
void psyqo::GTE::writeSafe< Register::ZSF3 > ( Short  z_)
inline

◆ writeSafe< Register::ZSF4 >()

template<>
void psyqo::GTE::writeSafe< Register::ZSF4 > ( Short  z_)
inline

◆ writeUnsafe< PseudoRegister::Color >()

template<>
void psyqo::GTE::writeUnsafe< PseudoRegister::Color > ( const Matrix33 in)
inline

◆ writeUnsafe< PseudoRegister::Light >()

template<>
void psyqo::GTE::writeUnsafe< PseudoRegister::Light > ( const Matrix33 in)
inline

◆ writeUnsafe< PseudoRegister::Rotation >()

template<>
void psyqo::GTE::writeUnsafe< PseudoRegister::Rotation > ( const Matrix33 in)
inline

◆ writeUnsafe< PseudoRegister::ScreenOffset >()

template<>
void psyqo::GTE::writeUnsafe< PseudoRegister::ScreenOffset > ( const Vec2 in)
inline

◆ writeUnsafe< PseudoRegister::Translation >()

template<>
void psyqo::GTE::writeUnsafe< PseudoRegister::Translation > ( const Vec3 in)
inline

◆ writeUnsafe< PseudoRegister::V0 >()

template<>
void psyqo::GTE::writeUnsafe< PseudoRegister::V0 > ( const Vec3 in)
inline

◆ writeUnsafe< PseudoRegister::V1 >()

template<>
void psyqo::GTE::writeUnsafe< PseudoRegister::V1 > ( const Vec3 in)
inline

◆ writeUnsafe< PseudoRegister::V2 >()

template<>
void psyqo::GTE::writeUnsafe< PseudoRegister::V2 > ( const Vec3 in)
inline

◆ writeUnsafe< Register::IR0 >()

template<>
void psyqo::GTE::writeUnsafe< Register::IR0 > ( Short  x_)
inline

◆ writeUnsafe< Register::IR1 >()

template<>
void psyqo::GTE::writeUnsafe< Register::IR1 > ( Short  x_)
inline

◆ writeUnsafe< Register::IR2 >()

template<>
void psyqo::GTE::writeUnsafe< Register::IR2 > ( Short  x_)
inline

◆ writeUnsafe< Register::IR3 >()

template<>
void psyqo::GTE::writeUnsafe< Register::IR3 > ( Short  x_)
inline

◆ writeUnsafe< Register::L11L12 >()

template<>
void psyqo::GTE::writeUnsafe< Register::L11L12 > ( Short  x_,
Short  y_ 
)
inline

◆ writeUnsafe< Register::L13L21 >()

template<>
void psyqo::GTE::writeUnsafe< Register::L13L21 > ( Short  x_,
Short  y_ 
)
inline

◆ writeUnsafe< Register::L22L23 >()

template<>
void psyqo::GTE::writeUnsafe< Register::L22L23 > ( Short  x_,
Short  y_ 
)
inline

◆ writeUnsafe< Register::L31L32 >()

template<>
void psyqo::GTE::writeUnsafe< Register::L31L32 > ( Short  x_,
Short  y_ 
)
inline

◆ writeUnsafe< Register::L33 >()

template<>
void psyqo::GTE::writeUnsafe< Register::L33 > ( Short  z_)
inline

◆ writeUnsafe< Register::LB1LB2 >()

template<>
void psyqo::GTE::writeUnsafe< Register::LB1LB2 > ( Short  x_,
Short  y_ 
)
inline

◆ writeUnsafe< Register::LB3 >()

template<>
void psyqo::GTE::writeUnsafe< Register::LB3 > ( Short  z_)
inline

◆ writeUnsafe< Register::LG2LG3 >()

template<>
void psyqo::GTE::writeUnsafe< Register::LG2LG3 > ( Short  x_,
Short  y_ 
)
inline

◆ writeUnsafe< Register::LR1LR2 >()

template<>
void psyqo::GTE::writeUnsafe< Register::LR1LR2 > ( Short  x_,
Short  y_ 
)
inline

◆ writeUnsafe< Register::LR3LG1 >()

template<>
void psyqo::GTE::writeUnsafe< Register::LR3LG1 > ( Short  x_,
Short  y_ 
)
inline

◆ writeUnsafe< Register::OTZ >()

template<>
void psyqo::GTE::writeUnsafe< Register::OTZ > ( Short  z_)
inline

◆ writeUnsafe< Register::R11R12 >()

template<>
void psyqo::GTE::writeUnsafe< Register::R11R12 > ( Short  x_,
Short  y_ 
)
inline

◆ writeUnsafe< Register::R13R21 >()

template<>
void psyqo::GTE::writeUnsafe< Register::R13R21 > ( Short  x_,
Short  y_ 
)
inline

◆ writeUnsafe< Register::R22R23 >()

template<>
void psyqo::GTE::writeUnsafe< Register::R22R23 > ( Short  x_,
Short  y_ 
)
inline

◆ writeUnsafe< Register::R31R32 >()

template<>
void psyqo::GTE::writeUnsafe< Register::R31R32 > ( Short  x_,
Short  y_ 
)
inline

◆ writeUnsafe< Register::R33 >()

template<>
void psyqo::GTE::writeUnsafe< Register::R33 > ( Short  z_)
inline

◆ writeUnsafe< Register::VXY0 >()

template<>
void psyqo::GTE::writeUnsafe< Register::VXY0 > ( Short  x_,
Short  y_ 
)
inline

◆ writeUnsafe< Register::VXY1 >()

template<>
void psyqo::GTE::writeUnsafe< Register::VXY1 > ( Short  x_,
Short  y_ 
)
inline

◆ writeUnsafe< Register::VXY2 >()

template<>
void psyqo::GTE::writeUnsafe< Register::VXY2 > ( Short  x_,
Short  y_ 
)
inline

◆ writeUnsafe< Register::VZ0 >()

template<>
void psyqo::GTE::writeUnsafe< Register::VZ0 > ( Short  z_)
inline

◆ writeUnsafe< Register::VZ1 >()

template<>
void psyqo::GTE::writeUnsafe< Register::VZ1 > ( Short  z_)
inline

◆ writeUnsafe< Register::VZ2 >()

template<>
void psyqo::GTE::writeUnsafe< Register::VZ2 > ( Short  z_)
inline

◆ writeUnsafe< Register::ZSF3 >()

template<>
void psyqo::GTE::writeUnsafe< Register::ZSF3 > ( Short  z_)
inline

◆ writeUnsafe< Register::ZSF4 >()

template<>
void psyqo::GTE::writeUnsafe< Register::ZSF4 > ( Short  z_)
inline