add input descriptors

This commit is contained in:
radius 2015-09-26 22:35:31 -05:00
parent 65ff54ff4e
commit 7c4c6baa5e
1 changed files with 18 additions and 0 deletions

View File

@ -298,9 +298,27 @@ static void check_variables(int started_from_load)
#endif #endif
} }
static void set_input_descriptors()
{
struct retro_input_descriptor descriptors[] = {
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT, "D-Pad Left" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "D-Pad Up" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "D-Pad Down" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "D-Pad Right" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B, "B" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A, "A" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" },
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" },
{ 0 },
};
environ_cb(RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS, descriptors);
}
bool retro_load_game(const struct retro_game_info* info) bool retro_load_game(const struct retro_game_info* info)
{ {
check_variables(1); check_variables(1);
set_input_descriptors();
#if defined(HAVE_DYNAREC) #if defined(HAVE_DYNAREC)
if (dynarec_enable) if (dynarec_enable)