include/nds/arm9/PA_Math.h File Reference

#include "PA9.h"
#include "PA_Interrupt.h"

Data Structures

struct  PA_TestInfos

Defines

#define PA_TESTSTART
#define PA_TESTEND
#define PA_Cos(angle)   PA_SIN[((angle) + 128)&511]
 Returns the Cos value for an angle. The value goes from -256 to 256... Watch out though : the angle is not in 360 degrees, but in 512 !
#define PA_Sin(angle)   PA_SIN[((angle))&511]
 Returns the Sin value for an angle. The value goes from -256 to 256... Watch out though : the angle is not in 360 degrees, but in 256 !

Functions

void PA_TestInit (u8 screen, float time)
void PA_TestResults (void)
u32 PA_Rand (void)
 Gives a random number, taken from Ham... This is taken from Ham, I have no credit.
void PA_InitRand (void)
 Auto-seeds the Rand function based on the clock !
void PA_SRand (s32 r)
 Set the random's seed. This is taken from Ham, I have no credit. I just made it a little shorter/faster (maybe).
u32 PA_RandMax (u32 max)
 Gives a random number, between 0 and the given number (included).
u32 PA_RandMinMax (u32 min, u32 max)
 Gives a random number, between the 2 given numbers (included).
u64 PA_Distance (s32 x1, s32 y1, s32 x2, s32 y2)
u64 PA_TrueDistance (s32 x1, s32 y1, s32 x2, s32 y2)
 Calculate the real distance between 2 points. Much slower than PA_Distance.
u16 PA_AdjustAngle (u16 angle, s16 anglerot, s32 startx, s32 starty, s32 targetx, s32 targety)
 Adjust an angle, for example to calculate in which direction an object shoudl turn.
u16 PA_GetAngle (s32 startx, s32 starty, s32 targetx, s32 targety)
 Get the angle, from 0 to 511, formed between the horizontal and the line.
s32 PA_Modulo (s32 var, s32 modulo)

Variables

PA_TestInfos PA_TestInfo
u32 RandomValue

Define Documentation

#define PA_TESTEND

#define PA_TESTSTART

Value:

{ PA_OutputText(PA_TestInfo.Screen, 0, 4+PA_TestInfo.Functions, "Testing function %02d", PA_TestInfo.Functions+1);\
                                PA_WaitForVBL();\
                                PA_TestVBLs = 0;\
                                while( PA_TestVBLs < PA_TestInfo.Time){


Function Documentation

s32 PA_Modulo ( s32  var,
s32  modulo 
) [inline]

void PA_TestInit ( u8  screen,
float  time 
) [inline]

void PA_TestResults ( void   ) 


Variable Documentation


Generated on Sat Jun 13 12:55:13 2009 for PAlib - Programmer's Arsenal by  doxygen 1.5.8