(360) Special button mappings added - RSTICK Up - Rewind - RSTICK

Up + RT - Load State - RSTICK Down + RT - Save State -RSTICK
Left + RT - Save State Minus - RSTICK Right + RT - Save State Plus
This commit is contained in:
TwinAphex51224 2012-02-09 00:58:22 +01:00
parent 2cd7349cac
commit e5e19edc65

View File

@ -26,6 +26,8 @@
static XINPUT_STATE state[4]; static XINPUT_STATE state[4];
const int DEADZONE = 16000;
static void xdk360_input_poll(void *data) static void xdk360_input_poll(void *data)
{ {
(void)data; (void)data;
@ -110,9 +112,22 @@ static void* xdk360_input_init(void)
static bool xdk360_key_pressed(void *data, int key) static bool xdk360_key_pressed(void *data, int key)
{ {
(void)data; (void)data;
XInputGetState(0, &state[0]);
switch(key) switch(key)
{ {
case SSNES_FAST_FORWARD_HOLD_KEY:
return ((state[0].Gamepad.sThumbRY < -DEADZONE) && !(state[0].Gamepad.bRightTrigger > 128));
case SSNES_LOAD_STATE_KEY:
return ((state[0].Gamepad.sThumbRY > DEADZONE) && (state[0].Gamepad.bRightTrigger > 128));
case SSNES_SAVE_STATE_KEY:
return ((state[0].Gamepad.sThumbRY < -DEADZONE) && (state[0].Gamepad.bRightTrigger > 128));
case SSNES_STATE_SLOT_PLUS:
return ((state[0].Gamepad.sThumbRX > DEADZONE) && (state[0].Gamepad.bRightTrigger > 128));
case SSNES_STATE_SLOT_MINUS:
return ((state[0].Gamepad.sThumbRX < -DEADZONE) && (state[0].Gamepad.bRightTrigger > 128));
case SSNES_REWIND:
return ((state[0].Gamepad.sThumbRY > DEADZONE) && !(state[0].Gamepad.bRightTrigger > 128));
case SSNES_QUIT_KEY: case SSNES_QUIT_KEY:
g_console.menu_enable = ((state[0].Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB) g_console.menu_enable = ((state[0].Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB)
&& (state[0].Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB)); && (state[0].Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB));