diff options
author | Michael Pavone <pavone@retrodev.com> | 2018-07-22 17:48:46 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2018-07-22 17:48:46 -0700 |
commit | 47d77ef9201c0ebe2c443a98d53b563657d9f7ed (patch) | |
tree | 8c39ffb718c9244fdb2b131550c99fce59f52216 /render_sdl.c | |
parent | 480b9bb35341fb64afbd0ab6e18b978b2cd6d4f8 (diff) |
Initial heuristics for detecting controller types and showing different labels in UI. Modified controller settings view to first display a list of controllers, only showing mapping after selecting controller
Diffstat (limited to 'render_sdl.c')
-rwxr-xr-x | render_sdl.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/render_sdl.c b/render_sdl.c index 3296581..1c9aecf 100755 --- a/render_sdl.c +++ b/render_sdl.c @@ -805,6 +805,22 @@ static int lowest_unused_joystick_index() return -1; } +SDL_Joystick *render_get_joystick(int index) +{ + if (index >= MAX_JOYSTICKS) { + return NULL; + } + return joysticks[index]; +} + +SDL_GameController *render_get_controller(int index) +{ + if (index >= MAX_JOYSTICKS) { + return NULL; + } + return SDL_GameControllerOpen(joystick_sdl_index[index]); +} + static uint32_t overscan_top[NUM_VID_STD] = {2, 21}; static uint32_t overscan_bot[NUM_VID_STD] = {1, 17}; static uint32_t overscan_left[NUM_VID_STD] = {13, 13}; |