summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTwinaphex2015-09-27 13:43:13 +0200
committerTwinaphex2015-09-27 13:43:13 +0200
commitcfc1a3391d765acfcc22324b77fe77d5d85a84c4 (patch)
treee3fc6db12c9c1f6356aa7363e1bfdc60bc02a6dc
parent65ff54ff4e6ff811246c0e106d45571a30762e74 (diff)
parent7c4c6baa5e275e20fce3cf351f94d27bf105b2f8 (diff)
downloadpicogpsp-cfc1a3391d765acfcc22324b77fe77d5d85a84c4.tar.gz
picogpsp-cfc1a3391d765acfcc22324b77fe77d5d85a84c4.tar.bz2
picogpsp-cfc1a3391d765acfcc22324b77fe77d5d85a84c4.zip
Merge pull request #14 from fr500/master
add input descriptors
-rw-r--r--libretro.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libretro.c b/libretro.c
index 336fb0d..6faae5f 100644
--- a/libretro.c
+++ b/libretro.c
@@ -298,9 +298,27 @@ static void check_variables(int started_from_load)
#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)
{
check_variables(1);
+ set_input_descriptors();
#if defined(HAVE_DYNAREC)
if (dynarec_enable)