From df4d0eb0cfe5e2f77b24ae196a6d233af0496224 Mon Sep 17 00:00:00 2001 From: Themaister Date: Sat, 2 Nov 2013 21:39:43 +0100 Subject: [PATCH] Add RETRO_ENVIRONMENT_GET_INPUT_DEVICE_CAPABILITIES. --- dynamic.c | 11 +++++++++++ libretro.h | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/dynamic.c b/dynamic.c index ce0a6e47c4..4e24163fab 100644 --- a/dynamic.c +++ b/dynamic.c @@ -764,6 +764,17 @@ bool rarch_environment_cb(unsigned cmd, void *data) break; } + case RETRO_ENVIRONMENT_GET_INPUT_DEVICE_CAPABILITIES: + { + RARCH_LOG("Environ GET_INPUT_DEVICE_CAPABILITIES.\n"); + uint64_t *mask = (uint64_t*)data; + if (driver.input && driver.input->get_capabilities && driver.input_data) + *mask = driver.input->get_capabilities(driver.input_data); + else + return false; + break; + } + // Private extensions for internal use, not part of libretro API. case RETRO_ENVIRONMENT_SET_LIBRETRO_PATH: RARCH_LOG("Environ (Private) SET_LIBRETRO_PATH.\n"); diff --git a/libretro.h b/libretro.h index e91beb8ba2..22c51d72e0 100755 --- a/libretro.h +++ b/libretro.h @@ -519,6 +519,13 @@ enum retro_mod // struct retro_rumble_interface * -- // Gets an interface which is used by a libretro core to set state of rumble motors in controllers. // A strong and weak motor is supported, and they can be controlled indepedently. + // +#define RETRO_ENVIRONMENT_GET_INPUT_DEVICE_CAPABILITIES 24 + // uint64_t * -- + // Gets a bitmask telling which device type are expected to be handled properly in a call to retro_input_state_t. + // Devices which are not handled or recognized always return 0 in retro_input_state_t. + // Example bitmask: caps = (1 << RETRO_DEVICE_JOYPAD) | (1 << RETRO_DEVICE_ANALOG). + // Should only be called in retro_run(). enum retro_rumble_effect