mirror of
https://github.com/libretro/RetroArch
synced 2025-02-07 03:40:24 +00:00
Fix --disable-menu
This commit is contained in:
parent
8dd0680cbc
commit
b5c4b2d618
103
retroarch.c
103
retroarch.c
@ -5107,6 +5107,58 @@ static int16_t input_joypad_axis(const input_device_driver_t *drv,
|
||||
return val;
|
||||
}
|
||||
|
||||
#define inherit_joyaxis(binds) (((binds)[x_plus].joyaxis == (binds)[x_minus].joyaxis) || ( (binds)[y_plus].joyaxis == (binds)[y_minus].joyaxis))
|
||||
|
||||
/**
|
||||
* input_pop_analog_dpad:
|
||||
* @binds : Binds to modify.
|
||||
*
|
||||
* Restores binds temporarily overridden by input_push_analog_dpad().
|
||||
**/
|
||||
#define input_pop_analog_dpad(binds) \
|
||||
{ \
|
||||
unsigned j; \
|
||||
for (j = RETRO_DEVICE_ID_JOYPAD_UP; j <= RETRO_DEVICE_ID_JOYPAD_RIGHT; j++) \
|
||||
(binds)[j].joyaxis = (binds)[j].orig_joyaxis; \
|
||||
}
|
||||
|
||||
/**
|
||||
* input_push_analog_dpad:
|
||||
* @binds : Binds to modify.
|
||||
* @mode : Which analog stick to bind D-Pad to.
|
||||
* E.g:
|
||||
* ANALOG_DPAD_LSTICK
|
||||
* ANALOG_DPAD_RSTICK
|
||||
*
|
||||
* Push analog to D-Pad mappings to binds.
|
||||
**/
|
||||
#define input_push_analog_dpad(binds, mode) \
|
||||
{ \
|
||||
unsigned k; \
|
||||
unsigned x_plus = RARCH_ANALOG_RIGHT_X_PLUS; \
|
||||
unsigned y_plus = RARCH_ANALOG_RIGHT_Y_PLUS; \
|
||||
unsigned x_minus = RARCH_ANALOG_RIGHT_X_MINUS; \
|
||||
unsigned y_minus = RARCH_ANALOG_RIGHT_Y_MINUS; \
|
||||
if ((mode) == ANALOG_DPAD_LSTICK) \
|
||||
{ \
|
||||
x_plus = RARCH_ANALOG_LEFT_X_PLUS; \
|
||||
y_plus = RARCH_ANALOG_LEFT_Y_PLUS; \
|
||||
x_minus = RARCH_ANALOG_LEFT_X_MINUS; \
|
||||
y_minus = RARCH_ANALOG_LEFT_Y_MINUS; \
|
||||
} \
|
||||
for (k = RETRO_DEVICE_ID_JOYPAD_UP; k <= RETRO_DEVICE_ID_JOYPAD_RIGHT; k++) \
|
||||
(binds)[k].orig_joyaxis = (binds)[k].joyaxis; \
|
||||
if (!inherit_joyaxis(binds)) \
|
||||
{ \
|
||||
unsigned j = x_plus + 3; \
|
||||
/* Inherit joyaxis from analogs. */ \
|
||||
for (k = RETRO_DEVICE_ID_JOYPAD_UP; k <= RETRO_DEVICE_ID_JOYPAD_RIGHT; k++) \
|
||||
(binds)[k].joyaxis = (binds)[j--].joyaxis; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
enum menu_mouse_action
|
||||
{
|
||||
@ -5992,57 +6044,6 @@ void menu_input_post_iterate(int *ret, unsigned action)
|
||||
} \
|
||||
}
|
||||
|
||||
#define inherit_joyaxis(binds) (((binds)[x_plus].joyaxis == (binds)[x_minus].joyaxis) || ( (binds)[y_plus].joyaxis == (binds)[y_minus].joyaxis))
|
||||
|
||||
/**
|
||||
* input_pop_analog_dpad:
|
||||
* @binds : Binds to modify.
|
||||
*
|
||||
* Restores binds temporarily overridden by input_push_analog_dpad().
|
||||
**/
|
||||
#define input_pop_analog_dpad(binds) \
|
||||
{ \
|
||||
unsigned j; \
|
||||
for (j = RETRO_DEVICE_ID_JOYPAD_UP; j <= RETRO_DEVICE_ID_JOYPAD_RIGHT; j++) \
|
||||
(binds)[j].joyaxis = (binds)[j].orig_joyaxis; \
|
||||
}
|
||||
|
||||
/**
|
||||
* input_push_analog_dpad:
|
||||
* @binds : Binds to modify.
|
||||
* @mode : Which analog stick to bind D-Pad to.
|
||||
* E.g:
|
||||
* ANALOG_DPAD_LSTICK
|
||||
* ANALOG_DPAD_RSTICK
|
||||
*
|
||||
* Push analog to D-Pad mappings to binds.
|
||||
**/
|
||||
#define input_push_analog_dpad(binds, mode) \
|
||||
{ \
|
||||
unsigned k; \
|
||||
unsigned x_plus = RARCH_ANALOG_RIGHT_X_PLUS; \
|
||||
unsigned y_plus = RARCH_ANALOG_RIGHT_Y_PLUS; \
|
||||
unsigned x_minus = RARCH_ANALOG_RIGHT_X_MINUS; \
|
||||
unsigned y_minus = RARCH_ANALOG_RIGHT_Y_MINUS; \
|
||||
if ((mode) == ANALOG_DPAD_LSTICK) \
|
||||
{ \
|
||||
x_plus = RARCH_ANALOG_LEFT_X_PLUS; \
|
||||
y_plus = RARCH_ANALOG_LEFT_Y_PLUS; \
|
||||
x_minus = RARCH_ANALOG_LEFT_X_MINUS; \
|
||||
y_minus = RARCH_ANALOG_LEFT_Y_MINUS; \
|
||||
} \
|
||||
for (k = RETRO_DEVICE_ID_JOYPAD_UP; k <= RETRO_DEVICE_ID_JOYPAD_RIGHT; k++) \
|
||||
(binds)[k].orig_joyaxis = (binds)[k].joyaxis; \
|
||||
if (!inherit_joyaxis(binds)) \
|
||||
{ \
|
||||
unsigned j = x_plus + 3; \
|
||||
/* Inherit joyaxis from analogs. */ \
|
||||
for (k = RETRO_DEVICE_ID_JOYPAD_UP; k <= RETRO_DEVICE_ID_JOYPAD_RIGHT; k++) \
|
||||
(binds)[k].joyaxis = (binds)[j--].joyaxis; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* input_menu_keys_pressed:
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user