From 75d0baea864df62c4806e1f339f0f1e78fd80354 Mon Sep 17 00:00:00 2001 From: EkeEke Date: Sun, 20 Jul 2014 23:07:58 +0200 Subject: [PATCH] [libretro] fixed new input controller & multitap support --- libretro/libretro.c | 139 ++++++++++++++++++++++++++------------------ 1 file changed, 83 insertions(+), 56 deletions(-) diff --git a/libretro/libretro.c b/libretro/libretro.c index 0b34067..90379b2 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -13,15 +13,14 @@ #include #endif -#define RETRO_DEVICE_MDPAD_3B RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 0) -#define RETRO_DEVICE_MDPAD_6B RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 1) -#define RETRO_DEVICE_SMSPAD_2B RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 2) -#define RETRO_DEVICE_PORT_NONE RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 3) -#define RETRO_DEVICE_MDPAD_3B_WAYPLAY RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 4) -#define RETRO_DEVICE_MDPAD_6B_WAYPLAY RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 5) -#define RETRO_DEVICE_MDPAD_3B_TEAMPLAYER RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 6) -#define RETRO_DEVICE_MDPAD_6B_TEAMPLAYER RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 7) -#define RETRO_DEVICE_SMSPAD_4P RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 8) +#define RETRO_DEVICE_MDPAD_3B RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 0) +#define RETRO_DEVICE_MDPAD_6B RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 1) +#define RETRO_DEVICE_MSPAD_2B RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 2) +#define RETRO_DEVICE_MDPAD_3B_WAYPLAY RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 3) +#define RETRO_DEVICE_MDPAD_6B_WAYPLAY RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 4) +#define RETRO_DEVICE_MDPAD_3B_TEAMPLAYER RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 5) +#define RETRO_DEVICE_MDPAD_6B_TEAMPLAYER RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 6) +#define RETRO_DEVICE_MSPAD_2B_MASTERTAP RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 7) #include "shared.h" #include "libretro.h" @@ -113,8 +112,8 @@ int load_archive(char *filename, unsigned char *buffer, int maxsize, char *exten { if (log_cb) log_cb(RETRO_LOG_ERROR, "Unable to open CD BIOS: %s.\n", filename); - return 0; - } + return 0; + } if (log_cb) log_cb(RETRO_LOG_ERROR, "Unable to open file.\n"); @@ -171,7 +170,7 @@ void osd_input_update(void) input_poll_cb(); - for(i = 0; i < MAX_INPUTS; i++) + for (i = 0; i < MAX_INPUTS; i++) { temp = 0; switch (input.dev[i]) @@ -267,6 +266,14 @@ static void config_default(void) config.gg_extra = 0; config.ntsc = 0; config.render = 0; + + /* input options */ + input.system[0] = SYSTEM_GAMEPAD; + input.system[1] = SYSTEM_GAMEPAD; + for (i=0; ipath)) return false; - for (i = 0; i < 2; i++) - retro_set_controller_port_device(i, input.dev[i]); - audio_init(44100, vdp_pal ? pal_fps : ntsc_fps); system_init(); system_reset();