OldSchool Library
|
Macros | |
#define | oslSrand vfpu_srand |
Set the seed for the VFPU random number generator. | |
#define | oslRandf vfpu_randf |
Generate a random floating-point value. | |
#define | oslRand_8888 vfpu_rand_8888 |
Generate a random color value in 8888 format. | |
#define | oslSinf vfpu_sinf |
Calculate the sine of an angle. | |
#define | oslCosf vfpu_cosf |
Calculate the cosine of an angle. | |
#define | oslTanf vfpu_tanf |
Calculate the tangent of an angle. | |
#define | oslAsinf vfpu_asinf |
Calculate the inverse sine (arcsin) of a value. | |
#define | oslAcosf vfpu_acosf |
Calculate the inverse cosine (arccos) of a value. | |
#define | oslAtanf vfpu_atanf |
Calculate the inverse tangent (arctan) of a value. | |
#define | oslAtan2f vfpu_atan2f |
Calculate the inverse tangent of two values, with quadrant correction. | |
#define | oslSinhf vfpu_sinhf |
Calculate the hyperbolic sine of a value. | |
#define | oslCoshf vfpu_coshf |
Calculate the hyperbolic cosine of a value. | |
#define | oslTanhf vfpu_tanhf |
Calculate the hyperbolic tangent of a value. | |
#define | oslSincos vfpu_sincos |
Calculate both sine and cosine of an angle. | |
#define | oslExpf vfpu_expf |
Calculate the exponential of a value. | |
#define | oslLogf vfpu_logf |
Calculate the natural logarithm of a value. | |
#define | oslPowf vfpu_powf |
Calculate the power of a number. | |
#define | oslFmodf vfpu_fmodf |
Calculate the floating-point remainder of division. | |
Mathematical functions utilizing the PSP's Vector Floating Point Unit (VFPU).
These functions provide efficient mathematical computations by leveraging the VFPU on the PSP. They are based on the libpspmath
library (version 4) by MrMr[iCE].
#define oslSrand vfpu_srand |
Set the seed for the VFPU random number generator.
This function sets the initial seed value for generating random numbers using the VFPU random number generator.
x | The seed value to initialize the random number generator. |
#define oslRandf vfpu_randf |
Generate a random floating-point value.
This function returns a random floating-point number between the specified minimum and maximum values using the VFPU.
min | The minimum value that can be returned. |
max | The maximum value that can be returned. |
min
and max
. #define oslRand_8888 vfpu_rand_8888 |
Generate a random color value in 8888 format.
This function returns a random color value in the 8888 format (8 bits per channel). The alpha channel is always set to 0xFF.
min | The minimum value for each color channel (range: 0 to 255). |
max | The maximum value for each color channel (range: 0 to 255). |
#define oslSinf vfpu_sinf |
Calculate the sine of an angle.
This function returns the sine of the given angle (in radians) using the VFPU.
x | The angle in radians. |
#define oslCosf vfpu_cosf |
Calculate the cosine of an angle.
This function returns the cosine of the given angle (in radians) using the VFPU.
x | The angle in radians. |
#define oslTanf vfpu_tanf |
Calculate the tangent of an angle.
This function returns the tangent of the given angle (in radians) using the VFPU.
x | The angle in radians. |
#define oslAsinf vfpu_asinf |
Calculate the inverse sine (arcsin) of a value.
This function returns the inverse sine (arcsin) of the input value using the VFPU.
x | The input value. |
#define oslAcosf vfpu_acosf |
Calculate the inverse cosine (arccos) of a value.
This function returns the inverse cosine (arccos) of the input value using the VFPU.
x | The input value. |
#define oslAtanf vfpu_atanf |
Calculate the inverse tangent (arctan) of a value.
This function returns the inverse tangent (arctan) of the input value using the VFPU.
x | The input value. |
#define oslAtan2f vfpu_atan2f |
Calculate the inverse tangent of two values, with quadrant correction.
This function returns the inverse tangent (arctan) of y/x
using the VFPU, with correct quadrant determination.
y | The y-coordinate. |
x | The x-coordinate. |
#define oslSinhf vfpu_sinhf |
Calculate the hyperbolic sine of a value.
This function returns the hyperbolic sine (sinh) of the input value using the VFPU.
x | The input value. |
#define oslCoshf vfpu_coshf |
Calculate the hyperbolic cosine of a value.
This function returns the hyperbolic cosine (cosh) of the input value using the VFPU.
x | The input value. |
#define oslTanhf vfpu_tanhf |
Calculate the hyperbolic tangent of a value.
This function returns the hyperbolic tangent (tanh) of the input value using the VFPU.
x | The input value. |
#define oslSincos vfpu_sincos |
Calculate both sine and cosine of an angle.
This function computes both the sine and cosine of the given angle (in radians) and stores the results in the provided pointers.
r | The angle in radians. |
s | A pointer to store the sine of the angle. |
c | A pointer to store the cosine of the angle. |
#define oslExpf vfpu_expf |
Calculate the exponential of a value.
This function returns the exponential of the input value (e^x) using the VFPU.
x | The input value. |
#define oslLogf vfpu_logf |
Calculate the natural logarithm of a value.
This function returns the natural logarithm (log base e) of the input value using the VFPU.
x | The input value. |
#define oslPowf vfpu_powf |
Calculate the power of a number.
This function returns the value of x
raised to the power of y
using the VFPU.
x | The base value. |
y | The exponent value. |
x
raised to the power of y
. #define oslFmodf vfpu_fmodf |
Calculate the floating-point remainder of division.
This function returns the floating-point remainder of x/y
using the VFPU.
x | The numerator. |
y | The denominator. |
x/y
.