/****************************************/ /* Pad.c - controller setup and test */ /* Rikki Prince 1999 */ /****************************************/ #include #include "pad.h" #include "define.h" volatile u_char *bb0, *bb1; void PadInit( void ) { GetPadBuf(&bb0, &bb1); /* Sets where Yaroze shoves info on what happens on pad */ } u_long PadRead( void ) { return(~(*(bb0+3) | *(bb0+2) << 8 | *(bb1+3) << 16 | *(bb1+2) << 24)); /* Returns info about what happens on pad */ } /* Use PadRead as such: PAD2=((PAD1=PadRead())>>16) */ /* This sets PAD1 to what happens on pad in 'Port 1', then shifts bits along to show what happens at 'Port 2' */ /* Use 'PAD1 & PADLeft' to check if Left on the d-pad has been pressed on the pad in 'Port 1' etc. */