paulo@0: #include "ljcontrol.h" paulo@0: #ifdef ARM9 paulo@0: #include paulo@0: #else paulo@0: #include paulo@0: #endif paulo@0: paulo@0: LJBits readHWKeys(void); paulo@0: paulo@0: LJBits readPad(unsigned int player) { paulo@0: LJBits hwKeys = readHWKeys(); paulo@0: LJBits out = 0; paulo@0: paulo@0: if (hwKeys & KEY_UP) { paulo@0: out |= VKEY_UP; paulo@0: } paulo@0: if (hwKeys & KEY_DOWN) { paulo@0: out |= VKEY_DOWN; paulo@0: } paulo@0: if (hwKeys & KEY_LEFT) { paulo@0: out |= VKEY_LEFT; paulo@0: } paulo@0: if (hwKeys & KEY_RIGHT) { paulo@0: out |= VKEY_RIGHT; paulo@0: } paulo@0: if (hwKeys & KEY_B) { paulo@0: out |= VKEY_ROTL; paulo@0: } paulo@0: if (hwKeys & KEY_A) { paulo@0: out |= VKEY_ROTR; paulo@0: } paulo@0: if (hwKeys & (KEY_L | KEY_R)) { paulo@0: out |= VKEY_HOLD; paulo@0: } paulo@0: paulo@0: #ifdef ARM9 paulo@2: // if (hwKeys & KEY_X) { paulo@2: // out |= VKEY_MACRO(3); paulo@2: // } paulo@0: if (hwKeys & KEY_Y) { paulo@2: out |= VKEY_MACRO(0);//VKEY_MACRO(2); paulo@0: } paulo@0: #endif paulo@0: paulo@0: // on the GBA and DS, we need to add the console buttons in paulo@0: out |= hwKeys << 16; paulo@0: return out; paulo@0: }