#include #include "pad.h" static volatile u_char *pb0; // pad on port 1 static volatile u_char *pb1; // pad on port 2 void PadInit( void ) { GetPadBuf( &pb0, &pb1 ); } u_long PadRead( void ) { u_long status = ( ~(*(pb0+3) | *(pb0+2) << 8 | *(pb1+3) << 16 | *(pb1+2) << 24)); if ( *pb0 ) // 0x00 if controller 1 present, 0xFF if not status |= PAD1start; if ( *pb1 ) // 0x00 if controller 2 present, 0xFF if not status |= PAD2start; return status; }