
//BUTTON CONTROLS

const LUP	=	1001;
const LDWN	=	1002;
const LLFT	=	1003;
const LRHT	=	1004;
const RUP	=	1005;
const RDWN	=	1006;
const RLFT	=	1007;
const RRHT	=	1008;
const L1	=	1009;
const L2	=	1010;
const R1	=	1011;
const R2	=	1012;
const STRT	=	1013;
const SLCT	=	1014;


//PAD READING

pad_read()
{
	new paddata_org;
//	PadState( .press = paddata_org );
	PadState( .repeat = paddata_org );

	if(	paddata_org & ePADLup )
		return	LUP;
	if(	paddata_org & ePADLdown )
		return	LDWN;
	if(	paddata_org & ePADLleft )
		return	LLFT;
	if(	paddata_org & ePADLright )
		return	LRHT;
	if(	paddata_org & ePADRup )
		return	RUP;
	if(	paddata_org & ePADRdown )
		return	RDWN;
	if(	paddata_org & ePADRleft )
		return	RLFT;
	if(	paddata_org & ePADRright )
		return	RRHT;
	if(	paddata_org & ePADL1 )
		return	L1;
	if(	paddata_org & ePADL2 )
		return	L2;
	if(	paddata_org & ePADR1 )
		return	R1;
	if(	paddata_org & ePADR2 )
		return	R2;
	if(	paddata_org & ePADstart )
		return	STRT;
	if(	paddata_org & ePADselect )
		return	SLCT;

	return	 -1;
}


