#include "ps_input.hpp" unsigned long PadStatus[2]; static AsPSInputHandler *theInputHandler; AsPSInputHandler::AsPSInputHandler() { PadStatus[AS_PLAYER_ONE] = 0; PadStatus[AS_PLAYER_TWO] = 0; //PadInit(); theInputHandler = this; } void AsPSInputHandler::PadInit (void) { GetPadBuf(&bb0, &bb1); } u_long AsPSInputHandler::PadRead(int controller) { switch(controller) { case AS_PLAYER_ONE: return(~(*(bb0+3) | *(bb0+2) << 8)); case AS_PLAYER_TWO: return(~(*(bb1+3) | *(bb1+2) << 8)); } //return(~(*(bb0+3) | *(bb0+2) << 8 | *(bb1+3) << 16 | *(bb1+2) << 24)); } void AsPSInputHandler::GetInput() { PadStatus[AS_PLAYER_ONE] = PadRead(AS_PLAYER_ONE); PadStatus[AS_PLAYER_TWO] = PadRead(AS_PLAYER_TWO); }