/* Handy common routines and defs */ #ifndef _PSCOMMON #define PSCOMMON #ifndef FALSE #define FALSE (0) #endif #ifndef TRUE #define TRUE (!FALSE) #endif #ifndef NULL #define NULL (0) #endif #ifndef RND #define RND(x) (rand()%(x)) #endif #ifndef ABS #define ABS(x) ((x)<0 ? (-(x)) : (x)) #endif #ifndef MAX #define MAX(a,b) ((a)<(b) ? (b) : (a)) #endif #ifndef MIN #define MIN(a,b) ((a)>(b) ? (b) : (a)) #endif /* Joypad constants */ #define PS_NOPAD 0xff #define PS_PAD 0x00 #define PS_MOUSE 0x01 #define PS_NEGCON 0x02 #define PS_STANDARD 0x04 #define PS_ANALOG 0x05 #define PS_GUNCON 0x06 #define PS_DUALSHOCK 0x07 /* Buttons positions for standard controller */ #define PS_PADLEFT (1<<15) #define PS_PADDOWN (1<<14) #define PS_PADRIGHT (1<<13) #define PS_PADUP (1<<12) #define PS_PADSTART (1<<11) #define PS_PADSELECT (1<<8) #define PS_PADSQUARE (1<<7) #define PS_PADCROSS (1<<6) #define PS_PADCIRCLE (1<<5) #define PS_PADTRIANGLE (1<<4) #define PS_PADR1 (1<<3) #define PS_PADR2 (1<<2) #define PS_PADL1 (1<<1) #define PS_PADL2 (1<<0) /* Common core routines */ void PS_InitHeap(void); /* Decode TIM info and store it into the frame buffer */ void PS_DecodeTIM(unsigned long *tim, GsIMAGE *img, int *texture_page); #endif /* END OF FILE */