Skip to content
/ pspla Public

A VFPU accelerated linear algebra & quaternion library for the PlayStation Portable.

License

Notifications You must be signed in to change notification settings

Jayanky/pspla

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pspla

A VFPU accelerated linear algebra & quaternion library for the PlayStation Portable.

Usage

Getting Started

All you need to do to get started is to include the pspla2.h header file, and to link with the pspla library.

Data Formatting

All functions are divided into A and U variants, standing for Aligned and Unaligned.

Aligned functions require vector data to be 16-byte aligned, or a fault will be generated by the VFPU.

Unaligned functions only require data to be aligned to word-sized boundaries, but are slower due to how unaligned loading works on the hardware.

pspla comes with the PSPLA_ALIGN define to align vector data.

Example:

float vectorU[4];              // Can only be used with unaligned functions
float vectorA[4] PSPLA_ALIGN;  // Can be used with both aligned and unaligned functions

Finding a function

All functions are prefixed with pspla, and are then followed by the type of data they are used for.

The types of data are Vec2, Vec3, Vec4, Mat2, Mat3, Mat4, and Quat. Functions that work with any vector size are given the type VecV.

Functions that work with scalar values don't have a type prefix or an alignment suffix (i.e. psplaArccosine, psplaRandom, etc.)