diff options
author | Adrien Plazas | 2016-07-30 00:59:47 +0200 |
---|---|---|
committer | Adrien Plazas | 2016-07-30 00:59:47 +0200 |
commit | a06f5a7008c19fb65c037f539439c029834026b3 (patch) | |
tree | 16652cf9de751c27dfa9f5c088ab1af4db87e744 /frontend | |
parent | 3e44337c146f4ebd9edf16ab8768efb10b8ae6d2 (diff) | |
download | pcsx_rearmed-a06f5a7008c19fb65c037f539439c029834026b3.tar.gz pcsx_rearmed-a06f5a7008c19fb65c037f539439c029834026b3.tar.bz2 pcsx_rearmed-a06f5a7008c19fb65c037f539439c029834026b3.zip |
libretro: Fix key passing of update_controller_port_device()
Change the way the key of the controler type variables is passed to one
which doesn't crash.
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/libretro.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/frontend/libretro.c b/frontend/libretro.c index d6c1ab8..b812d91 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -382,17 +382,36 @@ static void update_controller_port_device(unsigned port, unsigned device) if (port >= PORTS_NUMBER) return; - static const char **CONTROLLER_VARIABLE = { - "pcsx_rearmed_pad1type", "pcsx_rearmed_pad2type", - "pcsx_rearmed_pad3type", "pcsx_rearmed_pad4type", - "pcsx_rearmed_pad5type", "pcsx_rearmed_pad6type", - "pcsx_rearmed_pad7type", "pcsx_rearmed_pad8type", - }; - struct retro_variable var; var.value = NULL; - var.key = CONTROLLER_VARIABLE[port]; + switch (port) { + case 0: + var.key = "pcsx_rearmed_pad1type"; + break; + case 1: + var.key = "pcsx_rearmed_pad2type"; + break; + case 2: + var.key = "pcsx_rearmed_pad3type"; + break; + case 3: + var.key = "pcsx_rearmed_pad4type"; + break; + case 4: + var.key = "pcsx_rearmed_pad5type"; + break; + case 5: + var.key = "pcsx_rearmed_pad6type"; + break; + case 6: + var.key = "pcsx_rearmed_pad7type"; + break; + case 7: + var.key = "pcsx_rearmed_pad8type"; + break; + } + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value) { if (strcmp(var.value, "standard") == 0) |